days
-1
-3
hours
0
-8
minutes
-3
-6
seconds
-1
-3
search
Come on and get a life

Life: WebAssembly on your smart fridge? This new VM written in Go makes it possible

Sarah Schlothauer
#go
life
© Shutterstock / Beatriz Gascon J

Ever wanted to write WebAssembly programs for your smart devices? Expand past the browser. Life is a cross-platform WebAssembly virtual machine written in Go. Find out how to get started.

What is Life? No, we aren’t getting philosophical here, just looking at a new cross-platform WebAssembly virtual machine.

Developed by the Perlin network and written in Go, Life caters to decentralized applications.

WebAssembly (also known as Wasm) is a memory-safe, sandbox-executed “binary instruction format for a stack-based virtual machine.”

It is compatible with high-level languages such as C, C++, and Rust. Modules compiled with WebAssembly can then be loaded as JavaScript libraries, even in JavaScript virtual machines. When used in the web, WebAssembly enforces the same security policies as the browser in-use.

Let’s not waste any more time and dive in. After all, life is short.

The meaning of Life

On the announcement blog, Kenta Iwasaki writes, “Imagine writing blazing-fast WebAssembly programs running on your smart TVs/fridges, mobile phones, or even your gaming laptops. You could have smart devices all around the world securely training machine learning models, hosting up databases, or even hosting up blogs/online retail stores 24/7.”

WebAssembly has uses outside of just the browser and its security features and high-level language compatibility are unmatched.

SEE ALSO: Using Go for WebAssembly applications

With this image of the future in mind, we look at Life to guide us there. The cross-platform and modular WebAssembly VM runs on virtually any device.

Yes, you can link Life up to your Raspberry Pi. This opens up a lot of possibilities for developers. We look forward to seeing what people can create with this. (Let us know if your gears are turning!)

Iwasaki lists that life was developed to be fast, correct, secure, pure, and practical. We all know that WebAssembly is secure, and now we can be sure that Life takes advantage of that feature as well.

At the speed of Life

Life claims to be fast. (No, don’t go bringing out life expectancy numbers. I mean during stress-testing.)

Perlin benchmarked the speed of Life against two other WebAssembly implementations – Wagon and Wasami. Here are the results they got:

life

Source: Perlin Network

For the sake of impartial judging, it is worth noting that neither Wagon nor Wasami claim to be high-speed, and speed is not the sole measure of greatness. (Take a look at the raw results yourself and then see which is best for you and your project.)

Get a Life

Interested in getting started? GitHub has all the instructions you’ll need to get started and install the VM.

SEE ALSO: Go modules will land in Go 1.11: go mod split into multiple subcommands

You will need to initialize the WebAssembly virtual machine and then execute a function in the WebAssembly module. More detailed instructions on how to do so are also available here.

Security is not an issue. Life has already been tested out to run with complicated programs and according to Iwasaki they have, “even created a new backend to the open-source deep learning model compiler TVM which allows users to compile PyTorch, Tensorflow, Keras, MXNet, and Caffe models down to WebAssembly”.

This project is decentralized, which always gets a round of applause from us at JAXenter because of its accessibility! Kudos!

Perlin is also looking for code contributions, so if you have any commit messages to share, there’s no better time than now to let them know what you think.

Lastly, there is also a Discord server (with over 1,300 members at the time of writing this) for those of you who are interested in reaching out.

Author
Sarah Schlothauer

Sarah Schlothauer

All Posts by Sarah Schlothauer

Sarah Schlothauer is an assistant editor for JAXenter.com. She received her Bachelor's degree from Monmouth University in Long Branch, New Jersey and is currently enrolled at Goethe University in Frankfurt, Germany where she is working on her Masters. She lives in Frankfurt with her husband and cat.

Leave a Reply

Be the First to Comment!

avatar
400
  Subscribe  
Notify of