> For me, the most beautiful pieces of software are those that reveal something about the nature of programming languages.
There are three moments that make the functional programmer evolve their understanding of how a programming language really works as a symbolic representation of human thought, beyond the metaphor taught in school of a computer program as a grinder that crunches input data and produces results.
The first one is when you really understand recursion and how a function can be defined in terms of itself (with varying parameters for each call).
The second is when you discover Prolog variable unification or Haskell lazy evaluation and how you can represent infinite data structures without having the program hang in an infinite loop.
Third one is when you learn that the behavior of any imperative language (down to the working of the microprocessor data paths) can be fully represented in a pure functional rewrite language (without destructive assignment / cell state changes).
Those insights make one realize that all programming paradigms have the nature of symbols processing in common and there's no "true description" of a program's runtime execution - the imperative, functional and logic views of the running program are all equivalent representations.
> Third one is when you learn that the behavior of any imperative language (down to the working of the microprocessor data paths) can be fully represented in a pure functional rewrite language (without destructive assignment / cell state changes).
What no one is ever able to explain is: why is this a good thing?
The underlying machine does destructive assignment. The whole thing is a big mutable array. Why should we represent it in another way?
> Third one is when you learn that the behavior of any imperative language (down to the working of the microprocessor data paths) can be fully represented in a pure functional rewrite language (without destructive assignment / cell state changes).
Can you either expand on that one or link me to sources that do? I think I follow, but I'd like more info