Findings from investigating the Factor VM, and experiments with the language, shared with the Factor team.
The build-windows-arm CI job fails in core/kernel/kernel-tests.factor at
[ f 0 alien-unsigned-1 ] [ vm-error? ] must-fail-with. This is not caused
by the PRs it appears on.
trampoline,
which has no Windows unwind data. When a primitive’s C++ code faults,
Windows cannot unwind back to the Factor frame whose exception handler would
turn the fault into a vm-error, so the process dies with 0xC0000005.trampoline2, used for FFI calls with stack arguments), for the team to
choose between.The zig-vm-fuzzing branch adds a fuzzer for the Zig VM that runs random
GC-heavy Factor programs on it and on the C++ VM, and compares the output.
It also adds GC stress flags to the Zig VM (-gc-zeal, -gc-zeal-code,
-nursery-budget, -verify-heap).
zig build --fuzz.On glibc the Zig VM’s (format-float) returns an empty byte-array for
every call, so sprintf with %f or %e fails, and 41 formatting
tests fail. The C++ VM is unaffected.
LC_ALL_MASK in src/primitives/math.zig is
0xFFF, which glibc’s newlocale rejects with EINVAL (glibc’s mask is
0x1FBF).zig-vm-format-float-locale branch.The symbolic-algebra branch adds a computer algebra system in
extra/math/symbolic: symbolic expressions and simplification, derivatives
and integrals, limits, user-defined rewrite rules, and compilation of an
expression back into a quotation.