Skip to content

hyperpolymath/oblibeny

Repository files navigation

OblΓ­benΓ½

Dual-Language Paradigm compiler for secure edge computing

OblΓ­benΓ½ Programming Language

Proven β€’ Secure β€’ Sustainable

What is OblΓ­benΓ½?

OblΓ­benΓ½ (Czech: "beloved" or "favorite") is a programming language that fundamentally rethinks how we write, verify, and deploy software. It combines:

πŸ” Security by Design: Two-phase compilation ensures deployment-time code is provably terminating and resource-bounded

πŸ€– First-Class AI: AI effects are typed, tracked, and verified at compile-time

βœ… Distributed Verification: BOINC-powered crowd-sourced formal verification of language properties

🌍 Sustainability-Focused: Explicit resource tracking for energy, carbon, and computational costs

πŸ“ Formally Verified: Properties proven through property-based testing and formal methods

The Two-Phase Philosophy

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ COMPILE-TIME β”‚ β”‚ DEPLOYMENT-TIME β”‚ β”‚ (Turing-Complete) β”‚ ════> β”‚ (Turing-Incomplete)β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β€’ AI Integration β”‚ β”‚ β€’ Provably Safe β”‚ β”‚ β€’ Code Generation β”‚ β”‚ β€’ Resource-Bounded β”‚ β”‚ β€’ Optimization β”‚ β”‚ β€’ No Halting Issue β”‚ β”‚ β€’ Metaprogramming β”‚ β”‚ β€’ Edge-Ready β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ DEVELOPMENT PRODUCTION

Key Features

🎯 Core Language Features

Lisp-Inspired S-Expression Syntax: Clean, consistent, and easy to parse

Multiple Dialects:

Me: Educational dialect for learning (8-12 years old)

Solo: Systems programming with LLVM backend

Duet: Async/concurrent programming targeting WebAssembly

Ensemble: Verification-focused with Isabelle integration

Static Typing with Inference: Strong types without verbosity

Linear Types: Resource safety through ownership and borrowing

Effect System: Track and control computational effects (I/O, AI, network, etc.)

πŸ€– AI Integration

OblΓ­benΓ½ is the first language with first-class AI integration:

(adaptive-def fibonacci (n: Int) β†’ Int @requires: energy < 100J @optimize: minimize latency @ai-strategy: choose-best

(@solution "memoized"
  @when: n > 20
  @provides: energy: 50J, latency: 5ms
  (memo-fib n))
(@solution "naive"
  @provides: energy: 10J, latency: 100ms
  (if (<= n 1) n
      (+ (fibonacci (- n 1))
         (fibonacci (- n 2))))))

AI Effect Types:

(def analyze-sentiment (text: String) β†’ (AIEffect Sentiment) @model: "gpt-4" @budget: tokens: 500, cost: $0.01 @fallback: rule-based-sentiment …​)

πŸ”’ Security Guarantees

Termination Proofs: All deployment code is proven to terminate

Resource Bounds: Static verification of memory, energy, and time limits

No Undefined Behavior: Formal semantics with total functions

Capability-Based Security: Fine-grained permission control

🌐 BOINC-Powered Verification

OblΓ­benΓ½ uses BOINC for distributed formal verification:

Crowd-Sourced Testing: Millions of random programs tested by volunteers

Grammar Evolution: Test results refine the EBNF specification

Property Database: Repository of proven theorems about the language

Performance Baselines: Compare against all major languages

Platform Coverage: Verify behavior across architectures

Quick Start

Installation

Using Rust toolchain (recommended)

cargo install oblibeny

Or using Nix

nix-env -iA nixpkgs.oblibeny

Or build from source

git clone https://gitlab.com/hyperpolymath/oblibeny.git cd oblibeny cargo build --release

Hello World

; hello.obl (def main () β†’ (IO Unit) (println "Hello, OblΓ­benΓ½!"))

Run it:

oblibeny run hello.obl

Your First AI Program

; sentiment.obl (def main () β†’ (IO Unit) (let text "I love this language!") (let sentiment (analyze-sentiment text)) (println (format "Sentiment: {}" sentiment)))

