4 ms·
The obvious answer is to embed TCC or another C compiler and either generate a dynamic library or generate wasm and load it directly into the process. exec_was
by sitkack 6y ago
The obvious answer is to embed TCC or another C compiler and either generate a dynamic library or generate wasm and load it directly into the process.
exec_wasm(generate_wasm(generate_c(grammar)))
Now if you can make that whole fn chain incremental, then a delta_grammar -> delta_c -> delta_wasm -> delta_recomputed_wasm_call stack, this will propagate deltas down to exec_wasm and you could dynamically execute the generated code as the grammar changes.