Replies: 1 comment 1 reply
-
Hi! Thanks for your feedback. In short, Pen is an impure functional language but all its runtime values are immutable. So reference transparency doesn't work (i.e. we can't replace random expressions with their equivalent forms.) Also, Pen doesn't adopt any effect system like monads or algebraic effects (at least at the type system level) because part of its purpose is developer productivity for development scalability; we want to make it accessible and easy to learn for both newbie and expert programmers. Instead, Pen experiments with a more lightweight form of effect handling similar to dependency injection, which is popular in the OOP domain with functional programming to achieve the same benefits of such formal effect systems, such as determinism, testability, and so on, but keep the language lean. In Pen, any functions with side effects are always passed down from the To the best of my knowledge, the most similar model of our effect system is Scala's Effekt library where we are expected to pass down "effect objects" from function to function. I will elaborate on those things and put them up somewhere in the readme or documentation. |
Beta Was this translation helpful? Give feedback.
-
The ReadMe says that pen language is immutable, so I interpret it that pen is a pure language that does not allow mutations.
In a pure language like Haskell things related with IO and states are usually handled by multiple layers of monad transformers.
Pen's example program related with IO seems simple (the same ctx is being used). It seems not related with monad syntax. Does it just opens a hole of mutability to the immutable language? Or it involves an effect system?
Beta Was this translation helpful? Give feedback.
All reactions