r/ProgrammingLanguages • u/Key_River7180 Nain. • 20d ago
Help transpilation - Bootstrap compiler
So, I am making a compiler for my language, Nain, in CHICKEN Scheme. Should I output QBE IR or code for C or another language? This is a bootstrap compiler, I will use it only to test new language features and to compile the self hosting compiler so yeah.
1
Upvotes
View all comments
Show parent comment
1
u/[deleted] 20d ago
The intermediate stage sounds a much better idea. Then the first compiler written in Hain can be a simple port of the Scheme one that generates the same output.
Otherwise using a brand-new language to write a quite different compiler with a complex LLVM backend, sounds too ambitious to do in one go.
But also, if LLVM is on the cards anyway, why doesn't the scheme version generate that instead of C or QBE - what limitations does Scheme has that Nain will not have?