theGSman wrote:
White Flame wrote:
The C compiler will put all of the case bodies' variables in the same scope, reusing variable slots and potentially using CPU registers for many of them. I guess that is pretty Forth vs C specific.
A modern optimizing C compiler can generate more efficient code than even an assembly language programmer can produce. In this modern highly evolved information age, low level programming is going the way of valves and relay sets.
Don't count out tubes (valves) and relays just yet. Tube amplification is quite popular with musicians and audiophiles. My company does contract work for another company that sells tube-powered guitar amplifiers.
As for relays, billions are produced and used every year. Railroad signalling is a big user of relays, which are generally more trustworthy than their electronic counterparts in the harsh operating conditions encountered in such service.
Regarding the output of a C compiler versus an expert assembly language programmer, I disagree. A human programmer can always do a better job of optimizing code than any automatic code generator—which description applies to a language compiler. The programmer can often see patterns that a compiler cannot, which means the programmer can use that information to develop a tighter and faster routine.
That said, modern MPUs (especially the x86 family) have gotten so complicated and opaque, it's generally not economical anymore to write in assembly language.
Quote:
This is why nostalgia sites like 6502.org exist; so that members can experience computing and programming like it was in the pioneering days of the 80's.
Dunno how old you are, but to me, the "pioneering days" were the 1950s and 1960s.