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
| Type | Description | Example |
|---|---|---|
Int | Arbitrary precision integer | 42, 0xFF, 0b1010 |
Float | IEEE 754 float | 3.14, 1.0e10 |
String | UTF-8 string | "hello" |
Char | Unicode character | 'a', '\n' |
Bool | Boolean | True, False |
Unit | Unit 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