All Projects → ballercat → Walt

ballercat / Walt

Licence: mit
⚡ Walt is a JavaScript-like syntax for WebAssembly text format ⚡

Programming Languages

javascript
184084 projects - #8 most used programming language
Nearley
35 projects

Projects that are alternatives of or similar to Walt

Assemblyscript
A TypeScript-like language for WebAssembly.
Stars: ✭ 13,152 (+191.42%)
Mutual labels:  compiler, webassembly
Binaryen.js
A buildbot for binaryen.js, a port of Binaryen to the Web, with TypeScript support.
Stars: ✭ 201 (-95.55%)
Mutual labels:  compiler, webassembly
Wah
a slightly higher-level language superset of webassembly
Stars: ✭ 147 (-96.74%)
Mutual labels:  compiler, webassembly
Asterius
A Haskell to WebAssembly compiler
Stars: ✭ 1,799 (-60.14%)
Mutual labels:  compiler, webassembly
Speedy.js
Accelerate JavaScript Applications by Compiling to WebAssembly
Stars: ✭ 300 (-93.35%)
Mutual labels:  compiler, webassembly
Grain
The Grain compiler toolchain and CLI. Home of the modern web staple. 🌾
Stars: ✭ 2,199 (-51.27%)
Mutual labels:  compiler, webassembly
Prototype
(deprecated) The journey continues at ASNEXT: https://github.com/AssemblyScript/assemblyscript
Stars: ✭ 2,114 (-53.16%)
Mutual labels:  compiler, webassembly
Ring
Innovative and practical general-purpose multi-paradigm language
Stars: ✭ 716 (-84.13%)
Mutual labels:  compiler, webassembly
Cone
Cone Programming Language
Stars: ✭ 257 (-94.31%)
Mutual labels:  compiler, webassembly
Customasm
💻 An assembler for custom, user-defined instruction sets! https://hlorenzi.github.io/customasm/web/
Stars: ✭ 211 (-95.32%)
Mutual labels:  compiler, webassembly
Evm2wasm
[ORPHANED] Transcompiles EVM code to eWASM
Stars: ✭ 96 (-97.87%)
Mutual labels:  compiler, webassembly
Bytecoder
Rich Domain Model for JVM Bytecode and Framework to interpret and transpile it.
Stars: ✭ 401 (-91.11%)
Mutual labels:  compiler, webassembly
Wasm Forth
A Forth implementation compiling to WebAssembly.
Stars: ✭ 92 (-97.96%)
Mutual labels:  compiler, webassembly
Naskah
Bahasa pemrograman dengan sintaks Bahasa Indonesia (Programming language with Indonesian syntax) 🇮🇩
Stars: ✭ 132 (-97.08%)
Mutual labels:  compiler, webassembly
Viper
[WIP] A Pythonesque language with a design that focuses on efficiency and expressiveness. Compiles to WebAssembly
Stars: ✭ 23 (-99.49%)
Mutual labels:  compiler, webassembly
Wag
WebAssembly compiler implemented in Go
Stars: ✭ 177 (-96.08%)
Mutual labels:  compiler, webassembly
Turboscript
Super charged typed JavaScript dialect for parallel programming which compiles to WebAssembly
Stars: ✭ 487 (-89.21%)
Mutual labels:  compiler, webassembly
Webassemblyjs
Toolchain for WebAssembly
Stars: ✭ 566 (-87.46%)
Mutual labels:  compiler, webassembly
Ppci
A compiler for ARM, X86, MSP430, xtensa and more implemented in pure Python
Stars: ✭ 210 (-95.35%)
Mutual labels:  compiler, webassembly
Webml
A Standard ML Compiler for the Web
Stars: ✭ 326 (-92.78%)
Mutual labels:  compiler, webassembly



Walt | Alternative Syntax for WebAssembly | Demo

Build Status contributions welcome Coverage Status code style: prettier Gitter chat

Walt is an alternative syntax for WebAssembly text format. It's an experiment for using JavaScript syntax to write to as 'close to the metal' as possible. It's JavaScript with rules. .walt files compile directly to WebAssembly binary format.

Highlights:

  • Write "close to the metal" JavaScript!
  • No C/C++ or Rust required, just typed JavaScript.
  • NO LLVM/binary toolkits required, zero dependencies 100% written in JS.
  • Fast compilation, integrates into webpack!

📖 Read the Quick Start Guide

🚀 Try it out in the Walt Explorer.

🙏 Contributions are welcomed! Contributing guide.

🐥 Current status: Alpha

Roadmap

Problem

Writing zero-overhead, optimized WebAssembly is pretty tough to do. The syntax for .wat files is terse and difficult to work with directly. If you do not wish to use a systems language like C or Rust, then you're kind of out of luck. Your best bet (currently) is to write very plain C code, compile that to .wast and then optimize that result. Then you're ready to compile that into the final WebAssembly binary. This is an attempt to take C/Rust out of the equation and write 'as close to the metal' as possible without losing readability.

I feel like this is currently a problem. Most Web engineers are not familiar with the C family languages or Rust. It's a barrier for wide spread adoption of WebAssembly. A competent Front-end engineer should be able to edit WebAssembly as easily as any other systems programmer.

Solution

Provide a thin layer of syntax sugar on top of .wat text format. Preferably porting as much of JavaScript syntax to WebAssembly as possible. This improved syntax should give direct control over the WebAssembly output. Meaning there should be minimal to none post optimization to be done to the wast code generated. The re-use of JavaScript semantics is intentional as I do not wish to create a brand new language.

Here is what an example of a .walt module which exports a recursive Fibonacci function looks like:

export function fibonacci(n: i32): i32 {
  if (n <= 0) return 0;

  if (n == 1) return 1;

  return fibonacci(n - 1) + fibonacci(n - 2);
}

When this code is ran through the walt compiler you end up with a buffer which can be used to create a WebAssembly module with a fibonacci export just as you would expect. All done with familiar JS syntax and without any external binary toolkits! A working demo of this exists in the fibonacci-spec.js unit test file.

Project Goals

The ultimate goal of Walt is to make WebAssembly accessible to average JavaScript engineer by providing a subset of JavaScript syntax which compiles to WebAssembly bytecode directly. That WebAssembly should be easy to make use of and simple to integrate into an existing project with the current build tools.

Use cases

Pretty much everyone who wants a quick-start into wasm can use Walt to get there. The use-cases are not specific to this project alone but more to WebAssembly in general. The fact that Walt does not require a stand-alone compiler and can integrate into any(almost?) build tool still makes certain projects better candidates over others.

  • Web/Node libraries, looking to improve performance.
  • Games
  • Projects depending on heavy real-time computation from complex UIs to 3D visualizations
  • Web VR/AR
  • Anyone interested in WebAssembly who is not familiar with system languages.

See Wiki for detailed design decisions etc.

Prior Art

  • wah - A slightly higher level syntax on top of the wasm text format
  • mini-c - Experimental C to WebAssembly compiler

Contributors

ballercat tbroadley thomassturm Baransu whitecrownclown balajmarius
ballercat tbroadley thomassturm Baransu whitecrownclown balajmarius
hlaaftana ForsakenHarmony hamlim petetnt novoselrok Dragas
hlaaftana ForsakenHarmony hamlim petetnt novoselrok Dragas
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].