r/ProgrammingLanguages • Nain. • 23d 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

13 comments sorted by

View all comments

1

u/gio_vs 20d ago

Eu escolheria C. Como você só vai usar esse compilador para testar recursos da linguagem e compilar o compilador definitivo, acho que não vale a pena complicar muito. Gerar C é mais simples, facilita a depuração e ainda tem como aproveitar a infraestrutura de compilação C que você provavelmente já tem, considerando o CHICKEN. Também é mais portátil que QBE.

1

u/Key_River7180 Nain. 20d ago

Well, C is definitely portable and ubiquitous and debuggable but I'd argue it's ever so slightly harder to output C than QBE IR. QBE IR is an extremely simple language too, but QBE IR is SSA so I must do some weird trickery to lower it too, it's a single pass, not-very-optimizing compiler too.

I'm leaning C here lol

(srry for not responding in Portuguese i can only read it not write it)