My compiler now works on the Uxntal "Hello, world" so I guess that's it, job done ^_^
Let me introduce "nito", a proof-of-concept compiler from #Uxntal to C.
You can find it at https://codeberg.org/wimvanderbauwhede/nito.
I might still do an actual LLVM IR backend, and will almost certainly do Fortran as it is too good to let pass.
@pixelherodev 🤣
That's me being lazy, because I use combined declarations + statements and that is not a valid target.
@wim_v12e I'm aware! :)
I've written some transpilers targeting C for fun; my solution was, more convolutedly, to track whether a label was needed :P
@pixelherodev Ah, I should probably do too. But laziness is a virtue 😄
@wim_v12e It's a matter of axioms, really: do you intend for the output of your transpiler to be machine code that happens to be valid input to a C compiler, or to be C language code?
If the former, the "lazy" approach is actually the *correct* one. You shouldn't optimize for human readability for the C, because it's basically trash. Its only purpose is to be lowered to QBE/GIMPLE/LLVM/SDIR/etc and from there to machine code, which will be more readable than the C anyways.
@pixelherodev I prefer the former, that is why I'll probably go to LLVM IR directly (but after I've done Fortran ^_^).
@pixelherodev By the way thanks for looking at it in that level of detail!
@wim_v12e Well I wasn't going to comment _without_ at least reading the README! >_>
@pixelherodev You're way ahead of lots of people on the internet with that attitude :-D
@wim_v12e pure madness 💯
@neauoire telestic or poetic?
@wim_v12e
Neato!! #uxn