FacadeLang

A typed language for façade design. Units, dimensions and kinds of quantity are part of the type, so the slider swap of paper Fig. 5 becomes a compile-time error.

Builds on Aish, Fisher, Orchard, Torry. Programming Languages for the Future of Design Computation. Onward! 2024.

loading the checker…

drag to rotate · scroll to zoom · right-drag to pan · double-click to fit


      
    

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

Error codes

E0001–E0005syntax errors (see the grammar)
E0101dimension mismatch
E0102kind mismatch (the Fig. 5 swap)
E0103unknown name
E0104unknown unit
E0105geometry used in arithmetic
E0106wrong number of arguments
E0107duplicate declaration
E0108type mismatch (other)
E0109invalid 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: