15:02
<eemeli>
Could the order of my two items in today's first session be flipped around? If we get through Trim Specific Characters in less than its allocated 30 mins, I'd love to be able to use that time for the Un-Annex-B String.prototype.substr continuation.
16:06
<Rob Palmer>
Please share a link to spec.html slides for the notes
16:07
<James M Snell>
for some context, for those who don't know, Dan Carney (currently presenting) is new to the committee but he's been a core contributor to v8 for quite some time... so this this coming from the pov of an engine implementer. And yeah, I'll get a link to the slides
16:08
<James M Snell>
Slides: https://drcarney66.github.io/ecma-formal/slides.html#1 Link also added to notes
16:10
<Chris de Almeida>
please add a link to the slides to the agenda md as well 🙏
16:17
<Michael Ficarra>
is this the esmeta double debugger or something else?
16:17
<Michael Ficarra>
because it looks basically identical to the esmeta debugger
16:17
<Chris de Almeida>
I think it's basically that, but different
16:17
<Chris de Almeida>
sort of why I am on the queue re: prior art
16:18
<nicolo-ribaudo>
esmeta must have been in the training set :)
16:18
<bakkot>
the lean formalization is much more interesting to me than the executable part
16:18
<Chris de Almeida>
funny, but also more likely than not!
16:19
<Michael Ficarra>
@bakkot I think that's pretty much just generated by SpecTec, it's the SpecTec that he's generating with Claude
16:23
<Chris de Almeida>

SpecTec that he's generating with Claude

is it?

