wasm-snake
waforth
wasm-snake | waforth | |
---|---|---|
2 | 6 | |
7 | 456 | |
- | - | |
7.7 | 7.0 | |
2 months ago | 3 months ago | |
WebAssembly | WebAssembly | |
- | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
wasm-snake
-
Classic Snake in Direct WebAssembly Text
All of the game graphics, state and logic are written in WebAssembly Text. The host environment (Javascript) is responsible for:
Game tick loop
User input
Providing characters "0123456789GAMEOVER" byte data on game startup
Blitting the pixel buffer to the display with WebGL2
The game uses 3 virtual pages of memory (64kb each) for a total of 192kb. Within those exist the pixel buffer contents, the characters data and snake positions. For more detailed breakdown you can check src/snake.wat.
The memory is shared between WASM and JS. On each game tick, the pixel buffer region of the memory is transferred to a WebGL2 texture, uploaded to the GPU and blitted to the screen.
For more info you can refer to the repo - https://github.com/gnikoloff/wasm-snake
waforth
-
Show HN: TinyWasm – A tiny WebAssembly Runtime written in Rust
Super nice project! I also spent the last month writing a WASM interpreter ( https://github.com/rrampage/wart ) using Java 21. I started it as an excuse to try out the pattern matching in switch / sealed classes in Java. It kind of snowballed in scope and can now run Doom and Waforth ( https://github.com/remko/waforth )! Have not yet tried compiling it to WASM and running it as a meta-circular interpreter.
-
Bunch of questions about forth
Concerning the point 8. There is an online Forth system demo Thurtle (in the browser) with turtle graphics, which is based on WAForth.
-
A Dynamic Forth Compiler for WebAssembly
There's a note on the page from 2022-08-19, that a lot has been added to it. It also links to the github page[1] for the up-to-date changes.
I am a Lisp, April, APL/J/BQE, and Forth[2] aficionado. I did some file munging programs in Factor back in 2012 at my job to sort through theater attendance logs in Word to compile statistics.
[1] https://github.com/remko/waforth
[2] https://factorcode.org/
- WAForth (WASM-based ANS Forth) supports interactive "notebooks" in VSCode
What are some alternatives?
forthlisp - A Small Lisp in Forth
cforth - Mitch Bradley's CForth implementation
discussion - Discussion repository for Forth enthusiasts.
JS-Monster - JavaScript is a BEAST, JS Monster portrays that awesomeness with a mascot inspired by the JS logo.
micropolis - Automatically exported from code.google.com/p/micropolis
wasker - Wasm compiler for running Wasm on your favorite kernel
sandspiel - Creative cellular automata browser game
xxhash-wasm - A WebAssembly implementation of xxHash
owi - WebAssembly Swissknife
openfirmware - Open Firmware (IEE1275-1994) implementation by its inventor.
ESP32forth - FORTH developments for ESP32
raillisp - A fast and portable lisp implemented in forth