Live data from Hacker News

Introduction to Ada

learn.adacore.com

161–170 of 193 posts

Re: Introduction to Ada

#161

Nice documentation. Ada looks a lot like Pascal. It is interesting that SPARK is a subset of subset of Ada.

It's Pascal inspired but certainly not any of Wirth's syntaxes, like 1/2 line if's, semi colons in weird places making blocks look odd. Ada has a more inclusive syntax, whereby "is" or "begin" and "end" encases what is inside it. Compare Modula's: MODULE X; ... END MODULE X. and Ada's: package X is ... end X; Ada's package feels like one statement containing others, whereby Modula's looks like it ends on the first li…

That difference may be due to ";" being considered a statement separator in Pascal, and a statement terminator in Ada. https://wiki.haskell.org/Terminator_vs._separator

Re: Introduction to Ada

#162

Earlier quoted context omitted.

I don't get this whole need to shorten keywords to 2 letters when the IDE will just autocomplete them, it's really stupid.

Not everyone wants to write code in an IDE. Quite a lot of people prefer a text editor of some kind.

VSCode / Atom aren't IDE's, they are editors with lots of plugin's, like VIM and Emacs are.

Re: Introduction to Ada

#164
post #91

I spent about 4 years of my early career working with Ada in the aerospace industry (specifically, I worked on the GPS satellite program). It was rather career-limiting because I ended up as a young engineer with a lot of experience in an extremely niche language. It took a while, but I was finally able to escape and start working with more modern technology (involved a lot of self-learning on side projects and final…

It's a brilliant language and due to the fact that it can limit you in the eyes of employers is one reason why I'm dabbling with other languages (including Go) and also a syntax for a new one inspired by Ada.

> also a syntax for a new one inspired by Ada

I suspect that you wouldn't agree about the desirability, but I've long thought that doing a simple substitution on some of the terminals in the Ada grammar to turn it into a curly brace language would do a lot for adoption. For someone to do it the right way would mean a tool capable of also doing the reverse substitution on a curly brace text, which would produce output that could be consumed by "legacy" (non-curly brace-aware) compilers. With the rest of the grammar and semantics all staying the same, this would mean a level of fluidity that would allow existing Ada programmers and the programmers working in the hip new "Attica-B"† dialect to work together on the same projects with no more friction than the way that a lot of people already use gofmt.

† Get it?

Re: Introduction to Ada

#165
post #142

Earlier quoted context omitted.

Ada is/was heavily used in the defense/aerospace industry. Most of these legacy maintenance requests come from defense contractors who do not want to pay top-dollar for expertise. They want to put butts-in-seats to soak up billable time and keep the govt customer just content enough not to cancel their contract. So they'll happily hire anyone with a clearance. If they can't find someone who already knows the language…

Let me tell you a story. 25+ years ago there was a bid in my city about how to renovate the main postal office. Architects all over the city did their bid, as requested by law, including the biggest of them all who had basically the entire local council in his pockets. At the time I was a student, and was working as simple designer (AutoCAD) for an architect teacher who just opened his private architecture firm (6 mo…

See also the War Dogs story:

https://www.rollingstone.com/feature/the-stoner-arms-dealers...

Re: Introduction to Ada

#166
post #38

One thing I liked about Ada is that the authors of the language also wrote why they choose things the way they are, what was rejected, etc... Their is a document about this called "The Ada Rationale" available on the web: http://www.ada-auth.org/standards/rationale12.html I did contribute the HTML version of the Ada 1995 Rationale (first language revision) back in the day: https://www.adaic.org/resources/add_content/…

dwheeler's Steelman bibliography is also useful:

https://dwheeler.com/steelman/

Re: Introduction to Ada

#167
post #26
post #13

Earlier quoted context omitted.

That was an April Fools' joke.

Seriously, the curly braces are a huge improvement. That's no joke. The "fn" and ":" are good too. I'm less sure about "include", because I doubt Ada does textual inclusion. If it does, then that is good too. Otherwise, better choices might be: using, use, require, requires, depend, depends, external, library, unit, module...

The point of using the end statements is to make sure the programmer knows which clause is being closed.

Re: Introduction to Ada

#168
post #115

Earlier quoted context omitted.

Any recent popular languages with similar support for types of Ada? Is such type system being costly to implement the reason not many other languages pick up the feature?

Ada is peculiar because the checks for the ranges are done at runtime. This mean you need a small runtime. A lot of languages are inspired by C and C++ and the types are simple in these languages so it could be an explanation. Haskell has `Numeric.Natural` but I don't think you can define an integer constrained to a range. It probably goes beyond what the type system can do (statically). I think it's possible with De…

Runtime checks are compiler implementation issue rather than language issue itself. With static analysis compiler could eliminate redundant runtime checks.

For example, if SPARK (Ada subset) is used and absense of runtime errors can be proved by GNATprove, then runtime check generation can be disabled in Ada compiler.

Re: Introduction to Ada

#169
post #26

Earlier quoted context omitted.

Seriously, the curly braces are a huge improvement. That's no joke. The "fn" and ":" are good too. I'm less sure about "include", because I doubt Ada does textual inclusion. If it does, then that is good too. Otherwise, better choices might be: using, use, require, requires, depend, depends, external, library, unit, module...

I don't get this whole need to shorten keywords to 2 letters when the IDE will just autocomplete them, it's really stupid.

I can't stand that autocomplete. It gets in the way of actual typing. What if I want nothing in the list? What if I actually want to use the arrow keys immediately after that thing has decided to trigger?

It probably also cuts down on human ability, like never taking the training wheels off. In the long run productivity might be lower.

Re: Introduction to Ada

#170

Earlier quoted context omitted.

I bought the original spec MIL-STD-1815 10-December-1980 back in 1980 or so, but it didn't survive a purge I made when moving. A couple years ago I went looking for it. It's not online anywhere, but I found an old library copy for sale and snapped it up. It's green, and I don't have any of the other specs. I'm sad I also purged my DECSystem-10 "Orange Book". I've never been able to find a replacement anywhere.

Do you remember if the nickname was "Orange Book" or was it "phone book"? I didn't see the former when searching for more information, but the latter was referenced here [0]. If it's actually "phone book", then [1] seems promising. [0] http://www.columbia.edu/cu/computinghistory/pdp10stuff/ [1] http://www.bitsavers.org/pdf/dec/pdp10/TOPS10/1972_PDP-10_Us...

It looks like the "Assembly Language Handbook" in the first reference. It was a very thick book, printed on very thin paper like a phone book. I clearly remember it as "Orange Book", after all, it is orange, but that just might have been Caltech vernacular. (Caltech had many local words unheard off campus.)

A marvelous find, thanks! I'm glad they haven't all vanished. I'd still like a scan pdf!

Post reply on HN