really? I drastically prefer bytearray. In all fairness my experience with JS dev is limited to exploitation of webkit, meaning I'm probably playing with the absolute nastiest of edge cases, but like... I really like python a lot more? It feels cleaner to me in a lot of ways
-
-
Replying to @hedgeberg @scanlime
of course, I'm not exactly a huge python or js dev so my opinion is kinda moot on this, I use js for bad things and python for gross terribly structured scripts and I prefer to write everything in regular C so if anything I'm Objectively Wrong (tm)
1 reply 0 retweets 1 like -
Replying to @hedgeberg @scanlime
Eh, I agree, Python is a much better thought-out language, especially since they (after all these years) managed to pull off a backwards-compat breaking release (Py3) while JS is stuck with all of its warts forever. UTF-16, really? No integer types? sort() sorts in string order?
2 replies 0 retweets 4 likes -
The one thing JS has going for it is it's huge since it happens to be the language of the web, which means lots of time goes into optimizing the hell out of it, which means these days it's fast (but only thanks to ridiculously complex, massive, incomprehensible JIT engines).
1 reply 0 retweets 2 likes -
But, like, that happened *despite* JS being a terrible language. It's a consequence of its popularity; JS isn't popular because it's a good language, it's popular because it happened to wind up being *the* language of the web (and people are trying to use it for other things).
3 replies 0 retweets 3 likes -
I don't do node.js but I've had to deal with node.js codebases and I cannot for the life of me fathom writing any of the stuff I do in Python in JS. Just no. Please. I write JS for web stuff and for that it's tolerable, but I'd prefer Python if I had the choice.
1 reply 0 retweets 3 likes -
Hector Martin Retweeted Hector Martin
Also I just stumbled upon this one, and, seriously, I don't even. Who comes up with this stuff?https://twitter.com/marcan42/status/1008999468492918784 …
Hector Martin added,
Hector Martin @marcan42Yet another JS WTF. JS uses 64-bit floats for numbers, but it *lies* when displaying them. 0x4000000000000000 is 4611686018427387904 and is *perfectly* represented as a float. But JS renders it as 4611686018427388000, because that has fewer significant digits in decimal?! pic.twitter.com/xbYbqMP9mYShow this thread2 replies 0 retweets 0 likes -
Js follows IEEE 754, quite sure that's expected behaviour
1 reply 0 retweets 0 likes -
Hector Martin Retweeted Hector Martin
Nope, it doesn't. This is *specified* in IEEE 754. JS is violating the spec.https://twitter.com/marcan42/status/1009008156322623489 …
Hector Martin added,
Hector Martin @marcan42Here's the IEEE 754 spec explicitly saying conversions to integer must use the exact integer when the value is representable in both formats. JS is violating the IEEE 754 standard. Please don't make excuses about different representations for the same float. This is *broken*. pic.twitter.com/pUEdUCxGEdShow this thread2 replies 0 retweets 1 like -
Replying to @marcan42 @kentaromiura and
I think you’re confused about what double-precision floating-point means. See: https://tc39.github.io/ecma262/#sec-ecmascript-language-types-number-type … https://en.wikipedia.org/wiki/Double-precision_floating-point_format#IEEE_754_double-precision_binary_floating-point_format:_binary64 … https://developers.google.com/web/updates/2018/05/bigint … https://mathiasbynens.be/demo/integer-range … For integers, JavaScript uses 53 bits to store the digits and + 1 for the sign.
2 replies 0 retweets 4 likes
I think you're confused about what "integer" means. The 64-bit IEEE754 floating point value represented by the (big-endian) bytes 43d0000000000000 *represents* the int 4611686018427387904. It does *not* represent the int 4611686018427388000. The latter is not representable.
-
-
You can *round* 4611686018427388000 to the nearest representable integer in that format, which is 4611686018427387904. But there is no reason to conjure up 4611686018427388000 when converting back to integer. That is just wrong and broken.
1 reply 0 retweets 1 like -
Yes, the ECMAScript spec says toString must be implemented in this (broken) way. This is insane, and no other sensible language does this. It is misleading and wrong. https://tc39.github.io/ecma262/#sec-tostring-applied-to-the-number-type …
1 reply 0 retweets 0 likes - Show replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.