diff --git a/NEXT.md b/NEXT.md index d22790f..da43f24 100644 --- a/NEXT.md +++ b/NEXT.md @@ -346,6 +346,30 @@ callable), no cycle detection, and a package cannot import another one. ## sand.flan is two programs +**The stated reason below is narrower than it reads, and the real fix is a +one-line change to `Load` rather than two files.** Two claims got run together: + +- *raylib does not work on wasm* — false. It works through emscripten, which + plan.org says itself. What is true is that it does not work on the **wasi** + path, which is what the headless table targets, and which has no GL and no + browser. +- *a game loop cannot be expressed on wasm* — false. The browser cannot be + blocked, so a web build drives the loop with `emscripten_set_main_loop` + instead of a `while`. That is a different `main`, not a different program, + and nothing about it requires the simulation to live in its own package. + +What actually justifies the split is smaller and stands on its own: **the +headless test needs no window and no input on any target.** `sand.flan` could +not be that test even natively — with no mouse the grid stays empty and +`settle` and `move-grain` never run on real data. + +What makes the split *mandatory* rather than chosen is the packaging +limitation: **`Load` collects a package's C sources and link flags whether or +not anything references the package.** Make that conditional and the two files +become a preference. That is the thing to fix, and it is not large. + + + plan.org wants sand tested twice — interactive at 120 fps, and headless over N frames with the grid hashed, the version CI runs on native *and* wasm32. Those cannot be one binary: `Load` collects a package's C sources and linker