Specifying behavior with Protocols, Typeclasses or Traits. Who wears it better (Python, Scala 3, Rust)?

Within simple applications abstractions are only needed to a certain degree. E.g., why would someone need a complex class hierarchy, if the task at hand could be solved more pragmatically? However, as applications and the business get more complex, abstractions can become crucial for improving the quality and maintainability of your code. With typing.Protocol a great Python language feature was introduced, which allows abstraction and modularization while also having static typing. This allows for very robust software development. How do other languages solve that problem? Besides typing.Protocol we’ll also dive into the world of Scala Typeclasses, and Rust Traits, and explore how these features are used in each language to ensure the correctness and safety of code. All these mechanisms have in common that they specify behavior for types in a very flexible and safe manner.

This session took place in track Python Language and was classified suitable for intermediate domain / intermediate python by the speaker.

Kolja Maier

About — in the speaker's own words

I love architecting & building data products that have business impact. Drilling into business domains and leveraging data to thrive the business excites me. Passionate about shaping company culture around and towards data.

Social card for talk: Specifying behavior with Protocols, Typeclasses or Traits. Who wears it better (Python, Scala 3, Rust)?