Navigation

Related Articles

Back to Latest Articles
The day I met Erlang

The day I met Erlang


Juanmi Taboada
Juanmi Taboada
The day I met Erlang

It happened some time (years) while I was thinking about the problem of programming languages nowadays. I mean, I was asking questions myself 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, humans, 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 deeper thoughts, I concluded that I am not looking for a programming language that can write itself but a language that can describe itself. At that exact moment, I reminded myself about that knowledge I had already somewhere deep in my memories and almost forgotten. I mainly learned those functional languages at University: Haskell and Prolog. I remember how great it was to write what you wanted from the program; when you execute it, you get exactly that. I enlighten myself. That’s the way!

Imperative languages make you define how you want everything to be executed, while functional languages make you 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 the way to get to it. Of course, some purists will say that the way is also important…yes it is, but not on most of the programs you make (that is a different war I will get on 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 your target being better defined. Sometimes optimization is important, but in my career, I have seen so many programs with an awful design that I am pretty sure most of the programs in 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. They go by the hand with the natural evolution of hardware (to increase the number of cores inside the processor). The more threads the hardware is able to handle in real-time stronger the selected functional programming language.

In a few years, we will get more parallel processors (real manycore processors and not what we have now, which I call fewcore). I am talking about 50-100 cores in one processor. At that moment, functional languages will make 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

Show Comments (0)

Comments

Related Articles

Get your hardware for Arduino Underwater ROV
Underwater ROV

Get your hardware for Arduino Underwater ROV

In my last post, “Finishing the frame for an Underwater ROV”, I gave all details about the design I used to build the frame for Alioli Underwater ROV. In this post, I...

Posted on by Juanmi Taboada
Finishing the frame for an Underwater ROV
Underwater ROV

Finishing the frame for an Underwater ROV

In my last post, “How I designed the frame for my Underwater ROV“, I gave all details about the design I used for the frame for Alioli Underwater ROV. In this post, I...

Posted on by Juanmi Taboada