4 ms·
C! Made in AMERICA! (F--K YEAH!) We can't be using any of those sissy languages made in Switzerland! The real tragedy is that [Turbo] Pascal / Modula / Ober
by Roboprog 12y ago
C! Made in AMERICA! (F--K YEAH!)
We can't be using any of those sissy languages made in Switzerland!
The real tragedy is that [Turbo] Pascal / Modula / Oberon / Eiffel never got any traction. We could have been ahead of where we are now for low / medium low level languages DECADES ago.
E.g. - Turbo Pascal:
* Checks array boundaries, but you can cobble up pointer arithmetic if you really need to squeeze something (it looks funny, as it should, but it converts into the same assembly code as ptr += size ; ptr)
references ("var" params) used safely as non-optional values in most cases, using pointers for parameters that are truly optional.
* much stricter type checking and type range restriction allowed - most of which is only paid for at compile time, rather than run time.
* faster compiles, allowing quicker test cycles.
I suppose Ada fits in this group as well, but it was expensive in the late 80s.
Modern GC languages do well for long running application server programs, but they don't make good "transient" utility programs. We still need lower level languages for some types of programs.
Mobile could benefit from smaller memory footprints as well. I'm "gaming the game", but here are some tests on a 32 bit quad core setup, sorting by memory used for something that grinds through a number of connected objects as a surrogate for bulk data twiddling:
http://benchmarksgame.alioth.debian.org/u32q/performance.php?test=binarytrees&sort=kb http://benchmarksgame.alioth.debian.org/u32q/performance.php...
Alas, the Pascal version used 3 times the CPU seconds that the (fastest, but 2x more memory) GCC version did. However, a lot of work has been thrown into tuning GCC. Also, there were 6 C/GCC solutions submitted for this problem, of which 3 were not even correct. Of the other 2 C attempts, one was about the same size and speed as the Pascal version, and the other was twice as big and three times as slow.
- rancur 12y agoI don't need array checking, sometimes I might want to use a negative indices to access the last element