What does HackerNews think of wasmtime?

A fast and secure runtime for WebAssembly

Language: Rust

#2 in JavaScript
#3 in PHP
#25 in Rust
#2 in Minecraft
There are a few, but I suspect the most widely used would be wasmtime. It's written in Rust and can be used from Go [2] but requires CGo (as mentioned by GP).

[1] https://github.com/bytecodealliance/wasmtime [2] https://github.com/bytecodealliance/wasmtime-go

It is a runtime for wasm. Wasm is not executable in the same way an x86 binary is. It needs to run in a vm. Wasmtime is one such vm. In a browser context that vm is v8.

https://github.com/bytecodealliance/wasmtime

I haven't used it, but cranelift is also my first thought for this.

If you want a stable interface though, I might use wasm on top of it via wasmtime. I'm not sure how stable the API for wasmtime is, but at least the IR (wasm) is, and there's an ecosystem of tools around it.

https://github.com/bytecodealliance/wasmtime

wasmtime, Standalone JIT-style runtime for WebAssembly, using Cranelift: https://github.com/bytecodealliance/wasmtime

wasm3, WebAssembly interpreter: https://github.com/wasm3/wasm3

… and many more

There's a JIT framework in Rust: https://github.com/bytecodealliance/wasmtime

There's a library for doing full X.509 certificate parsing and verification: https://briansmith.org/rustdoc/webpki/

There's definitely some attempts at doing pure-Rust SSL, but I suspect a lot of them are also doing some sketchy things with crypto that shouldn't be trusted (getting constant-time stuff implemented properly is really challenging, and probably requires large amounts of assembly to guarantee correctness).

> I can't really square the idea that the 50-150ms time-delays in question comes down to the actual programming language, but it is absolutely believable that a longer test reduces the median latency rather than a high load test for a shorter duration.

It seems plausible to me: in Fastly's case, they're using WebAssembly via wasmtime[1] which does support AOT compilation but most JavaScript code is dynamic enough that they still need a runtime JIT engine. I believe the the current approach Fastly is using is to compile Mozilla's SpiderMonkey JIT engine itself into WebAssembly and they've done some really nice work making that load as quickly as possible:

https://bytecodealliance.org/articles/making-javascript-run-...

The catch, of course, is that this still leaves a fair amount work which a JavaScript program has to deal with at runtime compared to a Rust program which the compiler can spend minutes optimizing long before deployment. This is a classic tradeoff for dynamic languages and a lot of people are satisfied with the approach of defaulting to faster developer turnaround and later converting hot spots to something like C or Rust, but I think it's definitely dodgy to use a single example of something you know to be this complex and present the results as generally representative of the entire platform.

I have no knowledge of how Cloudflare ran their tests or reason to suspect malice but not disclosing test methodology and a “no benchmarks” license clause is going to make accusations about the results inevitable. Veterans of the benchmarketing wars have stories about comparisons where someone used a configuration option which happened to disable key performance optimizations for their competitors or used examples which favored their design decisions. Since nobody can read someone's mind to tell their real intent, the best way to avoid acrimony is to have full public disclosure of the benchmarks and their methodology — and to allow other people to conduct benchmarks so they can reproduce results or fill gaps.

1. https://github.com/bytecodealliance/wasmtime

Numerous native runtimes for webassembly already exist[0], with the current popular choices apparently being Wasmer[1] and Wasmtime[2].

All one would need to do (AFAIK) is ship a client for all major platforms, as is done with Electron (and web browsers themselves, and everything else.)

[0]https://github.com/appcypher/awesome-wasm-runtimes

[1]https://github.com/wasmerio/wasmer

[2]https://github.com/bytecodealliance/wasmtime

> You must view the browser with JS and WASM as a unit

“Web” assembly is a bit of a misnomer. It’s an IR at the end of the day and can be run without a browser[1]. But your other points could be true one day if the de facto WASM runtime becomes bloated or decides to ship with some GUI renderer.

[1] https://github.com/bytecodealliance/wasmtime

> I rather imagine we'll see a wasm vm/runtime in rust

Like Wasmtime? https://github.com/bytecodealliance/wasmtime

wasmtime[0] is a WebAssembly standalone runtime that does JIT. It’s quite performant anecdotally and I think some benchmarks might be available.

[0] https://github.com/bytecodealliance/wasmtime

To expand, this functionality is of course not unique. There are numerous WASM runtimes out there, like wasmtime [1] or wasmer [2].

The interesting aspects of using Deno for this are:

a) v8 is bound to have a high quality wasm JIT and already has a sophisticated sandbox (although JS and the browser context probably bring in a lot of complexity that a pure WASM sandbox doesn't have to deal with)

b) easy interop with Javascript/Typescript code

c) Deno is experimenting with finer grained permission based sandboxing, so this fits well within the domain

[1] https://github.com/bytecodealliance/wasmtime

[2] https://wasmer.io/