DSL Clock

A clock you write. The program below is parsed into a syntax tree and re-run every frame.

 
Program
Language
Statements are one per line. let makes a local; assigning to text, sub, color, background, size or spin drives the display. # starts a comment.

Time: h m s ms h12 ampm t (seconds since midnight) day month year dow dayname monthname pi tau

Functions: pad base pick round floor abs min max clamp lerp sin cos sqrt hsl rgb upper lower str len slice repeat

Operators: + - * / %, == != < <= > >=, and or not, and cond ? a : b. There are no loops and no way to define a function, so every program is guaranteed to finish.
Syntax tree