RISC OS Asm and BASIC Fun : C
Home News BASIC Tutorials Downloads
blog Docs PASCAL C Links |Bio|
The C Programming Language
C is a great language, having advantages over just about all other languages out there. If there were a decent C compiler out there I would likely switch over to it as my primary language.

C allows tricks that make it simple to produce compact source that packs a lot of functionality while being simple to translate to assembly for its low level nature.

The one trick I would like to see C gain from BASIC V is the abilty to have multiple entry points to a procedure sharing most of its code, just falling through if there is no ENDPROC. How this could be implemented in C is difficult to say, though I think it would have something to do with bringing back the entry keyword.

Any language that allows pointers to an array of function pointers to functions that return pointers to function pointers is a language with a lot of potential (so long as it also has the basics of a procedural language).
While C is one of the most versitile High Level Programming languages (only lacking a standard way to implement varying system calls among platforms), it is unfortunate that the two compilers we are stuck with on RISC OS fall short.

GCC falls short in that it takes to long to compile for a given level of optimization, and regardless of the optimization level produces AIF's that contain large sections of dead space (I believe for the particular implementation of the SharedCLibrary module that is included with RISC OS), producing a 5KB AIF when the code should compile to less than 1KB including the AIF header, and that is for a simple example that does not use the shared library at all.
GCC also falls short in that if you look at the binary produced there are very sub-optimal instructions sequences produced in loops, even when using -O3.

Then there is the DDE, Norcroft C. This compiler is great, for the most part. Actually I can find no flaw in the compiler, only flaws I see are in AMU and ObjAsm, both of which we owe much of our code to. !ASM is a better assembler, while AMU is almost never used many people prefering either custom made make utilities or a n*x make clone. So Norcroft C meets the need, though the other DDE utils fall short.