@Yury Delendik as a heads up, this is a simple sketch of what I'm thinking for wasmparser -- https://gist.github.com/alexcrichton/5cd36abd7bef3b57e4dd4033c7c3345b
the high-level idea is to remove ModuleReader
, Parser
, and ValidatingParser
. The first two would be replaced by the Parser
in that gist, and the latter would be replaced by Validator
and at the same time we'd make Parser
amenable to incremental parsing (data fed over time), and the validator would be optionally used to feed data into
so validation is on/off based on whether you use Validator
overall it should ideally be easier to manage because there's less of a state machine and more "it's just straight-line code"
oh the other goal is to enable parallel validation and to be able to reuse the results from validation
so we could, for example, hook up validation directly into cranelift
this'll be needed to implement module linking because a call to a function is somewhat nontrivial to figure out the signature of that call
or, really any type information becomes nontrivial due to aliasing
these are my changes so far (basically just implementing Parser
) -- https://github.com/bytecodealliance/wasm-tools/compare/main...alexcrichton:incremental-parser
Cool, I need to think about this more. Though it looks similar to what I used in the past -- https://github.com/wasdk/wasmparser/blob/master/src/WasmParser.ts#L1486
It will work
Last updated: Dec 23 2024 at 12:05 UTC