Joule Language Reference

The formal specification of Joule's syntax and semantics.

Contents

  • Types -- Primitive types, compound types, union types, generics, type inference
  • Expressions -- Operators, pipe operator, literals, control flow, closures
  • Items -- Functions, structs, enums, traits, impls, modules, const fn, comptime
  • Patterns -- Pattern matching: or patterns, range patterns, guard clauses
  • Attributes -- Energy budgets, #[test], #[bench], thermal awareness, derive macros
  • Memory -- Ownership, borrowing, references, lifetimes
  • Concurrency -- Async/await, spawn, bounded channels, task groups, parallel for, supervisors
  • Energy -- Energy system formal specification with accelerator support

Notation

In syntax descriptions:

  • monospace indicates literal syntax
  • italics indicate a syntactic category (e.g., expression, type)
  • [ ] indicates optional elements
  • { } indicates zero or more repetitions
  • | separates alternatives