1. 7
    1. 6

      Reactive Extensions? Again?

      Reinventing basic control flow by chaining function calls sounds great but never ends well. This leads to having to re-learn how to program, bending your knees to the framework in every single detail, and tying your codebase to this monstrosity, needing a full rewrite if you ever regret the decision (spoiler: you absolutely will).

      I’ve seen it in TypeScript with Angular. I’ve seen it in Node backends. I’ve seen it in Groovy trying to fix Vert.x. I’ve seen it too many times. Please don’t.

      Also, the code example is outrageous. How on earth is acceptable to compare a library against some code with zero helper functions being such a mess. It’s not that hard to have something equally functional and well done without selling your soul. The example is intentionally misleading.

      1. 1

        Reactive Extensions? Again?

        Not sure what you mean by this?

        IMO Effect didn’t reinvent anything. They built on top of fp-ts which uses this kind of style of piping functions to handle the control flow of an asynchronous value that can succeed or fail. Effect is more like taking ZIO from Scala and building it with fp-ts.

        The part of Effect that I do not have much experience with and feel uneasy about is the dependency injection aspect. I don’t like a library or framework taking control of how my code is defined because it makes my text editor and static analysis tools less powerful. Plus major upgrades can become a huge headache. This was my experience with AngularJS.

        1. 1

          This is what I mean: https://github.com/ReactiveX/rxjs

          EDIT: I have zero familiarity with fp-ts and my last experience with something similar was with Reactive Extensions. That’s why I’m feeling like they’re reinventing it.

        2. 1

          How on earth is acceptable to compare a library against some code with zero helper functions being such a mess.

          Isn’t the standard solution in js/ts code to just not bother and write something that’s broken in all the ways mentioned? I don’t see any other/better libraries that would offer this functionality in a way that’s nice to use or that even composes properly.

          But after trying myself: Is it at all easy or obvious how to write those 25 lines of Effect? No. For 80% of programmers this is a purely fictional lalaland.

          1. 2

            Isn’t the standard solution in js/ts code to just not bother and write something that’s broken in all the ways mentioned?

            The standard isn’t enough when the standard is extremely low. That’s not a valid excuse.

            I don’t see any other/better libraries that would offer this functionality in a way that’s nice to use or that even composes properly.

            Writing it yourself for your use case. Doing the thinking instead of relying on someone else having done it already. Every piece of software doesn’t need to be a fully featured independent library.

          2. 1

            Its all in the implementation tbqh, this is not exactly the same as angular & other observable based solutions as it looks pure fp

            Computations described by data, doing nothing by default.

            I was initially put off by this for similar reasons you are describing but I’m happy to keep having people tackle this problem, especially would love to see someone build something like a time travelling debugger for a system like this since the framework that runs the code could track all effects & roll them back in theory (?)

            Or a test running that can spit out a trace of effects & initial state that could be played back to see exactly when an expectation fails?

            It would be great if someone goes all out on these ideas in such a mainstream ecosystem.

            I do agree its an uphill battle & i will not be an early adopter.

          3. 1

            Two things I found interesting:

            1. They’ve raised $2.275.000 in funding for what is essentially an open source library. Very cool to see money injected into the open source community like this (two other big notable examples in the JS world being Bun (Oven)/Deno). I do wonder though, if this model has proven successful, what do maintainers need to do to get funding? What do they need to promise to investors? What data and stats are the return on investments based on?

            2. They use ._tag instead of .kind for giving types a unique field, and .kind is the normal practice in TypeScript. fp-ts use _tag, which makes sense if fp-ts inspired Effect, since the usage of Effect types is popular in ML languages. Makes me wonder if at some point, TypeScript will add better support for discriminating unions that require a common convention across all implementations.

            1. 1

              They’ve raised $2.275.000

              ಠ_ಠ

              Do you have a link for that?

              1. 1

                It’s at the bottom of the post:

                A year ago with the objective of making Effect as easy to use and as feature complete as possible we:

                • Incorporated Effectful Technologies Inc.
                • Raised a Seed Round of 2.275.000$ led by Amplify Partners with participation from Early Adopters.
                • Hired an amazing Founding Team.
                1. 1

                  Missed that because I didn’t reach the end of the post, as I had seen enough. Thanks.

              2. 1

                As for the .kind vs ._tag, i wonder why people don’t use symbols for these things?

                Serialization? What would be a time u want to serialize these things?

                1. 1

                  I took this approach for sum-types: https://github.com/unsplash/sum-types

                  It’s surprising how many things implicitly require an inherently serialisable data structure. Redux is an example.

            🇬🇧 The UK geoblock is lifted, hopefully permanently.