From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-0.0 required=3.0 tests=BAYES_20 autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!reader02.eternal-september.org!aioe.org!Lx7EM+81f32E0bqku+QpCA.user.46.165.242.75.POSTED!not-for-mail From: "Luke A. Guest" Newsgroups: comp.lang.ada Subject: Re: Adacore joins with Ferrous Systems to support Rust Date: Fri, 11 Feb 2022 19:24:02 +0000 Organization: Aioe.org NNTP Server Message-ID: References: <87o83pzlvm.fsf@nightsong.com> <87d2e0c1-c851-43e2-a085-fad30e475e35n@googlegroups.com> <70f72b7e-1f3f-4942-b6aa-1044430bdcd9n@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: gioia.aioe.org; logging-data="45325"; posting-host="Lx7EM+81f32E0bqku+QpCA.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org"; User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.1 Content-Language: en-GB X-Notice: Filtered by postfilter v. 0.9.2 Xref: reader02.eternal-september.org comp.lang.ada:63490 List-Id: On 11/02/2022 17:40, amo...@unizar.es wrote: > 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 I'd say C++ is like a "backgun" (search images). > 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. Exactly, people want something better, but for some reason CAN NOT accept anything that doesn't look like C/C++. > 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. And refuse to look for better, just accepting to continue using the same old, same old. > 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. So, you'd prefer, if Ada was designed now, it didn't do runtime checks (on pointers) and have compile-time checks? > I'm more ashamed now of the whole anonymous pointers and accessibility surprises in Ada. I'm not sure what you mean here. > 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. They added memory tracking at gnatprove time, much like the borrow checker afaik, which is an additional step. > 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. As soon as you hit the outside world, i.e. interfacing to other, lesser, languages or doing anything where memory has to be allocated, you need unsafe features. > All in all, Rust has one big thing that Ada hasn't, which is the borrow checker. I've not learnt any rust yet and that is my conclusion from what I've read. I need to do some tutorials at some point, but I also need eye bleach. > 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. I think the best way to really know a language better is to pick a single project and implement it in that language, something which is generally not trivial, but not too time consuming. I do want to experiment when I get back to my compiler project. > Boy, can I write a lot sometimes... That's not a lot, I didn't refuse to read it.