Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consolidate agent/agent cluster definitions with ES spec? #28

Open
domenic opened this issue Jun 14, 2017 · 7 comments
Open

Consolidate agent/agent cluster definitions with ES spec? #28

domenic opened this issue Jun 14, 2017 · 7 comments

Comments

@domenic
Copy link
Member

domenic commented Jun 14, 2017

See also tc39/ecma262#887. This is mostly a concern for when this gets to the level of formal specification, not during the design phase.

It seems like it'd be a bad end state for two separate specs to define these concepts, when they're meant to operate on the same level. There are a variety of solutions here, but the one that seems easiest is to send appropriate PRs to the ES spec to make sure their concept is general enough, and then reference them.

@jfbastien
Copy link
Member

The current approach for threads v1 wouldn't define any WebAssembly-specific agent. Developers would have to rely on web workers to create threads. Given this approach, I think your proposal would be tied to v2 (or whenever we do wasm-specific threads), correct?

@domenic
Copy link
Member Author

domenic commented Jun 15, 2017

I was mostly reacting to the definitions of agent/agent cluster in https://github.com/WebAssembly/threads/blob/master/proposals/threads/Overview.md. I assumed those were on target to be part of the spec.

@lars-t-hansen
Copy link

@domenic, I think the consensus is more or less that the v1 threads spec should remove any prose that was partially excerpted from the ES spec and just defer to the ES spec instead. (Notably for agents and memory model.) Some discussion of this problem at #25 (comment) et seq.

@binji
Copy link
Member

binji commented Jun 15, 2017

@lars-t-hansen right. I'll remove that from the overview.

@rossberg
Copy link
Member

rossberg commented Jun 16, 2017 via email

@lars-t-hansen
Copy link

I think that's why Ben added that prose to begin with - to keep it independent. But when Wasm is embedded in JS it becomes confusing if the prose in the Wasm spec does not reasonably match what's in the JS spec, so more care is needed in the Wasm spec.

Longer term, if Wasm-embedded-in-JS does not have an agent / agent cluster / memory model that matches JS well, things will get messy. Should the Wasm spec provide some hooks where an embedder can attach behavior? That's effectively how the ES spec deals with the fact that JS is running sometimes in a browser, sometimes not. The agent / agent cluster formalism is pretty high level, there's no mention of how agents are instantiated, nor of why an agent may have [[CanBlock]] set to false, say.

@rossberg
Copy link
Member

Yes, providing the right hooks makes total sense. And of course the semantics should match. Whether that necessarily allows avoiding duplication or requires matching definitional wording literally is a slightly different question. We might need to allow ourselves sufficient room to manoeuvre and avoid creating path dependencies on TC39.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants