Do It

This seems like a lot (the current commerial examples and operating system require 10 of millions to 100s of millions of lines of code). We ask: "How complex is this really?" Could active mathematics be invented to represent the semantic essence of "personal computing from the end-user down to the metal?" Could we produce runnable code that is many orders of magnitude smaller? A few "100s of 'Maxwell's Equations' T-shirts" vs. 10s of millions of pages of code?

really

active mathematics

type Point = (x, y : Real) type Bezier = (A, B, C : Point) type EdgeSpan = (x, y, c, l : Real) type EdgeSample = (x, y, a, h : Real) | (a : Real) | : Real { -a if a < 0, a } (a : Real) ◁ (b : Real) : Real { a if a < b, b } (a : Real) ~ (b : Real) : Real (a + b) / 2 DecomposeBeziers : Bezier >> EdgeSample ∀ (A, B, C) inside = (⌊ A ⌋ = ⌊ C ⌋ ∨ ⌈ A ⌉ = ⌈ C ⌉) if inside.x ∧ inside.y P = ⌊ A ⌋ ◁ ⌊ C ⌋ w = P.x + 1 - (C.x ~ A.x) h = C.y - A.y >> (P.x + 1/2, P.y + 1/2, w × h, h) else ABBC = (A ~ B) ~ (B ~ C) min = ⌊ ABBC ⌋ max = ⌈ ABBC ⌉ nearmin = | ABBC - min | < 0.1 nearmax = | ABBC - max | < 0.1 M = {min if nearmin, max if nearmax, ABBC} << (M, B ~ C, C) << (A, A ~ B, M)

Nile:"Ken Iverson meets Christpher Strachey"

"The Formula" in Nile (~ 45 LOC)

The Formula

CombineEdgeSamples : EdgeSample >> EdgeSpan (x, y, A, H) = 0 ∀ (x', y', a, h) if y' = y if x' = x A' = A + a H' = H + h else l = {x' - x - 1 if |H| > 0.5, 0} >> (x, y, |A| ◁ 1, l) A' = H + a H' = H + h else >> (x, y, |A| ◁ 1, 0) A' = a H' = h >> (x, y, |A| ◁ 1, 0) Rasterize : Bezier >> EdgeSpan ⇒ DecomposeBeziers → SortBy (@x) → SortBy (@y) → CombineEdgeSamples

Reset