S-Expression Syntax
Lisp-family syntax with modern ergonomics — type annotations, collection
literals ([], {}), threading macros (->, ->>), and keywords (:name).
A weir is a low dam built across a river to control water flow. It doesn’t block the river — it guides it. Weir the language follows the same principle: guard rails that prevent bugs without preventing expressiveness.
S-Expression Syntax
Lisp-family syntax with modern ergonomics — type annotations, collection
literals ([], {}), threading macros (->, ->>), and keywords (:name).
Static Types
Declarative static typing with local inference. Explicit function signatures, inferred locals, algebraic data types, and exhaustive pattern matching.
Live Reloading
Function-level hot-swap in dev mode. Edit code, see changes instantly — the runtime patches function pointers without restarting your program.
Native Performance
Cranelift JIT for dev mode (fast compilation), AOT compilation for release binaries. Tracing GC with opt-in arena allocation for hot paths.
Package System
weir.pkg manifests with path-based dependencies, native C source
compilation, and automatic dependency resolution.
C FFI
Call C libraries directly via extern "C" declarations. Build games with
GLFW, OpenGL, SDL, and more — with unsafe blocks for safety.
;; Define a struct(defstruct Vec2 (x : f64) (y : f64))
;; Define a sum type(deftype EnemyState Idle (Patrol Vec2 Vec2) (Chase i64) Dead)
;; Function with type annotations(defn spawn-wave ((n : i32) (origin : Vec2)) : (List Enemy) (map (fn (i) (Enemy :pos (Vec2 (* (to-f64 i) 32.0) (.y origin)) :health 100 :state Idle)) (range n)))
;; Pattern matching is exhaustive(match enemy-state ((Patrol start end) (move-between start end)) ((Chase target-id) (pursue target-id)) (Idle (stand-still)) (Dead (remove-entity)))Weir is under active development. What works today: