#id_effect

22 messages · Page 1 of 1 (latest)

vocal timber
#

Typed Effects in Rust — build composable, testable async programs where dependencies live in the type system and cleanup is guaranteed. If async Rust has you drowning in parameters and brittle .await? chains, start here: https://industrial.github.io/id_effect/introduction.html — runnable examples, no monad homework required. id_effect: describe what you want; the runtime does the rest.

neat sable
#

Do you realize that async functions return futures that aren’t run until you await them, right

gaunt pulsar
vocal timber
#

A lot of these concepts are from Haskell and other languages, I think.

neat sable
#

That explains why the whole thing felt a bit like JS to me

vocal timber
# gaunt pulsar AI probably lied to them and send them on a wild ride trying to recreate futures...
GitHub

Rust Effect<A, E, R> — sync and async functional effects with context/layers and pipe, interpreter-style, no bundled executor. - Industrial/id_effect

GitHub

Rust Effect<A, E, R> — sync and async functional effects with context/layers and pipe, interpreter-style, no bundled executor. - Industrial/id_effect

#

There are about 4 other Effect implementations on crates.io but most of them are very incomplete. This one is nearing completeness (with the Effect.ts lib anyway, I might diverge)

#

I asked the owner of effect if I could have it (hasn't been touched in 5 years) but hasn't responded yet.

quick fjord
#

I read the book a bit and I honestly don't get it. What does the library provide exactly? To me it sounds like a macro thats used instead of await or something.

#

Like the things that the library provides can be already be trivially done in Rust.

vocal timber
#

Yes, and a dependency injection system on top of that. It makes it clear with types what requirements a function has and you can mix/match these requirements outside of the function e.g. a live/staging/testing or a mock implementation of a service.

quick fjord
#

I get that but how is that different than a generic function?

neat sable
#

I guess it bundles a Supplier/Consumer dispatcher on top but you really only need that for highly dynamic dependencies

vocal timber
#

There is also error handling, concurrency/fibers, resources/scopes, streams, schema, and software transactional memory

neat sable
#

In rust, typically you take your dependencies as arguments

#

So if you need to mock, you just pass a different argument

quick fjord
#

I still dont get it tbh.

That's compile-time dependency injection: the full dependency graph is verified by the type checker, not discovered at runtime.
Like this very much sounds like generic args

#

I don't often use async Rust so I guess I don't really understand the use case. Good luck with the project 👍

vocal timber
#

Thanks! 🙂