Skip to main content
The energy-aware programming language

Every Joule counts.

Joule builds energy awareness into the type system, compiler, and runtime. It compiles to C for fast native binaries, and shows you the real energy cost of your code, function by function.

Compiles to CSelf-hosting compiler514+ example programsjoulec v1.1.0
Scroll
I · The Problem

Software has no idea
what it costs to run.

Compilers optimize for speed and size. None of them tell you the energy cost of a function call, a memory allocation, or a loop. We optimize for cycles. The grid pays in watts. And computing keeps growing.

~415 TWh
Data-center electricity
per year
Projected growth
by 2030
per-op
Granularity Joule
meters energy at
$0
Cost signal in your
toolchain today

Data-center figures follow IEA electricity estimates. Energy accounting is a first-class output of the Joule toolchain.

"You cannot optimize what you cannot measure. No language measured energy at the code level, so no language optimized for it." The blind spot
II · The Language

Joule makes energy
a first-class output.

Write ordinary, readable code. The compiler attributes an energy cost to every function and every operation, then compiles down to C for a fast native binary. The number is part of the build, not an afterthought.

average.joule
// Every function carries an energy cost.
fn average(readings: [f32]) -> f32 {
    let sum = readings.fold(0.0, |a, x| a + x)
    return sum / readings.len() as f32
}

fn main() {
    let data = [21.4, 22.1, 20.8, 23.5]
    print("avg = {average(data):.2}")
    // receipt: 3.9 µJ  (compute 3.1 · mem 0.6 · io 0.2)
}
Cost per function
Every function carries an energy figure. Callers see the cost before they call, so trade-offs are visible where you write them.
Optimize in joules
Change the code, watch the joules move. Optimizations are measurable in energy, not just in cycles or wall-clock time.
Compiles to C
Joule lowers to portable C, so your program runs as a fast native binary anywhere a C compiler runs.
III · Self-hosting

The compiler
compiles itself.

Joule's compiler is written in Joule. It compiles its own source to C, builds a new compiler, and that compiler produces a byte-for-byte identical result. A reproducible fixed point is a strong, concrete signal that the language is real and the compiler is stable.

Stage 0
Compiler source, written in Joule
compiles to C →
rebuild →
Stage N
Byte-identical output. Fixed point holds.
514+
example programs
that compile and run
Joule
written in Joule
the compiler bootstraps itself
C
portable output
fast native binaries
IV · The Receipt

Every build produces an
energy receipt.

An accounting of the energy your program spends, broken down by function, by category, and by target. Not a vibe, a number you can act on.

Energy Receipt · sensor_pipeline
total_energy42.7 µJ
  compute28.1 µJ
  memory11.3 µJ
  io3.3 µJ
operations1,847
hottest_fnresample
targetaarch64 native (via C)
V · A Real Language

A broad corpus.
Not a toy.

Over 514 example programs exercise the language across the areas real software is made of. They double as the living test suite: if they stop compiling or running, the build knows.

Data structures
lists, maps, trees, graphs
Algorithms
sorting, search, numerics
Concurrency
threads and channels
SIMD
vectorized kernels
N-D arrays
tensors and slicing
Numeric types
ints, floats, fixed-point
Text & parsing
strings, formatting
IDE tooling
formatter, checker
Energy analysis
receipts and budgets
VI · Get Started

Start counting joules.

Install the joulec toolchain and write your first energy-metered program.

terminal
# macOS
$ brew install joulec
# Windows
$ scoop install joulec

$ joulec new my_project && cd my_project
$ joulec build
  Energy receipt: 12.4 µJ (compute 8.1 · memory 3.2 · io 1.1)
  Finished in 0.34s
SystemsEmbeddedEdge AIFirmwareIoTCLI toolsNumericsWASM