JETH language documentation
JETH is a statically typed smart-contract language for the EVM. Its syntax is a strict TypeScript-shaped subset, while its values, arithmetic, storage, ABI, calls, errors, and execution model follow EVM and Solidity semantics.
class Counter {
count: u256 = 0n;
increment(): External<void> {
this.count += 1n;
}
get current(): External<u256> {
return this.count;
}
}JETH compiles source into typed IR and Yul, then uses solc to optimize and assemble creation/runtime bytecode. The compiler also emits ABI and storage layout information.
Guides#
The HTML book is organized as a structured language manual:
- Start here: installation, a first contract, a language tour, and examples.
- Language: declarations, contract structure, types, locations, expressions, control flow, functions, globals, and JETH-specific features.
- Contracts: inheritance, private members, modifiers, interfaces, calls, libraries, events, errors, and panics.
- Internals: ABI encoding, storage layout, compiler APIs, CLI behavior, and artifacts.
- Advanced: contract creation, CREATE2 clones, proxies, beacons, diamonds, facets, and namespaced storage.
- Security: smart-contract risks and the compiler-correctness model.
- Reference: syntax, differences, diagnostics, supported paths, and limits.
The short tour is optional. The detailed language chapters are the primary documentation.
Recommended path#
- Installation and first contract
- Structure of a contract
- Value types
- Reference and composite types
- Expressions and operators
- Statements and control flow
- Functions
- Interfaces and external calls
- Contract ABI
- Storage layout
- Contract creation and clones
- Security considerations
Core ideas#
TypeScript-shaped source, EVM behavior#
u256, address, mappings, storage slots, ABI words, EVM calls, and revert data are real language concepts. JavaScript number, implicit coercion, objects, promises, and garbage collection do not exist at runtime.
Native contract syntax#
- A bare leaf
classis a contract. - A bare field is storage.
- A leading
#makes a field or method private to its declaring class. External<T>andPayable<T>expose ABI entries.Visible<T>exposes a state, constant, or immutable getter.- Ordinary methods are internal.
- A
getclass method is read-only; the analyzer inferspureorview. - A
staticmethod is declared pure. - Initialized
staticfields are constants; uninitialized ones are immutables.
Safety-first compilation#
Accepted source must have a sound analyzer and code-generation path. When a complex copy, location, ABI, or aliasing shape is not proven, JETH rejects it at compile time. A clean over-rejection is safer than accepted wrong bytecode.
HTML book#
Run the local documentation build:
npm run docs:buildOpen docs/book/index.html directly or serve docs/book/ with any static HTTP server. The output has structured Guides navigation, search, light/dark themes, responsive pages, and a dedicated .jeth highlighter. It has no hosted documentation runtime dependency.
Documentation status#
These pages are versioned with the compiler. SUPPORTED.md remains the exhaustive source-shape acceptance matrix. Files directly under docs/ are engineering and audit records and can describe historical implementation states.