Hacker News new | ask | show | jobs
by pitherpather 868 days ago
Scrolled all the way through; very impressive.

> We have implemented (fully or partially) 48 POSIX Functions from above. ...[however] These 24 POSIX Functions will Halt when TCC WebAssembly calls them…

I was just wondering this evening: I have seen WASM described as an environment for selectively subsetting interfaces, in part for security. Is the following sometimes done?: Compile and link to a "glibc" which implements only a subset of calls, again for runtime security?

2 comments

Statically linking with musl and enabling LTO sounds like what you’re looking for.
That's basically what WASI is about (or now the specific derivation called WASIX). Essentially a POSIX runtime for WASM, but typically using musl instead of glibc.
A few months ago Wasmer tried add WASIX support to Zig so anything on Zig ecosystem could target the browser easily, which is quite relatable of what the TCC compiler is trying to achieve. I'm sure at some moment the community will pick it up.

I'll drop a link to WASIX in case is useful for the reader!

https://wasix.org