A bare metal physical implementation of WebAssembly. That's right, a WebAssembly CPU.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
elements
redux
.gitignore
LICENSE
README.md
_headers
index.html
package-lock.json
package.json
process.js
renovate.json
tsconfig.json
wasm-metal.d.ts

README.md

WASM Metal

A bare metal physical implementation of WebAssembly. That's right, a WebAssembly CPU. Inspired in part by this amazing talk.

GUI Microarchitecture Simulator

View the live demo.

git clone https://github.com/lastmjs/wasm-metal.git
cd wasm-metal
npm install
npm start

Go to http://localhost:5000 in your web browser.

RTL Microarchitecture Simulator

Not implemented yet.

Loading Microarchitecture Implementation to FPGA

Not implemented yet.

Roadmap

  • Understand the WebAssembly ISA
  • Implement the mircoarchitecture in HTML/CSS/JavaScript
    • This will be a GUI simulator of the microarchitecture
    • This simulator will become the specification for the microarchitecture
    • It will allow us to quickly experiment with hardware configurations
    • It will allow us to iterate and learn how the microarchitecture should work
  • Implement the microarchitecture as an RTL design in an HDL
  • Simulate the RTL design
  • Test the implementation on an FPGA
  • Design the ASIC

Why is this a good idea?

  • Maybe it's not, but who cares
  • The world is moving to WebAssembly
  • Some of the biggest and potentially most world-changing projects are implementing their virtual machines as WebAssembly virtual machines (DFINITY, Ethereum)
  • The bytecode is being designed as a compilation target for low-level languages first
  • The bytecode is meant to execute at near-native speeds on a variety of underlying ISAs
  • Java processors already offer potential benefits, even being compilation targets for a high-level language
  • Cutting out the translation from WebAssembly to the underlying ISAs could provide efficiency benefits
  • We could get rid of WebAssembly virtual machines entirely, and replace them with WebAssembly physical machines
  • If all SIM cards are Java processors, imagine what WebAssembly processors could do. I'm betting that WebAssembly is a better bytecode than Java bytecode for what Java bytecode is doing with microcontrollers, so WebAssembly could take over all spaces that Java processors currently have

Prior art