Stream: beginners

Topic: How's Effects in Roc


view this post on Zulip Locria Cyber (Aug 22 2022 at 13:47):

It's been a long time since I last used Roc. How's effects managed in Roc?

view this post on Zulip Locria Cyber (Aug 22 2022 at 13:51):

I designed my own language, and discovered that effects can be entangled with each other.

<A~B>; <A, B>; <A, A, B> are have different meanings

view this post on Zulip Locria Cyber (Aug 22 2022 at 13:52):

This allows the compiler more freedom to reorder your code. It's unfriendly towards text-based languages though.

view this post on Zulip Brendan Hansknecht (Aug 22 2022 at 14:11):

In this, are you asking about how dependencies between effects are handled?

Just not used to the <A~B>; <A,B> notation?

view this post on Zulip Locria Cyber (Aug 22 2022 at 14:23):

The entire syntax of my language: 1.jpg 2.jpg 3.jpg

view this post on Zulip Locria Cyber (Aug 22 2022 at 14:25):

explanation

view this post on Zulip Locria Cyber (Aug 22 2022 at 14:26):

Brendan Hansknecht said:

In this, are you asking about how dependencies between effects are handled?

Just not used to the <A~B>; <A,B> notation?

Forget about the notation. It's hard to express non-linearity in text.

view this post on Zulip Locria Cyber (Aug 22 2022 at 14:27):

I think I'm the first to propose this. All current literature and programming languages based on lambda calculus is bound by linearity of text.

view this post on Zulip Brendan Hansknecht (Aug 22 2022 at 14:41):

I'll have to read through this more later when I have more time, but i think the common answer is that effects in roc will be explicitly specified in a sequential ordering. That being said, platforms can expose primitives and semantics that enable more complex orderings.

view this post on Zulip Locria Cyber (Aug 22 2022 at 15:24):

I understand "effects" as holes. Like negative space in art.

view this post on Zulip Ayaz Hafiz (Aug 22 2022 at 15:58):

Roc effects are managed in their types, similar to the the monadic construction of effects. dependencies are embedded in the types, which means, as Brendan said, that the runtime can reordered layered effects at-will (i.e. the "multiplication" operation of monadic effects). It sounds like your approach may be more in-line with algebraic effects and effect handlers.


Last updated: Jul 06 2025 at 12:14 UTC