glimmerjs / glimmer-vm

MIT License
1.13k stars 191 forks source link

Streamline append VM implementation and remove enums #1643

Closed wycats closed 2 weeks ago

wycats commented 3 weeks ago

This PR begins the process of incrementally implementing many of the improvements in the error recovery branch.

I'm going to start with the easy stuff and work my way up to more complicated parts of the implementation, and in that spirit, this PR has two changes:

  1. Streamline the AppendVM by using private fields and an optional debug field pattern. This simplifies the implementation and also makes it possible to consolidate InternalAppendVM into the normal VM. The benefit of the "opcode-only" subset of the VM was waning anyway, and most of the remaining distinction had to do with private implementation details that are no longer present in the VM interface because they're now implemented using private fields.
  2. Replace const enum and enum with normal constants and literal types. There was a good reason for us to use const enum when we originally made the decision. But the dynamics have changed. Between (a) the fact that we can't reliably that const enum will be compiled away anymore, and (b) the fact that TS now has literal types, using normal constants and literal types is a better choice.
NullVoxPopuli commented 3 weeks ago

Ope -- this is a regression image

wycats commented 2 weeks ago

Superseded by: