gen-host-js: --valid-lifting-optimization#415
gen-host-js: --valid-lifting-optimization#415guybedford merged 4 commits intobytecodealliance:mainfrom
Conversation
|
One area I think it's fine to relax checks on is incoming JS values in the sense that those are embedder-specific and in theory already correct. I believe this PR is also relaxing checks for values coming out of the component itself, though, and I don't believe that's something that we can compromise on. The purpose of wit-bindgen is to be a component runtime polyfill and to implement that correctly many of these checks are required (e.g. variant discriminants all valid) |
|
I've rebased this PR and changed the flag name to |
99b26be to
448a8a7
Compare
|
To be completely clear about when this applies I've updated the flag name to |
This adds a new
--valid-lifting-optimizationflag to the JS generator to disable the runtime checks of the Wasm data structures. The assumption being that when the interfaces have been fully tested, this can be enabled in production for a significant reduction in output JS file size.We could could possibly treat this as an explicit optimization or production option. Checks of user inputs should still remain though.
I've based this branch to the
--tla-compatPR at #414 so it should land after that.I've also started to unify on the
uwriteln!/uwrite!patterns that feel a bit cleaner than the source functions, so am refactoring those as I go, let me know if you agree that these look better or have further suggestions on the refactoring. Would be nice to converge on code style with the formatting.