Introduction
AllTheLanguages is a Scrap Mechanic mod loader. It lets mods be written in any language that compiles to WebAssembly (WASM): C, C++, Rust, Go (with TinyGo), Zig, AssemblyScript and others.
A WASM mod is an ordinary Workshop mod. It lists AllTheLanguages as a dependency, ships its
compiled code as a .json file, and keeps everything else (shapes, tools, GUI layouts,
inventory text) exactly as any other mod would. Players subscribe to it like any other mod.
What you can write in WASM
Section titled "What you can write in WASM"- Mod-wide logic: code that runs every tick on the server or the client, without anything placed in the world.
- Parts and tools: script classes for shapes, tools, characters, harvestables, units, players, worlds and scriptable objects.
- Whole custom games: the game script, its worlds and their terrain generators.
Everything the game's Lua API offers is reachable from WASM, including other Lua mods and other WASM mods.
Pick a language
Section titled "Pick a language"| Language | SDK | Start with |
|---|---|---|
| C++ | The main SDK. Object-oriented, mirrors sm.*, needs no standard library. |
Writing a mod in C++ |
| Rust | The atl crate. A no_std port of the C++ SDK. |
Writing a mod in Rust |
| TinyGo | The atl and atl/sm packages. The C++ SDK's API in Go. |
Writing a mod in TinyGo |
| C | atl.h, header-only bindings to the raw bridge. |
Writing a mod in C |
| Anything else | Import the atl functions described in The GDT. |
The GDT |
Next steps
Section titled "Next steps"- Read How it works for the moving parts.
- Build your first mod.