I want to write a small DSL that will need to compile to another high level programming language (similar to C, but a lot more limited).What is the high level overview of what the compiler should do?To clarify, I'm especially interested into a conversion from an high level programming language to another relatively high level programming language, not in compilation in general.
How to translate from a programming language to another?
compilation
To clarify, I'm especially interested into a conversion from an high level programming language to another relatively high level programming language, not in compilation in general.Well, I have some bad news for you - translating from one language to another is compilation in general. Thinking that you can skip steps because you're working with high level languages, or because your language is very limited is only going to bring you trouble.Compilers are a well researched, well known, and well documented sort of software. The standard approach to building them is not as complicated as it may seem, and the general approach will save a pile of headaches and complexity down the road by dealing with the boatloads of corner cases that comprise even the simplest of languages.