Language design

Intent, built into
the language.

What a computation depends on. What it can change. Which effects it can produce. Jvav makes these intentions part of the language, for people to express and compilers to understand.

See what happens.
Before it happens.

A transition describes a computation over state whose result you can preview. Work out the next position, the next velocity, or the outcome of an action.

The same calculation can serve a preview, a simulation, and a real update. Applying its result is an explicit operation: that is when the target state changes.

Try the movement calculation
val result = move(entity, 1)
transition(entity) = result

The first line computes the result. The second applies it to the entity. During a preview, the current state is unchanged.

Same inputs.
Same result.

A pure function describes a pure computation. Given the same inputs and context, it always produces the same result, without modifying external state or producing observable side effects.

The same computation can support previews, simulations, and tests, and directly inform decisions during execution.

pure fun distance(
    speed: Float,
    time: Float
): Float {
    return speed * time
}

Inputs determine the result. A pure function only computes and returns a value. It neither reads hidden state nor changes the outside world.

When observable behavior is preserved, pure computations can be reordered, shared, combined, or eliminated, and run in parallel where dependencies permit. Optimizations must still respect numerical results, failure, and termination behavior.

Start with pure computation.

Fewer capabilities mean less state to reason about.

pure functions depend only on their inputs and return results, making them easier to reuse, test, parallelize, and optimize. Use const when you need to interact with external state while guaranteeing that this stays unchanged. Use mut only when you need to change the object. If you prefer, use auto and let the implementation determine the capabilities it needs.

Member access to this and external side effects
ModifierthisExternal effects
pureRead-onlyNone
constRead-onlyAllowed
mutMay mutateAllowed
autoFrom implementationFrom implementation

Compute a return value

pure fun doubled(): Int {
    return value * 2
}

doubled reads the current value and returns twice that value. It only computes, without changing the object or producing external side effects.

Output the current value

const fun report() {
    println(value)
}

report needs to produce output, but does not need to change the current object. It receives only the capabilities it needs.

Reset object state

mut fun reset() {
    value = 0
}

reset sets the current object’s value to zero. When an operation needs to change the object, mut makes that capability explicit.

Let the implementation decide

auto fun next(): Int {
    return value + 1
}

next only reads value and returns a result, so it can be inferred as pure. The compiler determines the required capabilities from the implementation.

This is a Jvav member-function design direction. Complete inference and composition rules for classifications such as const and auto are not yet part of the current working draft. Member-function mut is also distinct from mut T on a parameter.

Compilation targets · Planned

One codebase.
Different runtimes.

Jvav plans to support compilation to native code, .NET, JVM, and other targets. Choose the runtime that suits your project without switching languages, rewriting your core logic, or learning a different semantic model.

Language features such as pure, access capabilities, and state transitions will remain consistent across compilation targets.

JvavPurity · Capabilities · Transitions
Jvav IRPreserve semantics. Lower for each target.
  • Native codeLLVM IR
  • .NETCIL (MSIL)
  • JVMBytecode
Planned compilation targets

These are planned compilation targets, not currently available backend claims. They do not imply identical object layouts or automatic interoperability between platforms.

The details behind the promises.

Read the established rules, examples, and open design questions in the working draft.

Explore the specification