Values & types
The basic types — int, flt, str, bool, nil, list, map, sym, bytes — and their subtleties.
Fluxon has the following basic types:
| Notation | Type | Description |
|---|---|---|
42 | int | Integer |
3.14 | flt | Fractional number (float) |
"hello" | str | Text (string) |
true / false | bool | Boolean value |
nil | nil | "Nothing" / emptiness |
[1 2 3] | list | List — elements separated by spaces |
{a:1 b:2} | map | Key-value pairs — separated by spaces |
:ok | sym | Symbol — for enums/tags |
| — | bytes | Binary data — no literal, comes from functions |
Important subtleties
Binary data (bytes)
For non-text data like images, PDFs, archives. There is no literal syntax —
values come from functions: fs.readb path (binary file read), crypto.b64db s
(binary-safe base64 decode), bytes.of s (text → its UTF-8 bytes). Core operations:
b = fs.readb "logo.png" # bytes (nil if the file is missing)
bytes.len b # BYTE count (str.len counts CHARS)
bytes.str b # bytes → text (explicit error if not UTF-8)
bytes.slice b 0 4 # sub-bytes
fs.write "copy.png" b # fs.write/append accept str or bytes
rep 200 b {content_type:"image/png"} # raw binary HTTP responseIn logs/interpolation bytes render as <bytes N> — raw bytes never leak into
text. crypto.sha256/b64/hex inputs take str or bytes.
No commas in lists and maps
Elements are separated by spaces. This is intentional — commas waste tokens:
nums = [1 2 3 4]
user = {name:"Aziza" age:30 active:true}Putting a variable inside text (interpolation)
With "${...}" you embed an expression inside text:
name = "Aziza"
log "Hello ${name}!" # → Hello Aziza!
log "Total: ${price * qty} so'm" # an expression also worksFor a simple variable you can shorten it to "$name", but for an expression
${...} is required.
Multi-line text (block strings)
For long prompts, SQL, or templates use """. Content starts on the next line,
and the common indentation of the lines is stripped automatically — so the block
sits naturally inside indented code:
prompt = """
You are a helpful agent.
User question: ${question}
"""If the closing """ is on its own line, the text has no trailing \n.
Interpolation and \n/\t escapes work as in normal strings; " can be
written freely without escaping (handy for JSON/HTML fragments).
Symbols — instead of enums
To represent states, use a symbol instead of text. :new, :confirmed — these
are cheaper in tokens and clearer than the text "new":
status = :confirmed
dir = :inWhen a symbol is converted to text (interpolation, str.str, +, log) the
: prefix is dropped — the value is florist, the : is a syntax marker:
str.str :florist → "florist", "path/${:florist}" → "path/florist".
Inside a list/map, the : is kept ([:a] → [:a]), because there a symbol
needs to stand out from text.
Truthiness
nil and false are falsy. Everything else (including 0, "", and the empty
list) is truthy. This simple rule is intentional: only two things are falsy.