-
Notifications
You must be signed in to change notification settings - Fork 101
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
Clarify termination scope #527
Comments
(It might just be me and it's definitely in the realm of "bikeshedding", but I generally prefer the word "terminate" as it feels slightly less charged in contemporary usage). |
Personally, I don't think this is an infra issue (Infra is more of a "standard library" for specs, providing handy primitives like lists, maps. etc.). It's more of a "how to write a spec" issue. We should eventually write a guide on best practices for spec writing. |
As long as infra describes things to use in algorithms, I think this belongs there. After all, people are copying the style and usage across multiple specifications, and the point of infra is to help them do that appropriately. Relying on algorithms as a definitive normative explanation, when they are expressed in an undocumented format that allows for ambiguities, can have the effect of "hiding" those ambiguities behind an appearance of rigour. (I appreciate having algorithms, but I hope a best practices guide will include "explain what happens in prose even if it's non-normative, instead of assuming that the algorithms are self-explanatory". ) |
I agree that it would be good to clarify this. Algorithms are either introduced as an algorithm or as "these steps". Algorithms sometimes end up being nested, e.g., if you want to run something "in parallel" to the current algorithm you end up creating a nested algorithm. This also applies to callback-like algorithms that are somewhat common with fetch. Return and throw are scoped to a single algorithm. "Abort these steps" is also scoped to a single algorithm, but not currently defined. It is typically in use with "in parallel" algorithms because those cannot really return anything. They have to queue a task (perform IPC) to get data back to the other thread. "Abort when" is a very specific construct with no relation to "abort these steps". So thoughts based on that:
|
https://infra.spec.whatwg.org/commit-snapshots/3e751ef04a007e73b10c2be3a5e980e3a7858804/#algorithm-control-flow
I think it would be helpful to be clearer about the scope of things that terminate some steps. The problem I saw was an algorithm that had several sets of substeps, e.g.
It appeared to me that the meaning of substep 3 was to terminate the algorithm. When I read the conditional abort section, it seems to imply that "abort when" is intended to terminate a set of substeps.
I also found the section on returns and throws unclear about scoping. I'm not sure if the best thing is to add some phrasing to existing content, define scoping of termination specifically, or something else.
The text was updated successfully, but these errors were encountered: