-
Notifications
You must be signed in to change notification settings - Fork 73
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
Requirements #121
Requirements #121
Conversation
One thing that has come up in various discussions but is not addressed here is separate compilation. Is it a goal or non-goal for the GC proposal to support separate compilation to separate WebAssembly modules that will be instantiated together on the client? Is it important that specific ABI details are able to be abstracted away on the module boundary so that changing the definition of an item in one module does not necessarily require recompilation of all the other modules that use it? |
JS is on TIOBE, of course. But it is off this list because JS already exists in most (all) environments in which WASM exists. |
I can't stop wondering about the reluctance to design Wasm GC with JS in mind. If these two don't have great interop, everyone (or every language for that matter) using Wasm GC in a browser will suffer. Of course Wasm GC needs to be great to be targeted by AOT compiled languages, no doubt, yet not at least granting JS special status as our primary interop target exactly because "JS already exists in most (all) environments in which WASM exists", and designing accordingly, will require every GC'ed language to inefficiently bindgen or interfacecopy their way around it forever, don't you think? |
@dcodeIO, not sure where you're coming from with that. Excellent, fast JS interop is a hard requirement from the browser point of view - objects must be shareable between JS and wasm with very fast access from both sides (and there are now two competing proposals for how to accomplish that). In practice, browsers will use the JS heap and JS GC to manage wasm objects and layouts will be compatible enough for interop to be practical. Features of wasm GC that are hostile to current JS / browser GCs - for example, elaborate tagging schemes coupled with a requirement for uniform representations - may have a hard time getting accepted by the browser makers. |
I'm inclined to just take your word for it, yet I'd prefer if the document clearly stated that. The closest there is so far is the paragraph on "code migration" (contains the only four search hits for "JavaScript" in the entire document btw), but I'd argue this one should really just be "Excellent, fast JS interop", not bound to any specific use case or implementation detail, to avoid any misconceptions like (hopefully) mine. |
My high-level suggestion would be to take the Phased Release section and move it to after Goals and before Criteria. Within that section should be discussion of prioritization and overspecialization, which seem to be the two items causing the most discussion. That is, we need to prioritize the features we release across phases in some manner, but we should also strive to do so without overspecializing towards those features (which is often the easiest short-term way to achieve a prioritization, but which has long-term downsides). Then clarify that the subsequent goals, requirements, and CSFs are long-term, i.e. for the GC project as a whole, and that determining such goals, reqs, and CSFs for the first phase needs to be done. On the topic of specific languages, this sets us up so that we always stand to benefit from the insights of all languages even if they are not the ones being prioritized for the current phase. They are the best equipped to inform us of overspecializations we might be making unintentionally. Also, ideally we have separate documents for the immediate phase, the next phase, and the long-term vision, and non-priority languages can help us work on later documents (which might inform earlier documents if unexpected conflicts arise). On the topic of JS interop, this encourages us to find ways to provide excellent JS interop (a high-priority item) without overspecializing to JS. Maybe we'll discover that that's impossible, but I'd like us to at least explore the possibility before shortcutting to building the JS object model into WebAssembly. |
Reflect further consensus on requirements
Minor tweaks. Removed reference to TIOBE index.
Small wordsmith
To everyone who's reviewed this so far -- are there any outstanding concerns? |
The only thing in the current version that I found surprising was requirement 6, "Support for multiple GC 'memories'." It says that this is intended to improve compositionality, but I don't see how having isolated heaps is more composable than a single shared heap. IIRC, we discussed this idea in the context of @Brion's use case of limiting available resource, but that higher-level goal isn't mentioned in the document. |
Oh yeah, I was surprised that hadn't spurred more discussion. I pondered the idea for a while and I think it has some merits:
Regardless, I feel like it needs more explicit discussion. |
Yup, would agree that having separate GC spaces can help avoid a "tragedy of the commons" both in terms of performance and assigning blame for memory usage. This was an explicit goal of #78 too. |
I Immix GC / RC approach even better in this situation. btw GHC already experiment with this |
Some arguments for having multiple 'gc spaces':
FWIW, arg #1 was the reason that I originally thought about having multiple GC memories. OTOH, this is definitely something that can be staged for a later release. |
I'm not sure that's true. If it helps to statically ensure some separation of heap regions, that's hard (impossible?) to do with a top type (like |
Refactored multiple memory requirements into a compatibility with threads requirement.
Can we land this? |
I still wonder how we'd manage to achieve meaningful code migration / interop with the web given that interop is now mentioned in the document, yet the bottom line remains that it is "impossible" (#145 (comment)) or that "GC is not responsible" (#145 (comment)). To me it seems that there are conflicting requirements here: We either cheap out on good interop, so code migration etc. will be hard to achieve in the first place or become cumbersome/inefficient, or we don't so things become "possible", implying that "GC is (at least partially) responsible". As such I'm not sure that we should commit to it just yet, as we may easily paint us into a corner that even interface types can't fix. |
I think this crucially needs to say something about separate compilation, linking, and being usable in conjunction with Wasm modules. Also, please fix spelling of Wasm. ;) |
Should the file live under |
This is a draft requirements document to help guide our decision making on GC.
Comments and suggestions are more than welcome.