Exotic Programming Ideas, Part 3: Effect Systems
I highly recommend Oleg Kiselyov&#x27;s talk titled &quot;Having an Effect&quot;[0] in which he talks about<p>- purely functional model of computation and its pitfalls<p>- Actor model, effectful programming with requests and responses and an implementation in Haskell.<p>- denotational semantics and combining effects. Once you have a model of your language, what if you want to extend it by adding another effect?  It forces you to rewrite the semantics (and thus any interpreter of your language) completely.  Taking using the effects-as-requests viewpoint, only the request and handler for an effect needs to be added or changed, and the rest untouched.  This is known as &quot;stable denotations&quot;.<p>- really evaluating what it means for an expression to be pure or effectful. Even variable reference should be considered an effect.<p>- different scoping rules in lambda calculus can be expressed in terms of effects! Creating a dynamic closure is not effectful, though applying it usually is, OTOH, creating a lexical closure is effectful but using it is not.<p>I think Haskell provides a good example of how a purely functional language can still express effectful computation. through a monadic interface. Though monad transformers have their share of problems when heavily nested (n^2 instances, performance), various effect system libraries are gaining traction.[2]  On the bleeding edge of research there&#x27;s languages like Frank[1] where the effect system is pervasive throughout the language.<p>[0] <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=GhERMBT7u4w" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=GhERMBT7u4w</a><p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;frank-lang&#x2F;frank" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;frank-lang&#x2F;frank</a><p>[2] Implementing free monads from scratch, <a href="https:&#x2F;&#x2F;siraben.github.io&#x2F;2020&#x2F;02&#x2F;20&#x2F;free-monads.html" rel="nofollow">https:&#x2F;&#x2F;siraben.github.io&#x2F;2020&#x2F;02&#x2F;20&#x2F;free-monads.html</a>