Symlinks, hardlinks, errno, etc. It's not surprising that it's better supported on Unix than other platforms.
And yeah I agree it's disappointing they tacked such an obviously platform-biased API on to something that is supposed to be platform independent. I guess it was the pragmatic thing but still...
> And yeah I agree it's disappointing they tacked such an obviously platform-biased API on to something that is supposed to be platform independent. I guess it was the pragmatic thing but still...
What's the alternative? If you want an I/O system interface into WASM, something POSIX-like is probably the sanest choice one could make. Portable is literally in the name. In fact I'd say POSIX the least obviously biased system interface.
Is there some other syscall interface out there which implementS files, sockets, and clocks, which is simpler than POSIX?
In fact WASI seems quite stripped down from POSIX.
What you linked to is WASI-libc, which is a C standard library implementation on top of WASI - which itself is more low-level and less POSIX-like. https://github.com/WebAssembly/WASI
Fortunately the idea of WASI is for it to be modular. It makes sense for them to have the APIs required to make porting existing POSIX-ish-compatible apps easy, but there are also WASI modules (I forget the proper name) in the works for much more general IO objects etc. that better abstract away the underlying OS if you're willing to invest in that.
So I guess you could summarise it as: backward compatible-ish first, and then figuring out what a neater, more idiomatic world would look like second.
It's a pragmatic approach to bootstrapping the ecosystem, and there's no need for the POSIX-alike parts to hold anyone back, at least long term. Pretty soon you will be able to write apps that target WASI that end up reading and writing files in practice without the app even knowing what a "file" is (the runtime can just hand it an abstract IO object). That's a step beyond just not knowing about things like symlinks, and seems to me like a more "web-flavoured" future that can work even for CLI/desktop apps.
https://github.com/WebAssembly/wasi-libc/blob/main/libc-bott...
Symlinks, hardlinks, errno, etc. It's not surprising that it's better supported on Unix than other platforms.
And yeah I agree it's disappointing they tacked such an obviously platform-biased API on to something that is supposed to be platform independent. I guess it was the pragmatic thing but still...