Re:A Conversation with Language Creators: Guido, James, Ande...
by AnimalMuppet on Thursday April 04, 2019 @01:25PM
(#19574843)
All right, but...
When I actually get output that says "hello", that isn't pure, is it? And there is some way for me to actually produce that output, isn't there? It may not be "evaluating putStrLn", but it's something.
And if that's all true, then rujuladanh is essentially correct: You're being pedantic in a way that misses the main point.
Re:A Conversation with Language Creators: Guido, James, Ande...
by sbergot on Thursday April 04, 2019 @12:16PM
(#19574050)
He has a point though. You can imagine that all c code lives implicitly in an io monad and define evaluation the same way Haskell does. Then c becomes pure by your own criteria.
If you say that c is impure you have to admit that any program with the io monad also is. That is, any working Haskell program, even if Haskell allows you to write part of this program out of the io monad.
When you call a C function, you cannot know whether equational reasoning holds, whereas you can be sure when you're using a pure language. Therefore, when you're working on a project that is 100% in say Idris, you are in fact making a totally pure program. You could make an Idris compiler that inserts random perturbations in various functions, or you could look at crashes etc., but that is not where the concept of purity applies, it's a category error to think it does.