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
2
u/[deleted] 20d ago
This doesn't make much sense. If the bootstrap compiler generates QBE or C, wouldn't the self-hosting one do the same?
Switching implementation language from Scheme to your language wouldn't affect that part of it. It would be a separate development stage, unless you are planning to combine it so that the self-hosted version also generates its own native code or whatever.
If planning to have users, you might also consider whether they need to build your compiler from source code, in which case that will be harder when it is in your language. And also what dependencies they will need to process whatever output it produces.
As for the choice between QBE and C, use whichever works and is simplest, and again consider any users you might have.