The Jvav programming language

Purity of Form.
Purity of Function.

Clear in semantics. Pure in computation. Explicit in effects.

A language design in progress. First proposed by Dr. Haoyang Zhang.

Value computation
and side effects.

A transition describes a computation you can preview. See its result before you apply it to state.

move.jvav
pure fun move(
    entity: transition Entity,
    dt: Float
): transition Entity {
    val nextVelocity = entity.velocity +
        entity.acceleration * dt

    return {
        position = entity.position +
            nextVelocity * dt
        velocity = nextVelocity
    }
}
When you choose to apply itval change = move(entity, 1)
transition(entity) = change

See the next move.

Preview the position and velocity produced by move. Apply the result when you choose to update the entity.

entitydt = 1
Current entity state and the computed changes
FieldCurrentPreview
position10
velocity3
acceleration2

Preview the computation while the entity stays unchanged.

A semantic illustration from the working draft.Transitions · §12 (PDF, opens in a new tab)

The Jvav language design

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.

Explore pure computation
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.

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
Explore member capabilities

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.

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.

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

Jvav is under active design. Complete member classifications and multi-target backends remain in development planning; open questions in the current draft remain pending.

The Jvav
specification.

Explore Jvav’s syntax, types, and evaluation rules. The working draft explains how values, effects, and state transitions behave, with definitions and examples.

Read the draft (PDF, opens in a new tab)Download PDF Explore the specification
WORKING DRAFTJvav
Language Specification
SYNTAX · TYPES · SEMANTICSPDF · English 51 pages