When I was implementing self-hosted builtins I added special functions prefixed with ___ that did emit raw bytecode instead of real calls to JS functions. This functionality is conditionally enabled when evaluating self-hosted builtins right now. And now I have great idea that will work like Rust's procedural macros but instead it will generate raw bytecode rather than new SWC AST. For example we could provide API like this:
When I was implementing self-hosted builtins I added special functions prefixed with
___
that did emit raw bytecode instead of real calls to JS functions. This functionality is conditionally enabled when evaluating self-hosted builtins right now. And now I have great idea that will work like Rust's procedural macros but instead it will generate raw bytecode rather than new SWC AST. For example we could provide API like this: