News for hackers. Stuff that matters.
Re:Slimmer and faster JavaScript strings in Firefox by ch0wn on Monday July 21, 2014 @06:21PM (#8066362)
Is this similar to the Flexible String Representation[0] in Python 3.3?

[0] http://legacy.python.org/dev/peps/pep-0393/

Re:Slimmer and faster JavaScript strings in Firefox by AnkhMorporkian on Monday July 21, 2014 @06:46PM (#8066464)
Nearly the same, save for the fact that python also gives an option for UTF-32.
Re:Slimmer and faster JavaScript strings in Firefox by deathanatos on Wednesday July 23, 2014 @02:05AM (#8073115)
I wouldn't say it's an option: the string's internal representation might be UTF-32, but whether or not it is is transparent to you the coder. (Just as the JS change is transparent to the JS coder.)

However, the Python change wasn't entirely transparent: len() on a string now returns the length of the string in code points, whereas previously it returned the length in code units. Further, previously Python could be built with one of two internal string representations, so len(s) for a constant s could return different answers depending on your build. Now it doesn't, and len returning code points is much more useful.