A Picture Language in JavaScript

This is a JavaScript implementation of Peter Henderson’s 1982 paper "Functional Geometry". The most important element in this small language is called a painter. A painter is a one-argument function, when called with a frame, "draws an image that is shifted and scaled to fit within a designated parallelogram-shaped frame". Since it's just a function, we can utilize closure and higher order function to combine simple painters to make complex painters. For more information, check out the aforementioned paper, section 2.2.4 of SICP, and the source code.

canvas, ctx, frame are already initialized on the page, so you can use these variables directly.