Making robust software: the “Mars Code” talk (2012)
verticalsysadmin.com
verticalsysadmin.com
Even a simple linked list implementation uses double pointers to reset parent nodes.. Does anyone have insight into the risk in static analysis? Seems like it would be handled by whatever logic was handling normal pointer derefs.
Seems like the only argument is the one against function pointers, which is a pretty amazing thing to ban but at least provides logic WRT static analysis.
There is a possible risk element of Cargo Cult'ing here. I would hope that all programmers understood why the buttons weren't green. It sounds like they would have, having been certified, and in an environment that lives and breathes code safety, but it is always worth being aware that metrics like that can have hidden consequences.
The more accurate analogy is seatbelts' utility in a car fitted with various collision avoidance devices all the way up to fully autonomous driving. I say you'd still want the seatbelt for when collision does occur after all.
I think that the main advantage of C/C++ is the number of people who speak it. But my guess is that the time to train a competent programmer in a safe language can be easily saved in improved productivity.
We have about 40 years of experience writing C compilers today (and we still screw it up sometimes; C++ is... well, I mean, we have about 30 years of experience writing C++ compilers, but those are still in the "mostly right" state). Many subtleties of the language are well understood and many problems have had idiomatic, well-known, widely-used solutions for decades now.
Ada would be a good choice for such projects but for the relative flimsiness of its ecosystem. It's a great language, but its development is fairly underfunded, and back when all this stuff was happening, its future was very uncertain (it still is, I guess).
And when I say "fairly underfunded" and with a "very uncertain" future, you should understand that I mean "it used to be funded by the DoD, but with various levels of commitment" and "only a few companies, most of them government contractors, and maybe a few state institutions along with a small, but enthusiastic community were pushing for it".
Its fame on HN and Reddit may not indicate it, but Rust fares even worse in this regard. Ten years from now, Rust may not even exist anymore.
It's not only about technical merit. Projects like these would benefit a lot from being written in Ada (and Rust, too, I guess -- it's a great language), provided that there were such a well-developed ecosystem around either of them. But there isn't. E.g. when choosing their static analysis tools, these guys settled for the top 5 solutions. Top 5! They evaluated a bunch of programs and settled for the best 5. I don't think there are 5 static analysis solutions for Rust in total (and I'm pretty sure there are only two or three for Ada that have been maintained after 1999 or so).
Edit: for what it's worth, I do think it's on the right track on both accounts!
The ecosystem is really weak, though. There's no doubt about that. I don't see that changing regardless of whether Ada stays around. It's why I'm excited about Rust's mainstream adoption where it might get where Ada is or exceed it as tooling improves. It's one of few times mainstream goes for The Right Thing over Worse is Better. Eiffel, esp SCOOP model, being another good example that has significant momentum. The CompSci people are doing amazing things with SCOOP extensions right now that could be implemented in an Ada successor.
So, still potential at least. Plus, at least our tooling for C is now good enough to emulate Ada's safety with the right people doing the work. Plus, we only have to buy 5 tools now. Much improvement over old days. ;)
Me too! We had a great chance with Ada and we kindda wasted it. Rust is literally a second chance. This is pretty rare in tech.
https://en.wikipedia.org/wiki/International_Traffic_in_Arms_...
I think your question is valid nonetheless, especially for the USPS, Dept. of Education, etc.
The second was a software bug which led to a wrong file being deleted as part of regular housekeeping activities. The fix was straightforward and was applied and the MSL continues its investigation of life on Mars. (end of the article)
Further validates those aspects of my list. I'll keep recommending them. Most tools and the rule list are available but I see no link for scrub on his website. Is it not going to be freely distributed or just not ready for public release? More tools for code review that are field-proven is A Good Thing to have.
Are they implying that MSL is the first time they used automated code checks?
There's probably no change in the algorithms. They just use non-recursive versions.
They probably don't use trees and quicksort at all.
> What's the gain?
You can prove that you won't have a stack overflow. You can calculate the maximum depth of the stack at compile time, not runtime.If you can calculate the size of the stack at compile time, you don't need to manually manage it.
But if you really have to use recursion, you can always simulate it with a loop and an explicit stack. This way it's also easy to bound the stack size.
I hope that's an error in the document. I assume they meant "$(grep -r 'switch (' . | wc -l) != $(grep -r 'default:' . | wc -l)".