Live data from Hacker News

WasmEdge

wasmedge.org

1–10 of 88 posts

Re: WasmEdge

#2
Given the amount of C++ in this project, I wouldn't run this in an adversarial environment. Meaning, I would not accept untrusted Wasm modules. It is about 100kloc of C/C++ including headers.

Re: WasmEdge

#4

Seems like the edge is just SaaS microservices. Change my mind.

Can you elaborate on the connection as you see it? I think of edge computing, SaaS, and microservices as independent concerns.

Re: WasmEdge

#5

Seems like the edge is just SaaS microservices. Change my mind.

I think of the edge as a fancy term for services where minimizing I/O is one of the main goals. Which is sometimes, but not always the case with microservices. (Disclaimer: I'm not associated with this project in any way)

Re: WasmEdge

#6
Interesting to see that it has JavaScript support built in. It seems to be based on QuickJS which will work for some things but as they acknowledge quite slow.

> In the end, running v8 in a cloud-native environment often requires a full stack of software tools consisting of "Linux container + guest OS + node or deno + v8", which makes it much heavier and slower than a simple WasmEdge + QuickJS container runtime.

https://wasmedge.org/book/en/write_wasm/js.html#a-note-on-v8

Whether it's faster or not really depends on the complexity of what's being run. After reading about wasmtime 1.0's super fast 5 microsecond snapshot restore time (https://bytecodealliance.org/articles/wasmtime-1-0-fast-safe...) I did some experiments with QuickJS and Javy which runs QuickJS in wasmtime. Rendering a moderately complex web page with React renderToString production 30kB of html on my MacBook Air M1 took:

- Deno first iteration: 12-20ms

- Deno subsequent iterations: 2-4ms

- qjs native: 18-24ms

- javy (qjs wasmtime): 40-60ms

I've not tried WasmEdge but it's JS performance would presumably fall somewhere between that of qjs native and under wasmtime.

Firecracker claims a ~3ms snapshot restore time on ARM so might be the best way to go currently for such workloads but there is certainly a large subset of problems for which the current performance is adequate.

There has been talk of AOT compilation for SpiderMonkey.wasm (https://bytecodealliance.org/articles/making-javascript-run-...) which I hope this will some day happen since it should close the gap substantially. I recently asked on the ByteCode Alliance Zulip but there hasn't yet been any progress and it requires a substantial amount of work.

Re: WasmEdge

#8

Interesting to see that it has JavaScript support built in. It seems to be based on QuickJS which will work for some things but as they acknowledge quite slow. > In the end, running v8 in a cloud-native environment often requires a full stack of software tools consisting of "Linux container + guest OS + node or deno + v8", which makes it much heavier and slower than a simple WasmEdge + QuickJS container runtime. http…

Another thing that would be interesting to measure here is memory usage. QuickJS might be slower (as a minimal interpreter) but at least it should be much smaller than a full optimizing JS engine (running normally or compiled to wasm), both in terms of code size and runtime memory usage. That might matter in some cases.

Re: WasmEdge

#9
WasmEdge is one of the most exciting Wasm runtimes out there. It is part of the CNCF and does support a bunch interesting functionality (wasi-nn, integration with Docker via runwasi, etc)

Re: WasmEdge

#10

Interesting to see that it has JavaScript support built in. It seems to be based on QuickJS which will work for some things but as they acknowledge quite slow. > In the end, running v8 in a cloud-native environment often requires a full stack of software tools consisting of "Linux container + guest OS + node or deno + v8", which makes it much heavier and slower than a simple WasmEdge + QuickJS container runtime. http…

I remain mystified about the value of running JS inside a wasm VM. I see why people want to go there, because they want one tool to rule them all, but I don't get the actual value add. WASM hasn't been built for this. Not yet. You'll be running the garbage collector, compiler, bytecode interpreter fully in an emulated environment. There's bound to be overhead. For no reason. (And remember overhead isn't just slow processing of customer jobs -- it's energy consumption as well.)

There are already multiple runtimes that can run both WebAssembly and Javascript/TypeScript. The JS runtimes themselves. V8 does a great job of running both wasm and JS. And a custom V8 (or JavaScriptCore or whatever) embedding with appropriate sandboxing can be put together without a huge amount of work.

Seems like the better peg for the hole in question if people want support for JS and WASM in a hosted environment.

Post reply on HN