From 6c88739d9bf6ef376a4fb220de330480e9640029 Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Mon, 3 Aug 2015 22:35:08 -0400 Subject: [PATCH] Revised overview section --- docs/Writing-the-Cyclone-Scheme-Compiler.md | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/docs/Writing-the-Cyclone-Scheme-Compiler.md b/docs/Writing-the-Cyclone-Scheme-Compiler.md index d3e3589b..cd794eab 100644 --- a/docs/Writing-the-Cyclone-Scheme-Compiler.md +++ b/docs/Writing-the-Cyclone-Scheme-Compiler.md @@ -24,17 +24,13 @@ In addition, developing [Husk Scheme](http://justinethier.github.io/husk-scheme) ## Overview -TODO: overview of the compilation process - Cyclone has a similar architecture to other modern compilers: -input file => scheme AST => IR's => C-gen => C compiler => exe or obj +flowchart of cyclone compiler - +An input file containing Scheme code is received on the command line and load by Cyclone's parser. The code is represented as an abstract syntax tree (AST) of regular Scheme objects. Since Scheme represents both code and data using [S-Expressions](https://en.wikipedia.org/wiki/S-expression), our compiler does not have to use custom abstract data types to store the code as would be the case with many other languages. -An input file containing Scheme code is received on the command line and load by Cyclone's parser. The code is represented as an abstract syntax tree (AST) of regular Scheme objects. Since Scheme represents both code and data using [S-Expressions](https://en.wikipedia.org/wiki/S-expression), our compiler does not have to use abstract data types to store the code as would be the case with many other languages. - -From there a series of source-to-source transformations are performed on the AST to make it easier to compile to C, perform optimizations, etc. The final AST is then output as a `.c` file and the C compiler is called to create the final executable or object file. +From there a series of source-to-source transformations are performed on the AST to make it easier to compile to C, perform optimizations, etc. The final AST is then output as a `.c` file and the C compiler is invoked to create the final executable or object file. ## Source-to-Source Transformations My primary inspiration for Cyclone was Marc Feeley's [The 90 minute Scheme to C compiler](http://churchturing.org/y/90-min-scc.pdf) (also [video](https://www.youtube.com/watch?v=TxOM9Y5YrCs) and [code](https://github.com/justinethier/nugget/tree/master/90-min-scc)). Over the course of 90 minutes, Feeley demonstrates how to compile Scheme to C code using source-to-source transformations, including closure and continuation-passing-style (CPS) conversions.