3 ms·
If you are looking for real-world code for an effect system, not just a PDF paper, you should probably look at the eff library: https://github.com/hasura/eff ht
by kccqzy 1y ago
If you are looking for real-world code for an effect system, not just a PDF paper, you should probably look at the eff library: https://github.com/hasura/eff https://github.com/hasura/eff
The acknowledgement section on that GitHub README mentions this paper.
- epolanski 1y agoAlso effect-ts in TypeScript world, which is by far the most popular effect system around (quite sure it has overtaken Scala's ZIO from which it is inspired). The ecosystem is massive. Cons: TypeScript is a great type system but requires some investment to get the best out of it, it's also very verbose. Pros: you have access to the entirety of the TypeScript ecosystem. https://effect.website/ https://effect.website/
- tome 1y agoeff has never been released to Hackage and as far as I know never used in production. I wouldn't call it "real-world code". For effect systems that people do actually use in production I suggest * Polysemy: https://hackage.haskell.org/package/polysemy https://hackage.haskell.org/package/polysemy * effectful: https://hackage.haskell.org/package/effectful https://hackage.haskell.org/package/effectful * Bluefin: https://hackage-content.haskell.org/package/bluefin/docs/Bluefin.html https://hackage-content.haskell.org/package/bluefin/docs/Blu... [Disclosure: Bluefin in my effect system]
- solomonb 1y ago`eff` is a research project that is no longer in active development and never made it to production in any sense. It would be AMAZING if `eff` were completed but I dont think that will happen at this point. `eff` is based on delimited continuations (which Alexis had to build into GHC), it is not using `Freer`. If you want to look at an effect system in Haskell that actually has been used in production AND is based on this paper then look at `freer-simple`: https://hackage.haskell.org/package/freer-simple https://hackage.haskell.org/package/freer-simple No it is not high performance, but neither are any other Haskell effect systems and performance is relative to your problem domain. It also has the benefit of being implemented very similarly to Oleg's paper making it a lot easier to learn from then most other options.
- tome 1y ago> No it is not high performance, but neither are any other Haskell effect systems This is not true. IO-wrapper effect systems (in practice, effectful or Bluefin) have as good performance as Haskell's IO monad, that is to say as good as you can get in Haskell.
- solomonb 1y agoYes but from what I understand at a loss of safety. You can decide if that is worth it but you aren't getting a free lunch. that said, your library is really cool. : )
- tome 1y agoNo, no loss of safety. Was there something in particular you were thinking of? With IO-wrapper effect systems you give up native multishot continuations (but you can always get them back by wrapping in LogicT). You can look at my table of "A Comparison of Effect Systems at a Glance" to see all the tradeoffs: https://hackage-content.haskell.org/package/bluefin-0.2.0.0/docs/Bluefin.html#g:12 https://hackage-content.haskell.org/package/bluefin-0.2.0.0/...
- tome 1y ago
- Twey 1y agoAs far as I know the shiniest implementations in the effect typing world at the moment are Koka and Effekt, which are both languages in their own right. They each have their own ideas about implementation to make effects (mostly) zero-cost. https://koka-lang.github.io/ https://koka-lang.github.io/ https://effekt-lang.org/ https://effekt-lang.org/ Frank is pretty old now but perhaps a simpler implementation: https://github.com/frank-lang/frank https://github.com/frank-lang/frank
- thesz 1y agoWhat is language feature in some language is a library in Haskell.
- Twey 1y agoArguably an effect monad is an EDSL that has algebraic effects :) But the things these languages are experimenting with are low-level implementation details that wouldn't be amenable to embedding. There's no escaping the Haskell GC.
- thesz 1y agoAtom [1] is an EDSL that escaped Haskell GC. Note that Atom takes ideas from Bluespec which compiles to hardware circuits, where GC is not availble. [1] https://hackage.haskell.org/package/atom One can make a Haskell EDSL with effects and everything and output a C (or some compiler's IR) code. These languages you mentioned repeat Rust's mistake. Rust's type system includes rules that remove definitions from the scope/environment. This is inherent and obligatory for uniqueness/linear types type systems. At the time Rust was conceived, Haskell had HList library [2] and Beyond Monads [3] extended state monad. Combining both would embed into Haskell most, if not all, Rust at the time, allowing to pursue research of how to combine borrow logic with algebraic effects. But Rust's developers preferred to go OCaml implementation (syntax first) way and not to pursue complexity issues of semantics. [2] https://hackage.haskell.org/package/HList [3] http://blog.sigfpe.com/2009/02/beyond-monads.html