Hello everyone,
I've been working on Nim bindings for TIC-80 using WASM and thought I'd share in case anyone else finds them useful.
Repository: https://codeberg.org/janakali/tic80-wasm-nim
If you've never heard of TIC-80, it's a Fantasy Computer - a platform for making, playing and sharing tiny games in various scripting languages, including Lua, JavaScript, and WASM. It's a modern take on old-school game consoles with built-in tools for code, sprites, maps, sound, and music - all packaged in a single .tic file. The "fantasy" part means it has artificial limitations (240x136 display, 16 colors, etc.) that encourage creative constraints. Maybe you've heard of a similar project - PICO-8. But this one is Free and Open Source:
The bindings I made are included with a template that lets you write TIC-80 carts in Nim, which then compile to WebAssembly and get imported into the cartridge. If you want to give it a try, here's the basic setup:
You'll need WASI-SDK (I'm using v23.0), the tic80 executable in your PATH, and Nim v2+ compiler.
git clone https://codeberg.org/janakali/tic80-wasm-nim
cd tic80-wasm-nim
export WASI_SDK_PATH="/path/to/your/wasi-sdk"
nimble runcart
I've included a couple demos with the template: a simple tetris clone and a very basic performance test (TIC-80 has a bunnymark demo for every supported language). You can compile and run each demo by passing the directory as the first argument to the build.sh script:
sh build.sh demo/blockgame
Feel free to check it out and let me know what you think. I'm open to feedback, suggestions, or contributions.
Cheers!