Commit Graph

50 Commits

Author SHA1 Message Date
f915db9337 Fix the results of binds problem. 2024-04-11 10:03:11 -07:00
632770f4f4 stray import 2024-04-11 09:25:28 -07:00
a3ce53bca2 A more complicated structure test. 2024-04-11 09:22:28 -07:00
85407c8f48 Formatting. 2024-04-11 09:15:19 -07:00
cfcb3f042b Fix broken struct type inference. 2024-04-11 09:15:08 -07:00
8479a84e07 basic structures work in the jit 2024-04-11 08:57:50 -07:00
5f2fc7cb34 ngrc version works? 2024-04-03 20:55:49 -07:00
fab5a230f1 move towards structure construction / deconstruction 2024-04-02 21:00:05 -07:00
e1e798ef8e Get to the point of needing to construct/reference fields. 2024-03-30 21:17:11 -07:00
854fd60132 Add a Fields structure. 2024-03-29 10:45:55 -07:00
a7b85d37da basic support for structures through the IR 2024-03-16 16:41:23 -07:00
b0cc2fc26b Broken structure now gets through syntax evaluator. 2024-03-08 18:39:13 -07:00
77c4277625 that example isn't broken 2024-03-06 18:30:01 -08:00
6c3fc2de01 parse tweaks 2024-03-06 14:35:46 -08:00
ac564e6e41 Add support for syntax blocks. 2024-03-06 09:50:42 -08:00
8dab797c90 Formatting 2024-03-05 20:25:29 -08:00
2b8133f4db upgrade dependencies 2024-03-05 20:11:17 -08:00
08d41686be cute unicode tricks 2024-03-02 22:08:00 -08:00
09308649ed remove dead test cases 2024-03-02 22:05:53 -08:00
b9da300db2 unneeded import 2024-03-02 21:57:46 -08:00
50f224ab2e Formatting 2024-03-02 21:56:25 -08:00
d54680a8fe shorten some logs 2024-03-02 21:54:11 -08:00
745e263b69 think that replaces all the printlns I care about 2024-03-02 21:52:56 -08:00
e9fbd275a2 Clean up pretty printing and work on logging. 2024-03-02 21:19:29 -08:00
b0aa5bc222 Upgrade 2024-02-22 17:03:50 -08:00
d663af8a46 better 2024-02-22 15:17:56 -08:00
0cc2b4ea9d wheee 2024-02-22 14:23:41 -08:00
26bd7e90fd getting closer ... 2024-02-22 13:47:06 -08:00
7edaf747aa it runs! gets the wrong answer, but runs! 2024-02-17 09:38:12 -08:00
9d41cf0da7 ran into another type inference problem 2024-02-05 17:30:16 -06:00
7def938781 tests all pass 2024-02-02 10:36:28 -08:00
4ba196d2a6 jit works 2024-02-02 10:31:54 -08:00
7ebb31b42f checkpoint 2023-12-28 20:57:03 -08:00
53a9d081bb got some basics working! 2023-12-27 14:32:00 -08:00
7101b62efb deal with unknown types at the syntax phase 2023-12-27 10:58:05 -08:00
5936f5a0d9 jit works yay 2023-12-27 10:27:18 -08:00
e5db6640f2 checkpoint in reconstruction 2023-12-26 21:08:01 -08:00
2c2268925a todo: arbitrary ir 2023-12-03 17:32:37 -08:00
93cac44a99 checkpoint; builds again 2023-12-02 22:38:44 -08:00
71228b9e09 Checkpoint 2023-10-14 16:39:16 -07:00
87d027bf8d Checkpoint: pushed through type checking, at least. 2023-10-07 14:36:17 +02:00
ca26d0ea40 Fix the parser, make the function name optional. 2023-10-07 11:25:49 +02:00
736d27953f Wire functions through everything, with some unimplemented, and add a basic scoped map. 2023-10-07 11:06:28 +02:00
eba5227ebc reorder the format and build stages 2023-09-24 17:25:55 -07:00
4c53419fc0 checkpoint 2023-09-24 08:12:35 -07:00
bd3b9af469 🤔 Add a type inference engine, along with typed literals. (#4)
The typed literal formatting mirrors that of Rust. If no type can be
inferred for an untagged literal, the type inference engine will warn
the user and then assume that they meant an unsigned 64-bit number.
(This is slightly inconvenient, because there can be cases in which our
Arbitrary instance may generate a unary negation, in which we should
assume that it's a signed 64-bit number; we may want to revisit this
later.)

The type inference engine is a standard two phase one, in which we first
generate a series of type constraints, and then we solve those
constraints. In this particular implementation, we actually use a third
phase to generate a final AST.

Finally, to increase the amount of testing performed, I've removed the
overflow checking in the evaluator. The only thing we now check for is
division by zero. This does make things a trace slower in testing, but
hopefully we get more coverage this way.
2023-09-19 20:40:05 -07:00
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