Lrqapi4nnd251t8fhtz6
SkillsCast

Impromptu: Using Dependent Types to Build a Better API for Async Call Graphs

14th December 2017 in London at Business Design Centre

There are 53 other SkillsCasts available from Scala eXchange 2017

Please log in to watch this conference skillscast.

680360742 640

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:

Thanks to our sponsors

Impromptu: Using Dependent Types to Build a Better API for Async Call Graphs

Jon Pretty

Jon has been having fun riding the bleeding edge of Scala for over a decade, and he's not finished yet.

SkillsCast

Please log in to watch this conference skillscast.

680360742 640

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:

Thanks to our sponsors

About the Speaker

Impromptu: Using Dependent Types to Build a Better API for Async Call Graphs

Jon Pretty

Jon has been having fun riding the bleeding edge of Scala for over a decade, and he's not finished yet.

Photos