The README makes claims about a human-centered programming language with a Rust compiler, consent gates, unit types, and blockchain FFI. This file backs them up with specific module paths, data-flow through the compiler pipeline, and honest notes about what is a working implementation vs. a design commitment.
WokeLang is a standalone language in the hyperpolymath estate, designed around
three principles: human-readable syntax (English-like keywords), ethical
scaffolding (consent gates, gratitude blocks, empathy annotations), and type
safety with dimensional analysis (units of measure enforced at compile time).
The primary implementation is a Rust compiler/interpreter (src/, Cargo.toml)
that runs WokeLang programs via a tree-walking interpreter or compiles them to
bytecode for the WokeLang VM. A WASM target is a design commitment (see Claim 2).
An OCaml reference core (core/, built with dune + menhir) provides an
independent AST + evaluator pipeline used for research, semantics
cross-checking, and the end-to-end CI gate. (Note: wokelang.opam is currently
an intentionally empty stub; the OCaml core builds from dune-project.)
The frontier workstream integrates echo types — hyperpolymath/echo-types,
a constructive Agda formalization of fiber-based structured loss — into the type
checker, backed by a near-first-principles machine-checked proof narrative
(Isabelle preferred), so the language discharges consent / affine-use safety for
the user automatically.
WokeLang is a programming language designed for human collaboration, empathy, and safety — without sacrificing power or performance. It combines Python’s readability with Rust’s performance. Hindley-Milner type inference with JavaScript’s expressiveness.
How it works.
The Rust compiler pipeline in src/ follows this data path:
-
src/lexer/(mod.rs,token.rs) — tokenises.wokesource text into aTokenstream including WokeLang-specific tokens (remember,measured in,only if okay,thanks to,then). -
src/parser/— recursive-descent parser producing a WokeLang-specific AST (src/ast/). -
src/typechecker/mod.rs— static type inference; theUnitenum encodes dimensional analysis (Meter,Kilogram,Second, etc.) so that5 measured in km + 3 measured in kmis valid but5 measured in km + 3 measured in kgis a type error at compile time. TheTypeErrortype carries a message string and implementsstd::error::Error. -
src/interpreter/— tree-walking interpreter forwoke run. -
src/vm/(machine.rs,compiler.rs,bytecode.rs,optimizer.rs) — bytecode compiler and stack VM forwoke compile+woke run-vm. -
src/codegen/— WASM code generation target. -
src/main.rs— CLI entry point usingclap; subcommandsrun,repl,compile,run-vm,disassemble,check,lint,format. -
src/repl.rs— interactive REPL loop.
src/lsp/ provides a Language Server Protocol implementation for editor
integration, and src/dap/ provides a Debug Adapter Protocol implementation.
Honest caveat.
The type checker currently implements a simplified form of Hindley-Milner
inference — the README’s claim of full HM unification applies to scalar types
and unit types, but full polymorphic inference over closures and module types
is a roadmap item.
PROOF-NEEDS.md and PHRONESIS-ALIGNMENT-GAP.md document the outstanding
obligations.
Vyper FFI:
vyper call "gratitude.add_entry"— immutable, auditable blockchain ops. WASM Target: Compile to run in browsers/Node.js. Portable and fast.
How it works (and what is real).
src/codegen/ declares a WasmCompiler scaffold for a future WASM backend.
examples/ contains .woke files demonstrating the implemented feature set
including only if okay consent gates (08_consent.woke, 22_consent_system.woke),
thanks to gratitude blocks (17_gratitude.woke), and security examples.
src/stdlib/ provides the standard library (array, chan, io, json,
math, net, string, time), where io and net route side effects
through the consent machinery.
fuzz/ contains fuzzing harnesses (driven by ClusterFuzzLite in CI).
verification/ holds formal verification artefacts.
Honest caveat.
The Vyper / blockchain FFI and the WASM target are design commitments described
in the README feature table, the language spec, and the research paper — they are
not working implementations in the current tree. There is no vyper bridge in
src/stdlib/, and the src/codegen/ WASM module is a scaffold that is not yet
wired into the build or emitting binaries. Treat both as research capabilities on
the roadmap, not production-ready integrations.
| Tool / Repo | How wokelang uses it |
|---|---|
|
Pre-commit security scan gate ( |
|
Standard hyperpolymath contractile integration |
|
Container build manifest for the WokeLang compiler image (Chainguard Wolfi base) |
|
Sibling estate (home of AffineScript / my-lang). WokeLang is a standalone repository in the hyperpolymath estate, not a submodule of |
|
Account-wide ABI/FFI convention applied: |
|
WokeLang grammar source feeding editor syntax support (TextMate / tree-sitter). |
|
Editor integration: a TextMate grammar plus a VS Code extension. The VS Code extension is currently syntax-only — its ReScript LSP client was removed (banned estate-wide) and an AffineScript reimplementation is tracked in issue #78. The Rust |
|
Research paper on consent-aware programming; wokelang is the reference implementation |
|
Hypatia CI checks for banned language patterns and dangerous |
| Path | What’s There |
|---|---|
|
CLI entry point: |
|
Tokeniser: WokeLang-specific tokens including |
|
Recursive-descent parser producing the WokeLang AST |
|
AST node definitions: all statement, expression, and declaration node types |
|
Type inference: |
|
Tree-walking interpreter: evaluates typed AST directly for |
|
Stack-based bytecode VM: instruction execution, call stack management |
|
AST-to-bytecode compiler: lowers typed AST to WokeLang bytecode |
|
Bytecode instruction set definition |
|
Bytecode optimiser: constant folding, dead code elimination |
|
Code-generation scaffolding ( |
|
Language Server Protocol implementation (built as the |
|
Debug Adapter Protocol implementation (built as the |
|
Interactive REPL loop |
|
S-expression AST dump (for debugging and tooling) |
|
Standard library: |
|
Static linter: style rules, consent-gate usage checks |
|
Code formatter: canonical WokeLang style |
|
Security analysis passes: dangerous operation detection |
|
Module system: import resolution and namespace management |
|
Idris2 ABI definitions ( |
|
Rust C-ABI FFI bridge ( |
|
Tree-sitter grammar source for WokeLang syntax |
|
TextMate grammar + VS Code extension (currently syntax-only; ReScript LSP client removed, AffineScript reimpl tracked in issue #78) |
|
|
|
Language specification documents |
|
Formal verification artefacts for core language properties |
|
Fuzzing harnesses for parser and typechecker |
|
Criterion benchmarks: interpreter and VM throughput |
|
OCaml reference core: |
|
Standalone Rust crate for the WASM compilation experiment ( |
|
Conformance test suite against the language specification |
|
Language documentation website source |
|
Research paper: WokeLang as reference implementation for consent-aware programming |
|
Rust workspace manifest |
|
OCaml build configuration for the |
|
Developer recipes: |
|
Outstanding formal proof obligations |
|
Documents gaps between stated design principles and current implementation |
|
Desired toolchain improvements (Idris2 type-checker integration, full HM) |
|
Container build manifest |
|
Reproducible build environments (Rust + OCaml toolchain); Guix primary, Nix fallback |