6 ms·
If it is so safe and reliable, why isn't used more for normal projects?
by yoodenvranx 12y ago
If it is so safe and reliable, why isn't used more for normal projects?
- wwwwwwwwww 12y agobecause choosing a language for a commercial project is rarely about safety or effectiveness - it's about language popularity, availability of libraries, and replaceability of the programmers.
- pjmlp 12y agoBecause in IT no one gets sued when they go wrong.
- curtis 12y agoIt could be that the code is indeed more safe and reliable, but also quite a bit more expensive to write and maintain.
- TeMPOraL 12y agoBecause safety comes at a price. I did a little bit of Ada programming, and one of the distinct features it has is you can't do anything clever without being extremely explicit about it. This language has the most aggressive type-correctness checking I have ever seen. When you finally get your code to compile, it's likely that it will work reliably.
- coldtea 12y agoSounds like you're describing Haskell. I don't think Ada is that strict.
- joevandyk 12y agoAda has the advantage of not being weird though. :) Also, at least back then, Ada has no garbage collection, so you know what latencies are.
- eru 12y agomalloc / free style memory management has unbounded latency, too. Though Ada might do something even more conservative.
- SkyMarshal 12y agoAda uses its type system plus managed memory pools for manual memory management, it's very cool. Safe manual memory management with memory control of C/C++ but the safety of an ML. http://en.wikibooks.org/wiki/Ada_Programming/Types/access http://en.wikibooks.org/wiki/Ada_Programming/Types/access
- JasonFruit 12y agoAda is very strict; its type system might not be as well-planned as Haskell's, but it's both strict and effective.
- deleted 12y ago[deleted]
- wfunction 12y agoFor someone who's never seen Ada code, could you explain what kind of strictness it has that doesn't exist in other languages like (say) C++?
- Padding 12y agoPeople usually think of Haskell when strict type systems come up.. Ada is a "different kind" of strict though. It doesn't do any of the fancy/confusing inference stuff that Haskell does in order to verify that type conversions/transformations progress along the intended paths, but instead requires you to be very explicit about what you're doing. E.g. (1) Trying to read something from stdin is a minor challenge, because of how Strings are usually fixed-length and don't interoperate with special arbitrary-length strings. (2) If you want to do dynamic memory stuff yourself, you need to declare your packages as such (with the intent of this showing up during reviews and thus leading to the code being more thoroughly scrutinized.) (3) It allows for creating special sub-types of primitives, like integers of a limited/well-speicified range, so that they can be put into APIs intead of ordinary machine/compiler-dependent integers. (4) Conditions (in IFs and such) don't (by default) short-circuit evaluate, and you have to use speical key words if you want short-circuit evaluation. And the list goes on.. All in all, Ada is quite enjoyable imho. It allows you to write code without thinking too much about it, since you won't be missing (many) corner cases. On the other hand of course all of this results in more work, which can feel tedious to some - but at least it's not the mind-boggling "what is this *?!" strictness that has you pulling your hairs out in confusion/desperation, that usually accompanies Haskell.
- antocv 12y agoYou can make an integer range like 2..15 if you know thats your possible input values, and nothing else, only that will be accepted - no need to parse it yourself or check for upper/lower-bounds/unsigned-ness, the compiler and later runtime does it for you. No casting.
- mercurial 12y agoSounds like dependent types.
- awjr 12y agoI was involved in writing the short term collision alert system for the New En Route Centre down in Swanwick, UK. Basically proving something won't kill is extremely important in this environment. The language is almost irrelevant. Proving every single piece of logic has been exercised (an OR statement had to have true true, false true, true false and false false tests...now add multiple ORs to that). Mission critical software is another world. Probably rather alien to the HN crowd ;)
- malka 12y agoThe Paris subwway network is partially automated. The software is written in OCaml, and mathematically proven correct using Coq.
- sitkack 12y agoWhich parts aren't automated?
- donquichotte 12y agoInteresting. Do you have any additional information on this?
- monort 12y agoIt seems to be not OCaml: First real success was Meteor line 14 driverless metro in Paris: Over 110 000 lines of B models were written, generating 86 000 lines of Ada. No bugs were detected after the proofs, neither at the functional validation, at the integration validation, at on-site test, nor since the metro lines operate (October 1998). The safety-critical software is still in version 1.0 in year 2007, without any bug detected so far. From: http://rodin.cs.ncl.ac.uk/Publications/fm_sc_rs_v2.pdf http://rodin.cs.ncl.ac.uk/Publications/fm_sc_rs_v2.pdf
- ghshephard 12y agoSafety and Reliability are not as relevant for most projects as speed, flexibility, familiarity, availability of frameworks and developers, inexpensive compilers/debuggers,etc... All of these are area in which Ada is not as highly qualified as some of its competitors. But, for Avionics and Space System, Ada is a well known, and continues to be a well known implementation language.
- mwfunk 12y agoThe safety and reliability comes at the price of more verbosity and less dynamism. Most programmers don't need (or don't think they need) that level of reliability, and choose not to use languages like Ada (if they are even aware of its existence). On the other hand, failure is much less of an option when it comes to things like avionics, so much more focus is placed on reliability. In these cases that price starts looking like a bargain, if the use of Ada isn't already mandated (which it probably is).
- SkyMarshal 12y agoI was just asking that recently too [1]. I think it's because most "normal" projects, aka web/desktop/mobile apps aren't safety critical, a large cadre of developers prefers dynamic languages that let them program in a completely bottom-up exploratory manner without thinking about types and the like. [1]:https://news.ycombinator.com/item?id=8245442 https://news.ycombinator.com/item?id=8245442