(def analyze-sentiment (text: String) β†’ (AIEffect Sentiment) @model: "claude-sonnet-4" @budget: tokens: 100 (ai-prompt "Analyze sentiment (positive/negative/neutral): {text}"))

Documentation

πŸ“š Core Documentation

Language Specification - Complete formal specification

EBNF Grammar - Formal grammar definition

Tutorial - Step-by-step learning guide

API Reference - Standard library documentation

Examples - Code examples for all features

πŸ—οΈ Architecture & Design

Architecture Overview - System design and components

Compiler Design - Two-phase compilation pipeline

Type System - Type theory and inference algorithm

Effect System - Computational effects tracking

Dialect Guide - Me, Solo, Duet, and Ensemble

πŸ”¬ Verification & Proofs

Proofs Documentation - Formal verification roadmap

Property Testing - QuickCheck-style testing

BOINC Integration - Distributed verification platform

Termination Proofs - Proving all code halts

Security Analysis - Security properties and guarantees

πŸ€– AI Integration

AI Effect Types - Type system for AI operations

AI Budget Management - Cost and token tracking

AI Model Integration - Supported models and APIs

Fallback Strategies - Handling AI failures gracefully

White Papers

Primary Papers

White Paper: OblΓ­benΓ½ - Comprehensive language overview

Language design philosophy Two-phase compilation model AI integration architecture Formal verification approach Performance benchmarks Use cases and applications

White Paper: JanusKey - Security utility demonstration

Maximal Principle Reduction (MPR) concept Provably reversible file operations Architectural gap elimination Security guarantees Implementation details

Research Papers

Economics-as-Code - Treating resources as first-class

Distributed Language Verification - BOINC approach

AI Effects in Programming Languages - Novel type system for AI Two-Phase Compilation for Edge Computing

Intellectual Property

IP Claims - Novel innovations and patentable concepts

Core language innovations AI integration mechanisms Verification techniques Prior art analysis Trademark strategy (OblΓ­benΓ½β„’, JanusKeyβ„’) Licensing recommendations (Apache 2.0 + Patent Grant)

Project Components

JanusKey

JanusKey is a security utility that demonstrates OblΓ­bený’s "Maximal Principle Reduction" philosophy:

Encrypt a file (provably reversible)

januskey encrypt document.txt --output document.jk

Decrypt it

januskey decrypt document.jk --output document.txt

Verify reversibility

januskey verify document.txt document.jk

Security Guarantees:

βœ… Zero information loss

βœ… Cryptographically secure

βœ… Formally verified reversibility

βœ… Side-channel resistant

βœ… No hidden state

Read the JanusKey White Paper BOINC Verification Platform

Participate in distributed verification of OblΓ­benΓ½:

Join as a volunteer

boinc --attach_project https://oblibeny.boinc.org <your-account-key>

Contribute compute resources to:

- Test random programs

- Verify formal proofs

- Benchmark performance

- Check cross-platform compatibility

Join the BOINC Project Language Examples

Resource-Bounded Computing

(def process-batch (data: List[Item]) β†’ Result[Summary] @resources: memory: 1GB energy: 500J time: 30s

@carbon-aware: prefer-renewable
(transaction "batch-processing"
  (map-reduce process-item aggregate data)))

Linear Types for Safety

(def transfer-funds (from: Account, to: Account, amount: Money) β†’ (IO (Result Unit)) ; Money is a linear type - can’t be duplicated or lost (with-transaction (let funds (withdraw from amount)) ; from loses ownership (deposit to funds) ; funds transferred, can’t be reused (Ok ())))

Reversible Transactions

(transaction "user-registration" @rollback-on: EmailExists | InvalidUsername

(checkpoint "validate")
(validate-username username)
(checkpoint "create-user")
(create-user-record user-data)
(checkpoint "send-email")
(send-welcome-email email)
@on-rollback: (fn (checkpoint)
  (log "Registration failed at: {checkpoint}")))

AI-Powered Code Generation

