| 02:22 | <sideshowbarker> | So -9 >>> 0 returns 4294967287 rather than -9 |
| 02:22 | <sideshowbarker> | I’m trying to find where in the current spec that behavior is defined |
| 02:25 | <sideshowbarker> | that is, -9 >>> 0 — bitwise logical right shift, by zero bits to the right |
| 02:25 | <jmdyck> | https://tc39.es/ecma262/#sec-numeric-types-number-unsignedRightShift |
| 02:25 | sideshowbarker | looks |
| 02:26 | <sideshowbarker> | jmdyck: thanks (dunno now why I wasn’t able to find that) |
| 02:27 | <sideshowbarker> | so now I’m trying to understand how this is different from what other runtimes do |
| 02:27 | <sideshowbarker> | for example, in java -9 >>> 2 is -9 |
| 02:28 | <sideshowbarker> | and intuitively, if no zeroes are being shifted in from the left, then the most-significant bit of that number is still 1 |
| 02:30 | <sideshowbarker> | so there’s some other magic that causes the JavaScript runtime to consider the value returned to not be the a two’s-complement representation |
| 02:32 | <sideshowbarker> | ah, I guess that’s just because the operation requires treating the left-hand value as unsigned |
| 02:32 | <jmdyck> | 1073741821 is what I get for -9 >>> 2, not -9 >>> 0 |
| 02:33 | <sideshowbarker> | jmdyck: yeah, sorry I originally mistyped it, but then edited it to correct that |
| 02:33 | <sideshowbarker> | ah no, I didn’t correct that part |
| 02:33 | <jmdyck> | -9 >>> 0 is 4294967287, i.e. 2^32 - 9, i.e. ToUint32(-9) |
| 02:34 | <sideshowbarker> | sorry — thanks, yeah, I get the same (and fixed now also in my original message) |
| 02:36 | <sideshowbarker> | anyway, I see now that this is because in JavaScript, the left-hand side of the operation gets handled as unsigned — whereas in Java, the left-hand side gets handled as signed |
| 02:38 | <sideshowbarker> | so the ES spec is clear on this — it’s just not very discoverable |
| 02:39 | <sideshowbarker> | I had expected to find that info at https://tc39.es/ecma262/multipage/ecmascript-language-expressions.html#sec-unsigned-right-shift-operator |
| 02:40 | <sideshowbarker> | but there’s no link from there to https://tc39.es/ecma262/multipage/ecmascript-data-types-and-values.html#sec-numeric-types-number-unsignedRightShift (where the real information is) |
| 02:40 | <jmdyck> | The thing is, there's 2 numeric types, so it can't just link to the Number-specific semantics. |
| 02:41 | <sideshowbarker> | aha |
| 02:41 | <sideshowbarker> | OK yeah I can understand how it would lead to that |
| 02:42 | <jmdyck> | You can click on EvaluateStringOrNumericBinaryExpression and then ApplyStringOrNumericBinaryOperator and then the little table in step 8 tells you to apply T::unsignedRightShift |
| 02:42 | <jmdyck> | but again, it can't just link to Number::unsignedRightShift |
| 02:43 | <sideshowbarker> | OK |
| 02:43 | <sideshowbarker> | right |
| 02:43 | <sideshowbarker> | well I’m updating MDN so I’ll get the additional links into MDN for it at least |
| 02:44 | <jmdyck> | conceivably there could be 2 more columns, giving Number-specific and BigInt-specific links for each numeric method |
| 02:44 | <sideshowbarker> | yeah that might be more helpful |
| 02:48 | <jmdyck> | Or at least a Note that linked you to 6.1.6.1 for Number, 6.1.6.2 for BigInt. |
| 02:49 | <sideshowbarker> | yeah |
| 10:37 | <yulia> | Heads up that I will need to be out for the first hour today |
| 15:16 | <yulia> | im here now |
| 15:19 | <shu> | Aki: when is the fixed layout object currently scheduled? |
| 15:20 | <shu> | today afternoon, tomorrow morning, or tomorrow afternoon? |
| 15:20 | <Aki> | shu: tomorrow afternoon |
| 15:20 | <shu> | thanks |
| 16:08 | <Justin Ridgewell> | @rbuckton Does Typescript keep a changelog for the changes between the Beta and Regular release? |
| 16:08 | <Justin Ridgewell> | Hmmm. Ron isn't in this channel... |
| 16:19 | <Aki> | rbuckton: 👆 |
| 16:59 | <danielrosenwasser> | the release notes come out for beta and RC |
| 17:00 | <danielrosenwasser> | https://devblogs.microsoft.com/typescript/announcing-typescript-4-4-beta https://devblogs.microsoft.com/typescript/announcing-typescript-4-4-rc https://devblogs.microsoft.com/typescript/announcing-typescript-4-4 |
| 17:00 | <danielrosenwasser> | or are you asking about what the differences are between a pre-release and a stable? |
| 17:06 | <Justin Ridgewell> | Yes, the differences between the 3 blog posts |
| 17:06 | <Justin Ridgewell> | I end up reading the Beta when it comes out, then you post the RC and Stable, and I have no idea if anything is changed |
| 17:15 | <Domenic> | I unsubscribed from the TypeScript blog RSS feed precisely because it was so repetitive |
| 17:20 | <danielrosenwasser> | Yeah, sorry 😅 We're typically feature-complete on the language side by beta, but often editor features & optimizations are the differences. Big difference this past time was |
| 17:22 | <danielrosenwasser> | I'll consider including a "changes since the ______" in the future if it's not too much trouble |
| 17:26 | <rbuckton> | @rbuckton Does Typescript keep a changelog for the changes between the Beta and Regular release? |
| 17:26 | <rbuckton> | We don't usually add new things once it hits beta, and very rarely do we roll back a feature in Beta |
| 17:28 | <Justin Ridgewell> | Thanks! |