Generalizing Turtle Geometry: An Extensible Language for Vector Graphics Drawing
summary
An extensible language called Panda generalizes turtle graphics into a polymorphic DSL implemented in Haskell that generates Bézier paths and SVG-style vector graphics. It exposes four core instructions (primitive, change, reset, transform), models state changes as a monoid acting on states, and uses field polymorphism so rotation/translation code reuses across turtle, path, and vector instantiations. The prototype renders concatenated paths and superimposed SVG, demonstrates 30-circle waves and a 36-repeat closure returning the turtle to origin, and runs as a writer-style monad.
AI-written summary · about
chapters (11)
- 0:00Introduction
- 0:22What is turtle geometry
- 1:50Common patterns in extensions
- 3:18Introducing PIA language
- 5:50Demonstration of PIA
- 7:11Polymorphic PIA implementation
- 11:29Instantiating PIA for domains
- 13:38Field polymorphism in state
- 14:40Correct media monad instantiation
- 16:34Key requirements for PIA DSL
- 17:17Q&A
related talks
16mGeometry Types for Graphics Programming
20mGraphical Primitive Recursion For String Diagrams
37mGoing bananas with recursion schemes for fixed point data types
27mReclaiming the Unexplored in Hybrid Visual Programming
28m"Making a Programming Language for 3D Design"
36mParallel Algebraic Effect Handlers
25mFormat Abstraction for Sparse Tensor Algebra Compilers
31mA tour of String diagrams and Monoidal categories
