anth64 a290be5dcc feat: implement .tmp directory isolation for safe hot-reload
Add foundation for cross-platform hot-reload system by isolating
loaded modules from source files using a temporary directory.

Changes:
- Add configurable tmp directory parameter to stk_init()
  (defaults to mods/.tmp/ if not specified)
- Copy all modules from mods/ to .tmp/ on initialization
- Load modules exclusively from .tmp/ directory
- Clean up .tmp/ directory on shutdown
- Add cross-platform file operations:
  * platform_mkdir() - create directories
  * platform_copy_file() - copy files
  * platform_remove_file() - delete files
  * platform_remove_dir() - delete directory and contents
- Improve BSD kqueue implementation to detect file overwrites
  (adds individual file watches with NOTE_WRITE)

This isolates the loaded shared libraries from source files,
preventing segfaults when users overwrite mods using cp/copy
operations. The actual reload logic remains unimplemented
(marked as TODO in stk_poll switch cases).
2026-01-18 21:26:17 +01:00
2025-12-20 08:22:41 -05:00
2025-10-08 19:01:44 +02:00
2025-09-28 14:21:06 +00:00

stk (Stalwart Toolkit)

stk is a lightweight, modular toolkit for building games and game engines. It provides a portable foundation for dynamically loading modules, native or WASM, without enforcing any architecture or design choices.

It is designed to run on modern systems running POSIX and Windows.


Key Features

  • Dynamic module loading (native .so / .dll)
  • Hot-swapping of modules at runtime
  • Optional WASM support for multi-language modules
  • Developer tools: lightweight metadata, logging/tracing, and dependency management
  • Minimal, portable API

stk is non-opinionated: developers control architecture, engine design, and game logic while relying on a predictable, lean foundation.

S
Description
A lightweight, portable, modular toolkit for building games and game engines.
Readme MPL-2.0 244 KiB
Languages
C 88.3%
Makefile 10.8%
Shell 0.9%