by katovatzschyn · 15y ago · 0 comments
Trying to write pure functions in a standard language is completely the wrong approach. You might as well say, tie one hand behind your back and try to write with the other hand.
Many functional languages don't require pure functions.
Many functional languages have garbage collectors, and they are fundamental for writing pure functional data structures. (It's almost impossible to properly emulate this in, say C, especially if your structures have cycles)
Many functional languages have other great features like type inference, macros, data patterns and more. Just using an existing language won't give you any taste for these.
Yes. Though I would suggest a newcomer to pick a language that requires purity, in order to make the transition cleaner.
One of the most notable one is:
http://www.cs.utexas.edu/~shmat/courses/cs345/whyfp.pdf
Benefits include: Easier reasoning about code correctness. More powerful abstractions leading to clearer and more succint code. Easier mechanical refactoring of code. Easier parallelism. More powerful compiler optimizations.
Apart from any benefit from actually using any language or tool, there's also the joy of learning.