OJaml / docsProject documentation

How-to guides

Separate editor diagnostics from runtime traps

Complete a task or diagnose a specific problem.

1. If a program does not run, first inspect its parse or type markers. Fix names, incompatible branches, and argument relationships before inspecting generated WebAssembly.

2. If checking succeeds but execution traps, inspect collection accesses: negative array lengths, out-of-bounds indices, empty-list head/tail, and absent map keys are guarded runtime failures. They are not recoverable OJaml exceptions.

3. Reduce the input to one failing operation, rerun it in a fresh module instance, and compare the result with the runtime-layout and validation reference. A fresh instance also avoids confusing module-lifetime allocation with persistent editor state.