It would be wonderful to make HVM4 compilable as an embedded library on WASM, iOS, Android, and Linux/macOS/Windows by adding minimal #ifdef guards to the system abstraction layer. Zero changes to the core evaluation engine.
Made 5 independent PRs/updates to do this, each on its own branch, would be great if you could take a look:
- Configurable HEAP_CAP and MAX_THREADS - Allow tuning for constrained environments (WASM linear memory, mobile address spaces).
- Platform-abstract mmap/munmap - Compile on platforms without POSIX
mmap (WASM, embedded).
- Guard dlopen/dlsym - Compile on platforms without dynamic linking (WASM, iOS App Store).
- Guard fork/execvp in AOT builder - Compile on sandboxed platforms that prohibit process spawning (WASM, iOS, Android).
- Add lib.c library entry point - Expose HVM4 internals as real linker symbols so external code can call into the runtime.
Scope
- ~50 lines changed across 5 files, plus 1 new file (
lib.c)
- All guards default to existing behavior
- All existing tests pass unchanged
- Only the system abstraction layer is touched
- Core evaluation is completely untouched
It would be wonderful to make HVM4 compilable as an embedded library on WASM, iOS, Android, and Linux/macOS/Windows by adding minimal
#ifdefguards to the system abstraction layer. Zero changes to the core evaluation engine.Made 5 independent PRs/updates to do this, each on its own branch, would be great if you could take a look:
mmap(WASM, embedded).Scope
lib.c)