Skip to content

Saying this "isn't a bytecode" is inaccurate and misleading #82

@dead-claudia

Description

@dead-claudia

Why not ship bytecode instead?

On the Web, no vendor would agree to ship bytecode.

  • Engines don’t want to be tied to a bytecode version.
  • It’s harder to verify bytecode, as bytecode is more expressive than syntax.
  • It runs the risk of bifurcating the language, as bytecode may be more expressive than structured JavaScript source.
  • Designing a new bytecode is an even more ambitious undertaking.

This is very misleading. A binary AST, especially if you represent nodes in reverse Polish form with the operator at the end, can very much be interpreted as stack machine bytecode. To draw a comparison, WebAssembly's bytecode was designed from the start to be a context-sensitive AST encoding, and even after the change to a stack machine, it still continues to this day to be almost entirely representable as an AST. And if you allow any number of non-value-returning nodes to exist both at the beginning of any block and after any value-returning node, it could be read in full as if it contained an AST.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions