Twitter hashtag: #esspec
便利ツール
時事ネタ
6/27にES2023が承認された
tars0x9752.icon うれしい
location-sensitive: ファイルの先頭だけで認識されるっぽい
"start of a Script or Module"で有効らしい
ご連絡
再来週は主催者が京都に旅立っているためskipしたいです…🙏
自己紹介 (近況報告)
syumai
来週引っ越し
準備が全然できてない
最近自分のOSSに手を入れられて無くてしんどみ
tars0x9752 (たーず / naoki aoyama) tars0x9752.icon
手首、良くなったり悪くなったりで結局まだ治ってない
yebis0942 (えびす) yebis0942.icon
Go, Reactを書いて暮らしています
Python入門してます
npm + nodenvみたいな機能を提供してくれる
masashi
React, Next.jsを書いてます
初参加のためちょっと緊張してます
antisatori
フィヨルドブートキャンプで学習している無職です
フロントエンドが好きでReactをよく書いてます
yasumura / harupiyo
Google Chrome のバグ報告しました
読み方のご説明
draft版を読んでいます
connpassの参加順に「音読→訳す→コメントとか相談とか」を繰り返していく
前回のあらすじ
Agent Cluster のはなし
Agent Cluster はただの Agent のまとまり
embedding ってやつが Agent 管理してそう
SharedArrayBuffer
他の Agent にメモリ共有できる
Forward Progress
Processing Model of WeakRef and FinalizationRegistry Targets
今回の範囲
9.10 Processing Model of WeakRef and FinalizationRegistry Targets の 9.10.2 Liveness から
Liveness
hypothetical WeakRef-oblivious
とは…?
仮説
集合SはあるWeakRef, WeakMap, WeakSetのキーとして使われている値ではないか
確かめたいこと
WeakRefとWeakMapの関係
WeakRefが呼んでいるAddToKeptObject
agent単位でリストを保持していそう
集合S(objectやsymbolの集合)がliveであるとは
...
observing the value being used as key in a Map
なぜMapなのか?
Mapが使っている同一性検証アルゴリズムを例として挙げている?
WH: I'd like to re-raise the issue I raised yesterday. から
StackOverflowの例
code:js
// GC発動したら "cleared"
{
const o = {};
const w = new WeakRef(o);
setInterval(() => {
console.log(w.deref() ? "kept" : "cleared")
}, 1000);
}
// GC発動しても "kept"
{
const o = {};
const w = new WeakRef(o);
setInterval(() => {
console.log(w.deref() && w.deref() === o ? "kept" : "cleared")
}, 1000);
}
// GC発動しても "kept!"
{
const o = { msg: "kept!" };
const w = new WeakRef(o);
setInterval(() => {
console.log(w.deref() && w.deref() === o ? w.deref().msg : "cleared")
}, 1000);
}
// GC発動するとTypeError
{
const o = { msg: "kept!" };
const w = new WeakRef(o);
setInterval(() => {
console.log(w.deref().msg);
}, 1000);
}
8VM440:5 Uncaught TypeError: Cannot read properties of undefined (reading 'msg')
{
const o = { msg: "kept!" };
const w = new WeakRef(o);
setInterval(() => {
console.log(o, w.deref().msg);
}, 1000);
}
わかりやすい例
code:js
{
const a = {}, b = {};
const wa = new WeakRef(a), wb = new WeakRef(b);
const lookup = new WeakMap(a, "b kept"], [b, "a kept");
setInterval(() => {
console.log(wa.deref() ? lookup.get(b) : "a cleared"); // kept
console.log(wb.deref() ? lookup.get(a) : "b cleared"); // kept
}, 1000);
}
{
const a = {}, b = {};
a.b = b; b.a = a;
const wa = new WeakRef(a), wb = new WeakRef(b);
const lookup = new WeakMap(a, "b kept"], [b, "a kept");
setInterval(() => {
console.log(wa.deref() ? lookup.get(wa.deref().b) : "a cleared"); // cleared
console.log(wb.deref() ? lookup.get(wb.deref().a) : "b cleared"); // cleared
}, 1000);
}