A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://stackoverflow.com/q/42919339 below:

javascript - Compile a JIT based lang to Webassembly

If you are actually implementing an interpreter then you don't need to generate machine code at runtime, so everything can stay within Wasm.

What you actually seem to have in mind is a just-in-time compiler. For that, you indeed have to call back into the embedder (i.e., JavaScript in the browser) and create and compile new Wasm modules there on the fly, and link them into the running program -- e.g., by adding new functions to an existing table. The synchronous compilation/instantiation interface exists for this use case.

In future versions it may be possible to invoke the compilation API directly from within Wasm, but for now going through JavaScript is the intended approach.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4