comp.lang.ada
 help / color / mirror / Atom feed
From: "amo...@unizar.es" <amosteo@unizar.es>
Subject: Re: Adacore joins with Ferrous Systems to support Rust
Date: Fri, 11 Feb 2022 09:40:14 -0800 (PST)	[thread overview]
Message-ID: <70f72b7e-1f3f-4942-b6aa-1044430bdcd9n@googlegroups.com> (raw)
In-Reply-To: <87d2e0c1-c851-43e2-a085-fad30e475e35n@googlegroups.com>

On Wednesday, February 2, 2022 at 4:29:13 PM UTC+1, amado...@gmail.com wrote:
> If possible please tell what Rust has to offer over Ada. 

In my minimally informed opinion after going through parts of the official tutorial a couple of times, what Rust has to offer in general:

+ Memory safety (no leaks, double-free, race conditions*) by default.
- Terrible illegible syntax
+ Safer/more expressive/more modern constructs than C
+ Modern tooling shared by all the community

[*] I guess in a protected-object sense, not in a high-level logic sense. But I don't really know.

The thing is that C is so basic and C++ so prone to shooting yourself in the foot, that Rust hits a middle ground that feels like the best thing since sliced bread to C/C++ programmers wishing for something better. Add to that the true novel contribution to a mainstream language that is memory safety (this is really a new way of thinking when you get into Rust), that if you don't know better (e.g., Ada) it really is overwhelmingly compelling. I'm not surprised at the cult-like following (I mean, we feel like that sometimes in the Ada world, right?) In a sense, Rust is the Ada of a younger generation, and without the baggage.

Of course you sometimes have to use "unsafe" programming evading the borrow checker, just like pointers are sometimes a necessity in Ada; and the legibility becomes truly awful IMHO really fast (to me, this is THE Achilles heel nobody seems to care too much about), but as I said, it has a couple of real selling points over the competition. Of course, if legibility is not your concern because you're used to C++ templating nightmares, you don't feel that particular pain. It's always the same story with Ada; most people don't know better to realize what they're missing.

The whole memory safety thing with the borrow checker goes beyond a gimmick, and it has a solid quality which goes beyond "in Ada you don't need pointers most of the time". It's a compile-time check, and it makes evident that runtime checks are a poor substitute. I'm more ashamed now of the whole anonymous pointers and accessibility surprises in Ada. Yes, SPARK added something similar for pointers, but in Rust it is for all variables. The equivalence in Ada would be not being able to use the same variable in two consecutive calls as an in-out parameter. So it's not the same, besides being only in SPARK.

Not having done anything of real import, I'm not sure how inevitable it is to go unsafe in Rust. My guess is that it will be hidden in libraries just like the Ada standard containers contain some scary pointer use (and I mean that I wouldn't like to have to understand what is going there with the tampering checks etc.) At that point, obviously, you've lost the most solid selling point IMHO. Ada is safer not in a single sense, but as a whole design.

All in all, Rust has one big thing that Ada hasn't, which is the borrow checker.

And that is what how I would summarize it: Rust is better in a single narrow sense, but Ada is better as a general language. Which is, not surprisingly, the consequence of the design motivations for each, which were precisely to have a memory-safe language and a high-integrity-oriented language. So the funny thing is that both have succeeded at their objective.

I really miss not having the time to become proficient in Rust at least to be able to properly compare. I think the memory safety is great to have (and if Ada were designed today, I guess it should play the same integral part, if practical), but Rust is demanding on the programmer in a way that C/C++ aren't, and the maintainability seems suspect, so I don't know how far it will carry Rust into the future. I guess it could absorb a big part of both new C and C++ development.

Boy, can I write a lot sometimes...

  parent reply	other threads:[~2022-02-11 17:40 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-02  8:57 Adacore joins with Ferrous Systems to support Rust Paul Rubin
2022-02-02 13:04 ` Luke A. Guest
2022-02-02 15:29   ` Marius Amado-Alves
2022-02-02 16:36     ` Luke A. Guest
2022-02-04 17:51       ` Stephen Leake
2022-04-18 16:01       ` Rene
2022-02-02 20:07     ` G.B.
2022-02-03 23:29     ` John McCabe
2022-02-11 17:40     ` amo...@unizar.es [this message]
2022-02-11 19:24       ` Luke A. Guest
2022-02-12 17:34         ` Alejandro R. Mosteo
2022-02-12  5:22       ` John Perry
2022-02-12 10:08         ` Marius Amado-Alves
2022-02-12 18:24         ` Alejandro R. Mosteo
2022-02-13  8:10           ` J-P. Rosen
2022-02-14 23:25           ` Randy Brukardt
2022-02-15  4:29             ` Paul Rubin
2022-02-12 23:59         ` John Perry
2022-02-18 13:24     ` Kevin Chadwick
2022-02-02 20:06   ` Paul Rubin
2022-02-03  1:34     ` Luke A. Guest
2022-02-03  2:20       ` Paul Rubin
2022-02-03  2:52         ` Luke A. Guest
2022-02-03  4:22           ` Paul Rubin
2022-02-03  9:54             ` Björn Lundin
2022-02-04  3:38             ` Randy Brukardt
2022-02-04  5:19               ` Paul Rubin
2022-02-03 11:30           ` Simon Wright
2022-02-03 12:51             ` Luke A. Guest
2022-02-04  3:20               ` Randy Brukardt
2022-02-04 10:28                 ` Luke A. Guest
2022-02-04 17:51                   ` Andreas ZEURCHER
2022-02-05  4:31                   ` Randy Brukardt
2022-02-02 16:19 ` Stephen Leake
2022-02-02 18:48 ` Gautier write-only address
2022-02-02 20:03   ` Paul Rubin
2022-02-02 20:45     ` Dennis Lee Bieber
2022-02-12  4:42 ` 25.BZ943
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox