Skip to content

Awareness-focused programming language for conscious computing

License

Notifications You must be signed in to change notification settings

hyperpolymath/wokelang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

120 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

WokeLang

WokeLang: A Human-Centered Programming Language

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.

  • Unique features like thanks to, only if okay, and measured in for ethical, self-documenting code.

Table of Contents

  • [πŸš€ Quick Start](#-quick-start)

  • [🌟 Key Features](#-key-features)

  • [πŸ“¦ Project Structure](#-project-structure)

  • [πŸ›  Development](#-development)

  • [πŸ“š Examples](#-examples)

  • [🎯 Next Steps](#-next-steps)

  • [🀝 Community](#-community)

πŸš€ Quick Start

1. Install

git clone https://github.com/hyperpolymath/wokelang.git
cd wokelang

# Install dependencies (asdf + tools)
asdf install  # installs rust, deno, idris2, zig

# Build
cargo build --release

2. Run the REPL

cargo run --release -- repl

Example REPL Session:

wokelang> remember x = 5 measured in km
wokelang> x + 3 measured in km
Result: 8 measured in km

3. Run Examples

# Hello World
cargo run --release -- run examples/01_hello.woke

# Fibonacci
cargo run --release -- run examples/13_fibonacci.woke

# All examples
ls examples/*.woke

4. Build & Execute

# Compile to bytecode
cargo run --release -- compile examples/01_hello.woke -o hello.wbc

# Run on VM
cargo run --release -- run-vm hello.wbc

```markdown
## 🌟 Key Features

| Feature               | Example                                  | Why It’s Special                          |
|-----------------------|------------------------------------------|-------------------------------------------|
| **Human Syntax**      | `to add(a, b) -> a + b`                  | Reads like plain English.                 |
| **Empathy Annotations** | `@feeling(confident=true)`              | Codes with emotional context.             |
| **Consent Gates**     | `only if okay "Delete?" { ... }`         | Ethical scaffolding for dangerous ops.    |
| **Gratitude Blocks**  | `thanks to { "Alice" β†’ "Fixed X!" }`      | Acknowledges contributors in code.       |
| **Units of Measure**  | `5 measured in km`                       | Prevents unit-related bugs.               |
| **Pipelines**         | `data then clean then analyze`           | Intuitive data transformations.          |
| **Vyper FFI**         | `vyper call "gratitude.add_entry"`      | Immutable, auditable blockchain ops.      |
| **WASM Target**       | Compile to run in browsers/Node.js.      | Portable and fast.                       |

## πŸ“¦ Project Structure

```bash
wokelang/
β”œβ”€β”€ .bot_directives/     # Bot constraint files for gitbot-fleet
β”œβ”€β”€ .claude/             # Project-specific AI instructions
β”œβ”€β”€ .github/workflows/   # CI/CD (Hypatia, CodeQL, Scorecard)
β”œβ”€β”€ .machine_readable/   # Machine-readable metadata
β”‚   └── 6scm/           # SCM checkpoint files
β”œβ”€β”€ contractiles/        # Contractile definitions
β”‚   β”œβ”€β”€ dust/           # External dependencies
β”‚   β”œβ”€β”€ k9/             # Security constraints
β”‚   β”œβ”€β”€ lust/           # Desired features
β”‚   β”œβ”€β”€ must/           # Required features & must runner
β”‚   └── trust/          # Trust boundaries
β”œβ”€β”€ docs/               # Documentation
β”‚   β”œβ”€β”€ architecture/   # Architecture docs (COMPILER-ROADMAP.adoc)
β”‚   β”œβ”€β”€ sessions/       # Development session reports
β”‚   β”œβ”€β”€ ABI-FFI-README.adoc        # ABI/FFI integration guide
β”‚   β”œβ”€β”€ DEPLOYMENT.adoc            # Deployment documentation
β”‚   β”œβ”€β”€ GAP-ANALYSIS.adoc          # Implementation gaps
β”‚   β”œβ”€β”€ NEXT-STEPS.adoc            # Development roadmap
β”‚   β”œβ”€β”€ PALIMPSEST.adoc            # License philosophy
β”‚   β”œβ”€β”€ PROVEN.md                  # proven library integration
β”‚   └── WORKERS.adoc               # Worker documentation
β”œβ”€β”€ examples/           # Example WokeLang programs
β”œβ”€β”€ ffi/
β”‚   └── zig/           # Zig FFI implementation (C ABI)
β”‚       └── src/
β”œβ”€β”€ license/            # License files
β”‚   └── PMPL-1.0-or-later.txt
β”œβ”€β”€ scripts/
β”‚   β”œβ”€β”€ install-hooks.sh  # Install git hooks
β”‚   └── setup.sh          # Setup script
β”œβ”€β”€ site/               # wokelang.org website
β”‚   β”œβ”€β”€ content/        # Markdown content
β”‚   β”œβ”€β”€ templates/      # Tera templates
β”‚   └── config.yaml     # Site configuration
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ abi/            # Idris2 ABI definitions with formal proofs
β”‚   β”‚   β”œβ”€β”€ Foreign.idr
β”‚   β”‚   β”œβ”€β”€ Layout.idr
β”‚   β”‚   └── Types.idr
β”‚   β”œβ”€β”€ ast/            # Abstract Syntax Tree
β”‚   β”œβ”€β”€ interpreter/    # Tree-walking interpreter
β”‚   β”œβ”€β”€ lexer/          # Token generation (logos)
β”‚   β”œβ”€β”€ parser/         # Parser (tokens β†’ AST)
β”‚   β”œβ”€β”€ stdlib/         # Standard library modules
β”‚   β”‚   β”œβ”€β”€ array.rs
β”‚   β”‚   β”œβ”€β”€ chan.rs     # Go-style channels
β”‚   β”‚   β”œβ”€β”€ io.rs       # File I/O with consent
β”‚   β”‚   β”œβ”€β”€ math.rs
β”‚   β”‚   β”œβ”€β”€ net.rs      # HTTP with consent
β”‚   β”‚   β”œβ”€β”€ string.rs
β”‚   β”‚   └── time.rs
β”‚   β”œβ”€β”€ typechecker/    # Hindley-Milner type inference
β”‚   β”œβ”€β”€ vm/             # Bytecode VM
β”‚   β”‚   β”œβ”€β”€ bytecode.rs
β”‚   β”‚   β”œβ”€β”€ compiler.rs
β”‚   β”‚   β”œβ”€β”€ machine.rs
β”‚   β”‚   └── optimizer.rs
β”‚   β”œβ”€β”€ main.rs         # CLI entry point
β”‚   └── repl.rs         # REPL
β”œβ”€β”€ tests/              # Test suite
β”œβ”€β”€ .tool-versions      # asdf tool versions (rust, deno, idris2, zig)
β”œβ”€β”€ AI.a2ml             # AI assistant instructions
β”œβ”€β”€ Cargo.toml          # Rust dependencies
β”œβ”€β”€ ECOSYSTEM.scm       # Ecosystem relationships
β”œβ”€β”€ META.scm            # Architectural decisions
β”œβ”€β”€ STATE.scm           # Current project state
└── README.adoc         # This file

## πŸ›  Development

### Must Runner (Contractile Enforcement)

WokeLang uses a **Mustfile** (in `contractiles/must/`) to enforce mandatory checks:

```bash
# Run all mandatory checks (security, tests, format)
must run

# Individual checks
just lint    # Security checks
just test    # Test suite
just fmt     # Code formatting

Mustfile defines requirements that MUST pass before commits/releases. See contractiles/ for full contractile system: - must/ - Mandatory requirements (MUST pass) - lust/ - Desired features (WANT to have) - dust/ - External dependencies - trust/ - Trust boundaries - k9/ - Security constraints

πŸ›  Development

Development Environment

Required Tools (managed via asdf): - Rust 1.84.0 - Compiler infrastructure - Deno 2.1.4 - Runtime (NO Node.js/npm) - Idris2 0.7.0 - ABI with formal proofs - Zig 0.13.0 - FFI C-compatible implementation

# Install asdf
git clone https://github.com/asdf-vm/asdf.git ~/.asdf

# Install plugins
asdf plugin add rust
asdf plugin add deno
asdf plugin add idris2
asdf plugin add zig

# Install versions (from .tool-versions)
asdf install

# Build
cargo build --release