* Variables were previously named "Local"s because they described a
local variable - however, this is kind of a misnomer because it
handles globals as well. This has been changed pretty much everywhere
when appropriate (hopefully).
* Renamed obj/names.rs to obj/reserved.rs, freeing up the "names" module
for the new Names handle
* Renamed obj/locals.rs to obj/names.rs, see above
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
A vector of instructions and constants can now be decompiled as text on
the terminal to give an idea of what the VM is doing.
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
I'm able to compile some basic expressions into instructions using the
`not` binary. Big first step, now we need to introduce branches and
loops to the syntax.
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
* 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>
* 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>
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>
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>
* Compile module is able to compile bytecode (or so it seems...)
* Runtime crate has had some new stuff added to it, mostly with objects
and vtables. Still not 100% on the object method function call story,
but I guess it'll be tackled when we get there.
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>