Commit Graph

4 Commits

Author SHA1 Message Date
099ee5ea0d Add local variable collection to compilation
* Upon entering a new body, the local scope variables are collected.
* VM instruction PushLocal now uses a `Local` value instead of a `Sym`
  value
* Compilation of a new AST body will implicitly create a new scope

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2020-09-16 17:27:33 -07:00
582b3a4b73 Add basic blocks and implementation of flattening thunks -> basic blocks
* Basic are a more linear way of representing code. Thunks beget basic
  blocks, which beget vectors of instructions.
* Basic blocks are also being flattened into a vector of instructions
  (hopefully, no tests done yet)
* OH yeah locals can be collected too (but currently are not being
  collected in the compiler, that should come soon)

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2020-09-16 17:18:31 -07:00
fdbb0a1307 Add some base VM implementations
Some instructions are currently implemented. Others are not. This is
mostly just a checkpoint so I can implement lexical name definitions.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2020-09-14 16:32:58 -07:00
372e58f620 Fold runtime/ crate into this source tree
While I like the idea of having a runtime completely decoupled from the
syntax and compiler, I don't think this is that big of a project for
that to be necessary or even useful yet.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2020-09-14 14:14:21 -07:00