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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: border1.nntp.dca3.giganews.com!border2.nntp.dca3.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!news.bbs-scene.org!weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: How (or Where?) to get started on Ada? (Properly) Date: Wed, 4 Sep 2013 14:15:17 +0200 Organization: cbb software GmbH Message-ID: References: <9ec51e40-081f-4ec7-b17f-7c73dbdcd10a@googlegroups.com> <52270a8c$0$6583$9b4e6d93@newsspool3.arcor-online.net> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: IenaDxMXK2hi7fvYcb+MlQ.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 X-Original-Bytes: 3451 Xref: number.nntp.dca.giganews.com comp.lang.ada:183284 Date: 2013-09-04T14:15:17+02:00 List-Id: 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