Past Meetup

# Functional Geometry

This Meetup is past

31 people went

## Details

Functional Geometry - http://users.ecs.soton.ac.uk/peter/funcgeo.pdf and http://eprints.soton.ac.uk/257577/1/funcgeo2.pdf

Imperative programming is rooted in compulsively thinking of programs as a sequence of instructions given to a machine that manipulates a set of bits. Bits represent state: each bit can be in 2 states, 10 bits in 1024 states, a 100 in 1e301 states. No matter whatever high level abstractions you create for talking about these primitive bits (floats, points, lines, boxes, polygons, fish), as long as you are writing programs that work with state, you are bound to run into this combinatorial explosion as you add complexity. We humans are really bad at keeping track of states in our heads! An average person can keep 7 ± 2 (http://en.wikipedia.org/wiki/The_Magical_Number_Seven,_Plus_or_Minus_Two) things in his/her working memory. What we are good at though, is narratives and descriptions...

The timeless paradigm of functional programming emphasizes thinking of programs as consisting of pure functions akin to mathematical identities. This decouples programming from the idea that programs have to be written for a computer, and as a series of instructions. Instead, in FP, we describe the world and the system we want to create in terms of its constituent parts, which, in turn, are similarly described in terms of their constituent parts.

Peter Henderson's "Functional Geometry" simply provides an example of a well-written functional program. In particular, the author builds a sequence of functions which start off by describing lines on a 2D plane and build up to a description of an intricate Escher (http://www.mcescher.com/) woodcut called Square Limit (http://www.wikiart.org/en/m-c-escher/square-limit) (final result in the figure). In the process, the author offers insights into how to write other such well-written functional programs.

A 600x600 grid of bits!

In this session we can plan to discuss:

• Primitives for describing geometry of lines on a 2D plane

• Abstraction barriers (http://mitpress.mit.edu/sicp/full-text/sicp/book/node29.html), and layered design of a richer set of functions (the fish and its poses)

• The description of Square Limit

• An implementation of a system to draw the primitives

• History of this paper, and how other notable works make references to it

• (Discussion) concrete lessons you can apply in your day-to-day programming - I am expecting this discussion to be a blast!