Live data from Hacker News

Ada is not just another programming language (1986)

sci-hub.se

31–40 of 68 posts

Re: Ada is not just another programming language (1986)

#31
post #4

I like how in ada you can specify custom range integers

Pascal had subrange types before Ada, not only for integers but characters too. var day : 1 .. 31; letter : 'A' .. 'Z'; And you could specify ranges on array subscripts as well: var weight : array[-5 .. 5] of integer;

Yes, but Ada extended the number of usable types for ranges, e.g. including fixed-point numbers.

All those that existed in Pascal also exist in Ada.

Re: Ada is not just another programming language (1986)

#32
post #3

Ada is a language that has been on my "todo list" of languages for awhile (just after FORTH). I generally hate this term, but Ada does kind of look like a language that was "ahead of its time", specifically in regards to concurrency.

While studying how concurrency is done in Ada is certainly instructive and even today many languages and multi-threading libraries have more poor support for concurrent programming than Ada had since the beginning, a language that was really ahead of its time regarding concurrency was IBM PL/I. 15 years before Ada, in 1964, IBM PL/I had facilities for multitasking that e.g. included a wait function that could do ever…

Any kernel based wmo is bot going to work well for fastpathed primitives. For example on windows you can't wmo for critical sections or keyed events.

But you can implement an pure userspace or hibrid user/kernel wmo even on top of something like unix poll just fine, so saying that the standard lacks it because of POSIX is wrong.

Re: Ada is not just another programming language (1986)

#33

Earlier quoted context omitted.

How verbose is it compared to others like Go or Rust ?

Somewhat more verbose. A great part of the verbosity is due to the fact that unlike CPL/BCPL/B/C and the languages inspired by them, which have replaced the Algol statement parentheses begin and end with "{" and "}" or similar symbols, Ada uses relatively long words as statement parentheses, e.g. loop and end loop . On the other hand, a good feature of Ada is that it followed Algol 68 in having different kinds of sta…

With good tooling, it might be possible to have autocomplete once you write the b of begin or the l of loop, which would reduce the typing verbosity.

Re: Ada is not just another programming language (1986)

#34

Earlier quoted context omitted.

While studying how concurrency is done in Ada is certainly instructive and even today many languages and multi-threading libraries have more poor support for concurrent programming than Ada had since the beginning, a language that was really ahead of its time regarding concurrency was IBM PL/I. 15 years before Ada, in 1964, IBM PL/I had facilities for multitasking that e.g. included a wait function that could do ever…

Any kernel based wmo is bot going to work well for fastpathed primitives. For example on windows you can't wmo for critical sections or keyed events. But you can implement an pure userspace or hibrid user/kernel wmo even on top of something like unix poll just fine, so saying that the standard lacks it because of POSIX is wrong.

The UNIX wait system call, introduced in 1970 or 1971, after porting UNIX to PDP-11, provided a subset of the features of PL/I wait, e.g. it allowed waiting until any of the children of a process terminates.

So UNIX had very early some kinds of waiting for multiple events. A decade later, various other waiting functions, e.g. select and poll were introduced, for networking.

I did not say anything about UNIX processes, but about the standard POSIX threads, the normal way to use multiple threads in a single process under UNIX-compatible operating systems. For example, with pthreads, you can join only a single thread. You can join all threads in an inefficient way, joining them one-by-one, but there is no way to join the first thread that happens to terminate, which is actually the most frequent thing that you want to do.

You can achieve this in a convoluted and inefficient way, using various forms of communication between threads, but this is a very basic feature that should have existed in the standard.

Taking into account that various methods of waiting for multiple events had existed for decades in UNIX, it is even more baffling that this was omitted in the POSIX threads standard. Like I have said, this has also constrained the later standards, e.g. the C++ standard.

Re: Ada is not just another programming language (1986)

#35

Earlier quoted context omitted.

How verbose is it compared to others like Go or Rust ?

Somewhat more verbose. A great part of the verbosity is due to the fact that unlike CPL/BCPL/B/C and the languages inspired by them, which have replaced the Algol statement parentheses begin and end with "{" and "}" or similar symbols, Ada uses relatively long words as statement parentheses, e.g. loop and end loop . On the other hand, a good feature of Ada is that it followed Algol 68 in having different kinds of sta…

Moreover, besides the long statement parentheses, the other main source of verbosity in Ada is that Ada does not use abbreviations.

Most programming languages use a set of abbreviations that have appeared in either PL/I or Algol 68, but Ada does not use them, for example Ada uses constant, procedure, character, integer instead of const, proc, char, int.

Re: Ada is not just another programming language (1986)

#36
post #33

Earlier quoted context omitted.

Somewhat more verbose. A great part of the verbosity is due to the fact that unlike CPL/BCPL/B/C and the languages inspired by them, which have replaced the Algol statement parentheses begin and end with "{" and "}" or similar symbols, Ada uses relatively long words as statement parentheses, e.g. loop and end loop . On the other hand, a good feature of Ada is that it followed Algol 68 in having different kinds of sta…

With good tooling, it might be possible to have autocomplete once you write the b of begin or the l of loop, which would reduce the typing verbosity.

Like autocompletion, also syntax coloring becomes more important with verbose programming languages, to help distinguish the relevant text between the large areas occupied by keywords.

Re: Ada is not just another programming language (1986)

#37
post #33

Earlier quoted context omitted.

With good tooling, it might be possible to have autocomplete once you write the b of begin or the l of loop, which would reduce the typing verbosity.

Like autocompletion, also syntax coloring becomes more important with verbose programming languages, to help distinguish the relevant text between the large areas occupied by keywords.

That's a good point too.

Re: Ada is not just another programming language (1986)

#39

Earlier quoted context omitted.

Pascal had subrange types before Ada, not only for integers but characters too. var day : 1 .. 31; letter : 'A' .. 'Z'; And you could specify ranges on array subscripts as well: var weight : array[-5 .. 5] of integer;

Wirth removed this again in Oberon, because experience with Pascal and Modula showed that it is not worth it.

Not sure that is the actual reason. (Also define worth it)

Wirth had developed that original, but misguided (IMO) notion that the faster a compiler can compile itself the better it is.

Consequently he has removed a lot from latest iterations of its languages/compilers

Pascal had an enum-like feature we could define an enumerated type.

Wirth removed it because... `CONST` should be enough for everyone.

Obviously it has simplified the compiler and increased the self-compilation speed. But I would not call that an improvement.

Re: Ada is not just another programming language (1986)

#40

Ada is just another programming language.

True, but nevertheless Ada is an important language in the history of programming languages. After 1970, there were less and less innovations in programming languages, in the sense of features that have not existed in any earlier languages. Many new languages have been introduced since then and some of them might be better than most previous languages, but usually the new languages offer only new combinations of feat…

>> The defect that is most universally accepted is that it is too verbose.

Another huge barrier (especially to early adoption) was the cost of Ada toolchains.

Even today, there are proprietary Ada implementations that cost thousands of dollars per seat.

Post reply on HN