Avoiding macros with inline and derived by Josh Suereth

preview_player
Показать описание
Scala Love in the City Conference 2021

Avoiding macros with inline and derived

Have you always wanted amazing compile-time features in your API, but been afraid of the Scala 2 macro syntax? Have no fear, Scala 3 is here! Scala 3 provides a rich set of features that negate the need for most macros and provide an incredible toolset for APis that are easy to maintain. We'll look at using inline methods, tuples and derived code to create performant AND flexible APIs, as well as prototype implementations from GPU + serialization use cases.

A quick agenda: Improving performance with Inline Deriving code at compile time & working with Tuples Writing good error messages w/ inline When not to inline
Рекомендации по теме
Комментарии
Автор

Great talk, couple of comments/questions:

1.) Return type of various asserts cannot be T as it has Unit as type of its else branch, so it must be either T | Unit or left to be inferred, right?
2.) literalStrings cannot return a list with head constValue[head], as its return type is List[String] and type 'head' is in now way tied to String. So, something like constValue[head].toString instead?

duduki