Experimental programming language · Java 21 prototype

Less punctuation.
Explicit meaning.

Caret uses whitespace for function application and indentation for blocks. Contracts, missing values, persistent collections, and reflection stay visible in ordinary code.

A work in progress.
Ideas welcome.
first-steps.caret
// application needs no commas
add a b =
  a + b

double value = value * 2
addThenDouble = add >> double

print addThenDouble 2 3
// 10
implementedrunnable^

Compact syntax.
Predictable semantics.

Caret asks how much routine syntax a language can remove while remaining readable and statically analyzable. The prototype is small, runnable, and deliberately explicit about absence, effects, and reflective visibility.

01

Calls read like expressions

Whitespace applies functions. Holes, lambdas, composition, and low-precedence application derive callables without extra ceremony.

02

Absence says what happened

? is present null. ~ is missing. Optional access makes expected absence a value instead of an exception.

03

Meaning remains inspectable

Contracts and effect bounds describe callable interfaces; reflection exposes language-owned metadata filtered by the current environment.

Syntax by example.

Five runnable examples of the prototype’s central ideas.

_

Currying & holes

Leave a hole and Caret returns a function waiting for the missing value. Specialized helpers emerge naturally from ordinary expressions.

Runnable now.
Still experimental.

The Java 21 tree-walking interpreter implements a substantial core. The broader language remains a staged roadmap, not a promise that every specified idea runs today.

available now

Functions and inference

Closures, recursion, lambdas, holes, composition, overloads, callable contracts, and inferred contracts and effects.

available now

Values and collections

Numbers, Unicode text, Booleans, null, missing, persistent sequences, dictionaries, exported Collections, and structural equality.

available now

Contracts and reflection

Derived and parameterized contracts, refinements, callable metadata, safe dynamic lookup, and environment-filtered reflection.

specified / planned

The larger design

Modules and imports, compile-time #, sandbox execution, semantic code reification, containers, cycles, formats, SIMD, rules, and rulesets are documented language work—not current prototype features.

See exact conformance status ↗
^

Download it.
Run an example.

Caret needs Java 21. Download a release or clone the repository, then run the included feature programs and inspect the implementation.

Get Caret and run it