cek-scheme: Demonstrative Call-by-Value Scheme reference interpreter for CEK machines

[ compilers-interpreters, language, library ] [ Propose Tags ] [ Report a vulnerability ]

An educational and demonstrative reference interpreter showcasing Call-by-Value Scheme with automatic Generic1 polynomial functor dissection, first-class call/cc continuations with O(1) Copy-on-Write capture, and mutable lexical variables over the CEK abstract machine architecture.

Notice: This package is provided primarily as an executable architectural example and documentation case study within the cek ecosystem.


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.1.0.2
Change log CHANGELOG.md
Dependencies base (>=4.18 && <5), cek-core (>=0.1.0.0 && <0.2), cek-pykinos (>=0.1.0.0 && <0.2), ghc-prim (>=0.10 && <0.14), primitive (>=0.9 && <0.10), pykinos-core (>=0.1.0.0 && <0.2) [details]
Tested with ghc ==9.14.1
License (EUPL-1.2 OR Apache-2.0)
Author Nadia Yvette Chambers
Maintainer nadia.yvette.chambers@ik.me
Uploaded by nyc at 2026-11-19T20:07:50Z
Category Language, Compilers/Interpreters
Home page https://github.com/NadiaYvette/cek
Bug tracker https://github.com/NadiaYvette/cek/issues
Source repo head: git clone https://github.com/NadiaYvette/cek(packages/cek-scheme)
Distributions
Downloads 3 total (3 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for cek-scheme-0.1.0.2

[back to package description]

cek-scheme

Important Notice: This package is an educational and demonstrative reference implementation showcasing CEK machine execution with first-class continuations (call/cc), mutable lexical environments (set!), and automatic GHC Generic1 polynomial functor dissection. It is provided primarily as an executable example and architectural pattern within the cek ecosystem documentation.

Overview

cek-scheme implements a Call-by-Value mini-Scheme interpreter demonstrating how higher-order control flow and mutable state are cleanly evaluated on top of the cek abstract machine infrastructure:

  1. Pure Syntactic Spines: Arithmetic operations (SAdd, SSub, SMul), relational comparisons, and sequencing (SSeq) are evaluated without manual frame plumbing via automatic Generic1 dissection (Dissectable).
  2. First-Class Continuations (call/cc): Continuations capture the unrolled 32-frame KontStack in strictly \(O(1)\) time via Copy-on-Write (captureKontSoA). Reinstating a captured continuation (restoreKontSoA) resumes execution with zero stack unwinding.
  3. Mutable Lexical Scope (set!): Lexical variables occupy mutable cells allocated in the unboxed SoAStore.

Module Structure

  • Cek.Scheme: Primary reference evaluator and AST definitions.
  • Cek.Examples.Scheme: Backward-compatibility re-export module.

Building and Testing

cabal build cek-scheme
cabal test cek-scheme:tests

License

EUPL-1.2.