Skip to content

Conversation

@GarboMuffin
Copy link
Member

@GarboMuffin GarboMuffin commented Sep 13, 2025

The new compiler broke all the extensions doing compiler patches. We promised not to help them when those break but it seems enough people use those extensions that we sort of got forced into finding some solution, so this makes these changes:

  • The exports for the new compiler are now in these_broke_before_and_will_break_again
  • i_will_not_ask_for_help_when_these_break now returns some stubs that pretend to be the old compiler. It also emits an event so -gui can show a warning.
  • Focus is on compatibility & safety, not performance. There will be unnecessary casts and scripts marked as yielding.
  • Extensions that meet these assumptions should work without changes:
    • Extensions do not try to combine this compatibility layer with any APIs provided by the new compiler.
    • Extensions treat IR nodes received from descendSubstack and similar as opaque objects because they will be the new intermediate objects instead of { kind: "..." }
    • Extensions need to implement the JS generators for all AST node kinds they use. Can not rely on the default JS generator because those generators are expecting a different format than { kind: "..." }

Lack of tests is intentional since this will be removed at some point when we have a proper API we can tell people to use

Renamed the new compiler's exports so that the old compiler's exports
can now return compatibility layer stubs instead. It seems like getting
most extensions to be functional is feasible, though there will be edge
cases that can't be handled and performance may be degraded.
If extensions were overriding the default blocks, this is a breaking change, but they really shouldn't do that
@GarboMuffin GarboMuffin force-pushed the old-compiler-compatibility branch from 20af054 to 33fa0a2 Compare September 13, 2025 22:34
… block

Was a leftover from an older version.
Not needed anymore as real.source is directly concatenated to now.
This reverts commit c553490.

My Blocks Plus needs this
@GarboMuffin GarboMuffin marked this pull request as ready for review September 14, 2025 15:48
@GarboMuffin GarboMuffin merged commit e1ad53e into develop Sep 14, 2025
2 checks passed
@GarboMuffin GarboMuffin deleted the old-compiler-compatibility branch September 14, 2025 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants