Values & Bindings stable

Learn about JAPL's immutable-first value system, let bindings, and primitive types.

Values & Bindings

JAPL is a typed actor language where all data is immutable by default. Values flow through functions and across process boundaries without hidden state changes.

Let Bindings

Use let to bind a value to a name:

let name = "JAPL"
let version = 1
let pi = 3.14159
let active = True

Primitive Types

TypeDescriptionExample
IntArbitrary precision integer42, 0xFF, 0b1010
FloatIEEE 754 float3.14, 1.0e10
StringUTF-8 string"hello"
CharUnicode character'a', '\n'
BoolBooleanTrue, False
UnitUnit type()

Immutability

Values cannot be reassigned. This eliminates an entire class of bugs:

let x = 42
-- x = 43  -- Error! Values are immutable

Expressions

Everything in JAPL is an expression that returns a value:

let result = if True { "yes" } else { "no" }
let sum = 1 + 2 + 3
Edit this page on GitHub