News for hackers. Stuff that matters.
Re:Learning Ada by xnXY on Thursday March 28, 2019 @05:47AM (#19510658)
The title should be "Why Rust is superior to Ada in 5 minutes".

He is not trying to learn Ada.

Re:Learning Ada by steveklabnik on Thursday March 28, 2019 @08:16AM (#19511401)
You can think whatever you’d like, anonymous hacker news account created for this comment. Everyone can read ill will into things.

I am trying to understand Ada better. I draw some comparisons to Rust because that’s one of the reasons why I’m reading about it in the first place: people ask questions comparing the two and I have no idea of the answers.

I spent much more than five minutes here, even though the writing is short; the learning website has a lot of stuff! As I said I’m the intro, this is mostly just a log of thoughts. But it was a good solid half-day of investigation. I’ll be doing more of it in the future, too.

Re:Learning Ada by ainar-g on Thursday March 28, 2019 @08:37AM (#19511549)
Thanks for the write-up. It pretty much mirrors every thought I've had while reading the same tutorial, except that I personally find That_Funny_Ada_Case weirdly appealing.

And, since you're here, you probably have a typo: “GNATT” in the paragraph about threads should be “GNAT”.

Re:Learning Ada by steveklabnik on Thursday March 28, 2019 @08:40AM (#19511566)
Thanks for the thanks, and for the typo spotting! I've fixed it.
Re:Learning Ada by Raphael_Amiard on Thursday March 28, 2019 @06:32AM (#19510871)
I'm one of the writers of learn.adacore.com and I disagree. This is a thought log from somebody who knows and loves Rust and is learning a new language.

Steve if you're around: there is an error I think in your post, you write

> Ranged integers are something people always say Rust is better at than Ada

And I think you meant the opposite ;)

Re:Learning Ada by steveklabnik on Thursday March 28, 2019 @08:09AM (#19511358)
I did! Thanks. I’ll fix that.
Re:Learning Ada by jonathanstrange on Thursday March 28, 2019 @06:01AM (#19510727)
If he really wanted to, he could take a look at the Consolidated Ada 2012 Language Reference Manual [1] and get his mind blown.

Don't get me wrong - I'm not claiming the reference manual is a good learning source, for that I would recommend Barnes's book, but that it's an example of a language specification. Having precise specs is a minimum requirement for a safe language. Rust is too complicated as a C replacement but arguably a good C++ replacement. Unfortunately, it's not well-defined (yet) for writing safe programs. Without spec you cannot even tell compiler bugs from intended behaviour.

[1] http://www.ada-auth.org/standards/ada12_w_tc1.html

Re:Learning Ada by steveklabnik on Thursday March 28, 2019 @08:27AM (#19511483)
I am planning on looking into more reference material eventually, but I prefer to do that after reading tutorials and writing code, as a way to answer the questions that I have.

And yes, the lack of a spec is a weakness in Rust. We've been working on it for a while, and are gonna push it even harder this year.

> Without spec you cannot even tell compiler bugs from intended behaviour.

So this is true, but it's also a bit more subtle than that. For example, "there should be no undefined behavior in safe Rust" is a design principle that, while we don't have a spec, can say if something is a bug or not. (And we do have a few of those bugs.) This is, of course, not as good as a full spec, but guiding principles can really help.

Re:Learning Ada by GenKali on Thursday March 28, 2019 @06:17AM (#19510801)
I've read through this article twice now and I still fail to see your point.

Steve is most likely more familiar with Rust than any other language - which is why I would expect comparisons between it and Ada - but he doesn't go out of his way to insist on Rust's superiority.

Re:Learning Ada by OpenBSD-supreme on Thursday March 28, 2019 @09:26AM (#19511929)
The rust shilling is obvious in this one.