Earlier quoted context omitted.
yeah, most times its solved by side-stepping the strict type system and making an exception for debug prints. but this is not a real practical solution, this is a stupid workaround born from overinsistence on "beautiful" design choices.
It seems to me like a pragmatic compromise and very much a real solution. What would you consider a real solution that isn’t overinsisting on beautiful design choices?
Algebraic Effects in Practice with Flix
11–20 of 55 posts
Re: Algebraic Effects in Practice with Flix
#12The algebraic effect handler pattern is a much simpler mental model than monads. And is transferrable to other languages pretty easily. See something like https://github.com/doeixd/effectively in Typescript
2. There is a much more popular and robust implementation of effects for Typescript: https://effect.website/
Re: Algebraic Effects in Practice with Flix
#13 "Error: "
Turns out its actually: "Error: ${msg}"Re: Algebraic Effects in Practice with Flix
#14> Solving the “what color is your function” problem. Eh. I currently use monads for my effects, and am open to the idea of language-based effects. But this isn't a solution to the colour problem - it is the colour problem. The compiler stops you accidentally calling red from blue. If you want to do it deliberately, you change the caller from blue to red.
Re: Algebraic Effects in Practice with Flix
#15I really want effects to shine and thrive, but since this is a very academic topic, only academic people engage with the research and it comes with academic pedantism, perfectionist worldview, strange attraction to beautiful consistency, etc. This automatically places effect research FAR from any practicality and grounded realism. 2 points, as examples: 1. Ever tried adding a simple print statement for debugging purp…
2. It's implementation dependent, but of course you lose tracing, etc if you want to just log with language primitives, which is why you shouldn't when every effect system offers you tools to do so. If you want a system where each side effect is traced, monitored and encoded as a recipe, then you use the effectful version.
Re: Algebraic Effects in Practice with Flix
#16Earlier quoted context omitted.
It seems to me like a pragmatic compromise and very much a real solution. What would you consider a real solution that isn’t overinsisting on beautiful design choices?
putting strong static type system into optional compiler pass. yes, I know this may be null is some cases, let me run my program for now, I know what I am doing. yes, there are unhandled effects or wrong signature, just let me run my test. yes, that type is too generic, i will fix it later, let me run my god damn program.
Re: Algebraic Effects in Practice with Flix
#17The algebraic effect handler pattern is a much simpler mental model than monads. And is transferrable to other languages pretty easily. See something like https://github.com/doeixd/effectively in Typescript
When Option was retrofitted onto Java, the NPEs didn't disappear. We got Options that could be null, but more importantly, devs (and the standard library) continued to use null liberally. We never ended up at the tautological goal of "if I have a Person, then I have a Person".
I am equally skeptical of bolting on effect systems after the fact. Even if one of these effect systems becomes 'the main one' and starts showing up in standard libraries, we'll still end up with declared-effectful code and undeclared-effectful code, but will again fall short of the goal, declared-effectful code.
Re: Algebraic Effects in Practice with Flix
#18"The only one that I know of besides Flix is Unison." huh? Koka, Effekt
Other pages also contain some more advanced details and casestudies on effect handling
Re: Algebraic Effects in Practice with Flix
#19 interface MovieApi {
List getPopularMovies();
}
What are effects providing over this?Re: Algebraic Effects in Practice with Flix
#20Maybe I’m not getting it, but isn’t this just interfaces and implementations from the OO world? For example their movie one is: interface MovieApi { List getPopularMovies(); } What are effects providing over this?
I’m guessing some languages would allow for checking to ensure that any induced effects are correctly noted and advertised so that the system as a whole can be more easily reasoned about.