Functional Composition of the Universe
summary
A live Scala.js demo compiles to the browser and composes small pure functions into rotating stars, orbiting planets and satellites drawn on a canvas; scala.js real-time canvas simulation uses implicits and typeclass-style helpers to map rotate and orbit functions over collections. A mass slider changes gravity so the Earth either tightens its ellipse or escapes entirely, and nested composition builds galaxies around a black hole; function composition builds orbit/rotation functions and mass slider shows escape vs capture threshold. The code runs and the composed scene animates in the page.
AI-written summary · about
chapters (16)
- 0:00Introduction and welcome
- 1:26Talk objectives explained
- 4:01Defining functions in math and CS
- 5:46What is functional composition
- 7:10Setting up the Scala.js demo
- 10:02Understanding the universe and movement
- 12:53Drawing the solar system
- 16:47Forces behind celestial motion
- 17:51Adjusting mass and gravity effects
- 19:14Adding planets to the system
- 21:53Including satellites like the moon
- 23:18Galaxies and black holes
- 24:21Building a galaxy with composition
- 26:11Positioning objects in the universe
- 27:58Final demo of the dog in space
- 28:19Conclusion and Q&A invitation
