Recent advances in machining, such as 5-axis raster grinding, have now made it possible to make high quality freeform optical surfaces, i.e. surfaces that do not have rotational symmetry. This opens up a whole new realm of design possibilities for illumination and imaging applications, but little theory exists for the design of such surfaces. I will describe methods that I have developed for this problem, based on differential geometry and partial differential equations. For some optical design problems, the surfaces may be modeled as integrals of distributions in Euclidean space. Hints of connections between Hamiltonian optics and these methods appear, but the full story remains unclear. During my lecture prototypes will be available for examination by the audience.