It happened some time (years) while I was thinking about the problem of the nowadays programming languajes. I mean, I was making questions to my self like:

– Is there some program that is able to write an if? (“if” is a very simple construction inside a programming language)

– Or maybe a program that is able to decide that it needs a loop somewhere when you ask about something that is looping?

– Is there some programming language that is able to write itself? We human are not able yet (for those with quick thoughts, cloning is copying, but a simple “write your name…hello <name>” program maybe there are some)

Following my thoughts deeper I got the conclusion that I am not looking for a programming language that is able to write itself, but a programming language that is able to describe itself. In that exactly moment I reminded myself about that knowledge that I had already somewhere deep in my memories and almost forgotten. Those are functional languages that I learned at University: Haskell and Prolog mainly. I remember how great was to write what you want from the program and when you execute it you get exactly that. I enlighten myself, that’s the way!

Imperative languages makes you to define how you want everything to be execute while functional languages makes you to describe your target, the result. This is in my opinion a more natural way of building a program since you focus on the target not on the way to get to it. Of course some purist will say that the way is also important…yes it is, but not on the most of the programs you make (that is a different war I will get in a different day).

While using imperatives languages you can get lost on the way, using functional programming you get nearer to the solution on each step, thanks to the fact that your target is better defined. Sometimes optimization is important, but in all my career I have seen so many programs with an awful design, that I am pretty sure most of the programs on the world focus the most on the target not on the way (thinking about optimization details), so in this point is always better to use a functional programming language since at least you get nearer to the solution.

I am pretty sure this is the natural evolution of programming languages and they go by the hand with the natural evolution of hardware (to grow up the number of cores inside the processor). More threads the hardware is able to handle on real time stronger is the selected functional programming language.

I believe that in few years we will get more parallel processors (real manycore processors and not what we have now, I call fewcore). I am talking about 50-100 cores in one processor, in that moment functional languages will get a lot of sense, I think Object Oriented Programming is living between imperative and functional programming languages.

The day I realized all of this, I met Erlang.

I recommend reading deeper at “Zen and art of functional programming

Comments are closed.