Cats vs ZIO

Поділитися
Вставка
  • Опубліковано 19 лис 2024

КОМЕНТАРІ • 49

  • @DevInsideYou
    @DevInsideYou  2 роки тому +2

    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

  • @SickAsSieves
    @SickAsSieves 2 роки тому +35

    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.

  • @xbmarx
    @xbmarx 2 роки тому +9

    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.

    • @marcello4258
      @marcello4258 Рік тому

      Haven’t seen any job offering requiring Scala without mentioning ZIO

  • @hectordoyle4718
    @hectordoyle4718 2 роки тому +1

    love you, Vlad
    thank you for the great video

  • @amislouma
    @amislouma 2 роки тому +3

    Thank you for “not it depends”

  • @SeriousWorm
    @SeriousWorm 2 роки тому +1

    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.

  • @sagnumb
    @sagnumb 2 роки тому +1

    keep up the good work mate. Scala 4 life.

  • @szotsmiklos8549
    @szotsmiklos8549 2 роки тому +6

    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.

    • @DevInsideYou
      @DevInsideYou  2 роки тому +1

      True, this happens often. Quality is not on par is debatable though. Some things are better in ZIO others are not as mature.

    • @unclebob418
      @unclebob418 2 роки тому +3

      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.

  • @SJ-ds8lp
    @SJ-ds8lp 2 роки тому +4

    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.

  • @danielstoica3633
    @danielstoica3633 2 роки тому

    Thank you for the video, Vlad ! :)

  • @LongLiveEnduro
    @LongLiveEnduro 2 роки тому

    thanks Vlad, very good video 👌

  • @miloventimiglia8547
    @miloventimiglia8547 2 роки тому +6

    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.

  • @ClewertonCoelho
    @ClewertonCoelho 2 роки тому +1

    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".

    • @DevInsideYou
      @DevInsideYou  2 роки тому +1

      I agree. Diversity is good and now that we have a choice I made mine.

  • @heartly4u
    @heartly4u 2 роки тому +1

    @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..

    • @DevInsideYou
      @DevInsideYou  2 роки тому +1

      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

  • @JorgeAdrianoBrancoAires
    @JorgeAdrianoBrancoAires 2 роки тому +5

    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.

    • @DevInsideYou
      @DevInsideYou  2 роки тому +2

      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

    • @AO-xe3dl
      @AO-xe3dl 2 роки тому

      Have you ever heard of zio-prelude?

    • @JorgeAdrianoBrancoAires
      @JorgeAdrianoBrancoAires 2 роки тому +2

      @@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
      @JorgeAdrianoBrancoAires 2 роки тому

      @@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.

    • @ardfard101
      @ardfard101 2 роки тому

      ​@@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.

  • @abc_cba
    @abc_cba 2 роки тому +2

    I am sorry but what was your finale point in picking between the two ?

    • @DevInsideYou
      @DevInsideYou  2 роки тому +6

      I am not sure if you are trolling, but the answer to your question is ZIO.

    • @abc_cba
      @abc_cba 2 роки тому +3

      @@DevInsideYou what the hell, no !
      I'm not trolling, I'm your fan.

    • @DevInsideYou
      @DevInsideYou  2 роки тому +6

      Cool cool. The answer is still ZIO. :)

  • @petacardi
    @petacardi 4 місяці тому

    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.

    • @DevInsideYou
      @DevInsideYou  4 місяці тому

      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.

  • @Somatik
    @Somatik 2 роки тому

    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.

  • @KamilKloch
    @KamilKloch 2 роки тому +1

    Thank you for the video! How does ZIO Streams compare to a jewel like fs2? (Features, addons etc).

    • @DevInsideYou
      @DevInsideYou  2 роки тому +2

      fs2 is a very mature and battle-tested library. It will take quite some time for ZIO Streams to catch up and prove itself.

  • @PeatySpirit
    @PeatySpirit 2 роки тому

    As I am currently looking into what library I should invest time and effort this is could not arrive at better time! Thx

  • @mmuschalik
    @mmuschalik 2 роки тому

    Agree with what you said. Keep it up.

  • @jonathanwinandy
    @jonathanwinandy 2 роки тому +1

    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.... )

    • @jonathanwinandy
      @jonathanwinandy 2 роки тому +2

      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.

  • @petacardi
    @petacardi 4 місяці тому

    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.

    • @DevInsideYou
      @DevInsideYou  4 місяці тому

      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.

    • @petacardi
      @petacardi 4 місяці тому

      ​@@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!

  • @SJ-ds8lp
    @SJ-ds8lp 2 роки тому +4

    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.

  • @DinoFancellu
    @DinoFancellu 2 роки тому

    Really good video. I like when people are prepared to have an opinion and state it without shame. Thanks