Live data from Hacker News

Let's Destroy C

gist.github.com

191–192 of 192 posts

Re: Let's Destroy C

#191
post #185

Those defines remind me of how Bourne shell was originally written using such a system to make the source look more like Algol 68. It might even still be maintained that way in BSD to this day [0]. [0] https://books.google.ca/books?id=9f9uAQAAQBAJ&pg=PA9&lpg=PA9...

"to this day" in 1994 is very much not "to this day" in 2020. The various BSDs use the Almquist and Korn shells for /bin/sh nowadays. Indeed, M. Van der Linden was out of date even back in 1994. At that time, BSD had already been largely freed of AT&T code, such as the Bourne shell, for 3 years. It's now approaching 3 decades.

I've forgotten how old that book is. Geez time flies. Thanks for the clarification!

Re: Let's Destroy C

#192

Earlier quoted context omitted.

Great post. In particular: "remove some of the undefined behaviors" I think the confusion caused by this is not nearly worth the optimization gained. Compiler folks will say "but look, this loop is 58% faster!" but ignore the fact that slow code can be optimized through other means, including profiling, restructuring, etc.

Or avoid them when your compiler hasn't documented if they support it. Such as gcc supporting union type punning in c++. Many compilers allow for reinterpret_cast'ing too, e.g. gcc and -fno-strict-aliasing This is more of knowing your language and tools. UB isn't some magic beast either, it's where it isn't really feasible for a language that runs on many platforms to dictate what happens. What should the std's say w…

[deleted]
Post reply on HN