Earlier quoted context omitted.
> ADA has proper arrays, with bounds checks. Not only that, but you can also opt out at compile-time if you need, for performance reasons. You also have (optional) runtime bound-checking for scalar values (aka "integers"), and you can even specify the bounds yourself (like "A number between 3 and 17").
Proper bounds checked arrays, possible to opt out, integers with bounds: Turbo Pascal had that too.
Airbus Chooses GNAT Pro Ada for Development of Unmanned Aerial System
71–80 of 203 posts
Re: Airbus Chooses GNAT Pro Ada for Development of Unmanned Aerial System
#72Not an expert in ADA, but after playing around with it for a while, I don't know why this language doesn't get more praise. It seems to solve a lot of the memory problems Rust solves, albeit in a different way. Its first-class arrays and strong type system seem to go a long way into not having to deal with pointers often, for example. These "features" today would likely be considered part of "a better C", except that…
Ada doesn't have compile-time-safe dynamic memory allocation and deallocation (i.e., tracking a pointer so that you know statically that it's no longer used elsewhere in the function that frees it). Rust does it through the lifetime system, which is based on Cyclone, which long postdates Ada. The usual alternatives are to statically allocate all your memory, to convince yourself it's safe to use Unchecked_Deallocatio…
Re: Airbus Chooses GNAT Pro Ada for Development of Unmanned Aerial System
#73Does anyone use Ada for general purpose programming, like for where one might otherwise use Python, Go, nodejs, or something like that? Is it used for any low-reliability areas?
Re: Airbus Chooses GNAT Pro Ada for Development of Unmanned Aerial System
#74Earlier quoted context omitted.
> ADA has proper arrays, with bounds checks. Not only that, but you can also opt out at compile-time if you need, for performance reasons. You also have (optional) runtime bound-checking for scalar values (aka "integers"), and you can even specify the bounds yourself (like "A number between 3 and 17").
Proper bounds checked arrays, possible to opt out, integers with bounds: Turbo Pascal had that too.
Re: Airbus Chooses GNAT Pro Ada for Development of Unmanned Aerial System
#75Earlier quoted context omitted.
Ada doesn't have compile-time-safe dynamic memory allocation and deallocation (i.e., tracking a pointer so that you know statically that it's no longer used elsewhere in the function that frees it). Rust does it through the lifetime system, which is based on Cyclone, which long postdates Ada. The usual alternatives are to statically allocate all your memory, to convince yourself it's safe to use Unchecked_Deallocatio…
As described in another post Ada has features to avoid the problem Rust want's to solve in most cases. You can e.g. allocate varable length arrays on the stack.
Re: Airbus Chooses GNAT Pro Ada for Development of Unmanned Aerial System
#76Earlier quoted context omitted.
Programming Rust by O'Reilly, haha.
I get why this is downvoted but it is solid advice: in C you absolutely have to track ownership and lifetimes of pointers and pointees, but the compiler is free to not help you in any way. Learning rust will make you a better programmer. Thus, the recommendation is very good.
Re: Airbus Chooses GNAT Pro Ada for Development of Unmanned Aerial System
#77Earlier quoted context omitted.
As described in another post Ada has features to avoid the problem Rust want's to solve in most cases. You can e.g. allocate varable length arrays on the stack.
Ada also lets you create ad hoc local reference types and disallows references escaping beyond the scope of their type. This is an insanely powerful combination for ensuring references do not leak beyond where they are supposed to.
Re: Airbus Chooses GNAT Pro Ada for Development of Unmanned Aerial System
#78Earlier quoted context omitted.
I get why this is downvoted but it is solid advice: in C you absolutely have to track ownership and lifetimes of pointers and pointees, but the compiler is free to not help you in any way. Learning rust will make you a better programmer. Thus, the recommendation is very good.
Learning any language makes you a better programmer
Re: Airbus Chooses GNAT Pro Ada for Development of Unmanned Aerial System
#79Re: Airbus Chooses GNAT Pro Ada for Development of Unmanned Aerial System
#80Earlier quoted context omitted.
My first IDE was Turbo Basic in 1989. Changing from Type Domain is 0..255; to Domain is 0..65535; Is quite easy.
"Turbo had a great IDE" in no way refutes that Ada suffered from not having an IDE.
https://datamuseum.dk/wiki/Rational/R1000s400
Eventually that experience was moved into UNIX workstations, like everyone else trying to capitalise on their market.
The "I don't need IDE" culture is more related to languages born in UNIX culture.