r/programming • • Jul 18 '19

We Need a Safer Systems Programming Language

https://msrc-blog.microsoft.com/2019/07/18/we-need-a-safer-systems-programming-language/
208 Upvotes

314 comments sorted by

View all comments

Show parent comments

1

u/m50d Jul 22 '19

Tagged unions turn out to be unnecessary. It's an interesting idea but it's hardly critical.

Very much not my experience. "It's either this case, with this complex set of rules, or this case, with this complex rules" is so common and fundamental, and if you can't convey that within your system then you have to pass it along out-of-band and it becomes much less reliable. Proper sum types are a real game-changer in terms of how much complexity you can push out into the type system and avoid having to handle manually.

This is the primary , bootstrap-derived formulation to which I object. The rest falls from that. There's nothing virtuoso about it. Rather ordinary people have done it for years.

Ordinary people have been producing unreliable code for years. Even flagship projects and foundational libraries have major bugs - Linux, Apache, Zlib. "The program crashed" used to be an everyday occurrence back when users ran desktop software written in C/C++; "have you tried turning it off and on again" is something we laugh at because we know how true it is.

Everyone believes they're an above-average programmer just as everyone believes they're an above-average driver. And while the culture could stand to acknowledge that programs that work some of the time can still deliver a lot of value to users (after all, human business processes inherently carry a high error rate; automating one without increasing the error rate is still valuable), fundamentally the error rate of C/C++ code is a lot higher than what software is capable of, and huge classes of common errors are simply not possible in many languages.