From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.66.250.233 with SMTP id zf9mr1136586pac.12.1378310993000; Wed, 04 Sep 2013 09:09:53 -0700 (PDT) X-Received: by 10.50.44.67 with SMTP id c3mr189055igm.13.1378310992559; Wed, 04 Sep 2013 09:09:52 -0700 (PDT) Path: border1.nntp.dca3.giganews.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!n2no20627481pbg.1!news-out.google.com!z6ni33820pbu.0!nntp.google.com!j7no266122qai.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 4 Sep 2013 09:09:51 -0700 (PDT) In-Reply-To: <9ec51e40-081f-4ec7-b17f-7c73dbdcd10a@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=64.183.207.38; posting-account=zwxLlwoAAAChLBU7oraRzNDnqQYkYbpo NNTP-Posting-Host: 64.183.207.38 References: <9ec51e40-081f-4ec7-b17f-7c73dbdcd10a@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: How (or Where?) to get started on Ada? (Properly) From: "Dan'l Miller" Injection-Date: Wed, 04 Sep 2013 16:09:52 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Original-Bytes: 11489 Xref: number.nntp.dca.giganews.com comp.lang.ada:183289 Date: 2013-09-04T09:09:51-07:00 List-Id: On Wednesday, September 4, 2013 4:14:55 AM UTC-5, e.s.h...@gmail.com wrote: > As a programmer that has spent most of his time in managed environments s= o far (Java mostly, with some PHP and Python here and there), I have been t= rying to get more into "native code" recently, in order to be able to contr= ol things like memory layout and get deterministic resource usage (and thus= deterministic run time performance).=20 >=20 > Initially I started looking at C/C++, but soon realized that the intricat= e semantics of C++ were a deal-breaker (and not necessary for what I was lo= oking for anyways) and that C lacked too many libraries (hash tables, file = systems, threading, etc.) to be useful for one-man-projects these days (yes= there's things like APR or GLib but those are quite a bit of a hassle).=20 > [...snip...] > TL;DR: > What I am struggling the most when learning new languages is knowing virt= ually nothing about what the syntax actually does. I have tried some online= tutorials that manage to walk me through the compilation process and then = slowly introduce new languages pieces through example programs, but (for me= at least) that has been a rather frustrating experience, considering that = I'm essentially just copy-pasting code (and having to ignore irrelevant bit= s in the code that are not relevant yet, but still necessary for it to run)= .. >=20 > What I'm looking for is a text that starts from the other way, i.e. expla= ins the language blocks, the data/object model, etc. first, and only after = that goes on to provide full examples of working code. I guess this is some= thing I'll only be able to find in a book. >=20 > I did look on Amazon about available books, but all of them seem fairly d= ated. "Programming in Ada 2005" by John Barnes did look interesting judging= by the reviews, yet I'm not sure of how helpful it will be in covering all= details that are relevant to writing useful software these days (things li= ke utf8, interfacing with C, etc.). >=20 > Do you have any recommendations for me? Well, there are generally 4 major eras of Ada: Ada83, Ada95, Ada2005, Ada2= 012. Ada83 (code-named Green during the competition) was a design-by-commi= ttee during the 1970s and early 1980s, but with a strong counter-cultural a= ttitude by Jean Ichbiah, Green team's lead designer. Some of that counter-= cultural attitude has been beneficial (e.g., the vigorous pursuit of correc= t object lifetimes), whereas other portions of that counter-cultural attitu= de was Ada83's downfall (e.g., accomplishing goals via Draconian restrictio= ns). I came first to Ada83, then, after having been repulsed by its excess= ive restrictions and lack of runtime polymorphism, spent the next 20 years = in C++, which was designed with the style of Ada83 done "correctly" from th= e C-minded slapstick perspective of the Marx Brothers' "Doctor it hurts whe= n I do this!" "Well, then don't do that!" Like Austin Obyrne's posting ab= ove, I came back to modern Ada decades later, when I became repulsed to cor= e of my being at C++'s (especially Boost Libraries') excessive use of (poor= ly-)emulated functional programming in the metatemplate programming style o= f using the Turing-complete (at compile-time) capabilities of C++ templates= . The compile-time error messages emitted by metatemplate programming is c= ryptic & obtuse at best, and little better that "unknown error at unknown l= ocation" at worst. If this is what you mean by "knowing virtually nothing = about what the syntax actually does" and "the intricate semantics of C++ we= re a deal-breaker", then you have completely grasped the current (dystopian= ) state of C++, and I wholeheartedly agree with you at some level much furt= her along the learning curve. But conversely if you mean that you do not understand the canonical impleme= ntation of virtual functions as a per-instance pointer to a type's virtual-= function table singleton(-per-type) that is an array of runtime-polymorphic= function-pointers to call, as the fundamental rubber-meets-the-road mechan= ism of OOP, then you need to read (for C++) Stan Lippman's _Inside the C++ = object model_, which predates metatemplate programming and hence is not con= taminated by that MTP filth. The underlying underpinnings of C++ can be th= ought of as the child's play-toy version of the industrial-strength underly= ing underpinnings of Ada95-&-onward, with C++'s per-instance pointer to vir= tual-function table roughly analogous to Ada95-&-onward's tag in a tagged r= ecord, for example. Independent of language, you need to learn what the "n= ative" machine-language languages do. I suspect that this book will really= stoke the fire in your mind, solving many mysteries in pre-MTP C++, Ada95-= &-onward, and even some C. From this stronger basis in what "native"/"unma= naged" machine-language programming-languages do, your learning of Ada will= likely be accelerated as you will be able to visualize in your mind what i= s happening at the machine-language level for each feature in Ada (even if = no such textual explanation appears in the later Ada books that you are rea= ding). http://www.amazon.com/Inside-Object-Model-Stanley-Lippman/dp/0201834= 545/ref=3Dsr_1_1?s=3Dbooks&ie=3DUTF8&qid=3D1378307415&sr=3D1-1&keywords=3DC= %2B%2B+object+model For C & C++ programmers coming to Ada95-&-onward, I recommend Norman Cohen'= s _Ada as a second language_, which for you, would be after you read Stan L= ippman's underlying-underpinnings-of-C++ book above. As with Stan Lippman'= s book, Norman Cohen's book predates metatemplate programming, so it is not= polluted by that filth. http://www.amazon.com/Ada-Second-Language-Norman-= Cohen/dp/0070116075/ref=3Dsr_1_5?s=3Dbooks&ie=3DUTF8&qid=3D1378305539&sr=3D= 1-5&keywords=3Dada The most lucid revelation of Ada2005 semantics (including Ada95) is (Britis= h) John Barnes's _Programming in Ada2005 with CD_. I wish John Barnes woul= d add another several hundred pages (perhaps as a Volume Two) and merge in = the equivalent of Stan Lippman's underlying-underpinning book, but for Ada,= so that the reader can crystal-clearly see "what the syntax actually does"= under the hood. There appear to be 2 types of learners: 1) those who love learning opaque black-boxes as opaque black-boxes, embrac= ing the opaqueness to the nth degree. (These people are not me, Stan Lippm= an, and apparently you. John Barnes obviously loves voluminous details of = the opaque black-box, and does an incredible job of revealing what the lang= uage does as an opaque black-box, describing its externally-observable beha= vior without significant reference to underlying underpinnings. 2) those who love learning how to correctly & smoothly (nonjerkingly) drive= an automobile with a manual transmission by first looking at a diagram of = how the clutch lever actuates a partial-slip/partial-friction plate, then g= etting behind the wheel in a parking lot to learn to feather in the slip-po= int on the clutch by visualizing in one's mind an imagined-animated variant= of the diagram of the manual transmission. Stan Lippman's book above is f= irmly in this school of thought. Nancy Leveson wrote an entire book on how= an accurately not-too-abstracted & not-too-hokus-pokus mental model is one= of the most important aspects of learning a complex system correctly (e.g.= , so that the operators of a nuclear-fission power-plant know how the syste= ms work well enough to respond correctly to various emergent scenarios). T= his book is about a style of design for a style of deep learning, not a rec= ommendation for your Ada learning and native machine-code object model lear= ning (but apropos for validating precisely the style of lucidly-revealing l= earning that your original posting is yearning). http://www.amazon.com/Saf= eware-Computers-Nancy-G-Leveson/dp/0201119722/ref=3Dsr_1_fkmr1_1?s=3Dbooks&= ie=3DUTF8&qid=3D1378310557&sr=3D1-1-fkmr1&keywords=3DNancy+Levinson+safewar= e 3) Then there are those people who (very partially, very badly) "learn" new= things only by mangled analogy to opaque black-boxes that they already kno= w. They, for example, try to learn to drive a manual-transmission automobi= le by only direct & unembellished analogy to a automatic-transmission autom= obile. Usually, such people with so-impaired thoughts never learn to drive= a manual-transmission automobile correctly & smoothly until they disavow t= heir ignorance (and likely join with us #2-type learners above, when some #= 2-type learner teaches how the underlying underpinnings of the clutch actua= lly work). Norman Cohen's book partially falls into this rut, and hence is= supplemental reading material to fortify already-partially-learned Ada kno= wledge. (Nancy Leveson's book lambastes this style of shallow learning and= the misguided design style that evokes this shallowness.) And when you get beyond basic Ada knowledge on towards intermediate, you sh= ould start reading sections of the Ada2012 (or Ada2005 or Ada95) rationale.= When you get to intermediate on towards advanced stage of learning, you s= hould start reading section of the Ada2012 (or Ada2005 or Ada95) annotated = reference, which is a further-embellished variant of the language standard. http://www.ada-auth.org/standards/rationale12.html and http://www.adaic.org/ada-resources/standards As you read Ada2012, Ada2005, and Ada95 material (perhaps in that reverse-c= hronological order), you will see Ada83 (codenamed Green) morph further & f= urther toward the 2nd-place runner-up in the competition: Red. This is be= cause Ada95, Ada2005, and Ada2012 was steered by the remnants of the Red te= am, after Green team's Jean Ichbiah resigned from his position of Distingui= shed Reviewer in protest against Ada95 (or some sanitized rewording thereof= ). Studying redder-&-redder Ada95-&-onward along with pre-2000 C++ (predat= ing the metatemplate programming filth) are complementary activities, becau= se redder-&-redder Ada2005-&-onward is what 1990s pre-MTP C++ could have be= come.