Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Ada & Unicode support

174 views
Skip to first unread message

Gour

unread,
Sep 20, 2014, 6:01:03 PM9/20/14
to
Hello,

in (not so) recent time I was evaluating several programming languages as
candidates for writing multi-platform desktop app and amongst them there
were e.g. D, Rust, Nimrod...

In a present time I am playing with Go for my web needs and must say
it's nice package including its tooling support libs etc.

However, when it comes to type-safety there are not many mature options
like Ada, but I wonder how is Unicode support in Ada 2012 considering
that all those above-mentioned languages are newer and mostly start with
Unicode support from the very beginning?

Moreover, I little bit confused with the comparison chart at
http://www.ada2012.org/comparison.html where it's stated that in Ada
2005 there is support for '8/16/32 bit (full unicode)' while Ada 2012
adds 'String Encoding package'.

Lastly, i was confused when I learnt on #ada that Ada's Character is
Latin-1 which is definetely different than handling of
Strings/Characters in Go.

So, can someone provide some explanation what is the meaning of e.g.
full unicode support in 2005 and what is the significance of 'String
Encoding Package' in this context?

Finally, what is the impact of current Unicode/UTF-8 support in Ada on
writing apps which one wants to have properly l10n/i18n-ed?

How does GtkAda handle those requirements in the context of the overall
Unicode support in Ada language?


Sincerely,
Gour

--
When your intelligence has passed out of the dense forest
of delusion, you shall become indifferent to all that has
been heard and all that is to be heard.

Ludovic Brenta

unread,
Sep 20, 2014, 8:17:21 PM9/20/14
to
Gour writes on comp.lang.ada:
> So, can someone provide some explanation what is the meaning of e.g.
> full unicode support in 2005 and what is the significance of 'String
> Encoding Package' in this context?

You need to distinguish between the character set and encoding of the
Ada text (which you give to the compiler) and the character set(s) and
encoding(s) that your program must support.

ARM 2.1 specifies that the character set for Ada text is Unicode
(precisely, ISO/IEC 10646:2011 Universal Multiple-Octet Coded Character
Set) and that the encoding is implementation-defined. For example, GNAT
supports several encodings, including UTF-8 with command-line options.

As for the text that your program must process, that's really up to you.
Ada 95 added the Wide_Character and Wide_String to help you use 16-bit
characters (not exactly UTF-16, rather supporting only the first plane
of the Unicode character set); Ada 2005 added Wide_Wide_Character for
32-bit characters (i.e. UTF-32 encoding) The String Encoding package is
there to help you transcode text between 8-bit Latin_1, UTF-8, proper
UTF-16 and UTF-32. The new packages are there to help you but they
don't do anything that wasn't possible in previous versions of Ada
(i.e. you could reimplement them in Ada 95 if you so wished).

GTK+ and GtkAda treat all strings as UTF-8. If your program uses
GtkAda, then don't bother transcoding anything and specify that all
Strings really contain UTF-8.

HTH

--
Ludovic Brenta.

David Botton

unread,
Sep 20, 2014, 9:07:24 PM9/20/14
to

> In a present time I am playing with Go for my web needs and must say
>
> it's nice package including its tooling support libs etc.

Before you jump the Ada ship so quick, I have not made any official announcements yet, since there is much more to go for my 1.0 goals (I have a few more weeks), but take a look at http://www.gnoga.com you will find that with that Ada may be the best choice today for web app development :)

Is like having Node.JS, Go, Java, JS and all combined on Steroids and no need to write a desktop and Web version of any app and cross platform to every platform that Ada runs for local UI and remote UI to anything from a flip phone to an IPad.

Gnoga - The GNU Omnificent GUI for Ada

David Botton

Gour

unread,
Sep 21, 2014, 3:01:02 AM9/21/14
to
On Sun, 21 Sep 2014 02:17:36 +0200
Ludovic Brenta <lud...@ludovic-brenta.org> wrote:

> You need to distinguish between the character set and encoding of the
> Ada text (which you give to the compiler) and the character set(s) and
> encoding(s) that your program must support.

Right.

> For example, GNAT supports several encodings, including UTF-8 with
> command-line options.

OK, that's enough and glad to hear it.

>The String Encoding package is there to help you transcode text between
>8-bit Latin_1, UTF-8, proper UTF-16 and UTF-32.

Ahh, that was the missing link. Thank you.

> GTK+ and GtkAda treat all strings as UTF-8. If your program uses
> GtkAda, then don't bother transcoding anything and specify that all
> Strings really contain UTF-8.

That's just what we wanted to hear. UTF-8 everywhere and less
complications. :-)

> HTH

Yes, thanks again.


Sincerely,
Gour

--
In the material world, one who is unaffected by whatever good
or evil he may obtain, neither praising it nor despising it,
is firmly fixed in perfect knowledge.

Gour

unread,
Sep 21, 2014, 3:01:03 AM9/21/14
to
On Sat, 20 Sep 2014 18:07:23 -0700 (PDT)
David Botton <da...@botton.com> wrote:

> Before you jump the Ada ship so quick, I have not made any official
> announcements yet, since there is much more to go for my 1.0 goals (I
> have a few more weeks), but take a look at http://www.gnoga.com you
> will find that with that Ada may be the best choice today for web app
> development :)

Let me say that when I wrote 'web development' I was really thinking
about learning Go in order to be able to tweak Hugo static site
generator which I use for web sites.

Otherwise, I'm not so much interested for writing 'web apps'.

> Is like having Node.JS, Go, Java, JS and all combined on Steroids and
> no need to write a desktop and Web version of any app and cross
> platform to every platform that Ada runs for local UI and remote UI
> to anything from a flip phone to an IPad.

As I wrote above, not being such a big fan of web-everywhere. That
option was suggested to me in every programming language's community I
was evaluating. :-)

I'm more an old-school guy preferring, at least for my use cases,
classical desktop app.

However, I'm curious about the widget set which should be available for
Gnoga?

I understand that web apps are capable to replace desktop things in many
cases, but, otoh, I believe that in majority of use cases those 'apps'
are anyway so dumb so simple cli app could fulfill the need.


Sincerely,
Gour

--
One who restrains his senses, keeping them under full control,
and fixes his consciousness upon Me, is known as a man of
steady intelligence.

Per Sandberg

unread,
Sep 21, 2014, 3:27:36 AM9/21/14
to
Nice :)
Looking forward to see release 1.0.

/P
0 new messages