I don't care moving Nim0 repository from GitLab to GitHub if it can help 
collaboration on that project. I can even share it with another maintainer if 
someone is interested. For the current time, I've created a clone at 
<https://github.com/pmetras/nim0>.

But I don't think that this project is worth adding an AST. Wirth created 
Oberon-0 as an illustration for teaching CS and compiler construction. He 
wanted to keep it as simple as possible, though touching some important parts 
of compiler design like records or arrays. Nim0 is a direct port of Oberon-0 
compiler with a few enhancements. I kept Wirth's coding style in some parts 
even if using Nim could make the code nicer or I thought that more modern 
coding would improve it. It's really a pedagogical toy to learn compilation 
while reading the book _Compiler Construction_ and trying to do some exercises 
at the end of chapters.

If I wanted to have a more powerful bare compiler with an intermediate 
representation, I would start from scratch. Nim0 was thought to be a 
single-pass in-memory compiler with RISC code interpretation (Wirth even 
provided an FPGA hardware to execute programs). Adding an AST would require 
changing the whole code generation module and make the whole program more 
complex for beginners. As it is, it limits the type of language experiments you 
can do with it. But the goal of Nim0 is not to replace Nim compiler but to make 
it easier to understand how it works.

Reply via email to