Table of Contents: 00:00 Intro 02:42 "The Big Rewrite" is not worth the cost 04:21 Tagless-Final is not pulling it's weight 08:50 Defensive Programming 11:04 Library vs Framework
I don't think this has been said enough: there's absolutely no requirement on using tagless final if you choose cats-effect. I've been using CE for 4 years and have 1 tagless final algebra (in a non-tf codebase) where I use different effects. A lot of people (even cats/cats-effect maintainers) won't recommend TF as a starting point.
I do agree ZIO is gaining ground in the industry. I've been working with some recruiters (just curiously seeing the job market) and I'm pretty surprised by how much more demand there seems to be from even a year ago.
Great video, it was very helpful. I've been developing with Scala since 2011 but have just started looking at FP libraries/frameworks, and I agree that ZIO really does seem like a good choice to go forward with on new projects. Thank you.
I also never understood why ce == tl. It's just as good of an effect lib as zio (1) is/was without needing to use tl. You say it yourself "we don't need n versions of each lib", I agree and before zio we already had a lot of well established libs for all things that matter. Now thanks to zio all of those libs doubled in number but quality is not on par with previous libs. The reason I'm uneasy with the zio community is because of it being a fork and not an extension to scala libs. Great video though, agree with your points.
Perhaps you should be uncomfortable with cats - after all, it's a fork, not an extension of scalaz. Forks aren't necessarily a bad thing. Look at all the innovation that has happened as a result. Cats and ZIO are both much better off as a result thanks to genuine innovation in both libraries.
I am not familiar with ZIO yet but the remarks you make about "which stack shall I learn?", and "too many things that do the same" are definitely accurate. I guess that is the reason why large corporations prefer Java/Springboot; one stack rules them all! Not to extend it makes operations cheaper and finding experienced developers easier.
Diversity is good, not bad. You can take whatever fit your client's needs and the team is productive with. There's no reason for "a solution to rule them all".
@vlad any plans on making a beginners video for FS2 and streaming.. Mostly interested in learning real life scenarios in this. Apologies for being derailed of the topic...but just thought of asking..
I always wanted to make a video about FS2 but I don't have the time or the need to use it. I think Daniel made one recently you might wanna check it out ua-cam.com/video/XCpGtaJjkVY/v-deo.html
A point you did not address is that ZIO is about IO. How does ZIO help me when I want to do non-IO functional programming? How do I sequence a List of Either's? How do I stack an Option and an Either? Also it doesn't offer an equivalent to the collection of concrete data types you find in Cats, for e.g. NonEmptyList, Validated, Ior. Currently, there appears to be ZIO-Prelude to address both of these points to some extent, but in its early beginnings.
The video is rather about cats-effect (or in fact the tagless-final technique). I myself will keep combining cats-core with ZIO since cats-core is also a utility library. In fact I made a video about the fact that it's a utility library long time ago ua-cam.com/video/BPexEu4yFVc/v-deo.html
@@DevInsideYou thank you for you answer. I need to re-watch that one video, it's been a while. I do the same, ZIO+Cats-core. But how clean is it? That's the question. The ZIO type is meant to avoid monad transformers, and instead utilize what de goes calls "effect rotation" (see One Monad to Rule Them All), but use cats-core based functional programming and you're back to transformers. ZIO is meant to, and I quote introduce "no jargon, no type classes, no implicits, no higher-kinded types, and no category theory", all of which come with cats-core. Are devs going to be learning Foldable, Traversable and Apply anyway?
@@JorgeAdrianoBrancoAires I think how you stack your concrete Monad is orthogonal to learning about Foldable, Traversable, Apply etc. ZIO type is not based on traditional Monad Transformer but it's still conform/implements to type classes laws so all the Cats utility functions that depends on the typeclass laws still works anyway.
The point I was trying to make is that TF (as everything else) has a cost. You are precisely right. In this particular scenario a unit test would have been a better choice and so I was arguing that TF is a worse choice most of the time. The relationship between my example and TF is the fact that both of them would have tried to solve the problem with more types rather than something as simple as a unit test or some other tool.
Playframework was also something we all thought would never go away but progress stopped. Akka/Alpakka is in a similar situation. These days I try to avoid libraries that have both a Scala and Java api. Staying compatible with both is not like 1 + 1 = 2 but more 1 + 1 = 3. Creating a PR for eg Alpakka is not something I look forward to.
Already doing some TF in ... 2012 with scalaz. That doesn't make me younger nor wiser. I am glad ZIO explored another path, that seems more manageable for the day-to-day code.
But why are you treating cats and tagless final as the same thing? I have been working with Cats as an effect system without any taggles algebra. It is fine to straight depend on the entire IO.
You are right. I should have made the distinction more clear. Years after I made this video I'd argue though that even if you use cats-effect without TF you are likely to use the rest of the typelevel ecosystem which is written in TF so you'll at least have the cognitive overhead. Furthermore at the time the idea of having IO in the business logic was frowned upon in the typelevel ecosystem whereas it was embraced in ZIO. Again all that said I should have made the distinction more clear.
@@DevInsideYou That's true. I have also worked in projects fully embracing TF and it was though to get into them. That may be why I am so sensitive about using the IO everywhere haha. Thanks for answering!
I am using CE, because of the mature ecosystem: fs2 and a handful of libraries, but ZIO does look more and more attractive exactly for the reasons you mentioned. As a one man show, it's hard to change now (15K lines 😛). But hopefully, there is enough bridge between the 2 that one can interop with the other seamlessly. The thing I worry about is the division between 2 that forces people to pick camps damaging the userbase.
Table of Contents:
00:00 Intro
02:42 "The Big Rewrite" is not worth the cost
04:21 Tagless-Final is not pulling it's weight
08:50 Defensive Programming
11:04 Library vs Framework
I don't think this has been said enough: there's absolutely no requirement on using tagless final if you choose cats-effect. I've been using CE for 4 years and have 1 tagless final algebra (in a non-tf codebase) where I use different effects. A lot of people (even cats/cats-effect maintainers) won't recommend TF as a starting point.
I do agree ZIO is gaining ground in the industry. I've been working with some recruiters (just curiously seeing the job market) and I'm pretty surprised by how much more demand there seems to be from even a year ago.
Haven’t seen any job offering requiring Scala without mentioning ZIO
love you, Vlad
thank you for the great video
Thank you for “not it depends”
Great video, it was very helpful. I've been developing with Scala since 2011 but have just started looking at FP libraries/frameworks, and I agree that ZIO really does seem like a good choice to go forward with on new projects. Thank you.
keep up the good work mate. Scala 4 life.
I also never understood why ce == tl. It's just as good of an effect lib as zio (1) is/was without needing to use tl.
You say it yourself "we don't need n versions of each lib", I agree and before zio we already had a lot of well established libs for all things that matter. Now thanks to zio all of those libs doubled in number but quality is not on par with previous libs. The reason I'm uneasy with the zio community is because of it being a fork and not an extension to scala libs.
Great video though, agree with your points.
True, this happens often. Quality is not on par is debatable though. Some things are better in ZIO others are not as mature.
Perhaps you should be uncomfortable with cats - after all, it's a fork, not an extension of scalaz. Forks aren't necessarily a bad thing. Look at all the innovation that has happened as a result. Cats and ZIO are both much better off as a result thanks to genuine innovation in both libraries.
In the end, I hope both ecosystems bash each other less and learn from each other, instead of quickly dismissing ideas from one or other.
Thank you for the video, Vlad ! :)
thanks Vlad, very good video 👌
I am not familiar with ZIO yet but the remarks you make about "which stack shall I learn?", and "too many things that do the same" are definitely accurate. I guess that is the reason why large corporations prefer Java/Springboot; one stack rules them all! Not to extend it makes operations cheaper and finding experienced developers easier.
Diversity is good, not bad. You can take whatever fit your client's needs and the team is productive with. There's no reason for "a solution to rule them all".
I agree. Diversity is good and now that we have a choice I made mine.
@vlad any plans on making a beginners video for FS2 and streaming.. Mostly interested in learning real life scenarios in this. Apologies for being derailed of the topic...but just thought of asking..
I always wanted to make a video about FS2 but I don't have the time or the need to use it. I think Daniel made one recently you might wanna check it out ua-cam.com/video/XCpGtaJjkVY/v-deo.html
A point you did not address is that ZIO is about IO. How does ZIO help me when I want to do non-IO functional programming? How do I sequence a List of Either's? How do I stack an Option and an Either? Also it doesn't offer an equivalent to the collection of concrete data types you find in Cats, for e.g. NonEmptyList, Validated, Ior. Currently, there appears to be ZIO-Prelude to address both of these points to some extent, but in its early beginnings.
The video is rather about cats-effect (or in fact the tagless-final technique). I myself will keep combining cats-core with ZIO since cats-core is also a utility library. In fact I made a video about the fact that it's a utility library long time ago ua-cam.com/video/BPexEu4yFVc/v-deo.html
Have you ever heard of zio-prelude?
@@DevInsideYou thank you for you answer. I need to re-watch that one video, it's been a while. I do the same, ZIO+Cats-core. But how clean is it? That's the question. The ZIO type is meant to avoid monad transformers, and instead utilize what de goes calls "effect rotation" (see One Monad to Rule Them All), but use cats-core based functional programming and you're back to transformers. ZIO is meant to, and I quote introduce "no jargon, no type classes, no implicits, no higher-kinded types, and no category theory", all of which come with cats-core. Are devs going to be learning Foldable, Traversable and Apply anyway?
@@AO-xe3dl Yes, I misnamed it zio-core in my original comment above, my bad, will fix it. I believe that is in its early beginnings though.
@@JorgeAdrianoBrancoAires I think how you stack your concrete Monad is orthogonal to learning about Foldable, Traversable, Apply etc. ZIO type is not based on traditional Monad Transformer but it's still conform/implements to type classes laws so all the Cats utility functions that depends on the typeclass laws still works anyway.
I am sorry but what was your finale point in picking between the two ?
I am not sure if you are trolling, but the answer to your question is ZIO.
@@DevInsideYou what the hell, no !
I'm not trolling, I'm your fan.
Cool cool. The answer is still ZIO. :)
8:33 The entire point of the problem in that example code can be avoided with a unit test. Still not find the relation with taggles final.
The point I was trying to make is that TF (as everything else) has a cost. You are precisely right. In this particular scenario a unit test would have been a better choice and so I was arguing that TF is a worse choice most of the time.
The relationship between my example and TF is the fact that both of them would have tried to solve the problem with more types rather than something as simple as a unit test or some other tool.
Playframework was also something we all thought would never go away but progress stopped. Akka/Alpakka is in a similar situation. These days I try to avoid libraries that have both a Scala and Java api. Staying compatible with both is not like 1 + 1 = 2 but more 1 + 1 = 3. Creating a PR for eg Alpakka is not something I look forward to.
Thank you for the video! How does ZIO Streams compare to a jewel like fs2? (Features, addons etc).
fs2 is a very mature and battle-tested library. It will take quite some time for ZIO Streams to catch up and prove itself.
As I am currently looking into what library I should invest time and effort this is could not arrive at better time! Thx
Agree with what you said. Keep it up.
Can we like the video twice? Interesting comments on your video ( I will try the CE without TF, but not sure if I can stand it.... )
Already doing some TF in ... 2012 with scalaz. That doesn't make me younger nor wiser. I am glad ZIO explored another path, that seems more manageable for the day-to-day code.
But why are you treating cats and tagless final as the same thing? I have been working with Cats as an effect system without any taggles algebra. It is fine to straight depend on the entire IO.
You are right. I should have made the distinction more clear.
Years after I made this video I'd argue though that even if you use cats-effect without TF you are likely to use the rest of the typelevel ecosystem which is written in TF so you'll at least have the cognitive overhead.
Furthermore at the time the idea of having IO in the business logic was frowned upon in the typelevel ecosystem whereas it was embraced in ZIO.
Again all that said I should have made the distinction more clear.
@@DevInsideYou That's true. I have also worked in projects fully embracing TF and it was though to get into them. That may be why I am so sensitive about using the IO everywhere haha. Thanks for answering!
I am using CE, because of the mature ecosystem: fs2 and a handful of libraries, but ZIO does look more and more attractive exactly for the reasons you mentioned.
As a one man show, it's hard to change now (15K lines 😛).
But hopefully, there is enough bridge between the 2 that one can interop with the other seamlessly. The thing I worry about is the division between 2 that forces people to pick camps damaging the userbase.
Really good video. I like when people are prepared to have an opinion and state it without shame. Thanks