16:23
<bakkot>
he described both as generated
16:26
<Chris de Almeida>
ok I am confused about tooling vs output
16:27
<jmdyck>
my guess is Claude handles spec.html -> spectec, and some rust code handles spectec -> lean
16:27
<bakkot>
also I would like to see this applied to the user code annotation, though unfortunately that's mostly inferred by ecmarkup, not in the code. could just translate that algorithm from ecmarkup though. (or maybe have it have a mode where it marks up the spec, maybe.)
16:27
<Chris de Almeida>
https://github.com/drcarney66/ecma-formal
16:30
<Michael Ficarra>
I can confirm all of these claims that DCY is making about esmeta
16:31
<Michael Ficarra>
they almost certainly would have done it this way if they were starting today, it's not as powerful, it's not as high of an assurance, and it's missing large parts of the spec
16:48
<bakkot>
https://github.com/Wasm-DSL/spectec/tree/main/spectec
16:48
<bakkot>
(I believe)
16:51
<Michael Ficarra>
my editorial prerogative of making the spec better for machine consumers is finally paying off 😎
16:51
<eemeli>
it's interesting and possibly relevant that there's some current discussion ongoing at WHATWG considering using Lean as an alternative basis for the HTML spec.
16:53
<nicolo-ribaudo>
Ah Microsoft Word, the well-known machine readable format
16:53
<jmdyck>
there's a wide spectrum of what constitutes "machine-readable"
16:54
<Aki>
https://www.iso.org/schema/isosts/
16:55
<Aki>
oh wait that's an old link
16:55
<Aki>
ignore that
16:56
<bakkot>
yeah although the machines consumers have been getting better at reading much faster than the spec has been getting more readable
16:56
<Michael Ficarra>
meeting in the middle is fine by me
16:56
<Aki>
The ISO coding guidelines ed 2.1 link is a PDF
16:56
<bakkot>
(also credit to jmdyck for carrying that effort for much longer than the editors have)
16:58
<nicolo-ribaudo>
Meeting ended by host?
16:58
<bakkot>
um
16:58
<Chris de Almeida>
yeah... Rob left and clicked the wrong button
16:58
<Justin Ridgewell>
Lol
16:59
<eemeli>
Guess we're done then?
16:59
<nicolo-ribaudo>
Am I being censored?
16:59
<Chris de Almeida>
calling him...
16:59
<Chris de Almeida>
he is returning
16:59
<Justin Ridgewell>
We can just rejoin
16:59
<Olivier Flückiger>
it's up again
16:59
<Justin Ridgewell>
We don't need him
17:00
<eemeli>
Re-joining seems to be the fix.
17:00
<Rob Palmer>
Meeting restarted. Apologies all!
17:02
<mgaudet>
(I did literally the same thing last week -- it's a dangerous button that leave one :P)
17:20
<sffc>
TCQ keeps crashing for me (turning into a black screen). Here is the error from the web inspector Uncaught Error: Minified React error #185; visit https://react.dev/errors/185 for the full message or use the non-minified dev environment for full errors and additional helpful warnings. at hi (react-CQEYGgFt.js:8:27494) at pi (react-CQEYGgFt.js:8:27067) at Yo (react-CQEYGgFt.js:8:52193) at Ko (react-CQEYGgFt.js:8:52022) at Gc (react-CQEYGgFt.js:8:91670) at Ol (react-CQEYGgFt.js:8:106759) at Dl (react-CQEYGgFt.js:8:106643) at Ol (react-CQEYGgFt.js:8:107523) at Dl (react-CQEYGgFt.js:8:106643) at Ol (react-CQEYGgFt.js:8:107523)
17:23
<bakkot>

it's not going to use the dollar anchor to know that it will it can search from right to left. It will just search linearly across the entire string

is this actually true? for fixed-length regexes? I kind of assumed that would be optimized

17:24
<Chris de Almeida>
this smells like an extension interfering
17:25
<bakkot>
probably Michael Ficarra should turn off minification though, that's not really valuable here
17:27
<Michael Ficarra>
@bakkot but my bandwidth bill!
17:27
<bakkot>
... where actually is it hosted, now that you mention it?
17:28
<Michael Ficarra>
GCP
17:28
<Michael Ficarra>
(it costs on the order of $0.10 per meeting to run nowadays)
17:29
<bakkot>
I strongly suspect you could fit this on cloudflare's free tier, not to sound like a shill
17:29
<nicolo-ribaudo>
(< TDZ?)
17:29
<Michael Ficarra>
"I want a Unicode text trim, but I don't want it to change" sounds incoherent to me
17:29
<Michael Ficarra>
if you reach for a text operation, you want it follow Unicode updates
17:32
<nicolo-ribaudo>
Stage 2 feedback before asking for Stage 1 happens when the slides already show a fully concrete solution before Stage 1 :)
17:33
<Chris de Almeida>
it sort of... always happens? the main thing is to not get too bogged down in later-stage things when time is constrained
17:40
<Michael Ficarra>
great self-management of the queue here by EAO, I love to see it
17:44
<Chris de Almeida>
makes our job easier as well 🙂
17:46
<Michael Ficarra>
woooooow we live in different worlds
17:47
<Michael Ficarra>
I forgot that substr/substring existed until the agenda item was added
17:47
<Chris de Almeida>
new <slice|substring|substr> who dis
17:54
<bakkot>
you can pry .blink from my cold dead hands
17:54
<bakkot>
more seriously, actually removing those would genuinely break a lot of sites, I am confident
17:54
<Michael Ficarra>
maybe if a W3C spec started documenting the String.prototype HTML methods from Annex B, we could drop them from our spec
17:54
<Michael Ficarra>
but they have to be documented somewhere
17:55
<Michael Ficarra>
I don't think anyone is suggesting removing them from browsers, just our spec
17:55
<nicolo-ribaudo>
Oh I like this, making it somebody else's problem
17:55
<bakkot>
EAO: So the flip side of this is that do we really need to keep in Annex B all of the specifications for what happens when you call the HTML padding functions in. When I was looking into this their usage rates overall seemed minuscule. So it feels to me I don't know if we've ever done this. But to possibly actually do the thing that MDN for example threatens that we might do and consider removing the specification from even Annex B.
17:56
<Michael Ficarra>
somebody else's authority
17:56
<bakkot>
oh, I misunderstood
17:56
<bakkot>
I thought the suggestion was to drop them from the spec and also browsers, since the usage is minimal
17:56
<bakkot>
if they're not being dropped by browsers it doesn't really matter what spec they're in or what usage is
17:56
<nicolo-ribaudo>
I understood the same
17:57
<Michael Ficarra>
I also could have been mistaken, but actually removing them from browsers seems so unrealistic that my brain didn't allow me to understand the proposal in that way
18:00
<Richard Gibson>
if we manage to incorporate Annex B syntax into the main spec, I'd love to spin out the additional properties it defines into a new spec, so ECMA-262 is ECMAScript, ECMA-402 is ECMAScript Internationalization, and ECMA-600 or whatever is ECMAScript Legacy Web Browser Features
18:01
<Aki>
move quickly enough and it's ECMA-437
18:05
<bakkot>
I think escape and unescape are good candidates to move into the main spec and make non-optional, much as I loathe them
18:06
<Richard Gibson>
yeah, also missing only from engine262
18:08
<bakkot>
probably also trimStart and trimEnd, unfortunately, per 70k github matches https://github.com/search?q=%28lang%3Ajs+OR+lang%3Ats%29+%28%22.trimLeft%28%22+OR+%22.trimRight%28%22%29&type=code
18:08
<bakkot>
that leaves us with the string HTML-construction methods, Date.prototype.{getYear,setYear,toGMTString}, and RegExp.prototype.compile
18:09
<bakkot>
I don't think it would be worth maintaining a separate document just for those
18:10
<Richard Gibson>
I think the "maintenance" would be less even than ECMA-404
18:10
<bakkot>
we touch it not-infrequently for editorial conventions
18:11
<bakkot>
and would need to ensure AOs referred to it are kept up to date, etc
18:12
<Richard Gibson>
it wasn't even ecmarkup until a year ago, and since then has been changed twice: https://github.com/tc39/ecma404/commits/main/
18:13
<bakkot>
sorry, I meant we touch annex B not infrequently
18:21
<ljharb>
trimStart and trimEnd aren't in annex b i think? trimLeft/trimRight may be
18:22
<bakkot>
sorry, yes, those are what I meant
18:22
<bakkot>
that's what the github search is
18:59
<Rob Palmer>
We begin in one minute!
19:15
<ljharb>
i don't see a temp check ftr
19:16
<Aki>
ljharb: not doing a TCQ temp check
19:16
<ljharb>
ah k
19:16
<Aki>
this is a generic "please speak up"
19:21
<Chris de Almeida>
we've had THIRTEEN unique note helpers at this meeting so far. seems like a record, but regardless, strong work. can we get to 15? 20? 🤔🤔🤔
19:35
<bakkot>
re: garbage for iterator protocol, https://bugzilla.mozilla.org/show_bug.cgi?id=2085932
20:11
<chipmorningstar>
Count leading zeros on a bigint could be very fast, since the value is always +∞
20:12
<James M Snell>

