Name: Nim0, a subset of Nim language, with a compiler to a 32-bits RISC CPU and a runtime emulator
Author: Pierre Métras
Nim0 is a toy language similar to Nim but much more limited (no fancy feature X; replace X by generics, templates, closures, imports, etc.). But it comes with a one-pass compiler to 32-bit RISC instructions and an emulator, and a few examples to show what you can do with it. In fact, the interesting part in Nim0 is not the language itself but the compiler source in less than 4000 lines of commented code, with references to Niklaus Wirth's Compiler Construction book that you can follow while reading the book, even if the book talks about Oberon-0. When you have completed the book and added a few features to Nim0 compiler, you'll be ready to jump into hacking Nim compiler.
Name: Nim0, a subset of Nim language, with a compiler to a 32-bits RISC CPU and a runtime emulator
Author: Pierre Métras
Nim0 is a toy language similar to Nim but much more limited (no fancy feature X; replace X by generics, templates, closures, imports, etc.). But it comes with a one-pass compiler to 32-bit RISC instructions and an emulator, and a few examples to show what you can do with it. In fact, the interesting part in Nim0 is not the language itself but the compiler source in less than 4000 lines of commented code, with references to Niklaus Wirth's Compiler Construction book that you can follow while reading the book, even if the book talks about Oberon-0. When you have completed the book and added a few features to Nim0 compiler, you'll be ready to jump into hacking Nim compiler.
Want to try it? Look at the simple instructions and detailed example at https://pmetras.gitlab.io/nim0/.