4 ms·
How is Ada safer than Haskell? Everyone talks up Ada's safety, but they always seem to compare it to other Foogols, like C, C++, and Java/C#.
by cbd1984 12y ago
How is Ada safer than Haskell?
Everyone talks up Ada's safety, but they always seem to compare it to other Foogols, like C, C++, and Java/C#.
- pjmlp 12y agoIt is a different type of safety. Algol type safety, that C designers didn't care when creating the language rather leaving it out to lint. You cannot directly compare Ada with Haskell just on safety as they use different paradigms. Anyway, just from the top of my head: - Bound checked arrays - Real strings - Reference parameters - Real enumerations without implicit conversions to numeric data types - Type definitions are real types, not synonyms like C's typedef. Just like Haskell's newtype. - Ability to define type ranges for enumerations and numeric types - Subtyping - Generics - Explicit type conversions required among numeric types. - Contracts, Eiffel style - Pointers by default are always valid, unless your are doing unsafe code. In terms of performance, there are ways to enable unsafe code, if you really really need it, but like other memory safe systems programming languages you need to be explicit about it. A plus feature over Haskell is that currently the Ada has primitives for hardware access. The guys doing HaLVM and Home had to add extensions to Haskell.