On Folding
Where does computation live? In origami, it lives in a paper crease. We build a functional crease pattern generator in Scala to explore what origami teaches us about programs. The insight is material before it is mathematical: pure functional programming emerges naturally from the physics of folding.
This talk uses origami as a concrete, geometric setting for ideas that often stay abstract. We walk through the implementation of a crease pattern generator in Scala: a program that takes a set of folding rules and produces the geometric blueprint for an origami model. The patterns we generate, we fold into physical objects.
Along the way, the talk covers how to model a physical system as immutable data and how to encode mathematical laws as type constraints, so the compiler rejects invalid states. We are not using functional programming as a convenient tool. Instead, we are making the argument that origami is a form of computation, and that the math enforcing which folds are physically valid is a type system.
The audience will leave with a concrete example of type-driven design applied to a real domain, an intuition for why immutability and pure functions are not just good practice but sometimes the only model that fits, and (in the best case) the realisation that computation can live anywhere. Even in a sheet of paper.
This talk is aimed at beginners and experienced Scala developers alike. Its goal is less to close things down than to open them up.
I'm a Scala developer with a background in fine arts and music production. My sculptural practice has long revolved around folding and unfolding. Writing Scala turned out to be less of a departure than I expected.
I work at Tiko and have contributed to the open source Sounds of Scala web audio library as part of Google Summer of Code 2024 under the Scala Center.
