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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.66.221.137 with SMTP id qe9mr1151462pac.4.1378310719985; Wed, 04 Sep 2013 09:05:19 -0700 (PDT) X-Received: by 10.49.12.133 with SMTP id y5mr4189qeb.42.1378310719575; Wed, 04 Sep 2013 09:05:19 -0700 (PDT) Path: border1.nntp.ams3.giganews.com!border1.nntp.ams2.giganews.com!border3.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!newsfeed.tele2net.at!news.glorb.com!n2no20618498pbg.1!news-out.google.com!rn2ni64931pbc.1!nntp.google.com!q10no2629494qai.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 4 Sep 2013 09:05:19 -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=140.78.186.245; posting-account=EGQ3wAoAAABMlvcviStPLgY0shtgbvUX NNTP-Posting-Host: 140.78.186.245 References: <9ec51e40-081f-4ec7-b17f-7c73dbdcd10a@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <2e821865-60c7-4056-91b1-165a6e7748ac@googlegroups.com> Subject: Re: How (or Where?) to get started on Ada? (Properly) From: e.s.harney@gmail.com Injection-Date: Wed, 04 Sep 2013 16:05:19 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Original-Bytes: 6379 Xref: number.nntp.dca.giganews.com comp.lang.ada:183288 Date: 2013-09-04T09:05:19-07:00 List-Id: > Extensive should mean coverage tests, I suppose. Not the number of times the same function with same parameters was called and nobody noticed it crashed?=20 Perhaps my choice of words wasn't ideal.. What I really meant was not reall= y tested in the context of unit tests, but something that is widely used or= at least part of a widely used library (and thus checked/analyzed for conf= ormance/compatibility/vulnerabilities, as well as optimized).=20 I realize this isn't ideal, but popularity is pretty much the only metric I= have to determining the quality of 3rd party libraries, considering that I= probably lack the domain knowledge (as well as the large amounts of time) = necessary to do this myself.. > Since Ada can return #1 of unknown in advance size > on the stack, you almost never need #3.=20 Yes, I remember using this in some exercises, because I didn't want to both= er with learning how proper heap allocations work in Ada.=20 Back then though, I thought of this as more of a hack, since I was creating= lots of small functions that essentially just worked around the fact of no= t having a heap. Is this accepted practice when working with Ada? How does Ada do these stack-allocations of variable size? Is there any perf= ormance downside to it? (e.g. by having to relocate things on the stack, or= stacks getting huge?) > This is an orthogonal issue. A string is an array of code points. As such it cannot be UTF-8 or not.=20 "Idealized" Spec and "conventions" (libraries/APIs) sort of drift apart her= e in most languages in my experience, which is why I haven't really perceiv= ed this as an orthogonal issue so far. (Things like the length function cou= nting non-bmp "code points" differently depending on how the run time is co= mpiled in python or counting always only the size in bytes in Go, or having= no surrogate-aware substring functionality in Java, etc.) Thank you for explaining what things look like in Ada, this is what I was l= ooking for. > the good people on Usenet can be very valuable, too Yes, I'm pleasantly surprised by all the responses here. I did not expect t= his much activity, considering the age of the other threads. On Wednesday, September 4, 2013 11:14:55 AM UTC+2, e.s.h...@gmail.com wrote= : > Some general details on my situation (that may be useful or not for the q= uestion; feel free to skip down to the "TL;DR" marker if you don't want to = read them): >=20 >=20 >=20 > 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 >=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 >=20 >=20 >=20 > Looking at the other options available currently, Ada seemed like the bes= t one (still actively maintained; competitive compiler; windows/linux-porta= bility; .. at times I wonder if we'd be seeing thing like Rust or Go if Ada= didn't still have its Pascal syntax...) >=20 >=20 >=20 > So here I am, looking into learning Ada.. I have dabbled in it (as well a= s Turbo Pascal) at various points in time for school/university courses, bu= t those have been very shallow experiences. >=20 >=20 >=20 > TL;DR: >=20 > 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 >=20 >=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 >=20 >=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 >=20 >=20 > Do you have any recommendations for me?