Comments by "" (@jboss1073) on "ThePrimeTime"
channel.
-
95
-
61
-
38
-
25
-
25
-
19
-
17
-
12
-
10
-
10
-
9
-
9
-
8
-
7
-
7
-
7
-
7
-
@sk-sm9sh One thing at a time. You said:
"so what I think about "algebraic type system" is type system that allows expressions such as
X = Y | Z
In this regard C lang type system is not "algebraic" as in that it doesn't allow to do any any kind of operations on top of type system."
This is all correct. However, this is also the same thing that I said. Now, hold on. I know you're talking about type algebra and I was talking about code algebra. But they are actually the same. This was proven in 1935 when Gentzen and Church's work were shown to complement each other - one though code, the other through the types.
Now on to the second thing. You are conflating the notion of "algebraic types" with the notion of "turing-complete types".
A turing-complete type-system does not necessarily result in an algebraic type system - Zig and Rust are not algebraic, although typescript is (I believe, from last time I checked; I'm not a js coder). For example, Zig's type system is not algebraic just because it is turing-complete, although being turing-complete makes it capable of being algebraic; however once made algebraic, that portion of the code will be "narrower" and "stricter" than the rest of Zig's type system. Hence algebraization is a formalization, an assurance that all the terms work together compatibly, and can be computed by reduction.
Then you said:
"So I get it that it may make some sense to describe your typesystem as algebraic. But I fail to see how it makes sense to describe a feature in your language as "algebraic effect". If your effects are compatible with your language's typesystem and if your typesystem is algebraic then by deduction I already know that it's "algebraic". "
But this is wrong: Monads are NOT algebraic (they famously cannot be composed, needing a monad transformer to do so, which is essentially writing the glue code manually - the opposite of algebraic composition), hence not every effect system is algebraic.
That's the wonderful thing about algebraic effects: they're finally algebraic, which means no more monad stacks, monad transformers, or even monads for that matter - they all have become obsolete because Algebraic Effects (well, handlers and prompts, technically the things behind Algebraic Effects) were proven to be the composable mathematical dual of a Monad - meaning they're just as powerful as Monads, but they're actually composable - algebraic - on top of that.
Finally we have an algebraic way to deal with effects. If we had ever had that before, Monads would never have been invented.
Hence the tremendous importance in naming it "algebraic effects" so as to communicate that the solution to this enormous problem of modeling side effects algebraically - composably - has finally been found.
7
-
7
-
6
-
6
-
6
-
5
-
5
-
5
-
5
-
5
-
5
-
5
-
5
-
4
-
4
-
4
-
4
-
4
-
4
-
3
-
3
-
3
-
3
-
3
-
3
-
3
-
3
-
3
-
2
-
2
-
2
-
2
-
2