jolt/test/spec
Yogthos 8be7743b26 feat: futures on real OS threads (ev/thread)
Implement clojure.core futures backed by Janet's ev/thread for genuine
parallelism (CPU-bound work can use a second core, unlike cooperative go
blocks):

- future / future-call, deref + (deref f timeout-ms timeout-val), future?,
  future-done?, future-cancel, future-cancelled?; realized? on futures.
- A worker OS thread computes and marshals back a [:ok v]/[:error e] result
  over a thread-chan; a parent-side collector fiber caches it and closes a
  broadcast latch so any number of deref-ers unpark.
- Snapshot semantics: separate heaps mean the body + captured state are copied
  to the worker and only the result is copied back (mutating a captured atom
  does not propagate). Documented in README.
- future-cancel can't interrupt a Janet OS thread, so it marks the future
  cancelled/done (deref throws, predicates flip) while the worker runs out.

clojure-test-suite baseline 3915 -> 3913: implementing future unskips
realized_qmark.cljc's (when-var-exists future ...) block, which depends on
JVM Thread/sleep + real thread interruption jolt can't provide; deref then
re-raises the unresolved-Thread/sleep error. Documented at the baseline.

Spec: test/spec/futures-spec.janet (18 cases).
2026-06-05 20:00:11 -04:00
..
control-flow-spec.janet fix: case composite constants, associative?/reversible?, update non-fn args, nth nil 2026-06-05 10:19:43 -04:00
core-async-spec.janet feat: core.async Phase 3 — channel transducers + dropping/sliding buffers 2026-06-05 15:40:24 -04:00
destructuring-spec.janet test(spec): control-flow, functions, destructuring — fix loop destructuring 2026-06-05 00:16:15 -04:00
exceptions-spec.janet test: fold ported-clojure batteries into spec 2026-06-05 07:50:16 -04:00
functions-spec.janet test(spec): control-flow, functions, destructuring — fix loop destructuring 2026-06-05 00:16:15 -04:00
futures-spec.janet feat: futures on real OS threads (ev/thread) 2026-06-05 20:00:11 -04:00
host-interop-spec.janet test(spec): macros, reader, host-interop, namespaces — fix def-doc, resolve, %& 2026-06-05 00:35:48 -04:00
lazy-seqs-spec.janet test: fold phase ports into spec; promote compile-mode test 2026-06-05 01:07:09 -04:00
lists-spec.janet test(spec): collections contract (sequences, vectors, lists, maps, sets) 2026-06-05 00:08:37 -04:00
macros-spec.janet test(spec): macros, reader, host-interop, namespaces — fix def-doc, resolve, %& 2026-06-05 00:35:48 -04:00
maps-spec.janet feat: distinguish map entries from vectors; min-key NaN ordering; subvec float coercion 2026-06-05 14:22:06 -04:00
metadata-spec.janet test(spec): lazy sequences, transducers, metadata 2026-06-05 00:26:44 -04:00
multimethods-spec.janet test: fold phase ports into spec; promote compile-mode test 2026-06-05 01:07:09 -04:00
namespaces-spec.janet fix: catch binds unwrapped thrown value; var-set targets thread binding 2026-06-05 01:23:52 -04:00
numbers-spec.janet feat(strictness): numeric ops reject non-numbers/non-integers like Clojure 2026-06-05 10:58:21 -04:00
predicates-spec.janet fix: case composite constants, associative?/reversible?, update non-fn args, nth nil 2026-06-05 10:19:43 -04:00
protocols-spec.janet test: fold phase ports into spec; promote compile-mode test 2026-06-05 01:07:09 -04:00
reader-syntax-spec.janet docs: bring EBNF grammar and project docs up to date 2026-06-05 14:40:47 -04:00
sequences-spec.janet feat(strictness): seq/shuffle/NaN?/nthrest/nthnext reject bad args 2026-06-05 14:03:23 -04:00
sets-spec.janet fix: value-semantics for collection keys/elements; set literals evaluate 2026-06-05 01:02:00 -04:00
state-spec.janet test: fold ported-clojure batteries into spec 2026-06-05 07:50:16 -04:00
strings-spec.janet feat(strictness): subs validates bounds; assoc! bounds-checks vector index 2026-06-05 14:07:14 -04:00
transducers-spec.janet fix: transducers/reduce short-circuit over infinite seqs via reduced 2026-06-05 09:18:35 -04:00
transients-spec.janet feat(strictness): subs validates bounds; assoc! bounds-checks vector index 2026-06-05 14:07:14 -04:00
truthiness-spec.janet test: fold ported-clojure batteries into spec 2026-06-05 07:50:16 -04:00
vectors-spec.janet test(spec): collections contract (sequences, vectors, lists, maps, sets) 2026-06-05 00:08:37 -04:00