WebAssembly / wasm-c-api

Wasm C API prototype
Apache License 2.0
534 stars 77 forks source link

Access of v8 isolate possible? #178

Closed rahulchaphalkar closed 1 year ago

rahulchaphalkar commented 1 year ago

I am looking to access v8::Isolate to modify CreateParams for custom configuration, for example to assign a value to code_event_handler. Is there a way to do this via C++ APIs in wasm.hh? This question is similar to the one asked in https://github.com/WebAssembly/wasm-c-api/issues/143 .

rossberg commented 1 year ago

The API is meant to be platform-independent, so cannot directly expose implementation-specific functionality. However, the idea is that implementations may amend it with additional custom functions in their own namespace, e.g., wasm::v8. For example, to set additional options on Config, or extract engine-specific information from API types (such as converting wasm::Store to V8::Isolate).

But that's up to engines to decide and provide. In general, starting to depend on engine-specifics would of course largely defeat the purpose of using this API.