We all know exactly what is the only thing our MSX needs to be up with the times...
--- exactly! a Rust Compiler!
Well, allow me to present you the crazy project from this last weekend: the Z80 Babel. This is a series of pipelines to compile C, C++, D, Rust, Zig and Fortran, for our MSX:
https://github.com/MartinezTorres/z80_babel
As of now, there is only the code and some benchmark results. If I get to know exactly how I managed to get everything running in detail, I'll write it. The key takeover is that any llvm front-end that accepts the AVR target can produce llvm intermediate files that are suitable for the z80 (e.g., pointers being 16 bits). This llvm intermediate file is translated to C using the llvm-cbe backend, and this C is compiled for the Z80 using our beloved SDCC.
My first guess is that such a pipeline would break at some point, but amazingly, a little bit of duct tape (a.k.a SED) manages to fix most of the issues. Support for memory management or standard library is, of course, limited.
On the performance side, the intermediate C files generated by the llvm-cbe backend are very verbose, and SDCC has some trouble optimizing them, but if e crank up the *max-allocations*, it can be even faster than the C baseline! On the other hand, the binaries are quite larger than the C baseline.
With --max-allocs-per-node 1000:
With --max-allocs-per-node 50000: