Font Size: a A A

The Design And Implementation Of A Functional Programming Language Named Leaf Based On Hindley-Milner Type System

Posted on:2018-04-23Degree:MasterType:Thesis
Country:ChinaCandidate:H S WangFull Text:PDF
GTID:2348330518494428Subject:Computer technology
Abstract/Summary:PDF Full Text Request
The goal of Leaf language is to design a simple and easy functional language. This programming language is a compiled language that uses static types which can be type inferring by compiler automatically. Functional language has good mathematical properties and high abstraction, so it has stronger productivity, more clearly abstract module ability and good readability.Leaf programming language uses syntax that approaches scripting language,which can be easily extended to the game script engine, browser script engine, and can also be used as a general-purpose programming language. The security and reliability of its static type can provide a new feasible scheme for browser and game script implementation.This paper analyzes the theory of , calculus and discusses several modes of programming language. By analyzing the theory of programming language and compiling theory, a functional language is designed, and the definition of grammar is given. The implementation method is given by developing the compiler program ,and the compiler is optimized. This paper designs the core language of the programming language, the grammar generator and intermediate language format firstly. Then the overall structure of the software is given,and the compiler is implemented.Finally the functions of the programming language is tested.The compiler in this paper is divided into six modules,such as lexical analysis, grammar analysis, symbol table, semantic analysis, intermediate code generator and byte code interpreter. The implementation of the compiler uses the C# language,the design ideas and part of the data structure codes are given. The compiler optimization section mainly uses machine-independent optimizations to optimize the compiler.In this paper,a type checker of automatic type inference is realized. Some type errors of the Hindley-Milner type inference algorithm is further improved and corrected because of this type checker, which further improves the type inference ability. This paper implements an interactive execution environment,in order to interpreting the code string and compiling the source code to the bytecode.
Keywords/Search Tags:Functional programming language, Principles of compiler, Formal language, Object-oriented
PDF Full Text Request
Related items