4 ms·
Taken to the extreme like you are doing, no language could ever be considered "functional" because in the end, they all need to perform io and ordered execution
by bjourne 12y ago
Taken to the extreme like you are doing, no language could ever be considered "functional" because in the end, they all need to perform io and ordered execution to be of any use. Instead, the commonly understood meaning of the word "functional" is that the language's design emphasizes and encourages use of immutable data and Clojure fits that meaning.
- wcummings 12y ago>Instead, the commonly understood meaning of the word "functional" is that the language's design emphasizes and encourages use of immutable data and Clojure fits that meaning. I would say a language which relies on functional composition as its primary abstraction is "functional." Immutable data is a side effect of that.
- bad_user 12y agoI would say that immutable data is a prerequisite for doing functional composition and languages that don't have immutable data-structures in their standard libraries are not used as FP languages.
- innguest 12y ago"They all need to perform IO" - why does a programming language need to perform IO? Haskell does not have a function that performs IO. For instance, `putStrLn "hello world"` returns an IO action, but it does not print anything to the screen. In order to "perform IO" you have to name an IO action 'main'. Then the compiler understands that you want that action to take place in the Real World. But Haskell does not know about the Real World and so it cannot do IO. This difference is important, otherwise there is a misunderstanding that Haskell is just "minimizing IO". It's not - there's no IO.