just kind of curious while we're on the topic... would a BitSet container type be worthwhile...

const bs = new BitSet(...);
bs[0] = true;
bs[1] = false;
console.log(bs.count);  // 1   (essentially popcount)
console.log(bs.byteLength); // 1
20:12
<bakkot>
https://matrixlogs.bakkot.com/TC39_Delegates/2023-11-27#L179
20:12
<bakkot>
https://matrixlogs.bakkot.com/TC39_Delegates/2025-02-21#L143
20:14
<James M Snell>
so the answer is possibly yes... at least, there'd be some support
20:19
<bakkot>
Yeah; I'd be kind of tempted to do it as a TA-like wrapper of an ArrayBuffer? but maybe the idea would horrify engines. Also we'd need some sort of .equals() for that to work
20:19
<bakkot>
which you were gonna do anyway
20:21
<jschoi>
In the past, I saw some appetite from engine people like Shu for other efficient basic containers too. In particular, queues and stacks, since JS arrays try to do both and their implementations are cursed.
20:22
<James M Snell>
yeah, ArrayBuffer back definitely. I wouldn't make it a TA, but easily backed by an ArrayBuffer
20:23
<rbuckton>
I was thinking the same thing. We would definitely need the ability to set more than 32 bits
20:23
<Justin Ridgewell>
x >>> 0, I think
20:26
<James M Snell>
yep... (side note, I need to come back to my TA findWithin and concat proposals... but I also very much want compare/equals)
20:27
<bakkot>
I am personally much more excited about equals than those ones although they are also good
20:27
<bakkot>
equals has the annoying question of what to do about float TAs, my solution to which is, don't put it on float TAs
20:28
<peetk>
why on earth would we coerce non-numbers. why are we even talking about this
20:28
<ljharb>
historical baggage
20:28
<bakkot>
we are about to agree to coercing non-numbers
20:29
<peetk>
feels crazy to me
20:29
<James M Snell>
this makes me sad but I can't strongly defend it
20:30
<bakkot>
I'm sad about it but I don't even disagree with the decision
20:30
<ljharb>
ftr i'd be happy to make a proposal to audit all math methods - or even ALL methods - and try to make a sweeping change all at once to reduce the amount of coercion in legacy methods, if browsers are willing to try it in a general sense
20:31
<bakkot>
it's probably not worth doing in all methods but I bet you could get buy-in for doing it in TA/Atomics methods specifically since that set of coercions very regularly causes engine exploits
20:32
<bakkot>
not worth doing in the sense that too much stuff depends on it and we don't have a good way to identify which we could get away with
20:42
<ljharb>
so, Math + TA + Atomics, is your suggestion?
20:43
<rbuckton>
Mathieu Hofman: It's technically feasible to do that today if you create a new AbortSignal and overwrite it's [[Prototype]].
20:43
<rbuckton>
However, it's still reachable via EventTarget.addEventListener.call
20:46
<waldemar>
If that's web-compatible, that would be a good thing to do. My worry is that it's probably not web-compatible, and if it's not web-compatible then it would not be worth the breakage. It is worth doing on TA/atomics.
20:48
<Mathieu Hofman>
You'd also have to create a new AbortSignal to somehow hide the original AbortSignal.prototype too. An denying access to EventTarget.prototype is kinda a losing battle
20:50
<ljharb>
totally agree it wouldn't be worth breakage; basically any method that caused problems would have to be removed from the proposal
20:57
<waldemar>
For TA/atomics, throwing on non-Number/BigInt inputs would be good. Throwing on numeric inputs out of range of the type would be really bad. You want to be able to store -1 into an unsigned byte. That's what happens, for example, if you do an atomic decrement of an unsigned byte that has the value 0.
20:57
<waldemar>
It get the value 0xFF, which is correct. We need to keep that behavior.
21:27
<ljharb>
that makes perfect sense, and imo isn't really "coercion" in the sense the new policy means anyways - it's normalizing the domain of numerics
21:28
<ljharb>
i'll put something together for the next plenary
21:30
<bakkot>
somewhat less clear that uint8array[0] = NaN should write 0, but I agree the important part is the coercion from other types
21:40
<bakkot>

