BUIDL
p/buidl
Create complete DApps in minutes on your browser.
Chris Messina

Second State VM — High performance secure & portable Rust functions in Node.js

Featured
22
SSVM is a high-performance WebAssembly runtime for server-side apps. It is safer and 10x faster than Docker. It supports OS access (WASI), AOT compiler, stateful apps, seamless integration with Node.js, and access to hardware (AI chips).
Replies
Best
Chris McCoy
This is very interesting. Could a decentralized web services be built on top of your containers? This assumes compute is coming from inside data centers and on the edge...
Michael Yuan
Howdy! The Second State VM (SSVM) is WebAssembly optimized for the server-side! Why? That is because we want to create faster and lighter software, while preserving memory safety, security, and code portability. The SSVM is an application-level runtime (as opposed to Docker, which is at the OS level). It integrates into existing platforms, such as Node.js, as a lightweight module. Create a Rust function and run it inside Node.js, and you will get a Raspberry Pi kit for free. :) https://www.secondstate.io/artic... Let me know your thoughts!
Vagmi Mudumbai
This is quite interesting. There has been a huge interest generated in using WASM for the blockchain thanks to EOS. I was wondering whats your opinion on wasmtime and cranelift. As I understand wasmtime is one of the reference implementations of WASI and it also has other language bindings (just not node.js yet).
Michael Yuan
@vagmi_mudumbai There are several wasm implementations on the market -- as you mentioned, several blockchain projects have their own including Polkadot and Oasis, which adopted SSVM for the next-gen Ethereum VM. We believe that SSVM is the fastest (by far, due to AOT optimization) and provides the best tooling. It is far easier to use SSVM in nodejs than to use wasmtime or lucet. We do have benchmarks, but we encourage you to just try it (and get a Raspberry Pi on us). Thanks.
Gleb Platonov
WebAssembly on the server? Hmm that’s sound intriguing.
Michael Yuan
@glebplatonov Yes! 20 years ago server apps were written in C/C++. Then we have managed runtimes from Perl to Java to Ruby to JS/Node. But the downside of "heavy" runtimes is that they are slow -- that is problematic as hardware has largely stopped improving. WebAssembly is fast, lightweight, but also provides memory safety and code portability. So, here we are! Try it.
Tommy Tran
Is this WebAssembly VM similar time the Java VM or the Docker VM?
Michael Yuan
@tommy_tran It is similar to Java VM in the sense that you compile applications to bytecode that runs in the VM -- there is no bloated operating system for each application. However, unlike Java VM, it has no GC and supports multiple languages. In that sense, it is a "native" runtime like Docker.
Vivian Hu
This looks great 👍
Dave Waldron
Why wasm on the server?
Michael Yuan
@davewaldron 20 years ago server apps were written in C/C++. Then we have managed runtimes from Perl to Java to Ruby to JS/Node. But the downside of "heavy" runtimes is that they are slow -- that is problematic as hardware has largely stopped improving. WebAssembly is fast, lightweight, but also provides memory safety and code portability. So, here we are! Try it.
Dinty Andrews
I thought WebAssembly is for browsers. But this is cool.
Michael Yuan
@dintyandrews Yeah, Java and JavaScript also started as VMs inside browsers. There is a well establish path for technologies to migrate from front end to back end. :)
Conrad Yekel
Cool performance gain. Will try this out.
Fred Gould
Everyone is talking about Rust these days! I will try this on my next backend project.
ziyao li
This is interesting.
Mike Hu
It's very interesting , :)