News for hackers. Stuff that matters.
Re:Rust in Linux kernel is just a beginning by pjmlp on Tuesday October 25, 2022 @07:06AM (#33328906)
> I never talked with anyone who doesn't casts stones to C & C++ and badmouths it while saying that Rust is the one, and only, and the last savior we need.

So here is one, Ada was already that saviour in 1983, and in every use case where using a GC is an option, there are already plenty of options besides Rust.

Also until Rust compilers get fully botstraped, knowing C++ is a requirement to contribute to the compiler's backend.

Re:Rust in Linux kernel is just a beginning by howinteresting on Tuesday October 25, 2022 @12:00PM (#33332400)
Has Ada ever been the most loved language on the Stack Overflow developer survey for seven years in a row?

There are plenty of options besides Rust, but none that have & and &mut which eliminates many classes of bugs in both multithreaded and single-threaded code.

Re:Rust in Linux kernel is just a beginning by pjmlp on Tuesday October 25, 2022 @12:38PM (#33332940)
Stack Overflow did not exist during the first decade of Ada's existence, nor there was a free beer compiler for it.
Re:Rust in Linux kernel is just a beginning by c-cube on Tuesday October 25, 2022 @07:52PM (#33337809)
Ada is cool, but as far as I understand it doesn't give you memory safety in the presence of dynamic allocations? Unless you use recent improvements to spark? It's hardly a superset of the safety features rust has.
Re:Rust in Linux kernel is just a beginning by pjmlp on Wednesday October 26, 2022 @03:59AM (#33341007)
It surely does, RAII exists since Ada 95.

https://www.adaic.org/resources/add_content/docs/95style/htm...

You are not supposed to call Ada.Unchecked_Deallocation() directly, rather from Ada's version of "Drop".

Then SPARK allows for formal proofs that one actually does the right thing, integrated into the language as of Ada 2012.

The cherry on top of the cake is that the language is also getting affine types on top of the already battle tested features in 40 years of production deployment into high integrity systems.

Re:Rust in Linux kernel is just a beginning by c-cube on Friday November 04, 2022 @04:42PM (#33473454)
Who said anything about RAII? Having RAII doesn't make C++ memory safe. If you can take a reference or pointer to some RAII-created vector, and access it after the vector is gone… then you're not memory safe?

Yes, SPARK exists, and is very cool. I think there's work on a similar system for rust (or ferrocene, anyway, which is being co-developed by AdaCore: https://blog.adacore.com/adacore-and-ferrous-systems-joining...). It also seems that SPARK now has memory ownership and aliasing support, but only since ~2019 (https://blog.adacore.com/using-pointers-in-spark), and with clear inspiration from rust. It seems to me that this addition to SPARK was felt necessary by the AdaCore people, meaning that rust had something Ada did not support (or did not support well).