wasi-libc icon indicating copy to clipboard operation
wasi-libc copied to clipboard

Is there any plan about supporting WASI preview2?

Open lum1n0us opened this issue 2 years ago • 7 comments

Seems WASI is going to upgrade to preview2.

lum1n0us avatar Aug 04 '23 06:08 lum1n0us

Posting this because the best way to get an answer on the internet is to post the wrong answer and wait... 😉

My very rough understanding as an enthusiastic but otherwise uninvolved observer:

There's no great urgency to support preview2 in wasi-libc today for compatibility reasons because there are preview1->preview2 adaptors available — i.e. it's easy to adapt a module produced by wasi-libc to run on a preview2-only runtime.

On the other hand, as some preview2 WASI proposals mature, that would allow fleshing out missing functionality in wasi-libc. But there's still a fair bit of churn in the upstream WIT definitions for most of the proposals, so users wouldn't gain much by wasi-libc chasing preview2 now. It could be useful as an exercise in figuring out how best to support preview2 in wasi-libc, though.

I'm guessing some time after WasiCon would be good to start experimenting with that. But that's just my uninformed hunch.

Maybe someone who has more of a clue can correct me!

jeffparsons avatar Sep 02 '23 12:09 jeffparsons

And it wouldn't be very useful until Zig can compile to the new ABI.

Agreed. There's no urgency, especially since preview1 code can work in a preview2 context.

jedisct1 avatar Sep 02 '23 16:09 jedisct1

To confirm, yes, we are planning to have a preview2 build of wasi-libc, and it'll be useful for languages that do support it, and yes, it's not been the highest priority because of the availability of wit-component and the adapter.

sunfishcode avatar Sep 02 '23 16:09 sunfishcode

IIUC, please correct me when I'm wrong, at least in the next few months, wasi-libc will keep current status(by using preview1 style imports), especially api.h. If somebody want to work with a component instead of a core module, he/she should use wasi_snapshot_preview1.wasm.

lum1n0us avatar Sep 03 '23 14:09 lum1n0us

To confirm, yes, we are planning to have a preview2 build of wasi-libc, and it'll be useful for languages that do support it, and yes, it's not been the highest priority because of the availability of wit-component and the adapter.

it might be higher priority for someone who wants to use preview2 w/o component-model, right?

yamt avatar Sep 28 '23 04:09 yamt

it might very well be!

squillace avatar Oct 24 '23 11:10 squillace

I've just opened a new issue with a proposal that addresses this topic: https://github.com/WebAssembly/wasi-libc/issues/447

dicej avatar Nov 28 '23 03:11 dicej