pllab / scheme2beam

Source compiler from Scheme to BEAM VM.
4 stars 0 forks source link

AST #2

Open hkr-droid opened 4 years ago

hkr-droid commented 4 years ago

I want to make sure I've got the roadmap straight. We want to

  1. parse scheme into an abstract syntax tree
  2. somehow convert that syntax tree to erlang-core? this is perhaps under the banner of code generation in a compilers course?

In the first case it sounds like we can get the AST from whatever lambda calc we want, e.g. PCF. The grammar's already written for us. So we'd just need to write the parser from strings to sexps to AST.

I vote we use Ocaml :3.

Still unsure about 2 though.

zsisco commented 4 years ago

O🐫

zsisco commented 4 years ago

One thing to consider for 2: some of the BEAM language compilers that are written in Erlang utilize this module to compile to Core Erlang. This probably makes Core Erlang generation easier... So that's one argument to use Erlang as the compiler language... but one argument against is that we've never really written any Erlang

zsisco commented 4 years ago

I wonder what Gleam does...

hkr-droid commented 4 years ago

Yeah, I'm not trying to dive into learning erlang to the level of writing a compiler. Even my minimal experiences last night made me think it's a quirky language.