Skip to content

Integrating the learning from TypeScript in designing a ZIO powered by Scala 3

Photo of Sandra Wolf
Hosted By
Sandra W.
Integrating the learning from TypeScript in designing a ZIO powered by Scala 3

Details

In the last 2 years we engaged in a monster-size task to port ZIO and most of its ecosystem to TypeScript, you might ask, why? While being in love with ZIO and Scala we have many places where the JVM isn’t a viable option and Scala.js, while being very nice, isn’t well integrated with the npm (js) ecosystem.

Having a different language, TypeScript, as a target meant we had to rethink some patterns and in general the API of each module needed to be thought of in terms of both features and limitations of the language.

Very nice things happened, for example, we were forced to use an explicit Has[_] type instead of following the ZIO 1.0 service pattern, and, as it turns out, this is going to be the default for ZIO 2.0 too.

While Scala and TypeScript differ in many aspects there is a degree of similarity and this is getting even better with the introduction of Unions and Intersections in Scala 3 (that TypeScript already had for a long time).

Precisely having unions and intersection, plus a number of tricks is the reason why, in TypeScript, we can have a better developer experience in handling errors (when one error is handled it is removed from the union) and in providing partial environments (when one service is provided it is removed from the intersection).

Today we will be looking at both TypeScript & Scala 3 while developing an intuition of how ZIO might look in the future when Scala 3 will be its primary target.

About the speaker:
Michael Arnaldi the author of Effect-TS, a functional programming library. The library allows building reliable, scalable, maintainable, and resilient web applications, leveraging the power of functional programming patterns.

PS. Together with Michael and Matechs we are organizing two amazing workshops:

Practical Functional Programming with Typescript - London, UK
https://www.eventbrite.co.uk/e/practical-functional-programming-with-typescript-london-edition-tickets-159683316097

And

Frontend testing in Typescript, London UK
https://www.eventbrite.co.uk/e/frontend-testing-in-typescript-london-edition-tickets-160606210499

Photo of ZIO Meetup (London) group
ZIO Meetup (London)
See more events