From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Received: by 2002:a6b:a8e6:: with SMTP id e99-v6mr976981ioj.105.1524058169467; Wed, 18 Apr 2018 06:29:29 -0700 (PDT) X-Received: by 2002:a9d:554a:: with SMTP id h10-v6mr136703oti.5.1524058169309; Wed, 18 Apr 2018 06:29:29 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!news.uzoreto.com!weretis.net!feeder6.news.weretis.net!feeder.usenetexpress.com!feeder-in1.iad1.usenetexpress.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!f63-v6no267713itc.0!news-out.google.com!u64-v6ni6807itb.0!nntp.google.com!k65-v6no3642036ita.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 18 Apr 2018 06:29:29 -0700 (PDT) In-Reply-To: <878t9nemrl.fsf@nightsong.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=96.247.198.106; posting-account=QF6XPQoAAABce2NyPxxDAaKdAkN6RgAf NNTP-Posting-Host: 96.247.198.106 References: <1c73f159-eae4-4ae7-a348-03964b007197@googlegroups.com> <878t9nemrl.fsf@nightsong.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: =?UTF-8?B?UmU6IEhvdyB0byBnZXQgQWRhIHRvIOKAnGNyb3NzIHRoZSBjaGFzbeKAnT8=?= From: Jere Injection-Date: Wed, 18 Apr 2018 13:29:29 +0000 Content-Type: text/plain; charset="UTF-8" X-Received-Bytes: 5889 X-Received-Body-CRC: 436983699 Xref: reader02.eternal-september.org comp.lang.ada:51587 Date: 2018-04-18T06:29:29-07:00 List-Id: On Monday, April 16, 2018 at 1:36:03 AM UTC-4, Paul Rubin wrote: > I'd like to know why Rust was invented: there was obviously a need for a > safer alternative to C++, but was Ada the answer that everyone simply > overlooked? I to have been messing with Rust lately and it is a fun language. I would wager a guess that it simply targets a different demographic than Ada currently does (not say that Ada doesn't want to target that demographic though). From my work in it over the last year, I would say that some of the big reasons people like Rust (at least in embedded): 1. It favors static allocation over dynamic whenever possible. This is huge for small embedded systems. 2. It is currently implemented on LLVM which is a huge pool of untapped user base for Ada (I don't think there are any current Ada implementations on LLVM with the most recent being somewhere around GNAT 4.7 or 4.8? Or do any other compiler vendors target LLVM at all?). 3. The default state of Rust in a couple of areas appears to be more safe. In some places where Ada defines something to be erroneous (such as two tasks modifying the same data without synchronization), Rust forces it to be a compiler error by default. A note on this: This is a very specific comment to only a couple of areas. In my opinion, Ada is generally a more safe language overall. 4. It is not hindered by backwards compatibility concerns. They take into consideration backwards compatibility, but the language is not beyond totally removing a feature or library in favor of another (in fact, it has done so many times). I know that will make some here squirm, but the reality of it is if someone is willing to change languages completely, there are many in that camp who are less worried about backwards compatibility. To be fair though, Rust is a really young language, so it can also get away with it more easily. 5. Many like the inheritance model that it uses. I find it very interesting. I won't say it is superior to Ada's (I don't believe that). In fact, I would be willing to guess of at least one person here who would not like it at all. It's sort of a hybrid composition model. I don't know if it is unique (I am sure other languages have something similar), but that is definitely an area many of its users really like. 6. The license situation is much nicer out of the gate. There are two available licenses to choose from (Apache and MIT). I do wish there was a GPL option as well (for those who like it), but the user base it targets is just different. 7. The language restrictions it sets makes a lot of typically "runtime" errors into compiler errors. The tradeoff here is the compiler is very much more picky than even an Ada compiler. It is much more difficult to get a complex program to compile in Rust than it is in Ada (which is slightly ironic given the learning curve comment alluded to in another message earlier). They say that the borrow checker is a cruel mistress, and they do not lie. 8. Making pointers completely "unsafe" and by default using references which cannot be null and cannot be deallocated manually. This leads to much safer code with compile time enforcement. I don't think any of these make Rust any better, but based on comments I have seen on stackoverflow and reddit, they are some of the things users of the language commented on in different contexts. > > I think answering your question would require an informed and critical > comparison between Rust and Ada. Something with real depth rather than > "verbose vs curly braces". I do know Rust has formal-methods work going > on. > I'm not sure the languages are similar enough to do a fair comparison. They both approach things very differently. Ada targets software development much more (Readability, problem domain describing types, etc.). Rust doesn't (at least yet) seem to target that area. Also Rust is still very infant and is changing a lot. Rust from a couple of years ago has many differences than rust today. I will say that Ada currently has a superior generics capability. Rust is very weak in that area. Rust currently has a much larger user footprint in its language development, so it will make changes in a much different fashion than Ada might (for better or for worse). I feel like the learning curve on Rust is much more difficult than that of Ada's (which is in contrast to a comment made earlier I believe). All in all, I feel like Ada is currently a generally safer language to program in. I've been writing code in both and still prefer Ada, but I do see some promising features out of Rust.