How to Avoid Safety Hazards when using Closures in Scala
summary
Shows a concrete library called spores 3 that replaces ordinary closures with an explicit, typed environment and a compile-time check that rejects accidental captures. It uses type-class serialization to guarantee serializability at compile time, interoperates with uPickle, and runs on Scala JVM and Scala.js with Scala Native planned. The implementation is open source (Apache‑2) and demonstrably prevents the common runtime "task not serializable" and data‑race hazards by shifting checks to compile time.
AI-written summary · about
chapters (6)
- 0:00Introduction
- 2:53Understanding closures
- 8:05Safety risks in closures
- 12:58Remedies and best practices
- 19:31Introducing Spores 3
- 32:21Serialization and summary
related talks
51mCats Effect: The IO Monad for Scala
36mFreestyle: A framework for pure functional apps, libs and microservices
39mComposable event sourcing with monads
59mDecomposing Java applications
49mFunctional programming in practice, with all its consequences
41mHow to write microservices in Scala without Akka
55mThe Incredible Efficiency of Log Unification!
46mVert.x 3 goes Scala
