News for hackers. Stuff that matters.
Re:Why Ada Is the Language You Want to Be Programming Your S... by phkahler on Tuesday September 10, 2019 @09:09PM (#20935618)
>> he actual 'bug' was caused by an integer overflow occurring due to the velocity variable not being wide enough to handle the higher horizontal velocities of the newer rocket.

Something all that fancy type system should have prevented. I found it interesting in the Hackaday piece that the C code xample called out the size of an integer while the Ada version did not. The Ada version caught an implicit conversion, but apparently does nothing for overflow.

Every language has it's good points and bad. I still want to learn more Rust. In fact I recall reading recently that some Ada developers want to adopt something akin to Rust's borrow checker. All I know is that C++ is not safe. How well does Ada work with C libraries? Rust is pretty OK at it.

Re:Why Ada Is the Language You Want to Be Programming Your S... by thesuperbigfrog on Tuesday September 10, 2019 @10:26PM (#20936005)
Ada / C interop is very easy to do.

https://learn.adacore.com/courses/intro-to-ada/chapters/inte... shows how Ada's Interfaces.C package and the Import and Export aspects are used to share data and make function calls between Ada and C.

Re:Why Ada Is the Language You Want to Be Programming Your S... by ajxs on Tuesday September 10, 2019 @11:21PM (#20936303)
Ada is miles ahead of Rust when it comes to C interoperability. I posted this before in one of the other Rust threads, but you can't get more than two paragraphs through the official Rust FFI documentation ( https://doc.rust-lang.org/nomicon/ffi.html ) before being asked to install a third-party dependency. The 'Interfaces.C' package is defined in the Ada language specification. And, as others have mentioned, Ada's language defined pragma directives, or Ada2012's aspects provide a way to implement FFI.
Re:Why Ada Is the Language You Want to Be Programming Your S... by roca on Wednesday September 11, 2019 @01:40AM (#20936896)
There's nothing wrong with pulling in the `libc` dependency. It literally means adding two lines of code and then `cargo` manages everything for you. It isn't really third-party; the owner is "rust-lang:libs".

I understand that people are conditioned to think APIs are easier to consume when they're in the standard library, because that's true in many languages, especially those that lack a modern package management system (e.g. Ada). But it's not true in Rust and there are advantages to having libraries like `libc` outside the standard library. For example `libc` is updated more frequently than the Rust standard library (multiple times per month vs every six weeks).

Re:Why Ada Is the Language You Want to Be Programming Your S... by kragen on Wednesday September 11, 2019 @01:51AM (#20936952)
Having libc updated multiple times per month sounds like a fucking nightmare to me. What am I missing about this situation?
Re:Why Ada Is the Language You Want to Be Programming Your S... by ajxs on Wednesday September 11, 2019 @02:46AM (#20937226)
I actually laughed at this comment. I was wondering the same thing. Although this is a cheap shot, how could I resist mentioning that Ada's FFI functionality is updated every 20 years on average and is still ahead of the curve.
Re:Why Ada Is the Language You Want to Be Programming Your S... by OneWingedShark on Monday September 16, 2019 @10:59AM (#20984723)
> There's nothing wrong with pulling in the `libc` dependency.

Yes, there is. Not only is dependency transitive: you now depend on everything libc depends on — but now you're depending on the correctness AND properties of the dependency, to include security.