(def generate-parser (grammar: EBNF) β†’ (AIEffect Parser) @model: "claude-sonnet-4" @budget: tokens: 5000, cost: $0.50 @validate: (fn (parser) (test-parser parser grammar)) @fallback: template-based-parser

(ai-generate-code
  "Create a parser for this grammar: {grammar}"
  @language: "oblibeny"
  @optimize-for: "correctness"))

Roadmap

Phase 1: Foundation (Q4 2025)

Language specification v0.6
EBNF grammar
Parser implementation (Rust)
Type checker
Basic REPL

Phase 2: Compiler (Q1 2026)

LLVM backend (Solo dialect)
WebAssembly backend (Duet dialect)
Optimization passes
Standard library
VSCode extension

Phase 3: AI Integration (Q2 2026)

AI effect type system
Model integration (Claude, GPT-4, Llama)
Budget tracking and billing
Fallback strategies
AI-powered code completion

Phase 4: Verification (Q3 2026)

BOINC platform launch
Property-based testing suite
Formal proofs in Lean 4
Termination checker
Resource bound analyzer

Phase 5: Production (Q4 2026)

1.0 Release
Package manager
Build system integration
Cloud platform support
Enterprise support

Community

Get Involved

Discussion Forum: https://forum.oblibeny.org

Discord: Join our Discord

Twitter: @oblibeny_lang

Contributing

We welcome contributions! See CONTRIBUTING.md for guidelines. Ways to contribute:

πŸ› Report bugs and issues

πŸ’‘ Suggest features and improvements

πŸ“ Improve documentation

πŸ§ͺ Write tests and examples

πŸ”§ Fix bugs and implement features

πŸŽ“ Create tutorials and educational content

🌐 Translate documentation

πŸ”¬ Participate in BOINC verification

Code of Conduct

We are committed to providing a welcoming and inclusive environment. Please read our Code of Conduct. Repository Structure

oblibeny/ β”œβ”€β”€ compiler/ # Compiler implementation β”‚ β”œβ”€β”€ parser/ # Parser (Rust) β”‚ β”œβ”€β”€ typechecker/ # Type checking and inference β”‚ β”œβ”€β”€ codegen/ # Code generation (LLVM, WASM) β”‚ └── optimizer/ # Optimization passes β”œβ”€β”€ runtime/ # Runtime system β”‚ β”œβ”€β”€ gc/ # Garbage collector β”‚ β”œβ”€β”€ effects/ # Effect system runtime β”‚ └── ai/ # AI integration runtime β”œβ”€β”€ stdlib/ # Standard library β”‚ β”œβ”€β”€ core/ # Core utilities β”‚ β”œβ”€β”€ ai/ # AI operations β”‚ β”œβ”€β”€ io/ # Input/output β”‚ └── data/ # Data structures β”œβ”€β”€ docs/ # Documentation β”‚ β”œβ”€β”€ spec/ # Language specification β”‚ β”œβ”€β”€ tutorial/ # Tutorials β”‚ └── api/ # API documentation β”œβ”€β”€ papers/ # White papers and research β”‚ β”œβ”€β”€ OBLIBENY_WHITEPAPER.md β”‚ β”œβ”€β”€ JANUSKEY_WHITEPAPER.md β”‚ └── IP_CLAIMS.md β”œβ”€β”€ examples/ # Example programs β”‚ β”œβ”€β”€ hello-world/ β”‚ β”œβ”€β”€ ai-integration/ β”‚ β”œβ”€β”€ web-server/ β”‚ └── tutorials/ β”œβ”€β”€ tools/ # Development tools β”‚ β”œβ”€β”€ vscode/ # VSCode extension β”‚ β”œβ”€β”€ repl/ # Read-Eval-Print Loop β”‚ β”œβ”€β”€ linter/ # Code linter β”‚ └── formatter/ # Code formatter β”œβ”€β”€ boinc/ # BOINC verification platform β”‚ β”œβ”€β”€ server/ # BOINC server configuration β”‚ β”œβ”€β”€ client/ # Verification tasks β”‚ └── dashboard/ # Results visualization β”œβ”€β”€ januskey/ # JanusKey security utility β”‚ β”œβ”€β”€ src/ # Source code β”‚ β”œβ”€β”€ tests/ # Test suite β”‚ └── proofs/ # Formal proofs β”œβ”€β”€ tests/ # Test suite β”‚ β”œβ”€β”€ unit/ # Unit tests β”‚ β”œβ”€β”€ integration/ # Integration tests β”‚ └── property/ # Property-based tests └── benchmarks/ # Performance benchmarks β”œβ”€β”€ speed/ # Execution speed β”œβ”€β”€ memory/ # Memory usage └── energy/ # Energy consumption

