Your First Space App
Goal: run and inspect a small app without learning maintainer internals first.
This tutorial uses the Snake example as the smallest current app-shaped starting point.
Run the Example
From a Space checkout, build the runtime and launch Snake with its assets before the shared Space assets:
sh
make build
SPACE_ASSETS_PATH="$(pwd)/examples/snake/assets:$(pwd)/assets" ./build/space -m mainThe first asset root supplies the app. The second asset root supplies shared runtime assets that the host still needs.
Inspect the App Shape
Open the Snake example and trace these files first:
assets/lua/main.fnlis the default entrypoint loaded byspace -m main.assets/lua/snake/app.fnlis the hostable module that connects the app to the Space host.assets/lua/snake/game.fnlis pure app-owned logic for state and rules.
Keep app-owned logic separate from host-facing setup where possible. That separation makes it easier to test state changes, replace presentation, and understand which parts depend on host capabilities.
Next Steps
- App Layout Guide — understand the expected repository and asset layout.
- App Module Contract — look up the current entrypoint and hostable-module contract.
- Examples — compare curated starting points.
