Hacker News new | ask | show | jobs
by ramesh31 989 days ago
This is an ad. Just use WASI.
4 comments

"Just" use WASI is not useful advice. I've been trying to do that for my own purposes for over a year. The learning curve on that (as a Python programmer who wants to use WebAssembly for sandboxing) is practically a vertical wall.
I should have said "Just use any WASI compliant runtime". There's a ton of them with these features, and none of the commercial angle.
They have all proven extremely difficult to use for my sandbox case - see other messages in this thread.
Can you link to a similar example using WASI?
Take your pick of runtimes. Wasmtime is the most popular right now.

https://github.com/bytecodealliance/wasmtime/blob/main/docs/...

Thanks. I'm not sure how this maps to the original example, though. This is about compiling a standalone program which translates POSIX apis, it seems? How about calling it from Rust with string args etc?
Exactly. That's what Extism is trying to solve. That WASI post doesn't show at all how to use the WASM code from C, or vice versa, because it just compiles the entire C program to WASM which uses the POSIX-based WASI API. If you want an alternative to Extism, you need something like wasmer.io, not just wasmtime (Extism actually uses wasmtime as mentioned in the post).
Right. The point being that you can take your pick of WASI compliant runtimes which have those features. Extism isn't something special compared to any other open source project in this domain, yet it smells of a commercial venture. Count me out.
>Extism isn't something special compared to any other open source project in this domain

Well, ok, can you give me an example of some other project doing this sort of interop without manual memory mapping?

WASI is great and obviously Extism supports it as a superset of functionality - but you don’t always want to give your guest code access to system resources even in a limited environment.

Extism also offers a bunch of other features that you don’t get with WASI. But use what’s best suited for your needs!

Claiming to make a thing that is already easy easy is a whole business model.