google / schism

A self-hosting Scheme to WebAssembly compiler
Apache License 2.0
1.27k stars 65 forks source link

Refactor compiler handling of literals #77

Closed wingo closed 5 years ago

wingo commented 5 years ago

This PR implements the first step of https://github.com/google/schism/issues/39#issuecomment-514523950. The front-end treats literals as (literal VAL), and then that's lowered to calls later in the compiler.

Incidentally this improves bootstrap performance, I think because the frontend works on smaller terms:

Compiling stage1 compiler...
  Time: 3.506 s

Compiling stage2 compiler...
  Time: 2.177 s

Compiling stage3 compiler...
  Time: 2.098 s

Percent change (1 -> 3): -40%
Percent change (2 -> 3): -4%