Write you a mini-GRIN, a unified compiler back-end for lazy and strict FP languages.
GRIN is a simple C like language which opens up the possibility for optional whole program analysis and unified back-ends for functional programming languages. In this tutorial I walk through the basics of the technology and how to implement such a framework.
- Prelude: General discussion on how FP languages can be compiled
- Chapter 1: GRIN syntax and semantics
- Interlude: Intermediate language to compile Lambda Calculus to GRIN
- Chapter 2: Heap Points to Analysis via Abstracting Definitional Interpreter
- Interlude: Connection between pointer analysis, type systems and abstract interpretations
- Chapter 3: Program transformation, optimizations
- Epilogue: Possible futures of the Whole Program Analysis
Under the grin-compiler project we develop possible back-ends for Idris and GHC. We have an LLVM based code generator. The project is still in the active development phase.