‹ BackHN Continuity

Thread

Effect 4.0

87 points · 70 comments · stevefan1999

  1. claude-ai · · focus · HN ↗
    Three clicks, no info what effect 4.0 is, except that it's AI-ready, safe, good, and re-built from the ground up. No idea what it actually is.
    1. vantassell · · focus · HN ↗
      I had the same thought, until I realized the posted link is for their 4.0 release rather than their homepage.

      Their main page makes the product pretty clear.

      <a href="https:&#x2F;&#x2F;effect.website" rel="nofollow">https:&#x2F;&#x2F;effect.website

      1. SwellJoe · · focus · HN ↗
        Does it, though?

        I can&#x27;t parse this into meaning anything:

        &quot;Reliable TypeScript for the AI era

        Build production-ready systems your team can ship, customers can depend on, and AI agents can work with.&quot;

        OK, it&#x27;s written in TypeScript, I guess. Is it a library? What does it do?

        1. notpushkin · · focus · HN ↗
          I’ve had to click around a bit and I think this is a better summary: <a href="https:&#x2F;&#x2F;effect.website&#x2F;docs&#x2F;v4&#x2F;getting-started&#x2F;why-effect#the-effect-pattern" rel="nofollow">https:&#x2F;&#x2F;effect.website&#x2F;docs&#x2F;v4&#x2F;getting-started&#x2F;why-effect#th...

            import { Effect } from &quot;effect&quot;
            
            const divide = (a: number, b: number): Effect.Effect&lt;number, Error, never&gt; =&gt;
              b === 0
                ? Effect.fail(new Error(&quot;Cannot divide by zero&quot;))
                : Effect.succeed(a &#x2F; b)
            
            Effect.runSync(divide(4, 2)) &#x2F;&#x2F; =&gt; 2
          
          This seems to be similar in spirit to railway oriented programming (see e.g. <a href="https:&#x2F;&#x2F;returns.readthedocs.io&#x2F;en&#x2F;latest&#x2F;pages&#x2F;railway.html" rel="nofollow">https:&#x2F;&#x2F;returns.readthedocs.io&#x2F;en&#x2F;latest&#x2F;pages&#x2F;railway.html), but I’m not 100% confident here.
          1. exceptione · · focus · HN ↗
            Monad Maybe?
            1. notpushkin · · focus · HN ↗
              Kinda like that, but with the error branch having a value too. I think Result is the common name for this monad:

                type Result e v = Ok v | Err e
              
              <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Result_type" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Result_type
      2. pohl · · focus · HN ↗
        Still can’t tell if it’s a language, library or framework
        1. itishappy · · focus · HN ↗
          Have you tried reading the big bold text at the top of the page?

          &gt; Reliable TypeScript for the AI era

          It is a library.

          1. aand16 · · focus · HN ↗
            You forgot the &#x2F;s
          2. oliwarner · · focus · HN ↗
            I&#x27;m with the sibling. A library for what? UI, backend, graphing, visual effects? What does this replace?
            1. hexasquid · · focus · HN ↗
              &quot;typed error handling, structured concurrency, resource safety, and observability, all from one composable core&quot;
              1. oliwarner · · focus · HN ↗
                Yes, I read that and left scratching my head. Does it also encabulate?

                Really reminded me of this classic pitch (and yes I know it&#x27;s not the original turbo encabulator).

                &gt; More over, whenever fluorescent score motion is required it may also be employed in conjunction with a drawn reciprocation Dingle arm to reduce sinusoidal depleneration. The Retro Encabulator has now reached a high level of development and it&#x27;s being successfully used in the operation of Millford Trunions. It&#x27;s available soon wherever Rockwell Automation products are sold.

                1. itishappy · · focus · HN ↗
                  Not understanding something is different from it having no meaning.
                  1. oliwarner · · focus · HN ↗
                    Absolutely, but there&#x27;s so little context offered to derive actual meaning. If you already know, it&#x27;s probably a lot easier.

                    And if multiple people are wondering what something fundamentally is, perhaps it&#x27;s the pitch, not the people.

            2. itishappy · · focus · HN ↗
              A library for effects. Algebraic effects, to be more precise.

              To be fair &quot;algebraic effects&quot; is part of my priors. If you don&#x27;t know what that is those specific words won&#x27;t help you, but the examples should!

          3. Incipient · · focus · HN ↗
            &gt;incredibly simple to build the API and a background worker process with Effect. I get logging, telemetry, error handling, concurrency, API doc generation, and more for free!

            But that can&#x27;t be a library? Must be a framework? (eg more batteries included)

            1. nateb2022 · · focus · HN ↗
              &gt; (eg more batteries included)

              That&#x27;s not the definition of a framework.

              You call a library. A framework calls you.

      3. airstrike · · focus · HN ↗

        [dead]

Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.