Git Product home page Git Product logo

Comments (5)

rossberg avatar rossberg commented on September 25, 2024

Hm, I'm pretty sure that module_new performs validation in the V8 prototype (it essentially invokes the JS WebAssembly.Module constructor). That's the intention anyway.

Should the API also provide unchecked versions?

from wasm-c-api.

peterhuene avatar peterhuene commented on September 25, 2024

In V8, I assume wasm_module_new is returning null when the module data is invalid?

As a user of the C API, my assumption was that wasm_module_new would validate and would return null on invalid module data; if that is indeed the case then I think we should document that behavior and fix Wasmtime to behave the same way.

👍 on having adding an "unchecked" version that skips validation (if possible) since wasm_module_validate exists.

from wasm-c-api.

rossberg avatar rossberg commented on September 25, 2024

@peterhuene, yes, you should get null. Any factory methods can return null. And yes, there should be documentation of that fact -- any documentation whatsoever, for that matter. :)

The wasm_module_new and _validate functions should also have an optional out parameter for getting possible error reports in some form.

from wasm-c-api.

peterhuene avatar peterhuene commented on September 25, 2024

Thanks for the confirmation. That's what my use of the C API was assuming.

@sunfishcode I think we should fix this in Wasmtime to validate for wasm_module_new then.

from wasm-c-api.

sunfishcode avatar sunfishcode commented on September 25, 2024

@peterhuene Agreed. I'll close the issue here, and follow up on the Wasmtime side.

from wasm-c-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.