0xPolygonMiden / compiler

Compiler from MidenIR to Miden Assembly

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wasm translation should always produce IR `Component`

greenhat opened this issue · comments

After #146 is implemented.

Motivation

To unify the code paths for both Wasm module (pre-WIT) and Wasm component. This would simplify the frontend API (one function) and make any code using it less fragile.
We have enough information encoded in the IR Component type (imports, exports) to handle both pre-WIT and WIT specifics later in the pipeline.

Implementation

Recognize the Wasm binary type (module vs. component) by peeking at the first bytes and choose the compilation path (from module or component) accordingly.