Code Comments
Programming Forum and web based access to our favorite programming groups.Is there any advantage in using large amounts of gotos and similar things to use C only as a cross-platform assembly, compared to using C constructs like, say, Chicken does? (One divantage I can think of is that it could make FFIs harder.)
Post Follow-up to this messageSunnan wrote: > Is there any advantage in using large amounts of gotos and similar > things to use C only as a cross-platform assembly, compared to using C > constructs like, say, Chicken does? > > (One divantage I can think of is that it could make FFIs harder.) Yes, you avoid the horrible calling conventions. OTOH you have to compile everything into one function, which is probably slow for GCC to process (with all those graph algorithms). You lose separate compilation, and you can't call individual functions from outside the big blob method. For a while I though about this, but if I need to get real machine code, I'd rather compile to assembler instead. -- No man is good enough to govern another man without that other's consent. -- Abraham Lincoln
Post Follow-up to this messageI wonder if you could generate gcc's RTL and somehow convince GCC to compile that? Jon ---- Learn to program using Linux assembly language http://www.cafeshops.com/bartlettpublish.8640017
Post Follow-up to this messageJonathan Bartlett wrote: > I wonder if you could generate gcc's RTL and somehow convince GCC to > compile that? It would certainly be great if you could define your own calling conventions and otherwise use GCC's backend for optimizing, scheduling and register allocation. However, there doesn't seem to be lots of docs available, so I think it's easier (unfortunately, as with many badly docced open-source projects) to just roll your own simple backend. If you don't use C's calling conventions it might even be *faster* for well-structured code using many functions (ok, then maybe inlining would be a good thing to add, too...). -- No man is good enough to govern another man without that other's consent. -- Abraham Lincoln
Post Follow-up to this messageMarcin 'Qrczak' Kowalczyk wrote: > Jonathan Bartlett <johnnyb@eskimo.com> writes: > > > > > I guess it would be painful to port to various GCC versions as the RTL > is evolving. > How about a very thin frontend? It should map pretty closely to rtl, but still be sexp. I think I read of such a work in progress, once. Wonder what happened with it.
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.