frank
eff
frank | eff | |
---|---|---|
6 | 18 | |
268 | 546 | |
5.6% | 0.4% | |
0.0 | 0.0 | |
28 days ago | about 1 year ago | |
Haskell | Haskell | |
GNU General Public License v3.0 only | ISC License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
frank
-
Do Be Do Be Do (2017) [pdf]
For the curious, "do be do be do" is a seminal paper in the literature on algebraic effects that introduces _frank_, quirky little language that has algebraic effects but not handlers, at least in the traditional sense.
Traditionally, an effect handler is an interpreter for a stream of commands, conforming to a specific interface. Generally, handlers surface in languages as a sort of generalized try/catch mechanism, that receive a "callback" to resume the "exception" that produced the command. In frank, not so.
Frank is based around the idea of _operators_, which generalize functions with the capability of interpreting multiple streams of commands. A plain function can be seen, in fact, as the special case of an operator that interprets no commands.
Operators are organized around ports and pegs. Pegs are the set of side effects that a computation needs. Each port is an offer to extend that set for downstream callers. Instead of building up a union of effects that each function needs, Frank propogated ambient ability inwards. Operators can then be composed based on the ports and pegs they offer.
operator: X → [peg]Y
This works partially because operators are shallow handlers and not deep handlers. Handlers interpret commands: if the handler itself is in scope when interpreting a command, then the language is said to have deep handlers. Frank has shallow handlers, meaning that commands are interpreted in an environment without the handling operator present. Shallow handlers give greater control to the programmer with respect to how commands are interpreted.
(This is a bad explanation because you already need to know what I'm talking about to understand what I'm talking about, but oh well.)
My one critism of frank is that the effect model is kinda hard for the working programmer to understand. I can explain Koka effects as "exceptions plus multiple resumption". I don't really have a categorical phrase for frank, and that's its innovation. This isn't so much a criticism but a plea for the pedagogical ramp to this research to improve.
do be do be do.
If you're still curious, check out the compiler github repo:
https://github.com/frank-lang/frank
And if anything is wrong in the above explanation, please correct me, because we all benefit from Cunningham's Law in the end. Allow me to be the fool.
- Efficient Compilation of Algebraic Effect Handlers - Ningning Xie
-
Effekt, a research language with effect handlers and lightweight polymorphism
How does this compare to other effect-oriented languages like Koka, Frank, and Eff?
I've been doing some work with Koka lately, but I briefly looked into the other three (including Effekt) and it mostly came down to, 'Koka seems most active in development'[1] and 'Koka had the easiest to use documentation for me'[2].
[1] E.g. https://github.com/effekt-lang/effekt had its last commit back in June; https://github.com/frank-lang/frank last commit last year; but https://github.com/koka-lang/koka last update was Oct 15. Effekt seems semi-active, at least, compared to Frank. While stability is good, I wouldn't expect it in a language actively being used for research.
[2] Comparing https://koka-lang.github.io/koka/doc/book.html and https://effekt-lang.org/docs/ and https://www.eff-lang.org/learn/
- The Problem of Effects (2020)
- Extensible Effects in the van Laarhoven Free Monad
-
What are some cool/wierd features of a programming language you know?
Frank's effect handling. "A strict functional programming language with a bidirectional effect type system designed from the ground up around a novel variant of Plotkin and Pretnar's effect handler abstraction. ... Frank [is different from other PLs with effect type systems in that it is based on] generalising the basic mechanism of functional abstraction itself. A function is simply the special case of a Frank operator that interprets no commands. Moreover, Frank's operators can be multihandlers which simultaneously interpret commands from several sources at once, without disturbing the direct style of functional programming with values. Effect typing in Frank employs a novel form of effect polymorphism which avoid mentioning effect variables in source code. This is achieved by propagating an ambient ability inwards, rather than accumulating unions of potential effects outwards."
eff
-
Haskellers who moved to Rust: What has been your experience?
You can swap-out implementations for testing, avoid the crazy N^2 instances issues, etc. They're pretty cool. Currently there are many competing libraries. polysemy and eff both have good examples on their homepages.
-
What are the current hot topics in type theory and static analysis?
Effect systems and Algebraic effects. ocaml has just released a stripped-down effect system. People are also working on Effect systems for Haskell (eff, fused-effects, effet). Koka is a language built with effects first and foremost and it’s rapidly gaining popularity. Unison also has effects.
-
[ANNOUNCE] GHC 9.6.1 is now available
There are also a few subtle issues that arise with delconts related to semantics of higher order effects (see here and here), but they might be solvable.
-
Effectful | Paweł Szulc | Lambda Days 2022
Details are in https://github.com/hasura/eff/issues/12 and https://www.reddit.com/r/haskell/comments/pywuqg/unresolved_challenges_of_scoped_effects_and_what/.
-
Looking for languages that combine algebraic effects with parallel execution
You'll get fearless parallel with STM in the mixture, and GHC is getting a work in progress effect system for Haskell, as Delimited continuation primops has been merged.
-
Should I pick up OCaml or Haskell?
My last example is algebraic effects, some of which have been made possible in a both practical and efficient way thanks to extremely recent research, and that I can use to implement architectures like Ports and Adapters or Clean Architecture and have very maintainable code. (Extensible Effects — An Alternative to Monad Transformers was published in 2013, Effect Handlers in Scope was published in 2014 and they are behind Polysemy, while there is ongoing work on effects with even better performance, like Eff)
-
[ANN] cleff - fast and consise extensible effects
cleff's Eff monad is esentially implemented as a ReaderT IO. [...] This is first done by eff, [...]
-
Opinions on Reader + Continuation-based IO?
Here is link number 1 - Previous text "eff"
-
Where's more discussion of the designs of effect systems?
Languages such as Koka only support algebraic effects, not scoping operations such as catch and listen. The Effect Handlers in Scope paper introduces scoping operations, which lead to the Haskell libraries fused-effects and polysemy, but they turned out to have some weird semantics. eff is her effort to fix that.
-
Languages that don't support Error-Catching as a Control Structure?
There are a few languages that have algebraic effect systems, most notably Haskell, but these systems are implemented as libraries, not baked into the language (which can have advantages and disadvantages).
What are some alternatives?
koka - Koka language compiler and interpreter
freer-simple - A friendly effect system for Haskell
jellylanguage - Jelly is a recreational programming language inspired by J.
fused-effects - A fast, flexible, fused effect system for Haskell
granule - A statically-typed linear functional language with graded modal types for fine-grained program reasoning
frp-zoo - Comparing many FRP implementations by reimplementing the same toy app in each.
effekt - A research language with effect handlers and lightweight effect polymorphism
in-other-words - A higher-order effect system where the sky's the limit
gerty - A small implementation of graded modal dependent type theory. A younger cousin to Granule.
polysemy - :gemini: higher-order, no-boilerplate monads
ponyc - Pony is an open-source, actor-model, capabilities-secure, high performance programming language
extensible-effects - Extensible Effects: An Alternative to Monad Transformers