you can sort of get what you want by eagerly adding your own capturing listener that calls stopImmediatePropagation and re-dispatches on the next tick, but

  • if someone has passed your signal to .any, events on the resulting signal still fire eagerly
  • the event will not appear as trusted to the other listeners

first thing seems very hard to avoid.

21:40
<bakkot>
https://gist.github.com/bakkot/90e5796550ef0bb9ef7a6de7b6dcb7d3
21:56
<Richard Gibson>
I don't want TAs to stop coercing; strings are conveniently accepted by both number- and bigint-based types that respectively reject bigints and numbers
22:37
<bakkot>
the main thing I care about is new Uint8Array(new ArrayBuffer(10), { valueOf: () => { console.log('hi!'); return 2 } }) not the x[a] = b syntax
22:37
<bakkot>
presumably you are OK with that case not coercing?
22:39
<Richard Gibson>
yes, I can't think of any appropriate use case for that
22:40
<Richard Gibson>
but it's also extremely common all across ECMAScript functions, so cleaning up just a few corners seems basically pointless
22:41
<bakkot>
the reason to care about it for TA/ABs and Atomics specifically is that coercion in those APIs very regularly causes engine exploits, which is not true of most of the other APIs that do coercion
22:44
<Richard Gibson>
x[a] = b is more relevant to those exploits than constructor argument handling, which completes before getting to sensitive steps
22:45
<bakkot>
sorry, constructor was just an example, I meant to include e.g. .subarray, copyWithin, etc
22:45
<bakkot>
https://bugzilla.mozilla.org/show_bug.cgi?id=982974
22:45
<bakkot>
https://bugzilla.mozilla.org/show_bug.cgi?id=1326521
22:46
<Richard Gibson>
but if the concern is exploits, then the important aspect is not running user code, which is a weaker position than "no coercion". In particular, rejecting non-primitives while still allowing booleans/strings/etc. would satisfy it.
22:46
<bakkot>
https://blog.kiprey.io/2021/03/CVE-2018-16065/ is in BigInt64Array.of even
22:46
<Richard Gibson>
yeah, I still care about string→{number,bigint} coercion there
22:47
<bakkot>
just rejecting non-primitives is the main part I care about yes
22:47
<bakkot>
would be nice to get that in x[a] = b too
22:47
<Richard Gibson>
agreed