August 19, 2022 Re: Programs in D are huge | ||||
---|---|---|---|---|
| ||||
Posted in reply to rikki cattermole | On Thursday, 18 August 2022 at 17:15:12 UTC, rikki cattermole wrote:
>
> On 19/08/2022 4:56 AM, IGotD- wrote:
>> BetterC means no arrays or strings library and usually in terminal tools you need to process text. Full D is wonderful for such task but betterC would be limited unless you want to write your own array and string functionality.
>
> Unicode support in Full D isn't complete.
>
> There is nothing in phobos to even change case correctly!
>
> Both are limited if you care about certain stuff like non-latin based languages like Turkic.
A general toupper/tolower for Unicode is doomed to fail. As already mentioned Turkish has its specificity, but other languages also have traps. In Greek toupper/tolower are not reversible i.e. `x.toupper.tolower == x` is not guaranteed . Some languages have 1 codepoint input and 2 codepoints as result (German ß becomes SS in most cases, capital ẞ is not the right choice in most cases).
etc. etc.
|
August 19, 2022 Re: Programs in D are huge | ||||
---|---|---|---|---|
| ||||
Posted in reply to rikki cattermole | On Thursday, 18 August 2022 at 17:15:12 UTC, rikki cattermole wrote:
>
> Unicode support in Full D isn't complete.
>
> There is nothing in phobos to even change case correctly!
>
> Both are limited if you care about certain stuff like non-latin based languages like Turkic.
I think full D is fine for terminal programs. What you commonly do is tokenize text, remove white space, convert text to numbers etc. The D library is good for these tasks. Rewrite all this for betterC would be a tedious tak
|
August 19, 2022 Re: Programs in D are huge | ||||
---|---|---|---|---|
| ||||
Posted in reply to Patrick Schluter | On Friday, 19 August 2022 at 06:34:19 UTC, Patrick Schluter wrote:
> On Thursday, 18 August 2022 at 17:15:12 UTC, rikki cattermole wrote:
>>
>> On 19/08/2022 4:56 AM, IGotD- wrote:
>>> BetterC means no arrays or strings library and usually in terminal tools you need to process text. Full D is wonderful for such task but betterC would be limited unless you want to write your own array and string functionality.
>>
>> Unicode support in Full D isn't complete.
>>
>> There is nothing in phobos to even change case correctly!
>>
>> Both are limited if you care about certain stuff like non-latin based languages like Turkic.
>
> A general toupper/tolower for Unicode is doomed to fail. As already mentioned Turkish has its specificity, but other languages also have traps. In Greek toupper/tolower are not reversible i.e. `x.toupper.tolower == x` is not guaranteed . Some languages have 1 codepoint input and 2 codepoints as result (German ß becomes SS in most cases, capital ẞ is not the right choice in most cases).
> etc. etc.
That's why you should implementat formatting providers for languages that handle such things.
Like in C# you have the CultureInfo class that you can give to methods such as ToString, ToLower etc. which will correctly handle specific "cultures"
It's one thing D really misses, but is really hard to implement when it wasn't thought of to begin with. It should have been implemented alongside functions that may change between languages and cultures.
|
August 19, 2022 Re: Programs in D are huge | ||||
---|---|---|---|---|
| ||||
Posted in reply to bauss | On Friday, 19 August 2022 at 11:18:48 UTC, bauss wrote:
>
> It's one thing D really misses, but is really hard to implement when it wasn't thought of to begin with. It should have been implemented alongside functions that may change between languages and cultures.
I guess we have another task for Phobos v2.
|
Copyright © 1999-2021 by the D Language Foundation