Renderingen-US

Experimental through version 1. Version 0 was alpha. This is the first language release: the interface is relatively stable, not frozen. Nothing is promised stable until version 2.

Glyphs and Latin

Glyphs and operators#

Faber uses glyphs where the symbol is structural. Below is the full inventory of source glyphs recognised by the lexer.

Value flow#

GlyphMeaning
←Runtime binding, reassignment, and mutation
=Compile-time assignment — values known while compiling
→Function return type
⇥Alternate exit — error-channel type
⊥Default — inline value used when a conversion fails (↦ int ⊥ 0)
∴Lambda joint — connects closure body to signature ((a, b) → T ∴ a + b)

Type shape#

GlyphMeaning
∷Static type ascription (compile-time cast)
↦Runtime conversion (can-fail parse/coerce)
∪Inline union type (T ∪ none)

Comparison#

GlyphMeaning
≡ ≢Exact equality and inequality
≅ ≇Promoted exact equality — same value, compatible numeric types
≺ ≻ ≤ ≥Ordering — ASCII < > are generic delimiters only
≈ ≉Fuzzy equality — tolerance match with isclose defaults

Logical and bitwise#

GlyphMeaning
∧ ∨ ⊻ ¬And, or, xor, not
⇐ ⇒Left and right bit shift

Roots#

GlyphMeaning
√Square root
∛Real cube root (∛ -8.0 is -2.0)
∜Fourth root

The radicals are prefix operators. They bind like unary minus, so √ x + 1 is (√ x) + 1, and they apply where the matching method applies: floats and float tensors.

main {
    let f64 x ← 16.0
    print √ x, ∛ -8.0, ∜ x
}

This prints 4.0 -2.0 2.0.

Assignment updates#

GlyphMeaning
←Runtime assignment — the only assignment operator in expressions
=Compile-time assignment — a value fixed and known while compiling

Both are assignment. They differ in when the value is decided.

← stores a value at execution time: bindings, reassignment, mutation. = attaches a value the compiler already knows — field shape inside a literal, declaration metadata, annotation fields. Most languages spell both with = and leave the reader to infer which is meant; Faber splits them, so the glyph itself tells you whether anything happens at runtime.

class Punctum {
    let int x
    let int y
}

main {
    let _ p ← Punctum { x = 10, y = 20 }
    mut int count ← 0
    count ← count + 1
    print p.x, count
}

p ← … runs. x = 10 does not — it is the shape of the value being built, settled before the program starts.

Worked through in full under The binding convention matters.

Optional chaining and non-null assertion#

