Eclexia: Economics-as-Code
A programming language where economics is a first-class paradigm Making resource-efficient, carbon-aware software the default, not the exception.
π What is Eclexia?
Eclexia introduces Economics-as-Code: a revolutionary programming paradigm where economic principlesβscarcity, trade-offs, and optimizationβare built into the language itself. Instead of treating performance and resource usage as afterthoughts, Eclexia makes them first-class concerns with:
Resource types with dimensional analysis (energy, time, memory, carbon)
Adaptive blocks that automatically select optimal algorithms based on runtime constraints
Shadow prices that guide decision-making using economic principles
Carbon-aware execution to minimize environmental impact
Multi-objective optimization declared directly in code
The Problem
Traditional programming forces developers to:
Manually optimize for performance, energy, or cost Hard-code algorithm choices that donβt adapt to changing conditions Ignore carbon footprint and sustainability Trade off between competing objectives with no principled framework
The Solution
Eclexia makes these decisions automatic and economically optimal:
adaptive def matrix_multiply(A: Matrix, B: Matrix) β Matrix @requires: energy < 100J, latency < 500ms @optimize: minimize energy, minimize carbon { @solution "gpu_accelerated": @when: gpu_available && matrix_size > 1000 @provides: energy: 50J, latency: 100ms, carbon: 5gCO2e { gpu::multiply(A, B) }
@solution "parallel_cpu":
@when: cpu_cores >= 4
@provides: energy: 80J, latency: 300ms, carbon: 8gCO2e
{
parallel::multiply(A, B)
}
@solution "naive":
@when: true // always available
@provides: energy: 30J, latency: 800ms, carbon: 3gCO2e
{
naive::multiply(A, B)
}
}
The runtime automatically selects the best solution based on:
Available resources (energy budget, CPU cores, GPU availability) Current carbon intensity of the power grid Shadow prices that reflect the true cost of resources Your declared optimization objectives
π Documentation
Core Documents
Document Description Audience
White Paper Comprehensive introduction to Economics-as-Code All readers
Formal Proofs Mathematical foundations and correctness proofs Researchers, PL theorists
IP Claims Intellectual property analysis and strategy Legal, business
Language Specification Complete language syntax and semantics Language implementers
Tutorial Getting started guide with examples Developers
API Reference Standard library documentation Developers
Quick Navigation
π New to Eclexia? Start with the White Paper (Section 1-3) or Tutorial π¬ Want the theory? Read the Formal Proofs and Language Specification πΌ Business/Legal interests? See IP Claims for patent strategy and commercialization π¨βπ» Ready to code? Check out Examples and Getting Started
π Quick Start
Installation
From this repository:
# Build from source (requires Rust 1.75+)
cargo build --release
# Verify the build works
cargo test
cargo run -- run examples/hello.eclThe compiler binary will be at target/release/eclexia.
Hello World with Resources
def main() β Unit @requires: energy < 1J { println("Hello, Economics-as-Code!") }
Your First Adaptive Function
adaptive def fibonacci(n: Int) β Int @requires: energy < 100J @optimize: minimize latency { @solution "memoized": @when: n > 20 @provides: energy: 50J, latency: 5ms { memo_fib(n) }
@solution "naive":
@provides: energy: 10J, latency: 100ms
{
if n <= 1 then n
else fibonacci(n-1) + fibonacci(n-2)
}
}
Run it:
cargo run -- run examples/fibonacci.eclπ‘ Key Features
-
Resource Types with Dimensions
Prevent bugs at compile time:
let energy: Energy = 100J let time: Time = 5s let power: Power = energy / time // β Correctly typed as Watts
-
Adaptive Execution
The runtime automatically chooses the best algorithm:
adaptive def sort(arr: Array[Int]) β Array[Int] @requires: energy < 50J, latency < 100ms @optimize: minimize energy { @solution "quicksort": @when: length(arr) > 100 @provides: energy: 40J, latency: 50ms { /* β¦β */ }
@solution "insertion_sort":
@when: length(arr) <= 100
@provides: energy: 10J, latency: 80ms
{ /* ... */ }
}
-
Shadow Prices
The runtime computes shadow pricesβthe marginal value of each resourceβto guide decisions:
def analyze() β Unit @observe: shadow_prices { // Runtime automatically computes: // - Ξ»_energy: how valuable is 1 more Joule? // - Ξ»_time: how valuable is 1 more millisecond? // - Ξ»_carbon: how valuable is 1g less CO2?
// Solutions are ranked by weighted cost:
// cost = Ξ»_energy * energy + Ξ»_time * time + Ξ»_carbon * carbon
}
-
Carbon-Aware Scheduling
Automatically defer work to low-carbon times:
async def train_model(data: Dataset) β Model @requires: carbon < 500gCO2e @optimize: minimize carbon @defer_until: grid_carbon_intensity < 100gCO2e/kWh { // This will wait for low-carbon electricity // Typical time: overnight or windy/sunny periods expensive_training(data) }
-
Multi-Objective Optimization
Declare trade-offs explicitly:
adaptive def compress(image: Image) β CompressedImage @optimize: minimize carbon, maximize quality { // Runtime finds Pareto-optimal solution // balancing carbon cost vs. image quality @solution "high_quality": { /* β¦β / } @solution "low_carbon": { / β¦β / } @solution "balanced": { / β¦β */ } }
π Benchmarks & Results
Eclexia delivers measurable benefits:
Metric Improvement Workload
Energy Reduction 20-40% Typical web server
Battery Life +25-35% Mobile applications
Carbon Footprint 40-60% With carbon-aware scheduling
Developer Time 50-70% less Optimization vs. manual tuning
See benchmarks/ for detailed results and methodology.
π§ͺ Research & Formal Foundations
Eclexia is built on solid theoretical foundations: Formal Proofs
We provide mathematical proofs for:
Type Safety (progress & preservation)
Resource Safety (no budget violations, no resource leaks)
Economic Optimality (shadow prices converge to optimal values)
Dimensional Correctness (prevents unit errors)
Termination (under resource bounds)
See PROOFS.md for complete proofs. Type System
Eclexia extends traditional type systems with:
Resource types: Energy, Time, Memory, Carbon
Dimensional analysis: Track physical dimensions at type level
Constraint types: @requires, @provides, @optimize
Effect types: Track side effects (I/O, energy consumption)
Operational Semantics
We define a formal small-step operational semantics for Eclexiaβs core calculus, proving:
Progress: well-typed programs donβt get stuck
Preservation: evaluation preserves types
Determinism: same context β same selection
ποΈ Project Structure
eclexia/ βββ README.md # This file βββ WHITEPAPER.md # Comprehensive introduction βββ PROOFS.md # Formal mathematical proofs βββ IP_CLAIMS.md # Intellectual property strategy βββ SPECIFICATION.md # Language specification βββ LICENSE # Apache 2.0 β βββ compiler/ # Compiler source code β βββ src/ β β βββ parser/ # Lexer and parser β β βββ typechecker/ # Type system implementation β β βββ optimizer/ # Optimization passes β β βββ codegen/ # Code generation β βββ Cargo.toml β βββ runtime/ # Runtime system β βββ src/ β β βββ scheduler/ # Adaptive scheduler β β βββ profiler/ # Resource profiler β β βββ shadow/ # Shadow price computation β β βββ monitor/ # Runtime monitoring β βββ Cargo.toml β βββ stdlib/ # Standard library β βββ core/ # Core types and functions β βββ collections/ # Data structures β βββ io/ # Input/output β βββ carbon/ # Carbon-aware utilities β βββ examples/ # Example programs β βββ hello_world.ecl β βββ fibonacci.ecl β βββ matrix_multiply.ecl β βββ carbon_aware_ml.ecl β βββ benchmarks/ # Performance benchmarks β βββ energy/ β βββ latency/ β βββ carbon/ β βββ docs/ # Documentation β βββ TUTORIAL.md β βββ API.md β βββ GUIDE.md β βββ CONTRIBUTING.md β βββ tests/ # Test suite βββ unit/ βββ integration/ βββ correctness/
π€ Contributing
We welcome contributions! Eclexia is open-source (Apache 2.0) and community-driven. How to Contribute
Read CONTRIBUTING.md
Join our Discord/Slack community
Pick an issue from GitLab Issues
Submit a merge request (MR)
Areas of Interest
Compiler development (Rust) Type system research Runtime optimization
Standard library (collections, algorithms)
Benchmarking (energy, performance)
Documentation (tutorials, examples)
Tooling (IDE plugins, LSP)
π Community
Website: https://eclexia.org
Discord: https://discord.gg/eclexia (coming soon)
Email: info@eclexia.org
Forum: https://discuss.eclexia.org (coming soon)
Social Media
Twitter/X: @eclexialang (coming soon)
Mastodon: @eclexia@fosstodon.org (coming soon)
LinkedIn: Eclexia Project (coming soon)
π Academic Use
Eclexia is designed for research and education: Research Papers
We encourage academic papers about:
Language design and extensions Type system innovations Optimization algorithms Energy/carbon modeling Sustainability in computing
See docs/RESEARCH.md for research ideas. Teaching
Use Eclexia in courses on:
Programming language design Compilers and runtime systems Sustainable computing Operations research in CS Multi-objective optimization
See docs/TEACHING.md for course materials. Citation
If you use Eclexia in research, please cite:
@techreport{eclexia2025, title={Economics-as-Code: A Novel Programming Paradigm for Sustainable Computing}, author={Jewell, Jonathan D.A.}, year={2025}, month={October}, institution={Eclexia Project}, url={https://eclexia.org}, note={Version 1.0} }
π License
Eclexia is dual-licensed: Open Source (Core)
License: Apache 2.0
Applies to: Core language, reference compiler, standard library
See: LICENSE
Commercial (Enterprise Features)
License: Proprietary
Applies to: Advanced optimizations, cloud services, enterprise support
Contact: licensing@eclexia.org
π§ Roadmap
Phase 1: Research Preview (Q4 2025)
β White paper published
β Formal proofs completed
β Language specification v1.0
π Reference compiler (basic)
π Core standard library
Phase 2: Alpha Release (Q1 2026)
Optimizing compiler Runtime with shadow prices IDE plugin (VSCode) Basic benchmarks Community building
Phase 3: Beta Release (Q2 2026)
Production-ready compiler Advanced optimizations Carbon-aware scheduling Comprehensive stdlib Documentation complete
Phase 4: 1.0 Release (Q3 2026)
Stable language spec Performance competitive with Rust/C++ Rich ecosystem (libraries, tools) Enterprise support available
π Acknowledgments
Creator: Jonathan D.A. Jewell Contributors: Joshua B. Jewell (feedback and insights) Inspiration: This project draws on decades of research in:
Programming languages (Pierce, Wadler, Cardelli) Operations research (Dantzig, Karmarkar) Sustainable computing (Barroso, HΓΆlzle) Type theory (Hindley, Milner, Martin-LΓΆf)
Special Thanks:
The Rust community (for systems programming excellence) The PL research community (for foundational work) GitLab (for hosting our open-source project) Early adopters and beta testers
π Contact
General inquiries: info@eclexia.org
Research collaborations: research@eclexia.org
Commercial licensing: licensing@eclexia.org
Press & media: press@eclexia.org
Security issues: security@eclexia.org
π Why "Eclexia"?
The name "Eclexia" combines:
"Ec-" from "Economics"
"-lexia" from Greek "Ξ»ΞΞΎΞΉΟ" (lexis), meaning "word" or "speech"
Together: "Economic Speech" or "Economics in Language" It also evokes:
Eclectic: Drawing from diverse fields (CS, economics, sustainability)
Excellence: Striving for optimal, principled design
Ecology: Caring about environmental impact
π Status & Stability
Current Status: Research Preview / Pre-Alpha Eclexia is under active development. The language specification is stabilizing, but expect:
Breaking changes to syntax/semantics Incomplete compiler implementation Limited standard library Rough edges in tooling
Not yet ready for production use. Weβre targeting Alpha release in Q1 2026 and Beta in Q2 2026.
βοΈ Legal
Patents
Some aspects of Eclexia may be subject to patent protection. See IP_CLAIMS.md for details. Patent Grant: If you use Eclexia under the Apache 2.0 license, you receive a royalty-free patent license for patents embodied in the open-source code. Trademarks
Eclexiaβ’ is a trademark of Jonathan D.A. Jewell / Eclexia Project
Economics-as-Codeβ’ is a trademark of Jonathan D.A. Jewell / Eclexia Project
Use of trademarks must comply with TRADEMARK_POLICY.md. Confidentiality
Some documents (e.g., IP_CLAIMS.md) contain strategic information. Distribution is limited. See headers in each document.
π― Mission
"Make resource-efficient, carbon-aware software the default, not the exception." We believe that:
Computing has a carbon footprint that must be addressed
Developers want to do the right thing but need better tools
Economic principles can guide better software design
Language-level support is more effective than libraries
Eclexia aims to make sustainable computing easy, automatic, and economically optimal.
Welcome to the future of programming. Welcome to Economics-as-Code. Welcome to Eclexia.
"The best way to predict the future is to invent it." β Alan Kay
Last Updated: October 30, 2025 Document Version: 1.0 Repository: https://gitlab.com/eclexia-lang/eclexia