Live data from Hacker News

Giving Ada a Chance

ajxs.me

131–140 of 261 posts

Re: Giving Ada a Chance

#131
post #40

I love Ada, unfortunately it’s real world use seems to be relegated to old legacy code. I’d like to use it a little more on the side, but I also need to keep my priorities focused on realism, which sadly means ignoring Ada and learning something like C++ which seems unapproachable from any angle. Ada also seems to have a weirdly negative rep in many circles it seems. I recall looking around for an Ada compiler for a…

Lack of a free compiler with permit to use commercially (gnu linker exception), was a problem during a significant phase of the language.

GNAT debuted in 1995, 25 years ago. Some 12 years after the 1983 standard.

Re: Giving Ada a Chance

#132

Earlier quoted context omitted.

Right. I know it works with numeric indexes in Pascal. My point was that (using my previous example) in Ada it works with any discrete type, in that case characters (which are not numbers in disguise in Ada) so I can do this: Histogram : Character_Histogram; ... Histogram['A'] := Histogram['A'] + 1; (Ok, a bit more work because I didn't initialize the histogram to 0.)

Square brackets are coming, so you'd have to use ('A')

Hah, I've been in Go lately so my brain defaulted to the wrong thing in that example.

Re: Giving Ada a Chance

#134

Earlier quoted context omitted.

Well, "range" was not the correct term. What I meant is that you can't treat the source as sparse. You can't skip portions of it. So you can't make an array that only covers every other element of this enumeration: type Colors is (Red, Green, Blue, Black, Gray, White); It has to be a consecutive group of them, taken in order, as the specification of even this enumeration has an ordering to it as far as Ada is concern…

Ada 2012 allows you to define gaps, this is my best example I have available https://github.com/Lucretia/sdlada/blob/master/src/sdl-video...

That is great to read, and probably a sign that my learning materials should be updated. I'll try to remember this in the future.

Re: Giving Ada a Chance

#135
post #39

> I can’t help but think that complicated programming paradigms would seem more intuitive to beginners if taught through Ada instead of C and its derivative languages, as is common in computer science and engineering faculties worldwide. At my university, the first courses you took in CS used Ada. I think it was a really good choice but I was in the minority I guess because after my year they switched to either using…

A lot of Universities and company's were bribed by Sun to start using Java.

Do you have any evidence for this? As an early university adopter, I sure would have liked to know how to get in on that sweet Java bribe money.

Re: Giving Ada a Chance

#136
post #119

I like the "clean feel" of Ada's syntax: it combines the elegance of Python with a bit more structure and does not suffer from Python's significant whitespace issues. The so-called "Ada comb" structure that is used for packages, subprograms, and even declare blocks makes it easy to find what you are looking for because it makes the source code more regular. The "Ada comb" is formed by the shape of the source code wit…

> The so-called "Ada comb" structure that is used for packages, subprograms, and even declare blocks makes it easy to find what you are looking for because it makes the source code more regular. "Declare" blocks are a PITA. I don't mean the declaration part in the subprogram example you quoted (that's fine), but having to use explicit "declare" blocks to create new variables in the scope of a loop or a conditional. Y…

HN formatting tip: Put two extra spaces in front of each of those code blocks and remove all those unnecessary blank lines and you're comment will be tolerably formatted. As it is, it's a PITA to read because it spans several screens without any good cause.

Re: Giving Ada a Chance

#137
post #123

Earlier quoted context omitted.

Pascal (well Delphi/FreePascal incarnation) also works with chars and enums. This modern pascal is very feature rich and has plenty of fancy bells and whistles.

Wirth's original, standard Pascal allowed for int/char/bool/enum, and ranges thereof, as array bounds; it wasn't a Delphi enhancement.

I am sure it was. I am just not familiar with it hence specified the one I know.

Re: Giving Ada a Chance

#138
post #39

> I can’t help but think that complicated programming paradigms would seem more intuitive to beginners if taught through Ada instead of C and its derivative languages, as is common in computer science and engineering faculties worldwide. At my university, the first courses you took in CS used Ada. I think it was a really good choice but I was in the minority I guess because after my year they switched to either using…

Ada was also taught at my Comp Sci program back in 1987

Re: Giving Ada a Chance

#139
post #39

> I can’t help but think that complicated programming paradigms would seem more intuitive to beginners if taught through Ada instead of C and its derivative languages, as is common in computer science and engineering faculties worldwide. At my university, the first courses you took in CS used Ada. I think it was a really good choice but I was in the minority I guess because after my year they switched to either using…

what school did you go to? My university (Radford) did teach Ada as well the first year, way back in 1999, and switched to Java after it.

I liked Ada a lot, but Java gave me employment after school.

Re: Giving Ada a Chance

#140

> The writing is on the wall: Ada is here to stay. OK, this has no relation to the actual content of the article, but I have to point out that that is not what the phrase "the writing is on the wall" means.

Author here. Thank you for pointing this out! I actually did not know that this phrase had such a specific meaning. I had incorrectly inferred from other usage that the phrase meant that the fact in question was supported by evidence to a degree that warranted no further debate. I feel a little embarrassed for the misuse. However I'm all the better off for having been educated on its proper use! Thank you.
Post reply on HN