EYG - a functional language with managed effect and sound type inference, embeddable in Erlang

EYG is a functional language with managed effect and sound type inference. The main interest in it’s type system is that it type checks against the set of effects available to it and performing effects is the only method of reaching the host runtime and outside world.

This guide explains how to use EYG in an Erlang program exposing basic utilities through the effects system:

5 Likes

The idea that effects gate access to the host runtime is the part I find most interesting, since it makes the boundary explicit rather than implicit. I’m curious how the soundness claim holds up once Erlang’s own processes and message passing enter the picture — do those count as effects the type system has to track, or does the embedding treat them as part of the surrounding environment? The step-by-step guide sounds like a good way to see whether the ergonomics hold up in practice.

Both processes and message passing are something that are part of the surrounding environment. So an environment would have to choose how to present them to the program. There could be a tight alignment with the underlying platform and expose effects like Spawn etc or a higher level of abstraction could be exposed. i.e. something like raft could be built in the BEAM layer and effects could expose the leader and event stream