Live data from Hacker News

Introduction to Ada

learn.adacore.com

51–60 of 193 posts

Re: Introduction to Ada

#51

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.

I still have a copy of the original Ada MIL spec.

Re: Introduction to Ada

#52

Earlier 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.

I think someone was looking for that. You don't have a copy of the other languages do you? Red is online, but blue and yellow are not.

Re: Introduction to Ada

#53

Earlier 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.

[deleted]

Re: Introduction to Ada

#54
post #33

Earlier 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.

Why didn't you, at least, put in Ada's numeric type system into D? You would've had a massive edge over C++ right there.

Re: Introduction to Ada

#55

The 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 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

#56
post #55

The 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…

Oh Ada is so much more complex than Pascal. I think getting something with the numeric types is doable in a smaller timeframe, the OO, tasking stuff would be much harder.

You could knock out an object-Pascal / Oberon compiler in a matter of weeks imo.

Re: Introduction to Ada

#57
post #34

What an ugly, unintuitive language. Are there any benefits to Ada over something like c++?

> ugly

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

#59
Ada was the first language I learned at university back in 2003 (I had previously taught myself C/C++, Assembler and VB). It had a huge impact on me and influenced my entire career and how I approach software engineering. These days languages like Erlang and Haskell are carrying on some of the ideas (modularity, type safety, concurrency, etc.) in more modern incarnations. But there is still something special about Ada.

Re: Introduction to Ada

#60
Fun fact GNAT (GCC Ada front-end) will use a biased representation for range type when packing tight:

  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;
Post reply on HN