WokeLang: A human-centered, consent-driven programming language.
WokeLang is a programming language designed for human collaboration, consent, and affine-use safety — without sacrificing power or performance. The defining idea is that the type system discharges the hard consent and affine-use reasoning for you, so dangerous or destructive operations are scaffolded at the language level rather than left to convention.
It combines:
-
Readable, English-like syntax with a statically typed core.
-
Hindley-Milner-style type inference (scalar and unit types today; broader polymorphic inference is a roadmap item).
-
Consent-aware features like
only if okay,thanks to, andmeasured in(units of measure) for ethical, self-documenting code.
The primary implementation is a Rust toolchain in src/; a smaller OCaml
reference core in core/ cross-checks the language semantics end-to-end.
| Aspect | State |
|---|---|
Phase |
Implementation (~35% complete; version 0.1.0). |
Primary implementation |
Rust toolchain in |
Reference core |
OCaml in |
Tests |
173 Rust library tests passing. |
Binaries |
|
Frontier |
Integrating echo types ( |
Editor support |
Tree-sitter / TextMate grammar drives passive syntax highlighting. The VS Code
extension is currently syntax-only (see |
git clone https://github.com/hyperpolymath/wokelang.git
cd wokelang
# Build the Rust toolchain (Rust stable; see .tool-versions)
cargo build --releaseTo build the OCaml reference core as well:
dune build ./corecargo run --release --bin woke -- replExample REPL session:
wokelang> remember x = 5 measured in km wokelang> x + 3 measured in km Result: 8 measured in km
Adding mismatched units (5 measured in km + 3 measured in kg) is a compile-time
type error.
# Hello World
cargo run --release --bin woke -- run examples/01_hello.woke
# Fibonacci
cargo run --release --bin woke -- run examples/13_fibonacci.woke
# List all examples
ls examples/*.woke| Feature | Example | Why it matters |
|---|---|---|
Human syntax |
|
Reads like plain English. |
Consent gates |
|
Ethical scaffolding for dangerous operations. |
Gratitude blocks |
|
Acknowledges contributors in the code itself. |
Units of measure |
|
Dimensional analysis prevents unit-mismatch bugs at compile time. |
Pipelines |
|
Intuitive left-to-right data transformations. |
Empathy annotations |
|
Carries emotional / authorial context alongside code. |
|
Note
|
Some surface features described in the language spec and research paper
(for example a blockchain FFI bridge and a WASM target) are design commitments
rather than production-ready integrations. See EXPLAINME.adoc for the honest
"what is implemented vs. what is designed" breakdown.
|
wokelang/
├── src/ # PRIMARY Rust toolchain
│ ├── lexer/ # Tokeniser (logos): remember, measured in, only if okay, thanks to, then
│ ├── parser/ # Recursive-descent parser → AST
│ ├── ast/ # AST node definitions
│ ├── typechecker/ # Hindley-Milner-style inference + Unit dimensional analysis
│ ├── interpreter/ # Tree-walking interpreter (woke run)
│ ├── vm/ # Bytecode VM: compiler, machine, optimizer
│ ├── codegen/ # Code generation backend
│ ├── lsp/ # Language Server Protocol (binary: woke-lsp)
│ ├── dap/ # Debug Adapter Protocol (binary: woke-dap)
│ ├── formatter/ # Canonical-style formatter
│ ├── linter/ # Style + consent-gate lint rules
│ ├── security/ # Security analysis passes
│ ├── stdlib/ # Standard library modules
│ ├── abi/ ffi/ # ABI / FFI boundary
│ ├── modules.rs # Module system
│ ├── main.rs repl.rs # CLI entry point + REPL
│ └── bin/ # woke-lsp.rs, wokelang-dap.rs
├── core/ # OCaml reference core: lexer.mll + parser.mly + eval.ml (dune)
├── spec/ # Language specification: grammar.ebnf, axiomatic-semantics, SPEC.core.scm
├── examples/ # .woke example programs
├── conformance/ # Conformance test suite
├── fuzz/ # ClusterFuzzLite fuzzing harnesses
├── verification/ # Formal verification artefacts
├── editors/ # Editor integration (TextMate grammar; VS Code = syntax-only)
├── wiki/ # In-tree project wiki (start at wiki/Home.adoc)
├── docs/ # Documentation (architecture, sessions, PALIMPSEST, …)
├── contractiles/ # Contractile definitions (must / trust / dust / bust)
├── .machine_readable/ # Structured project metadata (6a2/, anchors/, svc/k9, bot_directives/, …)
├── .github/workflows/ # CI/CD (rust-ci, dogfood-gate, e2e, governance, hypatia-scan, …)
├── Cargo.toml # Rust workspace manifest
├── dune-project # OCaml build configuration
├── Justfile / Mustfile # Developer recipes + mandatory-check runner
└── README.adoc # This fileWokeLang’s production toolchain needs only Rust stable (.tool-versions pins
rust stable). The OCaml reference core additionally needs OCaml + dune
menhir. Reproducible environments are provided via Guix (guix.scm, primary)
and Nix (flake.nix, fallback).
# Rust toolchain
cargo build --release
cargo test # 173 library tests
# OCaml reference core
dune build ./core
dune runtest ./coreWokeLang uses a Mustfile to enforce mandatory checks before commits and releases:
must run # all mandatory checks (security, tests, format)
just lint # lint / security checks
just test # test suite
just fmt # formattingThe contractile system lives under contractiles/ (and the machine-readable
mirror under .machine_readable/contractiles/):
-
must/— mandatory requirements (MUST pass) -
trust/— trust boundaries -
dust/— external dependencies -
bust/— teardown / cleanup contracts
Self-validation (K9) templates live under .machine_readable/svc/k9/.
WokeLang follows the Hyperpolymath Standard:
-
Licence: MPL-2.0 (SPDX header on every file).
-
Language policy: an allowed / banned language set (for example, no TypeScript, Node.js, Go, or Python) enforced by the
governanceworkflow. -
CI: a multi-workflow GitHub Actions suite (
rust-ci,ocaml-core,e2e,dogfood-gate,governance,security,codeql,scorecard,secret-scanner,hypatia-scan, ClusterFuzzLite, mirror, instant-sync, …). -
Dogfooding gate: the repo applies its own tooling (a2ml lint, K9 self-validation, empty-lint, Groove discovery, eclexiaiser).
See wiki/CI-and-Governance.adoc for the full picture, and .machine_readable/
for the structured project state.
-
wiki/Home.adoc— in-tree project wiki (Overview, Architecture, CI & Governance, Roadmap). -
EXPLAINME.adoc— honest "claims vs. receipts" walkthrough of the codebase. -
spec/— the language specification. -
docs/— architecture notes, session reports, and the Palimpsest licence philosophy. -
arxiv-consent-aware-programming.tex— the research paper on consent-aware programming, for which WokeLang is the reference implementation.
-
Eliminate proof escape hatches; tighten the formal-verification story.
-
Integrate echo types into the typechecker (frontier workstream).
-
Restore a full LSP client for the VS Code extension once the estate ABI/FFI layer lands (the Rust
woke-lspserver already works with any LSP-capable editor). -
Broaden Hindley-Milner inference over closures and module types.
See ROADMAP.adoc and wiki/Roadmap.adoc.
-
Author / maintainer: Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>
-
Contributing: see
CONTRIBUTING.adoc. -
Code of Conduct: see
CODE_OF_CONDUCT.md.