[Oberon] Oberon with strings, Eberon

Jörg Straube joerg.straube at iaeth.ch
Tue Feb 23 08:44:36 CET 2016


Lars

Strange, that you admire GoLang and at the same time are against UTF-8.
The whole language of GoLang is based on UTF-8: the Go source code must be file encoded in UTF-8, hence all string constants in your program are automatically encoded in UTF-8.
len(str) does not return the number of characters but the number of bytes a string occupies in memory. The function RuneCount(str) returns the number of "runes" (=UTF-8 encoded unicode code points = characters)

As an ASCII character and the UTF-8 byte representation of the lowest Unicode plane are identical, you might not have been aware of the implementation details.

Jörg



Gruss, Jörg
> Am 22.02.2016 um 23:55 schrieb Lars <noreply at z505.com>:
> 
>> On Mon, February 22, 2016 12:39 am, Jörg Straube wrote:
>> Lars
>> 
>> 
>> He does NOT get the string spinach!
> 
> At least he's working on it, no one says his implementation is finished,
> it could be improved.
> 
>> Strings are more complex than it seems.
>> What do you think the function call "length(str)" should return?
> 
> GoLang tries to solve this problem using Runes and Bytes rather than
> chars, i.e. a new invention Rune tries to deal with the old char issue
> 
> 
>> 
>> The main problem in implementing strings is the question: how to
>> represent a character internally?
> 
> Again, GoLang tries to solve this question by runes..
> 
> My personal view is that internationalization, globalization, is a scam. I
> prefer to stick with english characters and force people to stop using
> silly complex languages that complicate programming further.
> 
> I am somewhat of a luddite, in the sense that I reject unicode, utf8, and
> prefer to build my char by char parsers by avoiding unicode entirely.
> 
> Almost all of my website visitors and customers are english, even the
> people who live in russia who I deal with speak english.. as do germans..
> So I ignore the whole unicode scam.
> 
> However I respect the attempts of people to build utf8 and clever things
> like it.... as they are trying to help the world. I feel it is a lost
> cause and creates numerous bugs in software that would be elimintated if
> we just stuck to the english alphabit. Whenever I talk to chinese business
> people about products they speak english anyway, so what's the point of
> having millions of stupid variations of languages and creating a computing
> nightmare of having all these ridiculous characters that go up to literal
> infinity? You can't solve an infinite problem, and that's what unicode is,
> and it will never work as good as people are trying to make it work.
> 
> GoLang runes is a nice attempt, and may help quite a bit.  Problem is it
> makes char by char parsers less simple and less readable than an old
> program from 1970 that just dealt with english. i.e. unicode creates less
> readable programs with more layers of obfuscations and silly
> abstractions... not even abstractions, more like "kludges".
> 
>> 
>> The fork Eberon returns as length the number of 16 bit units.
>> Unfortuntaly, there are characters (eg emojis) that need two of those 16
>> bit units to be represented correctly.
> 
> That's why unicode and utf8 should die and go to hell because it is
> infinitely complex and will never be solved by man.
> 
> Now I'm going to go back to my english char by char parser work... as I
> don't have time for unicode! It's a joke... I've never truly built a
> single international website in my life, it's always been english, nor
> have I built a international shareware program... I rarely find a need.
> IMO unicode is overhyped, overrated, and a nightmare for programmers.
> 
> 
> --
> Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
> https://lists.inf.ethz.ch/mailman/listinfo/oberon
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2376 bytes
Desc: not available
URL: <http://lists.inf.ethz.ch/pipermail/oberon/attachments/20160223/c79928d5/attachment.p7s>


More information about the Oberon mailing list