Next: Reflection, Previous: Introduction, Up: Guile Hoot [Contents][Index]
In Guile’s compiler tower, Scheme code goes through several transformations before being compiled to VM bytecode. Scheme is lowered to Tree-IL, which is then lowered to Continuation-passing style(CPS), and then finally to Bytecode. Hoot adds an additional backend that compiles the CPS intermediate representation to Wasm.
In contrast to Guile’s separate compilation approach where each module is compiled individually (with the possibility of some cross-module inlining), Hoot is a whole-program compiler. The user program and all imported modules are part of the same compilation unit and the result is a single Wasm binary. Hoot tries to make this binary as small as possible to minimize bandwidth usage when deployed to the web. To do this, Hoot uses a “tree shaking” approach to remove all code is unused in a program. Making a small change to a program and recompiling will recompile the entire program. Expect longer compilation times than you are used to with Guile.