Building a Tagless Final DSL for WebGL in Scala
summary
Claims that a tagless final DSL built in Scala.js provides composable layers from a low-level WebGL algebra up to a render-engine, interpreting into any effect type (demo uses Monix Task). Implements concrete ops like drawImage algebra, shader compilation that returns Either for compile errors, texture creation and matrix transforms, and a small SNES-style tile racer with sprites. Shows interpreters all the way down, a working browser demo, and mixing sequential and parallel effects via cats’ parallel instance.
AI-written summary · about
chapters (20)
- 0:00Introduction
- 1:04Motivation for tagless final
- 3:36EDSLs vs embedded DSLs
- 6:29Tagless final explained
- 8:17Simple console algebra example
- 11:29Combining multiple algebras
- 13:17Layering languages in DSLs
- 14:47WebGL game project overview
- 16:12DOM algebra for WebGL
- 17:35WebGL low-level algebra
- 19:00Simple race program demo
- 20:48Render engine higher-level algebra
- 23:20Interpreters all the way down
- 24:06Final racing game demo
- 24:49Parallelism with Cats Parallel
- 26:57Inspecting and optimizing programs
- 28:02Maine library for algebra composition
- 28:46Stack safety in tagless final
- 29:07Key benefits of tagless final
- 30:31Conclusion and Q&A
related talks
21mTagless Final for Humans
44mFunctional Interpreters and You
26mYo Dawg, Heard You Want To FlatMap Your Direct-Style
39mA roadtrip with monads: from MTL, through tagless to BIO
42mFunctional interpreters and you
31mAbstract nonsense
21mDemo: A functional EDSL for mathematics visualization that compiles to JavaScrip...
31mA tour of String diagrams and Monoidal categories
