Request: modules
Thanks for your work on this, we've been actively working on a fork of this compiler that bootstraps it all the way from a 357 byte binary on various architectures. One feature that is missing in particular is modules, which would allow separation of code into different files.
It's non-critical for our work but if added would greatly help, especially since we plan to build a Scheme interpreter on top of this. How complex would it be to add?
I've been wanting to add modules for a while. I've been holding off because I wanted to explore a little, and try implementing Agda-style modules for example. But perhaps it's best just to get something simple working first.
My experimental "precisely" compiler supports #include directives, which I use to split code across multiple files. I'll see if it makes sense to document it and make it a bit more official.
On closer inspection, it looks like "crossly" was my first compiler to support #include. It's just undocumented.
So if you manage to get "crossly" working, you can temporarily use includes to get a poor man's modules.
Yeah, we have blynn-compiler compiling all the way to precisely. Thanks!
I added modules, though there are many caveats at present. It's based on "methodically", and I hope to work my way back up to "crossly" via modules. https://crypto.stanford.edu/~blynn/compiler/module.html
Are features like qualified imports and hiding planned?
I hope to get around to it some time.
I have a rough implementation of qualified imports and hiding, though modules in general are rough around the edges.