ECMAScript仕様輪読会 #90
前回: ECMAScript仕様輪読会 #89
Cosenseの招待リンク: https://scrapbox.io/projects/esspec/invitations/85b96c9fa718ce5185e307196ed8fb53
connpass: https://esspec.connpass.com/
Discord: https://discord.gg/59S3y6weQj
ES Spec Draft: https://tc39.es/ecma262/
multipage: https://tc39.es/ecma262/multipage/
資料: https://speakerdeck.com/syumai/ecmascriptshi-yang-wodu-munonibi-yao-nazhi-shi-daiziesutoban
読み物リスト
Twitter hashtag: #esspec
便利ツール
esspec-memo: https://tars0x9752.github.io/esspec-memo/esspec.html
Scrapbox Codeblock Generator: https://vzvu3k6k.github.io/scrapbox-codeblock/
TC39 Terminology: https://github.com/tc39/how-we-work/blob/main/terminology.md
esmeta playground: https://es-meta.github.io/playground/
時事ネタ
自己紹介 (近況報告)
syumai syumai.icon
Twitter: https://twitter.com/__syumai GitHub: https://github.com/syumai
Go / TSを書いて暮らしてます
YAPC::FukuokaとCloudflare Workers Tech Talks Fukuokaに来てます
iwatsurut
とくに、イベントもなく過ごしています。
igrep(山本悠滋)
https://github.com/igrep/
また仕様を修正するpull requestを送ったが、変更を要請されどう直すか考え中
https://github.com/tc39/ecma262/pull/3716
maru。(まる)
https://x.com/sbleru
主にTSで仕事してます。React, Node
最近はブラウザの深い部分触る開発多い
前回のあらすじ
https://gemini.google.com/share/1f8f9c1851d9
https://x.com/petamoriken/status/1983157584245993493?s=20
今回のメモ
code:js
function* genOne() {
while (true) {
yield 1;
}
}
console.log(Number.MAX_SAFE_INTEGER);
// RangeErrorを返して欲しいが、通常想定される時間内に終わらない
console.log(Math.sumPrecise(genOne()));
code:js
function* genNotANumber() {
yield "a";
}
console.log(Math.sumPrecise(genNotANumber()));
// Firefox
// Uncaught TypeError: values passed to Math.sumPrecise must be numbers
code:js
const iv1 = NaN, 1; // NaN
const iv2_1 = -Infinity, Infinity; // NaN
const iv2_2 = 0, -1, 1, Infinity; // Infinity
const iv3_1 = Infinity, -Infinity; // NaN
const iv3_2 = 0, -1, 1, -Infinity; // -Infinity
const iv4 = -0; // -0
code:js
// https://github.com/tc39/proposal-math-sum?tab=readme-ov-file#proposal
let values = 1e20, 0.1, -1e20;
values.reduce((a, b) => a + b, 0); // 0
Math.sumPrecise(values); // 0.1
(2 ** 30)秒 = 34.0255519 年
2**10 = 1024
1ループ micro(10**-6) 秒でも、2**53-1だと、100年以上かかると思われます。
proleptic Gregorian calendar
https://ja.wikipedia.org/wiki/先発グレゴリオ暦