Re:BASIC in C++
by vezzy-fnord on Saturday June 20, 2015 @06:08PM
(#9751202)
Wasn't the original Bourne shell also written with (more basic) C preprocessor macros to imitate original ALGOL-style constructs?
[ Parent
| on HN ]
Yes. It was the inspiration for the IOCCC (International Obfuscated C Code Competition).
But the macros were the least of its problems: It allocated memory by trapping SIGSEGV (SIGnal for SEGmentiation Violation; that is, the signal the OS sends a program when it's tried to access memory beyond the region it owns); the function which caught SIGSEGV allocated more RAM. This made it difficult to port sh to the Motorola 68000-based computers which were the first generation of Unix workstations.