Purity in D
klickverbot.at
Purity in D
1–9 of 9 posts
Re: Purity in D
#2Re: Purity in D
#3I am the author of the linked article – feedback and comments of any kind are very welcome!
Re: Purity in D
#4I am the author of the linked article – feedback and comments of any kind are very welcome!
There is an issue with quotes — they appear to be swapped (tiny screenshot here: http://ompldr.org/vZHl4Mw ). I made a little check, it's the same with every font you specified in your CSS, so the problem must lie within your blog generator or something.
Re: Purity in D
#5Re: Purity in D
#6I was disappointed by the '›Weak‹ Purity Allows for Stronger Guarantees' section. I expected an explanation of why weak purity might give stronger guarantees, but what I got was a set of reasons why weak purity is more practical for a compiler that can't handle FP optimizations. Where's the stronger guarantees?
The point is that it enables some function to be pure in the traditional sense even if their implementation relies on mutating data – any idea how I could make this more clear?
Re: Purity in D
#7Earlier quoted context omitted.
There is an issue with quotes — they appear to be swapped (tiny screenshot here: http://ompldr.org/vZHl4Mw ). I made a little check, it's the same with every font you specified in your CSS, so the problem must lie within your blog generator or something.
In German, guillemets are actually only used like that – contrary to, for example, French. I got in the habit of using them almost exclusively, and usually enter them explicitly (most non-Windows keyboard layouts have them in a convenient location). If this is confusing to non-German readers, though, I suppose I should reconsider their use.
Re: Purity in D
#8I was disappointed by the '›Weak‹ Purity Allows for Stronger Guarantees' section. I expected an explanation of why weak purity might give stronger guarantees, but what I got was a set of reasons why weak purity is more practical for a compiler that can't handle FP optimizations. Where's the stronger guarantees?
I don't know how to explain that without analogies to Haskell (which, I presume, author deliberately avoids), though.
Re: Purity in D
#9I was disappointed by the '›Weak‹ Purity Allows for Stronger Guarantees' section. I expected an explanation of why weak purity might give stronger guarantees, but what I got was a set of reasons why weak purity is more practical for a compiler that can't handle FP optimizations. Where's the stronger guarantees?
When I read that section, it occurred to me that "weak purity" is like monads and "strong purity" is purity as we know it in the FP world. Then drawTriangle() become an action in some monad (I imagined a State one) and renderScene() is just a pure function using some monadic computations (doing something like evalState (drawTriangle ...)). I don't know how to explain that without analogies to Haskell (which, I presum…