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

THIS.

I knew someone a while back who worked on Patriot missile software. It was Ada. And Patriot still a formidable weapon.



You mean the Patriot that ended up getting 28 people killed due to a SW bug?[1] That Patriot?

Let me repeat myself again, Ada won't save you from human bugs. If you hire bad programmers or have bad dev and test practices, there's no magic programming language that will save you from your calculation and logic mistakes. You can code in raw machine code like you're 1960's NASA, and still have less bugs than a clueless vibe coder in Ada/Rust/etc. if you know what you're doing and have the right test and verification processes.

[1] https://www.cs.unc.edu/~smp/COMP205/LECTURES/ERROR/lec23/nod...


The Patriot failures were the result of floating point error. Ada provides facilities specifically to deal with this, while you're left rolling your own in C/C++. Of course Ada won't save you from human bugs, but it's silly to say that you're no better off with a language giving you everything it can to avoid them than one that is a notorious fuckup dispenser.


1. How is Ada better at floating point than C++?

2. In mission critical systems we always used fixed point fractional numbers in C as a representation of floats, to avoid floating point issues, so any issues of the language are moot.


In respect to both points, Ada provides decimal and binary fixed point representations as a first class feature of the language, and in the event you must use floating point, SPARK provides the capability to prove that you're not running into rough edges. It's actually one of the most immediately noticeable features of the language for a firmware developer coming from C, and I'm a bit surprised you don't know about it.

Of course I know that you can do all of this stuff in C. I did it for years. I just don't think there's any sort of honor or expression of skill in getting your balls busted by this stuff being an afterthought, it's just annoying. I know your response will be "get better", and I did, countless people have, and we all still appreciate that these nuisances can be taken care of by the language.


It will help a lot still. But as I said, Forth it's better than raw ASM.

On integers casted into floats, a Forth programmer would use a fixed point in a much saner way, they had experience for decades on it.


C programmers have been using fixed point integer math instead of floats for decades. It's a solved engineering problem in safety critical systems. It's only a problem for clueless devs who look for reason to shit on C and think the magic lies in the right programming language, not in having the right knowledge.


Chuck Moore disagrees. On C, I use OpenBSD and I even adapted some ports (mednafen, c++, but my point remains), one of them (not officially, as a home user) being cpulimit from Free to Open. Still, Forth on small devices it's far more predictable and introspectable than C.




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

Search: