4 ms·
Very cool project! Thank you for taking the time to prepare this reveal so well. Examples and roadmap and all. Good job! It looks like you started with writing
by ahaferburg 8y ago
Very cool project! Thank you for taking the time to prepare this reveal so well. Examples and roadmap and all. Good job!
It looks like you started with writing an interpreter in C#, then wrote the compiler in the language itself. Which is a cool concept, I must say. I can't fully wrap my head around the practicalities, though. Do you compile the compiler with an older version of itself during development? Do you plan to update the interpreter as the language evolves?
Builtin serialization of any type Couldn't this be implemented with compile time evaluation in the standard library?
Variable redeclarations Why?
What about a build tool? Is an interface with the compiler going to be part of the compile time evaluation?
How long have you been working on this? Is this your first language project?
- semigroupoid 8y agoIt looks like you started with writing an interpreter in C#, then wrote the compiler in the language itself. Which is a cool concept, I must say. I can't fully wrap my head around the practicalities, though. Do you compile the compiler with an older version of itself during development? This is called bootstrapping [0] and is common in compiler development. [0] https://en.wikipedia.org/wiki/Bootstrapping_(compilers) https://en.wikipedia.org/wiki/Bootstrapping_(compilers)
- nickmqb 8y agoThanks for the kind words! Correct, the initial compiler is built using the C# interpreter; the compiler can then be used to compile the next version of itself. Bugs and backwards incompatible language changes can be a problem though. For that reason, it's a good idea to keep the C# interpreter updated so there's always a safe path to bootstrap from. Variable redeclarations may be useful in certain scenarios, e.g. redeclaring a variable of type Maybe<T> as T. You're right that serialization may be better implemented as a library using some kind of reflection capability, this needs some more thought. I haven't yet thought about the specifics of build tools, but I very much want to make it easy for people to write tools, and offering the compiler as a library will be part of that. I started with the initial idea for Muon late 2017/early 2018. Initially, the plan was to create a higher level language (more like C#), but the more I iterated the more I realized that low-level was the way to go. Muon is my first large language project, though I've always been interested in compilers and have written some toy languages in the past.