jolt/test/spec
Yogthos 7d1e1f42e1 feat: clojure.core.async on Janet fibers (Phase 1 — API layer)
Janet fibers are stackful coroutines, so a go block is just its body run in a
fiber that parks on channel ops by yielding to the event loop — the interpreter
call stack rides along, no CPS/state-machine transform. So <!/>! work anywhere
(inside try, nested fns, loops), unlike Clojure's go macro.

src/jolt/async.janet implements chan/chan?/close!/<!/>!/<!!/>!!/go/go-loop/
thread/alts!/timeout/put!/take! over ev/ channels and fibers, installed as the
clojure.core.async namespace (pre-populated in init, so require finds it).

A channel is a pair of ev/chans (:ch values + :done close-signal); a take is
(ev/select :ch :done), which drains buffered values before the close signal —
giving Clojure's drain-then-nil semantics without the buffer loss of
ev/chan-close, and with no leaked fibers (close! just closes :done).

Single-threaded cooperative scheduling: <! (park) and <!! (block) coincide.
Dynamic-var conveyance (Phase 2) and channel transducers (Phase 3) are TODO.

spec: test/spec/core-async-spec (16 cases — go/channels, buffering+close,
go-loop pipelines, alts!/timeout, parking inside try/nested-fn). jpm test green.
2026-06-05 15:17:15 -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: clojure.core.async on Janet fibers (Phase 1 — API layer) 2026-06-05 15:17:15 -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
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