Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Wasn't the original Bourne shell also written with (more basic) C preprocessor macros to imitate original ALGOL-style constructs?


Yes. It was the inspiration for the IOCCC (International Obfuscated C Code Competition).

http://www.ioccc.org/faq.html

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.

http://www.in-ulm.de/~mascheck/bourne/segv.html

https://news.ycombinator.com/item?id=8843951




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: