3 ms·
And Frege was based on Haskell which takes the exact opposite approach: everything is pure/immutable by default, and extra effort is required to write impure c
by greydius 11y ago
And Frege was based on Haskell which takes the exact opposite approach: everything is pure/immutable by default, and extra effort is required to write impure code and mutable data. What if we had a plugin that worked this way? It would assume everything should be pure/immutable and require explicit annotations (@Impure, @Mutable) otherwise. There are a lot of complications, but it's food for thought.
- bobm_kite9 11y agoA couple of people have suggested this idea - pure by default, as opposed to impure by default. In Frege, as you point out, anything written in Haskell is pure by default. However, if you want to call methods from libraries or the JVM which are written in Java, then you have to tell Frege their level of purity. So effectively, your Haskell code is the "island of purity" inside the wider sea of impure Java runtime. But yes, I think this is a workable idea - so long as there was some way of identifying 3rd-party code purity instead of the annotation.