Antimatter - Engineering Log #2 #11
arshalaromal
announced in
Log
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Refining the language design
I have successfully finished the parser, and I have also added a few tests.
Over the past few days, I have been changing a lot of the language design. Some parts of the original plan were good in theory, but after working through the parser and thinking more carefully about the compiler pipeline, I realized the error model needed to be much stronger and more explicit.
Core Changes
1. A new error-handling model
Antimatter now uses a different approach to error handling built around the
Errorkeyword, theorkeyword, the?operator, and!T.This is meant to push developers toward handling errors properly instead of silently ignoring them. The idea is to make failure states explicit, structured, and harder to misuse.
I also introduced Error tags, which can be used like this:
2. Outcome has been removed
Originally, Antimatter had a tagged union called
Outcome<...>that was planned to represent errors, results, and none/null values.That design is now completely removed.
There is no null pointer in Antimatter.
3. Cycles are handled explicitly
To prevent cyclic memory leaks and related memory issues, Antimatter uses the
@weakcompiler directive.This is now part of the memory model instead of relying on a separate
Outcome-style abstraction.4. Simplicity is still a goal
Antimatter is not only about performance and safety. It also aims for simplicity.
The goal is still to keep the language understandable, practical, and clean to use, while avoiding unnecessary complexity in the core design.
QBE exploration
While working on these changes, I was also exploring QBE in parallel. Around this time, QBE 1.3 was released, so I spent time looking into the newer backend direction as well and how it could fit into Antimatter’s architecture.
Next step
The next step is to continue with the compiler pipeline: semantic checking, followed by code generation and the rest of the backend work.
This is still an experimental project, and the design will keep evolving as I keep building.
Beta Was this translation helpful? Give feedback.
All reactions