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

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain] [Publish]

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]

Properties

Versions 0.1.0.0, 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]
License EUPL-1.2
Author Nadia Yvette Chambers
Maintainer nadia.yvette.chambers@ik.me
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)
Uploaded by nyc at 2026-11-18T14:50:19Z

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


Readme for cek-scheme-0.1.0.0

[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

Building and Testing

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

License

EUPL-1.2.