Prolog vs Erlang (and other functional languages)

What happened to Prolog?

Prolog is good for lists and pattern mappings and offers refunds as a bonus. Yet for decades, it has remained a separate language, and functional languages ​​flourish and multiply.

Take Erlang as an example. Its syntax is borrowed from Prolog, it was originally implemented using Prolog, which is really interesting. That is, from the point of view of Erlang people, there is something fundamentally wrong with Prolog, or they adapted Prolog to their needs.

+6
source share
2 answers

In my opinion, Prolog is now starting to become interesting, and the jury on this issue is still not working.

Yes, Prolog has a much longer tradition than Erlang. And it is also a much more complex language in terms of implementation! It is also much more difficult to learn, exacerbating, for example, the fact that tasks that would already be unsolvable for beginners in all other languages ​​are traditionally given as the first few examples for Prologue beginners.

Obtaining tracing back, garbage collection, aliases, attributes, restrictions, exception handling and much more that Prolog gives you the right and efficiency , while adhering to their often rather subtle interdependence is something that, for obvious reasons, is impossible for several decades, even if some of the most talented and educated programmers are involved. Many of the Prolog systems currently available now reach a point where you can seriously use them in production environments.

It is relatively simple to make the progrom version of Prolog efficient and correct. Not so for the real thing.

For comparison, take any serious program and see how long its implementation has passed. The most interesting programs are still in serious development even decades after their initial release. The same with Prolog, and the full-fledged Prolog system certainly gives you much more than many other language implementations.

And we really want to! So yes, there is something wrong with Prolog: it is difficult to implement correctly. But with Prolog, there is a lot that is connected with the many functions mentioned above: Once it is fully implemented, Prolog is an amazing and unsurpassed development environment for all kinds of tasks: from a theorem proving web hosting, a solution to the combinatorial optimization problem, test case generation and many other applications that are currently emerging.

For example, Erlang process processes are only now being developed for Prolog. See, for example, Torbjörn Lager Pengines .

Why is it only now (i.e. the last 2 years or so) becoming available in Prolog? Quite simple: many Prolog systems (in this case: SWI-Prolog) did not quite meet the standard for reliable launch of 24x7 web servers until recently. And why so? Again, because it’s hard to get this right for Prolog because of the subtle interdependence of its many advanced features. Gradually, we finally get there.

Prologue for victory!

+13
source

A language must be able to sort real problems better than other languages ​​in order to become mainstream. Speaking of Erlang, it will be nothing more than other functional languages, if not its ability to program in real time with proactive multitasking, capable of handling millions of parallel tasks. This plus its ability to work in a virtual machine makes a really powerful combination. In this sense, these additions made Erlang unique. In fact, it is the only actor-oriented programming language widely used in the industry.

See how many different C / C ++ dialects have been created, and yet C / C ++ is in the main thread. These new dialects simply did not give any advantage over what was already (or not big enough).

I am sure that Prolog has its own niche, but it does not provide much over what other languages ​​can provide, and the list of problems on Wikipedia also offers some considerations related to considerations.

+3
source

All Articles