0x0 Syntax Reference
This reference summarizes implemented 0x0 syntax. See docs/grammar.ebnf for
the compact grammar sketch and docs/language.html for the implementation guide.
Files
A file contains parenthesized forms. The conventional first form is the module:
(⊙ main)
Comments begin with ; and continue to the end of the line.
Imports And Exports
Import a file:
(↥ "helper.0x0")
Import with an alias:
(↥ "helper.0x0" helper)
Import through the package lockfile:
(↥ "pkg:core-map")
Export selected functions from an imported module:
(↦ public-add public-sub)
Functions
(ƒ add
(∷ (→ I64 I64 I64))
(cap pure)
(doc "Return the sum of two integers.")
(a b)
(+ a b))
Function annotations are optional, but public library functions should carry
type, capability, and doc annotations where practical.
Bindings And Sequencing
Local bindings:
(≔ ((left 20)
(right 22))
(+ left right))
Sequencing:
(do
(print "ready")
42)
Conditionals
(if condition then-expression else-expression)
Values
Current values include:
- integers such as
42; - text such as
"hello"; - booleans
trueandfalse; Unit;- lists through list builtins.
Builtin Areas
The current builtin areas include arithmetic, comparison, lists, text, file,
stdin/stdout, argv/env, and runtime-support helpers documented in
docs/language.html.
Current Limits
- 0x0 does not claim the old
jmp0x1b/langembedded syntax as current syntax. - 0x0 does not currently expose generic socket or subprocess builtins as normal
language builtins.
- The checker is an implemented contract slice, not a complete type system.