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=1.8 required=3.0 tests=BAYES_50,PDS_FROM_2_EMAILS autolearn=no autolearn_force=no version=3.4.6 X-Received: by 2002:ad4:4ee9:: with SMTP id dv9mr1852222qvb.41.1644601214838; Fri, 11 Feb 2022 09:40:14 -0800 (PST) X-Received: by 2002:a25:ae8c:: with SMTP id b12mr2464966ybj.305.1644601214447; Fri, 11 Feb 2022 09:40:14 -0800 (PST) Path: eternal-september.org!reader02.eternal-september.org!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 11 Feb 2022 09:40:14 -0800 (PST) In-Reply-To: <87d2e0c1-c851-43e2-a085-fad30e475e35n@googlegroups.com> Injection-Info: google-groups.googlegroups.com; posting-host=155.210.248.194; posting-account=SuyozQoAAADXnDELfODTBs7QDv_fdf87 NNTP-Posting-Host: 155.210.248.194 References: <87o83pzlvm.fsf@nightsong.com> <87d2e0c1-c851-43e2-a085-fad30e475e35n@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <70f72b7e-1f3f-4942-b6aa-1044430bdcd9n@googlegroups.com> Subject: Re: Adacore joins with Ferrous Systems to support Rust From: "amo...@unizar.es" Injection-Date: Fri, 11 Feb 2022 17:40:14 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader02.eternal-september.org comp.lang.ada:63488 List-Id: On Wednesday, February 2, 2022 at 4:29:13 PM UTC+1, amado...@gmail.com wrot= e: > If possible please tell what Rust has to offer over Ada.=20 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. B= ut I don't really know. The thing is that C is so basic and C++ so prone to shooting yourself in th= e 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 tha= t the true novel contribution to a mainstream language that is memory safet= y (this is really a new way of thinking when you get into Rust), that if yo= u 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 someti= mes in the Ada world, right?) In a sense, Rust is the Ada of a younger gene= ration, 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 legi= bility becomes truly awful IMHO really fast (to me, this is THE Achilles he= el 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 y= our concern because you're used to C++ templating nightmares, you don't fee= l that particular pain. It's always the same story with Ada; most people do= n'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 point= ers 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 an= onymous pointers and accessibility surprises in Ada. Yes, SPARK added somet= hing similar for pointers, but in Rust it is for all variables. The equival= ence in Ada would be not being able to use the same variable in two consecu= tive 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 ta= mpering checks etc.) At that point, obviously, you've lost the most solid s= elling point IMHO. Ada is safer not in a single sense, but as a whole desig= n. All in all, Rust has one big thing that Ada hasn't, which is the borrow che= cker. And that is what how I would summarize it: Rust is better in a single narro= w sense, but Ada is better as a general language. Which is, not surprisingl= y, 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 (an= d 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 bot= h new C and C++ development. Boy, can I write a lot sometimes...