Re:Java's Original Sin (2009)
by grahamedgecombe on Monday July 15, 2019 @02:07AM
(#20438530)
> "runes" like Go would be even better but codepoints are halfway there
Go runes are codepoints.
I think Swift is interesting, a "character" in Swift is actually a grapheme cluster.
Swift probably inherits that from NeXT/OpenSTEP/Cocoa which was very unusual at the time in its degree of unicode support. For example it used something like unicode equivalence in string comparisons.
(You'd see objective-c benchmarks suffer because of this)
Thanks, yes the Swift model is what I would be going for.
I just wrote my first Go program this past weekend, evidently I misunderstood the tutorials/docs I read.
Python or hundreds of other languages have "everything is an object". Java is rare in having a small handful of non-objects in a mostly-object-oriented language.
Notice how big a problem the string/bytes split in Python 2 -> 3 migration was though - probably bigger than anything Java has had to do - which suggests this wouldn't necessarily have solved all problems as the author would like.
Edit: In Python, equality, addition, even attribute setting can all be overridden by implementing certain "magic" methods on a class. Much of Python syntax is effectively syntactic sugar for calling these methods.