Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Nim exceptions

A topic by Tom created Jan 21, 2022 Views: 93
Viewing posts 1 to 1
Host

For those using Nim, large portions of the standard library can raise exceptions, and even if exceptions don't happen, this can end up trying to import the wasi `proc_exit` function via Nim's `quit`. This makes the carts fail to load in the WASM-4 web client.

To work around this, there's now a `-d:nimNoQuit` option you can specify when calling Nim, but you have to use a Nim nightly, such as via:

choosenim devel --latest

The latest changes to unreleased wasm4 also include `-d:nimNoQuit` in the Nim template, but you'll need to add this to your existing build script if you already have one. (And note that this just makes `quit` do nothing rather than exit or hang the execution, so best to avoid circumstances that actually call it.)