Commit Graph

4 Commits

Author SHA1 Message Date
1fbfd0c2d2 📜 Add better documentation across the compiler. (#3)
These changes pay particular attention to API endpoints, to try to
ensure that any rustdocs generated are detailed and sensible. A good
next step, eventually, might be to include doctest examples, as well.
For the moment, it's not clear that they would provide a lot of value,
though.

In addition, this does a couple refactors to simplify the code base in
ways that make things clearer or, at least, briefer.
2023-05-13 15:00:08 -05:00
f4594bf2cc 🧪 Add evaluation tests to ensure that passes retain NGR semantics. (#2)
This change adds `Arbitrary` instances to the key IR data types (both as
syntax and as native IR), as well as evaluator functions for both. This
way, we can ensure that the evaluation of one version of the IR is
observationally equivalent to another version of the IR, or even a later
IR. It also adds a similar ability through both static file compilation
and the JIT, to ensure that the translation through Cranelift and our
runtime works as expected.

This actually found a couple issues in its creation, and I hope is
helpful extensions into more interesting programs.
2023-05-13 15:00:08 -05:00
99fb12910f 🤖 Make Github Actions work (#1) 2023-05-13 15:00:08 -05:00
b2f6b12ced 🤷 The initial version of the compiler, both static and JIT.
This implements a full compiler, with both static compilation and JIT
support, for the world's simplest and silliest programming language. You
can do math, and print variables. That's it. On the bright side, it
implements every part of the compiler, from the lexer and parser;
through analysis and simplification; and into a reasonable code
generator. This should be a good jumping off point for adding more
advanced features.

Tests, including proptests, are included to help avoid regressions.
2023-05-13 15:00:02 -05:00