2024-07-01 [08:41:02.0592] > <@ljharb:matrix.org> https://github.com/tc39/ecma262/pull/1314 is rebased and ready for a merge label :-) ready to merge [10:31:12.0341] thanks! i'm planning to put up an HTML PR before merging it, but hopefully I can do both today 2024-07-02 [13:48:13.0620] i assume yall don't mind if i push up a Meta commit that only changes scripts/check-form.js? [13:48:22.0707] if you do, i can make a PR, just takes longer [14:13:50.0371] unless there's a better reason than speed, I prefer everything go through PR to 262 [14:19:39.0685] btw i am PTO rest of the week [14:21:42.0027] sounds good, I’ll make a PR tonight or tomorrow 2024-07-03 [12:58:01.0903] Is there an editor call today? [12:59:17.0005] should be, unless Kevin can't make it [13:02:22.0700] (I couldn't remember when his leave started.) [16:05:20.0358] @ljharb:matrix.org IPR check failure 😭 https://github.com/tc39/ecma262/actions/runs/9785832817/job/27019602418?pr=3365 [16:07:26.0904] some github API 404 [16:46:50.0139] yes, it’ll fail until i land the fix that you want to go through a pr, that i haven’t had time to put up yet :-) [16:47:40.0651] (It’s that the repo finally got enough shas in forks to have a longer short sha than git can generate locally; commit is ready but internet is out) 2024-07-04 [19:48:05.0284] https://github.com/tc39/ecma262/pull/3366 2024-07-10 [14:03:00.0146] i will be missing this and the next several editor calls 2024-07-17 [09:06:07.0633] @shuyuguo:matrix.org editor call? [09:10:42.0632] omw 2024-07-18 [21:18:42.0946] i put https://github.com/tc39/proposal-is-error/issues/7 for advancement on the agenda; it'd be great if yall could review both https://tc39.es/proposal-is-error/ and https://github.com/tc39/proposal-is-error/pull/11 (they're small) [00:42:18.0056] editorially lgtm w/ proxy piercing removed 2024-07-24 [09:13:04.0879] the Intl.DurationFormat proposal needs a lot of editorial help [09:14:31.0114] I feel kinda bad just ignoring the editorial issues and letting it further drag down 402 [10:23:29.0136] what sort of things? [12:36:32.0488] just a lot of little things [12:36:44.0330] like returning {-1,1,0} instead of a spec enum [12:37:20.0372] and bespoke phrasing like "a new X Record with all fields set to Y" [12:37:40.0628] nothing catastrophic, it's just death by 1000 cuts for 402 [12:38:26.0404] but improving 402 is such an overwhelming task, I'm just not interested in it [12:38:51.0558] even more than when we first inherited 262 [12:56:53.0573] honestly with 10 different fields, for an operation only done once, I don't hate the "with each field set to 0" phrasing [14:34:33.0801] is nobody else coming to editor call today? [14:41:58.0788] i'm traveling with spotty internet [14:59:41.0870] reminder that https://github.com/tc39/ecma262/pull/2962 needs a review if anyone finds time [14:59:58.0272] I really want to prioritise that one 2024-07-26 [17:38:18.0251] I've updated the spell-checking PR to do what we previously discussed: https://github.com/tc39/ecma262/pull/3335 [17:40:39.0923] it now uses a GitHub action to add annotations to lines that use words other than dictionary words and words that already exist in the document (and are not composed of such words) [17:41:15.0255] I'd appreciate a review, though I don't think the action will run until it's been merged [17:43:13.0349] also it wouldn't output any warnings anyway because the PR doesn't introduce any misspellings, but we could try that out with a follow-up PR [17:52:59.0223] > <@michaelficarra:matrix.org> I'd appreciate a review, though I don't think the action will run until it's been merged never mind, it does run! [18:21:12.0178] commented [18:21:26.0168] you could introduce a misspelling just so we could see it work, and then revert? [18:59:52.0266] aha! it works! [19:03:39.0433] and the view from the action itself [20:38:16.0099] You remember how in PR 3361, the second commit changed "a |Foo| Contained within _code_" to "any |Foo| _x_ such that _code_ Contains _x_ is *true*" (https://github.com/tc39/ecma262/pull/3361/commits/f2b2d524)? I just discovered that's invalid, because Contains takes a *symbol*, not a Parse Node. [20:40:34.0547] I didn't notice it before, because I can't analyze the algorithm fragments in Annex B. I noticed it now because I merged main into my monkey_patch PR, putting those fragments into 'mainline [20:40:42.0925] * I didn't notice it before, because I can't analyze the algorithm fragments in Annex B. I noticed it now because I merged main into my monkey\_patch PR, putting those fragments into 'mainline' algos. [20:40:56.0159] * )I didn't notice it before, because I can't analyze the algorithm fragments in Annex B. I noticed it now because I merged main into my monkey\_patch PR, putting those fragments into 'mainline' algos.) [20:41:05.0416] * (I didn't notice it before, because I can't analyze the algorithm fragments in Annex B. I noticed it now because I merged main into my monkey\_patch PR, putting those fragments into 'mainline' algos.) [20:42:47.0670] (Of course, the prior wording was presumably invalid too, but more obscurely so.) 2024-07-30 [14:57:46.0942] @shuyuguo:matrix.org I want to work to get the spelling PR over the line with you at next week's editor call [15:40:44.0706] ok [16:38:39.0774] Michael Ficarra: we need to talk about how much heavy lifting we want "Suspend" and "Resume" to do at the next call, wasm wants to do something that makes me deeply uncomfortable [16:41:40.0337] https://github.com/tc39/ecma262/pull/2962 eliminates "Suspend" and "Resume" steps, if that helps. [16:42:25.0188] the recap is wasm wants to specify a way to suspend its execution in a web embedding _without_ touching the wasm spec, and wants to do this by suspending and resume 262 execution context. in a web embedding, you gotta call into wasm from JS, so you always have a JS execution context that called into wasm, let's call this the entry execution context. say you're in the middle of a wasm execution, i.e. JS -> Wasm the question is: if there is a step that says "Suspend the running execution context" during wasm execution, where the running execution context is the entry one, do we understand that to mean "magically pauses whatever stuff wasm is doing such that when we say Resume, that it'll resume into the wasm machinery"? [16:42:43.0045] i feel like the answer is clearly no but we don't have a lot of formalism around Suspend and Resume [16:42:56.0180] jmdyck: thanks, let me read that [16:47:01.0639] i don't think the transfer-of-control clarification helps this question, which is that if another spec embeds JS, and is running its own machinery, then removes a JS execution context in the middle of its _own_ steps, do we think that pauses at that point in the embedder's spec's machinery [16:47:19.0479] In that example, where is the step that says "Suspend the r.e.c."? [16:47:40.0297] let me see if i can spell out a full example: [16:48:48.0931] 1. JS calls into wasm. Let the REC at this point be the "entry EC" 2. wasm does its own thing 3. wasm calls what it calls a "host function", which is a JS function 4. before the host function pushes a new EC to run itself, the REC is still the entry EC. At _this_ point, there's a step that says "Suspend the REC" [16:48:58.0490] what happens when we resume it? [16:51:34.0021] When wasm calls the host function, the host function is to operate with respect to some pre-existing realm? [16:51:51.0997] i don't think the realm has to do with anything here, it's the same realm as the entry realm [16:52:04.0929] wasm calls imported JS functions and web API functions "host functions" [16:53:06.0029] my question is: the entry EC is suspended in the middle of wasm doing its own thing in step 2. when we resume, is it reasonable to say that we'll magically return to step 3 and then 2? [16:54:13.0962] that is, does the Suspend verb have the power to capture embedder spec steps as a continuation? this seems too powerful to me if it had that power 2024-07-31 [17:00:39.0362] So from the ES spec's PoV, the JS -> wasm interface is some non-standard host-provided functions? [17:01:05.0270] yes, it is this spec: https://www.w3.org/TR/wasm-js-api-2/ [17:01:09.0652] how kosher it is idk, i didn't review it [17:06:40.0175] https://www.w3.org/TR/wasm-js-api-2/#run-a-host-function 's step 5 invokes ES's Call operation, that's how control shifts back to ES semantics? [17:12:38.0337] So Call invokes the (host) function's [[Call]], which is (say) 10.2.1, which invokes PrepareForOrdinaryCall, which is where the stack manipulation happens. [17:33:04.0936] ... hm, if I understand correctly, your questions are independent of what the host function *does*, you're just asking about what happens when the host function returns? [17:42:21.0467] "my question is: the entry EC is suspended in the middle of wasm doing its own thing in step 2. when we resume, is it reasonable to say that we'll magically return to step 3 and then 2?" Modulo some terminology, and assuming I'm not misunderstanding, yes, I think it's reasonable. [17:59:56.0227] The ES spec doesn't explicitly consider the case where an ordinary function calls a non-standard exotic function which then calls an ordinary function, but I don't think the spec has a problem with it. [18:01:13.0257] The spec assumes that the exotic function isn't mangling the execution context stack somehow. (I.e., there are Asserts to something like that effect.) [18:02:05.0396] * The spec assumes that the exotic function isn't mangling the execution context stack somehow. (I.e., there are Asserts to something like that effect.) I suppose it could be more explicit about that, but I don't think that would change the answer to your question. [19:39:14.0981] A different way to look at it: Implicit in the ES spec (and Infra-based specs) is that when algorithm A invokes algorithm B, algo A waits, doing nothing, until algo B returns, at which point algo A picks up right where it left off. (Note that this is distinct from Suspend and Resume, which are verbs that apply to execution contexts, not algos.) [19:39:19.0553] So when https://www.w3.org/TR/wasm-js-api-2/#run-a-host-function invokes the Call operation (to execute the host function), the understanding is that the 'run a host function' algorithm will wait there, doing nothing, until the Call operation returns, at which point the 'run a host function' will pick up where it left off. [19:41:33.0604] So it's not magical, it's just the normal meta-semantics of one algo invoking another. [19:43:34.0345] And I don't think it has much to do with execution contexts (or Suspend and Resume). [19:52:28.0099] You're right that 2962's clarification of transfer-of-control doesn't help with this question, because the question doesn't involve a transfer-of-control in 2962's sense. But 2962 does eliminate "Suspend" and "Resume" as things you can do to execution contexts, which might help in thinking about the question. [19:58:12.0807] You ask: "if another spec embeds JS, and is running its own machinery, then removes a JS execution context in the middle of its own steps, do we think that pauses at that point in the embedder's spec's machinery?" What do you think would remove an execution context? [21:38:51.0553] > <@jmdyck:matrix.org> You ask: "if another spec embeds JS, and is running its own machinery, then removes a JS execution context in the middle of its own steps, do we think that pauses at that point in the embedder's spec's machinery?" What do you think would remove an execution context? if the wasm machinery has some operation that explicitly Suspends the execution context [21:39:00.0848] like, it normatively refers to the 262 notion of EC and Suspend [21:40:42.0886] > <@jmdyck:matrix.org> A different way to look at it: Implicit in the ES spec (and Infra-based specs) is that when algorithm A invokes algorithm B, algo A waits, doing nothing, until algo B returns, at which point algo A picks up right where it left off. (Note that this is distinct from Suspend and Resume, which are verbs that apply to execution contexts, not algos.) the thing that's conceptually happening is that algo B suspends, returns a Promise to the _caller_ of algo A, not a normal push/pop thing [21:41:59.0186] > <@jmdyck:matrix.org> ... hm, if I understand correctly, your questions are independent of what the host function *does*, you're just asking about what happens when the host function returns? no, i'm asking what if the host function Suspends its caller EC [21:44:07.0901] wasm is trying to write up the spec for JSPI, which suspends the wasm stack [21:44:14.0654] anyway i'll explain more in the next call [21:45:02.0693] i think the way they'd currently like to do it is not a good idea, as it imputes too much power to the Suspend verb that allows arbitrary algos to be suspended and resumed in a way we, as 262 editors, ever intended the Suspend verb to be used [03:40:53.0627] Ah, so when you said "without touching the wasm spec", you meant just the core wasm spec, I thought you meant the wasm-js-api spec too. [03:47:09.0960] Normatively referring to 262's Suspend is a bit tricky, since 262 doesn't define Suspend. [03:57:18.0699] * Normatively referring to 262's Suspend is a bit tricky, since 262 doesn't define Suspend (and might have a hard time defining it in a way that's consistent with all uses). [04:08:59.0974] "what if the host function Suspends its caller EC": Hm, there's at least 3 ECs at play here, for: 1) the JS code that calls the exported Wasm function; 2) the wasm function (which is presumably exotic in ES terms); 3) the host function. So when you say "the host function Suspends its caller EC", do you mean EC #2? But it's already Suspended. If you mean EC #3, what would that even mean? How would you write a JS function to accomplish that? Or are they assuming that the host function (for this purpose) is exotic and they get to define its semantics? [06:25:11.0893] I've now read about JSPI. It sounds like the host function isn't anything special, it just returns a Promise. And the question has to do with what the JSPI machinery does when that happens. [06:52:44.0104] Looking at [JSPI](https://github.com/WebAssembly/js-promise-integration/blob/main/proposals/js-promise-integration/Overview.md), I'm confused by the definition of `suspending function`. It says "Let `context` refer to the execution context that is current ..." which makes me think this is an ES execution context, but then step 2 is "Traps if context's state is not Active[caller] for some caller", but an ES execution context doesn't have a `state` component. It's got a `code evaluation state` component, but the ES spec isn't specific about its nature. So where does this "Active[caller] for some caller" come from? [06:53:51.0253] I thought maybe Wasm had its own definition of execution context... it has a definition for "context", but that doesn't have a `state` component either. [10:25:44.0294] (Asked https://github.com/WebAssembly/js-promise-integration/issues/42)