This little thing someday hopes to become a PureScript compiler. For now it's just a parser, but it is growing steadily.
We have provided a pre-commit hook to ensure consistent code formatting using cargo fmt
. Before committing changes, make sure your code is properly formatted. To set up the pre-commit hook, follow these steps:
-
Navigate to the root directory of the repository.
-
Install the pre-commit hook by running:
bash install-hooks.sh
This will copy the pre-commit hook to your .git/hooks
directory. Now, cargo fmt
will automatically check your code before each commit.
If you encounter any issues or have questions, please don't hesitate to reach out.
- Rewritten in
R U S T
- Mostly vaporware for now
The parser understands some real code (can parse the Restaumatic codebase and its dependencies).
Currently we're working on the renamer.
If you're interested, there's a development channel on Matrix/Gitter.
We're using salsa for incremental compilation.
Parsing is not incremental, whole file is parsed at a time. Later passes will be mostly done at definition granularity.
Our base inputs are source files, but keyed by module name, not file name. This is because file names essentially don't matter for PureScript1, so later passes refer to inputs by module name.
Handwritten, mainly due to layout handling.
Some issues there:
-
The layout rules are quite complicated and I frankly don't understand how this works anymore, but it seems to pass the layout test suite from the original compiler.
-
Tokens store
String
s instead of slices, so they are not Copy and we allocate a lot of stuff.
Nothing fancy, a tree linked together by Box
es.
There is a dedicated Symbol
type meant to introduce string interning later, but for now it's just a wrapper over String
.
Generated using the excellent LALRPOP parser generator.
Super incomplete. This is the current most intense area of development.
There's no trace yet of desugaring, renaming, typechecking or code generation.
We use insta for snapshot testing.
Footnotes
-
Except for FFI, which we currently don't handle. ↩