GlyphMeaning
? ?. ?[ ?(Optional chaining
! !. ![ !(Non-null assertion

When the callee of ?( or the receiver of ?[ is absent, the arguments or the index are not evaluated, so their side effects do not run (since 1.17).

Ranges#

GlyphMeaning
‥Exclusive range endpoint
…Inclusive range endpoint

A range is a value of type range<T> (la range<T>): it can be stored, walked with for range r let i, printed, and used to slice a rank-1 tensor, v[1‥4]. See Intervallum — ranges.

Literal delimiters#

GlyphTypeRole
'asciiFixed machine tokens
"stringLine string
« »stringBlock string (guillemets)
`formaCaptured template
\|list<b8>Hex byte literal, \|00ff\|
/…/regexInline pattern after regex or _: regex /a+b/; \/ writes a slash
§template holePlaceholder inside "…", «…», …

Punctuation#

GlyphRole
( )Grouping and call
{ }Block, class literal, or JSON document
[ ]List literal and indexing
.Member access
,Separator
;Statement separator
:JSON field separator
=Structural field shape (not runtime assignment)
@Annotation marker
#Line comment

Vocabulary and structural glyphs#

Three signal choices that make Faber source recognisable at a glance.

Faber makes three deliberate signal choices that work together to produce source with stable grammatical shape. A reader can see the semantic role of every construct before knowing which target backend the code will be compiled to.

The three signals#

SignalExamplesRole
Type-first declarationsstring name, int ageShape reads toward binding — type, then name.
Behavioural wordsfn, class, if, return, letDeclarations, statements, lifecycle, and behavioural intent.
Structural glyphs← → ∴ ≡ ∪ ⇥Value flow, type flow, and structural joints — universal, never localise.

These three are designed to be mutually reinforcing. A reader who knows Faber in one locale can read it in any locale because the glyphs and structure never change. A reader who knows the Rust backend can still recognise the Faber source because the keyword vocabulary and type-first order produce a distinct visual register.

Type-first declarations#

Faber puts the type before the name in every declaration. This is the opposite of mainstream C-family syntax, and it is deliberate:

ConstructC-family habitFaber
Variableint count = 0int count ← 0
Functionfn greet(name: String) → Stringfn salve(string name) → string
Parameter(String name)(string name)

Type-first declarations mean the shape of data is the first thing the reader sees. This aligns naturally with languages that read left-to-right for semantic breadth — Chinese, Hindi, and Arabic declarations follow the same order.

fn divide(int a, int b) → int ∪ none {
    if b ≡ 0 then return null
    return a / b
}

The behavioural vocabulary#

Faber gives every construct that has behavioural or grammatical shape a word. The English reader surface is what the tables below show; the pack files are keyed by the same vocabulary under Latin spellings, which faber convert --to la prints — a small, regular set drawn from a single classical source rather than the mixed etymologies of most programming languages.

Declarations#

KeywordRoleApproximate equivalent
fnDeclares a named function or methoddef, function
classDeclares a concrete type with fieldsclass, struct
interfaceDeclares a behavioural contractinterface, trait
typeDeclares a type aliastypedef, type
unionDeclares a tagged unionenum, sum type

Bindings and transfer#

KeywordRoleApproximate equivalent
letA fixed nameconst, final, val
mutA writable namelet mut, var
refA read-only name; a bare parameter is ref&T, const &
constA compile-time fact, set with =constexpr, static final
returnReturn a value from a functionreturn
throwThrow on the error channelthrow, raise
panicDeferred — behaviour not yet expressibleunimplemented!, todo

Control flow#

KeywordRoleApproximate equivalent
ifConditional branchif
elifElse-if branchelse if
elseElse branchelse
whileWhile loopwhile
forIteration (values, keys, or range)for
switchPattern-match (first arm wins)match, switch
doTry block with error recoverytry, do
catchError handler for docatch

The vocabulary is bindable — it ships with the identity pack and is remapped through reader locale. A Thai programmer sees ถ้า for if; a Chinese programmer sees 函数 for fn. The vocabulary is not privileged; only the grammar is.

Keywords are contextual: since Radix v0.79.0 there is no global reserved keyword table. The lexer emits identifiers for all words and the parser recognizes a keyword by spelling in its grammar position. A word is only a keyword in the slot where it is expected; everywhere else it is an ordinary identifier — you can name a variable if, a function fn, or a parameter coalesce. A small residual set (catch, guard, for, yields, throw, panic, assert, yield, main, async_main, import, from) is still globally reserved.

Structural glyphs#

Where behavioural vocabulary uses your reader locale's words, structural meaning uses universal glyphs. These never localise and never change their meaning across renderings. They are the visual anchor that makes Faber source recognisable regardless of which human language the keywords are rendered in.

Value flow#

GlyphMeaning
←Runtime binding, reassignment, and mutation — the only assignment operator
→Function return type declaration
⇥Alternate exit: error-channel type
⊥Default: inline value used when a conversion fails
∴Lambda joint — connects a closure body to its signature

Type shape#

GlyphMeaning
∷Static type ascription — compile-time assertion about a value's type
↦Runtime conversion — parsing or coercion that may fail
∪Inline union type — connects two types (as in T ∪ none)

Comparison and logic#

GlyphMeaning
≡ ≢Exact equality and inequality — strict type match required
≅ ≇Promoted exact equality — numeric widths join, then exact compare
≈ ≉Fuzzy equality — tolerance match with isclose defaults
≺ ≻ ≤ ≥Ordering comparisons — ASCII < > are generic delimiters only
∧ ∨ ⊻ ¬Logical and bitwise: and, or, xor, not

The binding convention matters#

One glyph choice deserves special attention because it is the most common point of confusion for new readers:

GlyphRoleUse for
←Runtime flowInitial binding, reassignment, and mutation at execution time
=Structural shapeField names inside literals and declaration metadata — not runtime stores

Most languages overload = for both "define this field in a type" and "put a runtime value in this variable." Faber splits those jobs. Every ← is live data flow; every = inside Type { … } is class field layout.

# Runtime binding: ← attaches a value to a name
class Point {
    let int x
    let int y
}

main {
    mut int count ← 0
    mut string label ← "ready"
    count ← count + 1

    # Structural shape: = defines field values inside a literal
    let _ p ← Point { x = 10, y = 20 }
}

Compared to mainstream languages#

The table below shows how common programming language patterns map to Faber's three-signal system. The Faber column uses a different glyph or keyword for each distinct semantic job — no overloading.

Semantic jobCommon in other languagesFaber
Parameter type declarationname: Stringstring name
Return type→ String, : String→ string
Runtime assignmentx = value←
Equality test==≡
NullabilityT?, Option<T>T ∪ none
Branch + one statementif (cond) return xif cond then return x
Type cast(T)value, value as Tvalue ∷ T
Conversion (may fail)try_into()value ↦ T

References#

  1. EBNF grammar — full glyph and keyword inventory
  2. radix/corpus/ — the language corpus, exemplars across all keywords
  3. radix/corpus/operatores/ — operator and glyph exemplars
  4. Commandments — the design laws that preserve these signals

Canonical vs sugar surfaces#

Multiple parseable surfaces, one semantic shape.

A recurring pattern in Faber's design: the language defines one canonical spelling for each construct, but accepts multiple sugar spellings that are semantically identical. The compiler does not prefer one over the other — both parse to the same AST node. The formatter keeps the spelling the author wrote.

The rule: Sugar spellings are semantically identical to long form. Multiple surfaces parse to the same HirAnnotation or type node. faber format preserves the spelling the author wrote.

Numeric type sugar#

Sized numeric types have one canonical spelling: the bare width marker (i8 … u64, d64, inf, f16, bf16, f32, f64). The compact sugar families below build on the markers. The choice between a container's long form and its sugar is per-module, not per-repository — a CLI package may use long form everywhere, while a tensor kernel module uses sugar:

SugarCanonical formDomain
tf32, tf32[4], ti64[2, 3]tensor<f32, _>, tensor<f32, [4]>Dense tensor — t + width + optional shape
sf32, sf32[2, 3], si64[N]sparse<f32, _>, sparse<f32, [2, 3]>Sparse tensor — s + width + optional shape
mf32[4, 4], mu32[3, 3]matrix<f32, [4, 4]>Register-class matrix — m + width + shape
lf32, lu32, li64list<f32>, list<u32>List — l + width

General Faber (prefer long form):

main {
    let list<f32> values ← empty
    let tensor<f32, [2, 3]> grid ← empty
    let i32 narrow ← 7
}

Numeric modules (prefer sugar):

main {
    let lf32 values ← empty
    let tf32[2, 3] grid ← empty
    let i32 narrow ← 7
}

Sugar is type-position only. Value identifiers named f32, tf32, or mf32 are unchanged — the compiler only interprets these as sugar when they appear in type positions. A file that consistently uses sugar should say so once at the top:

# STYLE: numeric sugar (tf32, mf32, sf32, lf32, lu32)

Annotation sugar#

Faber annotations follow the same dual-surface model as numeric types. Annotations are compiler-owned metadata attached to declarations — like @ option for CLI option definitions or @ future for async functions (legacy — prefer the async posture word in the signature slot).

Canonical form: a braced record with explicit field names:

@ option { binding = verbose, short = "v", long = "verbose", type = bool, description = "Enable verbose output", global = true }
main {
}

Sugar form: positional arguments and named aliases:

@ option { binding = verbose, short = "v", long = "verbose", type = bool, description = "Enable verbose output", global = true }
main {
}

Both forms produce the same HirAnnotation record. The canonical form is explicit and self-documenting; the sugar form is concise for frequently-used annotations where the field order is well-known. faber format preserves the author's chosen form.

Formatting#

faber format re-emits each file from analysed HIR, at the file's own reader locale. It keeps # comments and the sugar spellings the author wrote. It does not translate between reader locales: faber convert --to <locale> does that, and keeps comments and sugar the same way. Both run the compiler's front half, so invalid source produces diagnostics and is never silently formatted.

By default faber format reports each file that would change and exits 1 when any would; --write writes it back, and --stdout prints one file.

Key rules:

  • Four-space indentation
  • Stroustrup braces: opening { on the same line as the controlling header
  • The presence of blank lines is preserved, and a run of more than one collapses to one
  • No blank lines are inserted that the source did not contain

Design principle#

The canonical-vs-sugar pattern appears in multiple places because it is a deliberate design principle, not a collection of one-off conveniences:

DomainCanonicalSugar
Tensor typestensor<f32, [4]>tf32[4]
Annotations@ option { binding = verbose }@ option verbose ...

The pattern serves two goals. First, it lowers the barrier to entry — new users can write tf32[4] without typing tensor<f32, [4]>. Second, it keeps the canonical language unambiguous — when precision matters, the long form says exactly what it means. The formatter keeps whichever spelling the author wrote.

References#

  1. radix/docs/design/numeric-type-sugar.md — full sugar families, spelling preferences
  2. radix/docs/design/annotation-sugar.md — dual-surface annotation model
  3. radix/docs/design/faber-canonical-surface.md — the formatter and the re-emitter
  4. radix/grammar/EBNF.md — grammar tables for sugar forms