Commit Graph

20 Commits

Author SHA1 Message Date
b72b2eddb4 broken 2024-10-21 09:41:57 -07:00
6deccd5529 Get some indenting right. 2024-06-19 09:47:37 -07:00
212ca6cc53 CHECKPOINT: Initial syntax arbitrary implementation. 2024-06-16 20:59:32 -07:00
88d128df9f CHECKPOINT: Everything builds again. 2024-06-03 20:36:31 -07:00
4c2850427a Start isolating names into their own thing. 2024-04-29 21:38:17 -07:00
52d5c9252b checkpoint 2024-04-22 20:49:44 -07:00
7d4f182a67 Clean up primitive handling, finally. 2024-04-16 16:20:31 -07:00
763a895285 Allow chained equals. 2024-04-15 16:32:27 -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
ac564e6e41 Add support for syntax blocks. 2024-03-06 09:50:42 -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
9d41cf0da7 ran into another type inference problem 2024-02-05 17:30:16 -06:00
7ebb31b42f checkpoint 2023-12-28 20:57:03 -08:00
e5db6640f2 checkpoint in reconstruction 2023-12-26 21:08:01 -08: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
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
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