From 7d042947d013948f5ebdca2e0b493097e3f73d59 Mon Sep 17 00:00:00 2001 From: Rose Hogenson Date: Fri, 22 Apr 2022 21:43:28 -0700 Subject: Add a diagram of the compiler phases. --- README.md | 6 +- design.svg | 293 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 298 insertions(+), 1 deletion(-) create mode 100644 design.svg diff --git a/README.md b/README.md index f10efc5..653c43b 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,11 @@ The cute scheme compiler (like most compilers) consists of a number of phases that gradually transform a program from scheme code through numerous intermediate representations. The csc compiler has 3 such intermediate representations, not counting bytecode itself. These two -languages are creatively called IR1, IR2, and IR3. +languages are creatively called IR1, IR2, and IR3. Fig. 1 shows the +phases of code generation. + +![Code generation goes through several intermediate phases, named IR1, +IR2, and IR3.](design.svg) ### IR1 diff --git a/design.svg b/design.svg new file mode 100644 index 0000000..d901be2 --- /dev/null +++ b/design.svg @@ -0,0 +1,293 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Scheme code + + IR1 + + Macro expander + + + IR2 + CPS conversion + + + IR3 + Closure conversion + + Bytecode + + Code generation + + -- cgit v1.3.1