From mboxrd@z Thu Jan 1 00:00:00 1970
X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on
ip-172-31-74-118.ec2.internal
X-Spam-Level:
X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00,FREEMAIL_FROM
autolearn=ham autolearn_force=no version=3.4.5-pre1
Path: eternal-september.org!reader02.eternal-september.org!aioe.org!wKWAwmJsD7CgUAALcGwllg.user.gioia.aioe.org.POSTED!not-for-mail
From: Blady
Newsgroups: comp.lang.ada
Subject: Re: [ANN] UXStrings package available (UXS_20210207).
Date: Sat, 6 Mar 2021 19:13:24 +0100
Organization: Aioe.org NNTP Server
Message-ID:
References:
<23472fd3-fe53-4935-84b8-f66a6aa60cfbn@googlegroups.com>
NNTP-Posting-Host: wKWAwmJsD7CgUAALcGwllg.user.gioia.aioe.org
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Complaints-To: abuse@aioe.org
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:78.0)
Gecko/20100101 Thunderbird/78.7.1
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-US
Xref: reader02.eternal-september.org comp.lang.ada:61491
List-Id:
Le 27/02/2021 à 10:14, Blady a écrit :
> Le 11/02/2021 à 09:19, Emmanuel Briot a écrit :
>> There is clearly a need here, given the number of implementations out
>> there. I had also implemented GNATCOLL.Strings 4 years ago, with
>> similar goals to yours:
>> - unicode support (via generic formal parameters and traits
>> packages, so you can use UTF8, UTF16,... internally)
>> - unbounded strings (with optional copy-on-write)
>> - task safety (using traits to chose what kind of counter to use)
>> - performance (small-string optimization: no memory alloc for
>> strings of 18 characters or less)
>> - extended API (all missing subprograms from Ada.Strings.Unbounded)
>> - extensive testing
>>
>> I must admit I am not sure why AdaCore chose to write VSS instead of
>> improving one of their string implementations (ada.strings.unbounded,
>> gnatcoll.strings,...)
>> My initial idea had been that it would be possible to provide a nice
>> generic package, highly configurable via traits, on top of which we
>> could reimplement ada.strings.unbounded,
>> ada.strings.bounded,...) but I left AdaCore before that could be
>> accomplished.
>
> I'm preparing some optimization when the character set is reduced thus
> the internal structure will adapt to the actual content.
> But the memory management is bad, the set of API is very basic.
> I'll be glad that you can help.
>
>> I took a look at VSS and find the API confusing. Your API UXString is
>> at least much clearer (if lacking doc at the moment :-)
>
> Some documentation has been added in a form of comments of each API:
> https://github.com/Blady-Com/UXStrings/commit/2bee0ab61841f5e319533b67d2747dda66aa9bd7#diff-90cde6014508061fab9d62e58b327815a954859e5da8a1fd655fa4e5854e7ac5
>
>> I am hoping that the work on Alire (Ada package manager) will
>> ultimately help us find one implementation that is good enough for
>> everyone,
>> and could ultimately become part of the language.
UXStrings is now available with Alire
(https://alire.ada.dev/crates/uxstrings), in your Alire project, just
add UXStrings dependency:
% alr with uxstrings
Thus you can import the UXStrings package in your programs.
Pascal.
PS: for French readers, while referencing UXStrings on Alire, I make the
opportunity to write a short howto with ALire:
https://blady.pagesperso-orange.fr/a_savoir.html#alire