Technical Stack

Implementation

Parser: Rust with pest (PEG parser)

Type Checker: Rust with Chalk (trait solver)

Codegen: LLVM (Solo), Binaryen (Duet)

Verification: Lean 4 formal proofs

BOINC: Custom work units with ArangoDB backend

Development Tools

Version Control: GitLab (preferred over GitHub)

CI/CD: GitLab CI with Podman containers (preferred over Docker)

Package Registry: Cargo (Rust), npm (JavaScript)

Documentation: mdBook, rustdoc

Testing: PropTest (property-based), criterion (benchmarks)

Deployment

Container Runtime: Podman (preferred over Docker)

Orchestration: NixOS for reproducible builds

Cloud: Platform-agnostic (AWS, GCP, Azure, self-hosted)

Edge: ARM Cortex-M, RISC-V, x86-64

Performance

Energy Efficiency

OblΓ­benΓ½ programs typically use 20-40% less energy than equivalent programs in C++, Rust, or Go due to:

Explicit resource tracking Carbon-aware scheduling AI-optimized algorithm selection Compile-time waste elimination

Benchmarks

Benchmark C++ Rust OblΓ­benΓ½ Savings

Web Server 45W 42W 29W 35%

ML Inference 120W 115W 75W 37%

Data Processing 65W 60W 42W 35%

Mobile App 2.5W 2.3W 1.7W 32%

Benchmarks run on Intel i7-12700K, 32GB RAM, measuring wall-plug power consumption Carbon Impact

With carbon-aware scheduling:

40-60% reduction in carbon emissions

Automatic migration to renewable energy regions

Real-time adjustment based on grid carbon intensity

See detailed benchmarks License

OblΓ­benΓ½ Language: Apache License 2.0 with Patent Grant JanusKey: Apache License 2.0 with Patent Grant Documentation: CC BY 4.0 White Papers: CC BY 4.0 See LICENSE for full details. Citations

OblΓ­benΓ½ Language

