Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon

Introducing Walt: A syntax for WebAssembly text format written 100% in JavaScript and needs no LLVM/binary toolkits

Save for later
  • 2 min read
  • 11 Oct 2018

article-image

Walt, an alternative syntax for WebAssembly text format, was introduced today. It allows developers to use JavaScript syntax to write to as “close to the metal” as possible. Its ultimate goal is to make WebAssembly accessible to regular JavaScript programmers. Written 100% in JavaScript it requires no LLVM/binary toolkits.

What Walt tries to solve?


Writing zero-overhead, optimized WebAssembly code is difficult. You need to write very plain C code, compile that to .wast and then optimize that result. Then, finally, you're ready to compile that into the final WebAssembly binary. Walt attempts to take C/Rust out of the equation and write “as close to the metal” as possible without losing readability.

How it solves the problem?


What Walt does is, it provides a thin layer of syntax sugar on top of .wat text format. This improved syntax will give developers direct control over the WebAssembly output. This means that there should be minimal to none post optimization to be done to the wast code generated.

For example, here is what a .walt module, which exports a recursive Fibonacci function, looks like:

introducing-walt-a-syntax-for-webassembly-text-format-written-100-in-javascript-and-needs-no-llvm-binary-toolkits-img-0

Source: GitHub


When this code is passed through the Walt compiler, you get a buffer which can be used to create a WebAssembly module with a fibonacci export. Al this is done with familiar JS syntax and without any external binary toolkits.

Unlock access to the largest independent learning library in Tech for FREE!
Get unlimited access to 7500+ expert-authored eBooks and video courses covering every tech area you can think of.
Renews at $19.99/month. Cancel anytime

What are some of its use cases?


Anyone who is interested in WebAssembly but is not familiar with system languages can get a quick start with Walt. It can be used in the following scenarios:

  • Web/Node libraries
  • Games
  • Web VR/AR
  • Projects depending on heavy real-time computation from complex UIs to 3D visualizations


To know more about Walt and how you can get started with it, check out its GitHub repository.

Introducing Wasmjit: A kernel mode WebAssembly runtime for Linux

Unity Benchmark report approves WebAssembly load times and performance in popular web browsers

Why is everyone going crazy over WebAssembly?