comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: How (or Where?) to get started on Ada? (Properly)
Date: Wed, 4 Sep 2013 14:15:17 +0200
Date: 2013-09-04T14:15:17+02:00	[thread overview]
Message-ID: <i39s0lebaz51.n3mpkidbsmn5.dlg@40tude.net> (raw)
In-Reply-To: dbd4b15b-7dd9-488b-9ecd-5fa17c3bf311@googlegroups.com

On Wed, 4 Sep 2013 04:01:14 -0700 (PDT), e.s.harney@gmail.com wrote:

> Well, I'm only looking at it since Ada seems to be missing things like
> widely-used/extensively-tested HTTP or crypto libraries.

There exist Ada libraries for this. The may be no single library, because
too much depends on the application in question.

As for extensive testing, I doubt that many libraries you have in mind
actually were.

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?

> How does Ada represent its strings internally? (Or more specifically, what
> character set do the standard library functions for processing strings
> assume/expect?).

There are three major groups of strings with regard of memory management:

1. Fixed size strings
2. Bounded variable strings
3. Unbounded strings

Usually, 90% of all cases is covered by #1. #2 is almost never used. #3 is
rarely used.

The representation of #1 depends on whether bounds of the string are
statically determinable, then it is the string body which is kept in the
memory, or indeterminable, then its the bounds ("dope") and the body. So
you are in full control. Since Ada can return #1 of unknown in advance size
on the stack, you almost never need #3.

> Strings seem to be a hairy detail in many languages. Go uses uses utf8
> everywhere; C has utf8 mostly these days but there's still things like
> wchar (and associated w* string function) around;

This is an orthogonal issue. A string is an array of code points. As such
it cannot be UTF-8 or not.

Encoding is a method of putting a string proper into another string (array)
of octets, words, whatever else memory units. Encoding is only important
for communicating to the outer world.

In Ada, the predefined strings of the category #1 may have one of the
following encodings:

1. Latin 1 (String)
2. UCS-2 (Wide_String)
3. UCS-4 (Wide_Wide_String)

For UTF-8 representations one usually uses Latin 1. There exist various
libraries for that, including the standard library. Similarly for UTF-16
one customary uses Wide_String (e.g. under Windows).

> Is this covered by the reference manual for Ada?

Yes, though finding answers in Ada RM may be a bit challenging.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de


  parent reply	other threads:[~2013-09-04 12:15 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-04  9:14 How (or Where?) to get started on Ada? (Properly) e.s.harney
2013-09-04  9:40 ` Gour
2013-09-04 10:15 ` G.B.
2013-09-04 10:25 ` G.B.
2013-09-04 11:01   ` e.s.harney
2013-09-04 11:22     ` Peter C. Chapin
2013-09-04 12:15     ` Dmitry A. Kazakov [this message]
2013-09-04 15:32     ` G.B.
2013-09-04 12:04 ` mockturtle
2013-09-04 12:25 ` Austin Obyrne
2013-09-04 15:00 ` Eryndlia Mavourneen
2013-09-04 16:05 ` e.s.harney
2013-09-04 16:55   ` Dmitry A. Kazakov
2013-09-04 18:46   ` Jeffrey R. Carter
2013-09-04 20:35     ` Alan Jump
2013-09-05  8:42     ` Jacob Sparre Andersen
2013-09-05 14:34       ` Jeffrey R. Carter
2013-09-04 16:09 ` Dan'l Miller
2013-09-05  0:13   ` e.s.harney
2013-09-05 14:37     ` Mike H
2013-09-10  9:16   ` Maurizio Tomasi
2013-10-03 13:34 ` grodzicky_j
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox