A couple weeks back I was introduced to an open-source CAD application which uses constraints (e.g. "this line is perpendicular to that one") to let you describe drawings declaratively. At the time they were looking into alternate engines for this constraint system, so I thought I'd try to implement my own.
This article explains how
Expressions work and how we turn an arbitrary bit of math (e.g.
5 * (3 + sin(90))) into a more computer-friendly form.
I've actually implemented a lot more than this article lets on, but didn't want to say too much because I'm still working through some bugs. We can already solve equations, though!