Please log in to watch this conference skillscast.
Writing asynchronous code is often an uneasy fit for a language like Scala. While high-level constructs like Futures facilitate asynchronous programming, syntactic limitations often make blocking or the unchecked access of asynchronously-computed values more natural than the safer alternatives.
In this talk, you will discover Impromptu, a lightweight Scala API for safely defining and executing graphs of dependent tasks, avoiding blocking and preventing access of not-yet-completed values, guaranteed the type system.
You will use a combination of several advanced type-system features to encode a task's dependencies, then use these types as constraints to restrict access within a task only to the results of dependent tasks which are known to have been completed. You will further take advantage of Scala's type inference to avoid polluting the code with cumbersome type ascriptions. This gives you very lightweight and natural syntax, without blocking or unsafe access.
During this talk, you will explore how Impromptu is implemented, and learn how dependent types allow the framework to be written in just 30 lines of code, and show how a similar approach may be used to concisely implement typed actors.
Furthermore, you will take advantage of current research into implicit functions in Dotty to remove the small amount of remaining boilerplate from Impromptu task definitions.
YOU MAY ALSO LIKE:
Impromptu: Using Dependent Types to Build a Better API for Async Call Graphs
Jon has been having fun riding the bleeding edge of Scala for over a decade, and he's not finished yet. While he's not travelling the world attending Scala conferences, or organizing Scala World, Jon spends his time working on a variety of open-source Scala libraries, and providing professional Scala training services.