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:
- How I Rebuilt the Typelevel Ecosystem with Fury (SkillsCast recorded in March 2019)
- Fast Track to RESTful Microservices (in London on 11th - 13th November 2019)
- Scala eXchange London 2019 (in London on 12th - 13th December 2019)
- Scalax2gether Community Day 2019 (in London on 14th December 2019)
- Code Kata: Yilin Wei - Optics with Monocle (in London on 22nd October 2019)
- Solandra Hands-On Tutorial & Emergent Behaviour In Insects (in London on 28th October 2019)
- Abstract Data Types In The Region Of Abysmal Pain, And How To Navigate Them (SkillsCast recorded in September 2019)
- The Last Frontier and Beyond (SkillsCast recorded in August 2019)
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.