News for hackers. Stuff that matters.
Re:Java's Original Sin (2009) by nerdponx on Monday July 15, 2019 @12:42AM (#20438183)
Isn't this basically the Python data model? Especially so in Python 3, where strings are strings of unicode codepoints rather than bytes ("runes" like Go would be even better but codepoints are halfway there).

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.

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.

Re:Java's Original Sin (2009) by shellac on Monday July 15, 2019 @04:18AM (#20438996)
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)

Re:Java's Original Sin (2009) by nerdponx on Monday July 15, 2019 @09:34AM (#20440639)
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.

Re:Java's Original Sin (2009) by lmm on Monday July 15, 2019 @07:01AM (#20439608)
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.