03:19 | <Jack Works> | the longer answer is that in order to get some flavor of sleep() , you would have to add various other things in the language first in order to support it well, we already have timers in the spec, in the Atomics. |
03:20 | <Jack Works> | Maybe I'm blanking since I forget proposals. Has anyone suggested an operator like f??.() that is equivalent to typeof f === 'function' ? f() : f ? rather than this, I have a lot of code doing things like expr ? f(expr) : undefined |
03:27 | <Jack Works> | Are there particular design mistakes we might make with scheduler? since .wait is not available for now, I don't think await scheduler.postTask(() => {}, { delay: time }) is better in any sense than await new Promise(r => setTimeout(r, time)) in this use case. The old classic one is even shorter. await scheduler.postTask(() => {}, { delay: time })
await new Promise(r => setTimeout(r, time))
await scheduler.wait(time) // but it is not here yet!
|
03:32 | <Jack Works> | I wonder how far just pattern matching gets you in that domain. (might be asking a lot from the type inference) a lot, but we may not get all the features mentioned below (since the committee think it contains too much things) match (userData) {
when { type: 'a', field: Number and > 0 and < 100 }: ...
default: ...
}
|
03:42 | <Jack Works> | JSON numbers don't have a limit on numbers, you can already represent bigint numbers. you just need a special serializer. JSON.stringify({ x: 999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999n
}, (key, val) => typeof val === 'bigint' ? JSON.rawJSON(val) : val)
|
10:38 | <Danielle Church> | JSON numbers don't have a limit on numbers, you can already represent bigint numbers. you just need a special serializer. JSON.stringify({ x: 999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999n
}, (key, val) => typeof val === 'bigint' ? JSON.rawJSON(val) : val)
you could establish a convention like serializing bigints with an e-0 suffix, which is highly unlikely to occur in nature; most serializers probably wouldn't include a zero exponent at all, or else they'd use e+0 . Not to mention, typical numeric formatters using the exponent output in scientific notation, which includes a decimal point and thus is syntactically distinguishable from JSON.stringify(15n) === "15e-0" . |
11:32 | <annevk> | Speaking of JSON, https://www.mlsec.org/docs/2024b-asiaccs.pdf might be of interest |
14:47 | <Michael Ficarra> | why are we getting so much spam on github lately?! |