Generally speaking, libwee8 supports whatever V8 supports.
That said, the state of the stringref implementation in V8 is that (like
all early-stage proposals) it's behind an off-by-default flag:
--experimental-wasm-stringref, and libwee8 doesn't have a way to enable
such flags at runtime.
If you build your own libwee8, you can hack it by moving the "stringref"
entry in src/wasm/wasm-feature-flags.h from the STAGING list to the SHIPPED
list below it.
If you don't want to or can't modify libwee8's sources but you do know that
you're always linking against libwee8 (and not some other engine's
implementation of the Wasm C API), then I think you can use the regular V8
API to call v8::V8::SetFlagsFromString("--experimental-wasm-stringref") early
in your startup sequence (before calling the Wasm C API's Engine::make()).

All of that is admittedly far from perfect.

Please also keep in mind that the stringref proposal is currently not on
track towards finding community consensus. While we (V8) have no plans to
delete our implementation of it, we also cannot make any promises that we
will continue to keep it indefinitely if the proposal doesn't advance. At
the very least, if/when the proposal does pick up steam again, there will
likely be some changes to the behavior of certain features, and when
picking those up we will quite likely not worry about backwards
compatibility with earlier versions of the proposal. In summary: while I
understand that strings are very useful and the stringref proposal would be
great to have (especially in non-browser scenarios where the alternative
"JS String Builtins" proposal, which the community currently favors, is
unavailable), I feel compelled to caution you that basing any larger
project on an assumption that stringref will be available is a highly risky
decision at this time. On the other hand, if you manage to present a
sufficiently compelling use case, you might just be able to influence the
community's stance...


On Fri, Sep 27, 2024 at 2:05 AM Alex Dovzhanyn <dovzhanyn.a...@gmail.com>
wrote:

> Hello all, I am wondering if there is support for WASM stringrefs in
> libwee8? And if so, it that behind a flag during the build? I am noticing
> that I'm able to call:
>
>       auto wasmModule = wasm::Module::make(store.get(), binary);
>
> with no issues when I'm not using stringrefs, but as soon as I add a
>       (table $stringrefs 100 stringref)
>
> into the module, the wasm::Module::make seems to fail.
>
> Any pointers would be greatly appreciated! Thanks in advance.
>
> Best,
> Alex
>
> --
>

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/v8-users/CAKSzg3ThgREJsoHmXtGBCtr%2BvpxNoX0%2BJH9nrFk1PpksgY32%2BQ%40mail.gmail.com.

Reply via email to