https://github.com/milosgajdos/wasm-playground
Learning WASM
https://github.com/milosgajdos/wasm-playground
playground wasm webassembly
Last synced: about 2 months ago
JSON representation
Learning WASM
- Host: GitHub
- URL: https://github.com/milosgajdos/wasm-playground
- Owner: milosgajdos
- License: apache-2.0
- Created: 2018-12-18T10:40:35.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-14T00:07:28.000Z (over 2 years ago)
- Last Synced: 2025-04-06T10:02:46.098Z (about 2 months ago)
- Topics: playground, wasm, webassembly
- Language: HTML
- Homepage:
- Size: 1.38 MB
- Stars: 2
- Watchers: 0
- Forks: 1
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# wasm-playground
This repo contains various samples of programs I hacked when learning about [WASM](https://webassembly.org/).
# Prerequisites
In order to get something meaningful out of following the cruft stored in this repo you need to install some software on your workstation first:
* `CMake` **version 3.2 or higher** ([homebrew](https://brew.sh/) formula/package is available for macOS users)
* You need to install WABT: [The WebAssembly Binary Toolkit](https://github.com/WebAssembly/wabt)
* You need to install [Emscripten](https://kripken.github.io/emscripten-site/docs/getting_started/downloads.html) Toolkit
* You need to install [Rust](https://www.rust-lang.org/tools/install) and its toolchain
* You need to install [nodejs](https://www.npmjs.com/get-npm) (yes, JavaScript headaches will inevitably ensue)
* You need a browser which supports WASM. In my case that's [firefox](https://www.mozilla.org/en-GB/firefox/new/) which has WASM enabled by default in version 52+## WABT
The toolkit contains some annoying `git` submodules so you need to clone the repo `recursive`ly
```
git clone --recursive https://github.com/WebAssembly/wabt
cd wabt
make
```You can install the built `wabt` tools by running
```
make install
```
On macOS these are installed into `/usr/local/bin`.## Emscripten
The guide available on the URL mentioned above is pretty straightforward; I'm adding the list of commands here so I dont have to browse through and open "hundreds" of browser tabs:
```
git clone https://github.com/juj/emsdk.git
cd emsdk
./emsdk install latest
./emsdk activate latest
source ./emsdk_env.sh
```# Examples
The repo is structured into multiple subdirectories each containing some playground code written in some programming language; `clang` has source code written in `C`, `rust` in [Rust](https://www.rust-lang.org/) etc.
Each subdirectory has a list of steps how to build and run the code so you should be able to just follow the guide step by step.