Charles Pegge
20-01-2010, 12:09
Plans afoot for FreeBasic to emit C instead of Asm. This means that FreeBasic will be useable on any platform (and any hardware) that supports the GCC compiler.
V1ctor
Thanks. There were (and still are) many fix to be done in the gcc emitter, but it will allow FB to be ported to new platforms in the future (say x86-64, ARM), keeping it alive for much longer (don't let BASIC die!). Besides the gain with optimizations; in my tests, the gfx demos ran at least 2 times faster with "-O max"; i guess it'll be the same with the math intensive apps.
It's pretty functional already, but i still need to fix a couple of ICE's and test it against the test suite, plus rebuilding fbc completely using the emitter.
....
Just to make it clear, FB won't just translate BASIC to C. Gcc is used as a high-level assembler, not a single C header is ever included - you can also use OOP that's ABI-compatible with g++ (a C++ compiler) using gcc to compile (a C-only compiler).
The gcc emitter doesn't change anything in the front- and the middle-end of the compiler, so syntax and semantic checks continue to be done.
Discussion here:
http://www.freebasic.net/forum/viewtopic.php?t=14849
V1ctor
Thanks. There were (and still are) many fix to be done in the gcc emitter, but it will allow FB to be ported to new platforms in the future (say x86-64, ARM), keeping it alive for much longer (don't let BASIC die!). Besides the gain with optimizations; in my tests, the gfx demos ran at least 2 times faster with "-O max"; i guess it'll be the same with the math intensive apps.
It's pretty functional already, but i still need to fix a couple of ICE's and test it against the test suite, plus rebuilding fbc completely using the emitter.
....
Just to make it clear, FB won't just translate BASIC to C. Gcc is used as a high-level assembler, not a single C header is ever included - you can also use OOP that's ABI-compatible with g++ (a C++ compiler) using gcc to compile (a C-only compiler).
The gcc emitter doesn't change anything in the front- and the middle-end of the compiler, so syntax and semantic checks continue to be done.
Discussion here:
http://www.freebasic.net/forum/viewtopic.php?t=14849