-
Notifications
You must be signed in to change notification settings - Fork 84
Two-Stage Plan for GC #72
Description
The GC extension has the tension that a good design will take a long time to develop and a quick design will impose backwards-compatibility constraints we will regret. Thanks to some productive prompting by Adam Klein, I had any idea for how to resolve this tension: explicitly design the MVP so that it can be easily compiled to the long-term solution, and explicitly design the MVP with the expectation that it will be phased out (using this compiler) once the long-term solution is available. Here's a rough sequence of events to illustrate what I mean:
- Design of Stage 1 GC extension
- Release of Stage 1 with notice that it will become deprecated
- Design of Stage 2 GC extension
- Implementation of Stage-1-to-Stage-2 compiler
- Release of Stage 2 with notice that Stage 1 is now deprecated but with hosts temporarily supporting Stage 1 by using the Stage-1-to-Stage-2 compiler
- Update of gc-wasm modules to Stage 2, either by directly compiling source code to Stage 2 (since this will enable far better performance and interop), or by simply using the Stage-1-to-Stage-2 compiler
Remove support of Stage 1 from hosts
This will let us make a quick and dirty MVP without worrying about our decisions having unintended long-term consequences. In fact, I'd say what's already in the current GC proposal has the right ideas but is actually too complicated given this plan - I suspect we'd be able to strip out a bunch of features to get just the essentials for supporting typed GC languages (untyped GC languages will need lower-level features for good performance that the long-term proposal will provide). So I think this strategy would get us an MVP sooner and enable the long-term design to be better.
Questions? Clarifications? Thoughts? (I'm intentionally leaving conjectures about the specifics of the Stage 1 or 2 designs out of the discussion in order to focus on the high-level strategy for now - we can dive into the implications of this strategy on those designs later into the conversation when the appropriate time comes.)