comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Ada and Unicode
Date: Wed, 6 Apr 2022 20:30:58 -0500	[thread overview]
Message-ID: <t2lesj$d2f$1@dont-email.me> (raw)
In-Reply-To: t2knpr$s26$1@dont-email.me

"J-P. Rosen" <rosen@adalog.fr> wrote in message 
news:t2knpr$s26$1@dont-email.me...
...
> It was felt that in practice, being too strict in separating the types 
> would make things more difficult, without any practical gain. This has 
> been discussed - you may not agree with the outcome, but it was not made 
> out of pure lazyness

The problem with that, of course, is that it sends the wrong message 
vis-a-vis strong typing and interfaces. If we abandon it at the first sign 
of trouble, they we are saying that it isn't really that important.

In this particular case, the reason really came down to practicality: if you 
want to do anything string-like with a UTF-8 string, making it a separate 
type becomes painful. It wouldn't work with anything in Ada.Strings, 
Ada.Text_IO, or Ada.Directories, even though most of the operations are 
fine. And there was no political will to replace all of those things with 
versions to use with proper universal strings.

Moreover, if you really want to do that, you have to hide much of the array 
behavior of the Universal string. For instance, you can't allow willy-nilly 
slicing or replacement: cutting a character representation in half or 
setting an illegal representation has to be prohibited (operations that 
would turn a valid string into an invalid string should always raise an 
exception). That means you can't (directly) use built-in indexing and 
slicing -- those have to go through some sort of functions. So you do pretty 
much have to use a private type for universal strings (similar to 
Ada.Strings.Bounded would be best, I think).

If you had an Ada-like language that used a universal UTF-8 string 
internally, you then would have a lot of old and mostly useless operations 
supported for array types (since things like slices are mainly useful for 
string operations). So such a language should simplify the core 
substantially by dropping many of those obsolete features (especially as 
little of the library would be directly compatible anyway). So one should 
end up with a new language that draws from Ada rather than something in Ada 
itself. (It would be great if that language could make strings with 
different capacities interoperable - a major annoyance with Ada. And 
modernizing access types, generalizing resolution, and the like also would 
be good improvements IMHO.)

                                               Randy.


  reply	other threads:[~2022-04-07  1:30 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-17 22:03 Ada and Unicode DrPi
2021-04-18  0:02 ` Luke A. Guest
2021-04-19  9:09   ` DrPi
2021-04-19  8:29 ` Maxim Reznik
2021-04-19  9:28   ` DrPi
2021-04-19 13:50     ` Maxim Reznik
2021-04-19 15:51       ` DrPi
2021-04-19 11:15   ` Simon Wright
2021-04-19 11:50     ` Luke A. Guest
2021-04-19 15:53     ` DrPi
2022-04-03 19:20     ` Thomas
2022-04-04  6:10       ` Vadim Godunko
2022-04-04 14:19         ` Simon Wright
2022-04-04 15:11           ` Simon Wright
2022-04-05  7:59           ` Vadim Godunko
2022-04-08  9:01             ` Simon Wright
2023-03-30 23:35         ` Thomas
2022-04-04 14:33       ` Simon Wright
2021-04-19  9:08 ` Stephen Leake
2021-04-19  9:34   ` Dmitry A. Kazakov
2021-04-19 11:56   ` Luke A. Guest
2021-04-19 12:13     ` Luke A. Guest
2021-04-19 15:48       ` DrPi
2021-04-19 12:52     ` Dmitry A. Kazakov
2021-04-19 13:00       ` Luke A. Guest
2021-04-19 13:10         ` Dmitry A. Kazakov
2021-04-19 13:15           ` Luke A. Guest
2021-04-19 13:31             ` Dmitry A. Kazakov
2022-04-03 17:24               ` Thomas
2021-04-19 13:24         ` J-P. Rosen
2021-04-20 19:13           ` Randy Brukardt
2022-04-03 18:04           ` Thomas
2022-04-06 18:57             ` J-P. Rosen
2022-04-07  1:30               ` Randy Brukardt [this message]
2022-04-08  8:56                 ` Simon Wright
2022-04-08  9:26                   ` Dmitry A. Kazakov
2022-04-08 19:19                     ` Simon Wright
2022-04-08 19:45                       ` Dmitry A. Kazakov
2022-04-09  4:05                         ` Randy Brukardt
2022-04-09  7:43                           ` Simon Wright
2022-04-09 10:27                           ` DrPi
2022-04-09 16:46                             ` Dennis Lee Bieber
2022-04-09 18:59                               ` DrPi
2022-04-10  5:58                             ` Vadim Godunko
2022-04-10 18:59                               ` DrPi
2022-04-12  6:13                               ` Randy Brukardt
2021-04-19 16:07         ` DrPi
2021-04-20 19:06         ` Randy Brukardt
2022-04-03 18:37           ` Thomas
2022-04-04 23:52             ` Randy Brukardt
2023-03-31  3:06               ` Thomas
2023-04-01 10:18                 ` Randy Brukardt
2021-04-19 16:14   ` DrPi
2021-04-19 17:12     ` Björn Lundin
2021-04-19 19:44       ` DrPi
2022-04-16  2:32   ` Thomas
2021-04-19 13:18 ` Vadim Godunko
2022-04-03 16:51   ` Thomas
2023-04-04  0:02     ` Thomas
2021-04-19 22:40 ` Shark8
2021-04-20 15:05   ` Simon Wright
2021-04-20 19:17     ` Randy Brukardt
2021-04-20 20:04       ` Simon Wright
replies disabled

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