Assuming Guile and Chickadee are installed on your system, a fresh
project can be built like so:
./boostrap.sh
./configure
make -j$(nproc)
```
After the build system is initialized, only `make` needs to be run to
recompile the Scheme modules.
Note: On hosted guix the configure script might find the host guile
version instead of the guix provided one. This can lead to
incompatible bytecode errors. To force to use a consistent guile use
```
./configure GUILE=$(which guile)
```
to ensure the right version is configured.
** Running the game
To run the game from the source checkout, use the `pre-inst-env`
wrapper script:
```
./pre-inst-env run-game
```
** REPL-driven development
After the game is launched, a Guile REPL server will be running on
port 37146. We recommend using the
[Geiser](https://geiser.nongnu.org/) Emacs extension for connecting to
it using `M-x connect-to-guile`. Once Geiser connects to the REPL,
the game can be modified while it runs!
When the environment is set as indicated above and the emacs direnv
module is enabled, we can run `geiser-guile` as usual and everything
should work as expected.
To restart the game on crash I use *watchexec* to observe the folder and
restart on crash when the code is updated. That avoids scrolling
errors so I can read the error and immediately see if it is fixed on
saving.
```
$ watchexec -e .scm ./pre-inst-env run-game
```
** TODO Bundling
Use `guix pack`.
For this we need a proper package definition in a module with the
build instructions and sources and outputs.
I followed the instructions at [[https://guix.gnu.org/en/blog/2023/from-development-environments-to-continuous-integrationthe-ultimate-guide-to-software-development-with-guix/][Ultimate Guide to Software Development