Functional Object-oriented Imperative Scala
summary
Argues Scala deliberately fuses functional, object-oriented and imperative styles so APIs remain pure from the outside while implementations use mutation for performance and clarity. Uses real Scala.js Linker code: refactors a naive O(n^2) list loop into map or a ListBuilder, a reachability analyzer implemented as computeAnalysis (~500 lines) that uses shared mutable fields, an emitter that stores incremental caches in instance state, pluggable backends (Closure, NodeJS, user extensions), and a withGlobals monad proved (~50 lines of comments) to track globals.
AI-written summary · about
chapters (12)
- 0:00Introduction and talk overview
- 1:05Scala’s three paradigms fusion
- 3:35Imperative to functional refactor
- 6:28Builders for performance
- 9:25Local mutable state in methods
- 16:35Mutable state across methods
- 21:36Instance-level mutable state
- 28:07Encapsulation with mutable internals
- 31:02Scala’s unique paradigm power
- 33:12Open class hierarchies
- 37:32Monads for code composition
- 40:47Q&A session
