Compiler framework written in C++ for higher-order, dynamic, functional languages
There are many compiler frameworks out there that can aid in implementing the backend for a language (eg. LLVM). However, there seems to be a dearth of "middle-ends" that are written in C++, and that can represent higher-order, dynamic, functional 开发者_如何学Golanguages. The framework should do generic things like lambda lifting, closure conversion, type inferencing, etc. and help in other language specific transformations like, say, translating type classes, etc. Some candidates I can think of are PyPy and Clean. These are compilers for higher order, dynamic, functional languages. Arguably, one can connect the frontend for any language to these, and re-use the data structures and transformation available in them for doing the middle-end work. However, they are implemented in Python and Clean, respectively. Are there frameworks implemented in C++ for the above purpose?
However, there seems to be a dearth of "middle-ends" that are written in C++, and that can represent higher-order, dynamic, functional languages. The framework should do generic things like lambda lifting, closure conversion, type inferencing, etc. and help in other language specific transformations like, say, translating type classes, etc.
It would be a very odd choice indeed to write a compiler middle end -- what is essentially an engine for symbolic manipulation and transformation of algebraic data types -- in a language without constructor pattern matching or algebraic data types.
Compilers for functional languages are /always/ written in functional languages. Usually typed ones. The languages are just far, far better suited for this task.
精彩评论