@software{oblibeny2025, title = {OblΓ­benΓ½: A Programming Language with First-Class AI Integration}, author = {Jewell, Jonathan D.A.}, year = {2025}, url = {https://gitlab.com/hyperpolymath/oblibeny}, version = {0.6}, license = {Apache-2.0} }

White Papers

@techreport{oblibeny_whitepaper2025, title = {OblΓ­benΓ½: First-Class AI Integration and Distributed Verification in Programming Languages}, author = {Jewell, Jonathan D.A.}, year = {2025}, institution = {OblΓ­benΓ½ Project}, type = {White Paper}, url = {https://oblibeny.org/papers/whitepaper} }

@techreport{januskey_whitepaper2025, title = {JanusKey: Provably Reversible Cryptographic Operations Through Maximal Principle Reduction}, author = {Jewell, Jonathan D.A.}, year = {2025}, institution = {OblΓ­benΓ½ Project}, type = {White Paper}, url = {https://oblibeny.org/papers/januskey} }

Contact

Project Lead: Jonathan D.A. Jewell Email: info@oblibeny.org Website: https://oblibeny.org Repository: https://gitlab.com/hyperpolymath/oblibeny Acknowledgments

Special thanks to:

Joshua B. Jewell for valuable contributions and feedback

BOINC Community for distributed verification infrastructure

Academic Reviewers for formal verification guidance

Early Adopters for testing and feedback

Open Source Community for tools and libraries

OblΓ­benΓ½: Making AI Integration Safe, Provable, and Sustainable
Star ⭐ this repo if you believe in provably secure, AI-integrated programming!

Components

Overview

OblΓ­benΓ½ implements a novel compilation model designed for anti-tamper resilience and provable security guarantees on edge devices:

  • Master Language: Turing-complete for development (macros, metaprogramming, unbounded computation)

  • Deployment Subset: Turing-incomplete for deployment (provably terminating, bounded resources)

This dual-language paradigm enables developers to write expressive code that compiles down to a restricted, formally verifiable subset safe for deployment on constrained edge devices.

Key Features

Security Model

  • Capability-based I/O: No syscalls in deployment; explicit capability tokens required

  • Provable Termination: Call graph acyclicity + bounded loops

  • Resource Bounds: Max iterations, memory, stack depth, execution time

  • Semantic Obfuscation: Metamorphic code generation for anti-tamper resilience

Compilation Stages

Source (.obl) β†’ Lexer β†’ Parser β†’ AST β†’ Type Checker β†’ Phase Validator
                                  ↓
              HIR β†’ MIR β†’ LIR β†’ Code Generator β†’ Target Binary
               ↓     ↓
           Types   CFG + Optimizations
  1. Expansion (Stage 0): Macro expansion, compile-time execution

  2. Verification (Stage 1): Type checking, termination proofs, resource analysis

  3. Generation (Stage 2): Optimization, obfuscation, code generation

Target Domains

  • Edge computing nodes

  • IoT devices

  • Embedded systems

  • Sensor networks

  • Secure actuators

Quick Start

# Clone with submodules
git clone --recursive https://github.com/hyperpolymath/oblibeny.git
cd oblibeny

# Build the compiler
cargo build --release

# Run the REPL (when available)
./target/release/oblc repl

# Compile a file (when available)
./target/release/oblc build example.obl

Example Code

;; Deployment-safe function with resource bounds
(defun bounded-sum (arr)
  #:deploy
  #:max-iterations 1000
  (let ((sum 0))
    (bounded-for (i 0 (length arr))
      (set! sum (+ sum (get arr i))))
    sum))

;; Compile-time metaprogramming
(defmacro generate-handler (name)
  #:compile
  `(defun ,name (input)
     #:deploy
     (process input)))

Project Structure

Component Description

src/

OblΓ­benΓ½ compiler (oblc) - Rust implementation

grammar/

EBNF language specification (v0.6)

docs/

Formal semantics and implementation specification

wiki/

User documentation and tutorials

Ecosystem Submodules

Repo Description

obli-transpiler-framework

Oblivious program transpiler framework

obli-riscv-dev-kit

RISC-V development kit with oblivious computing

obli-fs

Oblivious filesystem with privacy guarantees

Development Status

Phase Status Description

Phase 0: Foundation

βœ… Complete

Grammar, compiler skeleton, RSR compliance

Phase 1: Core Compiler

πŸ”„ Q2 2025

Semantic analysis, code generation, optimizations

Phase 2: Verification

πŸ“… Q3 2025

Z3/SMT integration, formal proofs

Phase 3-7

πŸ“… 2025-2026

Runtime, tooling, stdlib, ecosystem

See ROADMAP.md for detailed milestones.

Documentation

Building from Source

Requirements

  • Rust 1.75+ (MSRV)

  • Cargo

Build Commands

# Development build
cargo build

# Release build (optimized)
cargo build --release

# Run tests
cargo test

# Generate documentation
cargo doc --open

License

This project is dual-licensed under your choice of:

  • MIT License - Permissive open source

  • AGPL-3.0-or-later - Copyleft for network services

See LICENSE.txt for details.

Additionally, this project encourages (but does not legally require) adherence to the Palimpsest principles for consent-based digital interaction.

Contributing

Contributions welcome! This project follows:

Acknowledgments

Part of the hyperpolymath ecosystem.

Copyright 2024-2025 hyperpolymath / Jonathan D.A. Jewell

About

Oblivious computing ecosystem - privacy-preserving computation tools

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published

Contributors 3

  •  
  •  
  •