drag to rotate · scroll to zoom · right-drag to pan · double-click to fit
| name | type | value (SI) |
|---|
The checker is the Rust implementation compiled to WebAssembly; it runs in your browser as you type. The geometry built-ins are opaque in the language: the 3D view runs simple stand-ins for them (a Curve input is a 4 m × 3 m bay). Like an untyped visual tool, the view runs even when the checker rejects the program, and then shows the result in red.
The bug
In paper Fig. 5, a façade panel is built from three unnamed number sliders: inset = −1, offset = 0, thickness = 0.9. Connect the inset slider where the thickness should go, and Dynamo builds a wrong panel without a word. In FacadeLang every input has a name and a type:
param inset : Inset = -1.0 m param thickness : Thickness = 0.9 m let panel = thicken(mid, inset) -- error[E0102]: expected Thickness, found Inset
Both values are lengths, so a checker with units alone would accept the swap. But an inset and a thickness are different kinds of length, just as torque and energy are different kinds of N·m. The checker knows this, and rejects the program.
The language in one screen
-- domain concepts are declared, not hard-coded (the prelude declares SI and façades) dimension Length dimension Area = Length^2 unit m : Length unit mm = 0.001 m kind Thickness : Length -- a Length with a specific meaning extern thicken(Surface, Thickness) -> Solid -- geometry is opaque: only its type is known -- a design: named, typed inputs and a dataflow of pure functions param thickness : Thickness = 0.9 m where thickness > 0 m let panel = thicken(mid, thickness) let vol = area(mid) * thickness -- inferred: Length^3
- Dimensions.
+,−and comparisons need equal dimensions (E0101).*,/and^combine them, as an abelian group of exponent vectors: L² · L = L³, inferred without annotation. - Units are normalised to SI and then erased:
2.5 mmis the number 0.0025 of dimension Length. - Kinds form a subtyping hierarchy:
Thickness <: Length. A plain0.9 mreceives its kind once, where a name is declared. After that a kind cannot be relabelled, and anInsetnever reaches aThicknessparameter (E0102). - Guarantee. Well-typed programs are dimensionally homogeneous (Kennedy's dimension types) and kind-safe. The typing rules and proof sketches are in the formal document for Feature 1.
Error codes
| E0001–E0005 | syntax errors (see the grammar) |
| E0101 | dimension mismatch |
| E0102 | kind mismatch (the Fig. 5 swap) |
| E0103 | unknown name |
| E0104 | unknown unit |
| E0105 | geometry used in arithmetic |
| E0106 | wrong number of arguments |
| E0107 | duplicate declaration |
| E0108 | type mismatch (other) |
| E0109 | invalid unit declaration |
The standard prelude (built in, loaded before every program)
Status
Done: lexer and parser with error recovery, readable diagnostics, the Feature 1 checker (dimensions, units, kinds, subtyping, inference), unit, example and property-based tests (dimension group laws), a command-line checker, and this WebAssembly playground.
Next:
- Tolerances as intervals (Moore arithmetic);
whereclauses checked as proved, error or cannot prove; compatibility of tolerance stack-ups. - Construction order: components as linear resources with typestate (Fabricated → Installed), rejecting invalid assembly sequences.
- A hierarchy of warnings, and a Haskell reference checker for differential testing.