I always liked Ada, from my first reading around 1980 of MIL-STD-1815. Many of D's features were inspired by Ada.
Shame you didn't write an Ada compiler, the docs were available. It would've been interesting to see what you would've come up with. It'd still be interesting I think. A lot of the older closed compiler are still based around the program library idea which is no longer required, considering GNAT is file / project based. I've only used GNAT and have no idea how the program library versions work.
Introduction to Ada
51–60 of 193 posts
Re: Introduction to Ada
#52Earlier quoted context omitted.
Shame you didn't write an Ada compiler, the docs were available. It would've been interesting to see what you would've come up with. It'd still be interesting I think. A lot of the older closed compiler are still based around the program library idea which is no longer required, considering GNAT is file / project based. I've only used GNAT and have no idea how the program library versions work.
I still have a copy of the original Ada MIL spec.
Re: Introduction to Ada
#53Earlier quoted context omitted.
Shame you didn't write an Ada compiler, the docs were available. It would've been interesting to see what you would've come up with. It'd still be interesting I think. A lot of the older closed compiler are still based around the program library idea which is no longer required, considering GNAT is file / project based. I've only used GNAT and have no idea how the program library versions work.
I still have a copy of the original Ada MIL spec.
Re: Introduction to Ada
#54Earlier quoted context omitted.
If you have the time, I'd love to hear a bit about why you ended up creating D, rather than writing an Ada compiler? (Seeing how you wrote a c++ compiler...).
At the time, I had only written a couple toys. I thought writing an Ada compiler was impossible. It's also impossible to write a C++ compiler, but I didn't realize that and did it anyway (several years later, after I'd written a C compiler). I thought that C++ was just adding member functions and a few keywords to C.
Re: Introduction to Ada
#55The GNAT Ada compiler is open source, generates good code, and has really good error messages. There's a story behind its development, which I tried to summarize here: https://dwheeler.com/essays/make-it-simple-dewar.html
I didn't quite understand why someone who wrote a c++ compiler would think Ada was insurmountable - this adds some context.
In my nativité I'd have guessed that writing an Ada compiler was on par with Pascal (but with more types and stuff). This is probably the same (wrong) reasoning by which Mr Bright tricked himself into writing a c++ compiler ;)
Ed: note, I was introduced to Object Pascal - not plain Pascal - so that's the comparison I'm alluding to.
Re: Introduction to Ada
#56The GNAT Ada compiler is open source, generates good code, and has really good error messages. There's a story behind its development, which I tried to summarize here: https://dwheeler.com/essays/make-it-simple-dewar.html
Thank you for posting that. Especially interesting in light of Walter Bright's comment(s) in this thread. I didn't quite understand why someone who wrote a c++ compiler would think Ada was insurmountable - this adds some context. In my nativité I'd have guessed that writing an Ada compiler was on par with Pascal (but with more types and stuff). This is probably the same (wrong) reasoning by which Mr Bright tricked hi…
You could knock out an object-Pascal / Oberon compiler in a matter of weeks imo.
Re: Introduction to Ada
#57What an ugly, unintuitive language. Are there any benefits to Ada over something like c++?
It makes much use of English words rather than symbols. This was intended to maximise readability, even at the expense of writeability. It's not the way most modern languages are designed, sure enough, and I'm not sure it really improves readability, but I'm not especially au fait with Ada so I'm not the best person to comment.
> unintuitive
This strikes me as another way of saying unfamiliar. Forth and Haskell are also extremely unintuitive languages, to people who don't know them, but that's not really much of a criticism.
Re: Introduction to Ada
#58Re: Introduction to Ada
#59Re: Introduction to Ada
#60 with Ada.Text_IO; use Ada.Text_IO;
procedure T is
type T1 is range 16..19;
type T2 is range -7..0;
type R is record
A : T1;
B,C : T2;
end record;
for R use
record
A at 0 range 0 .. 1;
B at 0 range 2 .. 4;
C at 0 range 5 .. 7;
end record;
X : R := (17,-2,-3);
begin
Put_Line(X'Size'Image); -- 8 bits
end T;