Live data from Hacker News

Extism makes WebAssembly easy

dylibso.com

21–30 of 100 posts

Re: Extism makes WebAssembly easy

#21
post #4

Another open Source project locking their community discussions away on Discord where it can't be easily discovered or searched. At least consider mirroring to the web - or at this stage inform people you will one day make posts available on the open web. Acquiring that consent afterwards is painful.

Iis there any problem with that? Discord is nice to use, free and most people already have it.

Re: Extism makes WebAssembly easy

#22
post #21
post #4

Another open Source project locking their community discussions away on Discord where it can't be easily discovered or searched. At least consider mirroring to the web - or at this stage inform people you will one day make posts available on the open web. Acquiring that consent afterwards is painful.

Iis there any problem with that? Discord is nice to use, free and most people already have it.

can't view without a phone number at times

Re: Extism makes WebAssembly easy

#23
The thing I want to achieve with WebAssembly is still proving a lot harder than I had anticipated.

I want to be able to take strings of untrusted code provided by users and execute them in a safe sandbox.

I have all sorts of things I want this for - think custom templates for a web application, custom workflow automation scripts (Zapier-style), running transformations against JSON data.

When you're dealing with untrusted code you need a really robust sandbox. WebAssembly really should be that sandbox.

I'd like to support Python, JavaScript and maybe other languages too. I want to take a user-provided string of code in one of those languages and execute that in a sandbox with a strict limit on both memory usage and time taken (so I can't be crashed by a "while True" loop). If memory or time limit are exceeded, I want to get an exception which I can catch and return an error message to the user.

I've been exploring options for this for quite a while now. The furthest I've got was running Python in wasmtime: https://til.simonwillison.net/webassembly/python-in-a-wasm-s... and running Pyodide inside of Deno: https://til.simonwillison.net/deno/pyodide-sandbox

Surprisingly I've not found a good pattern for running a JavaScript interpreter in a WASM sandbox yet. https://github.com/justjake/quickjs-emscripten looks promising but I've not found the right recipe to call it from server-side Python or Deno yet.

Can Extism help with this? I'm confident I'm not the only person who's looking for a solution here!

Re: Extism makes WebAssembly easy

#24
post #14

Earlier quoted context omitted.

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?

Re: Extism makes WebAssembly easy

#25
post #23

The thing I want to achieve with WebAssembly is still proving a lot harder than I had anticipated. I want to be able to take strings of untrusted code provided by users and execute them in a safe sandbox. I have all sorts of things I want this for - think custom templates for a web application, custom workflow automation scripts (Zapier-style), running transformations against JSON data. When you're dealing with untru…

>When you're dealing with untrusted code you need a really robust sandbox. WebAssembly really should be that sandbox.

We shouldn't have to trust any code. WASM is a stepping stone out of the insanity that is ambient authority.

Re: Extism makes WebAssembly easy

#26
post #23

The thing I want to achieve with WebAssembly is still proving a lot harder than I had anticipated. I want to be able to take strings of untrusted code provided by users and execute them in a safe sandbox. I have all sorts of things I want this for - think custom templates for a web application, custom workflow automation scripts (Zapier-style), running transformations against JSON data. When you're dealing with untru…

To run a JavaScript interpreter (spidermonkey, in this case) in Wasm, as well as running that same wasm in a JS engine, you want to look at `jco` https://github.com/bytecodealliance/jco

The component model tooling is getting very close to maturity and will solve many of these problems.

Re: Extism makes WebAssembly easy

#27
post #24

Earlier quoted context omitted.

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).

Re: Extism makes WebAssembly easy

#28

Earlier quoted context omitted.

While it'd be a nice addition, I wouldn't expect it any time soon. It's currently still a stage 1 proposal, while we've been waiting for years for other proposals to be merged. The last time a proposal was actually finished was over 2 years ago. https://github.com/WebAssembly/proposals https://github.com/WebAssembly/proposals/blob/main/finished-...

Indeed, webassembly is moving extremely slowly. I started a project years ago expecting https://github.com/WebAssembly/memory-control/blob/main/prop... and https://github.com/WebAssembly/memory64 to be fixed at some point. Neither are yet, and the project still suffers from it to this day. I think wasm is still great without these fixes, but I have lost confidence in the idea that wasm will reach its full potential a…

https://github.com/WebAssembly/memory64/blob/main/proposals/...

For your second one, it looks like it is already implemented in Chromium and Firefox but not Safari. Sadly, it's not new for Apple to be dragging their feet on moving web standards forward.

It took what seems like a decade to get proper WebRTC support in Safari.

Re: Extism makes WebAssembly easy

#29
post #21
post #4

Another open Source project locking their community discussions away on Discord where it can't be easily discovered or searched. At least consider mirroring to the web - or at this stage inform people you will one day make posts available on the open web. Acquiring that consent afterwards is painful.

Iis there any problem with that? Discord is nice to use, free and most people already have it.

There are several problems with Discord; see https://mastodon.derg.nz/@anthropy/110922638711307077

Re: Extism makes WebAssembly easy

#30
post #21
post #4

Another open Source project locking their community discussions away on Discord where it can't be easily discovered or searched. At least consider mirroring to the web - or at this stage inform people you will one day make posts available on the open web. Acquiring that consent afterwards is painful.

Iis there any problem with that? Discord is nice to use, free and most people already have it.

1. Discord search is very poor

2. Discord will go away one day and so will all the accumulated knowledge

3. People who aren't directly looking for your project won't find it. It's will have no search footprint. You have to actively seek out the Discord to discover that that's activity there.

"Most people" don't already have it. Only a fairly specific handful of demographics.

Post reply on HN