cut.
[flagged]
Ask HN: What's Prolog like in 2024?
271–280 of 289 posts
Re: Ask HN: What's Prolog like in 2024?
#272Earlier quoted context omitted.
So SWI appears to be more performant, it has an open license, so as per the GGP's claim regarding Scryer in the post above, it must not be ISO-compliant?
A key performance attraction of Scryer Prolog is its space efficiency for representing lists of characters, yielding a 24 times (!) more compact representation than a naive implementation would. With Scryer Prolog and other recent systems that implement this representation, such as Trealla Prolog, we can easily process many GBs of text with DCGs, arguably realizing the full potential of the originally intended use ca…
Re: Ask HN: What's Prolog like in 2024?
#273Earlier quoted context omitted.
So SWI appears to be more performant, it has an open license, so as per the GGP's claim regarding Scryer in the post above, it must not be ISO-compliant?
A key performance attraction of Scryer Prolog is its space efficiency for representing lists of characters, yielding a 24 times (!) more compact representation than a naive implementation would. With Scryer Prolog and other recent systems that implement this representation, such as Trealla Prolog, we can easily process many GBs of text with DCGs, arguably realizing the full potential of the originally intended use ca…
In the SWI-Prolog discourse thread linked above this is pointed out to Jan Wielemaker who clarifies it was a mistake. He then repeats the benchmark comparing a newer version of Scryer to SWI and finds that Scryer has improved significantly:
Updated Scryer Prolog to 0.9.3. They made serious progress. Congrats! The queens_clpfd.pl and the sieve.pl benchmarks have been added. The ISO predicates number/1 and retractall/1 have been added. I had to made more changes to to get the code loaded. Creating a module with the programs and some support predicates somehow did not work anymore (predicates became invisible). Loading a file programs.pl from directory holding a subdirectory programs silently loaded nothing until I added the .pl suffix. The sieve bar is cut at 20, but the actual value is 359.
https://swi-prolog.discourse.group/t/porting-the-swi-prolog-...
Re: Ask HN: What's Prolog like in 2024?
#274Earlier quoted context omitted.
See https://news.ycombinator.com/item?id=41013798
I saw, as I saw your upthread quote from the paper above but I think you misunderstand it. The previous paragraph gives context to your quote: The main conclusion [5] was that declarative language programs for POTS were a lot shorter and easier to understand than imperative language programs. Un- fortunately the declarative languages lacked features for concurrency control and had poor error handling facilities. We c…
I had explicitly stated above that "he conceived Erlang as Prolog-Ideas+Functional/Procedural+Concurrency+Fault-Tolerance." Here i am not making an equivalence between Prolog and Erlang but emphasizing the inspiration that Prolog provided for the design of Erlang (that is what is to be understood from all the links to the papers and comparison charts given in earlier comments). That inspiration is in the syntax of pattern matching, Atoms/Variables, Module/Export directives etc. Similarity of Syntax is very important for learning/understanding new languages since your cognitive load is decreased dramatically. A good example is C++ to Java/C# where the similarity in syntax (though the runtime object model is very different) is what was crucial to the widespread adoption of the latter. It is in this sense that Prolog to Erlang comparisons should be understood.
Your arguments of grouping/comparing widely dissimilar languages are somewhat disingenuous. A much better side-by-side comparison of languages is https://hyperpolyglot.org/ where the author has tried to group by intended functionality and historical development. I think this is a good way to do it.
Re: Ask HN: What's Prolog like in 2024?
#275Earlier quoted context omitted.
I saw, as I saw your upthread quote from the paper above but I think you misunderstand it. The previous paragraph gives context to your quote: The main conclusion [5] was that declarative language programs for POTS were a lot shorter and easier to understand than imperative language programs. Un- fortunately the declarative languages lacked features for concurrency control and had poor error handling facilities. We c…
First, my other comments for reference; https://news.ycombinator.com/item?id=41013798 and https://news.ycombinator.com/item?id=41015406 I had explicitly stated above that "he conceived Erlang as Prolog-Ideas+Functional/Procedural+Concurrency+Fault-Tolerance." Here i am not making an equivalence between Prolog and Erlang but emphasizing the inspiration that Prolog provided for the design of Erlang (that is what is to…
Re: Ask HN: What's Prolog like in 2024?
#276Earlier quoted context omitted.
Thanks, I know that history, and nobody is denying the influence. The broader context are your claims about "a lot of commonalities here". There are commonalities, but they are shallow.
That we have to disagree. Leaving aside the non-Prolog features, much of the Erlang syntax is definitely inspired by Prolog (mentioned in many papers including https://www.erlang.org/faq/academic ). That was the reason the HN submission i had referenced which linked to a reference sheet comparing Prolog/Erlang/Elixir was so interesting (direct link https://hyperpolyglot.org/logic ). In most cases the Erlang syntax is…
Re: Ask HN: What's Prolog like in 2024?
#277Earlier quoted context omitted.
I saw, as I saw your upthread quote from the paper above but I think you misunderstand it. The previous paragraph gives context to your quote: The main conclusion [5] was that declarative language programs for POTS were a lot shorter and easier to understand than imperative language programs. Un- fortunately the declarative languages lacked features for concurrency control and had poor error handling facilities. We c…
First, my other comments for reference; https://news.ycombinator.com/item?id=41013798 and https://news.ycombinator.com/item?id=41015406 I had explicitly stated above that "he conceived Erlang as Prolog-Ideas+Functional/Procedural+Concurrency+Fault-Tolerance." Here i am not making an equivalence between Prolog and Erlang but emphasizing the inspiration that Prolog provided for the design of Erlang (that is what is to…
What I'm saying is that this is the entirely wrong thing to focus on, i.e. syntactic similarities. Prolog is a language of the logic programming paradigm, one of the first ones. Its syntax is that of (a restriction of) the first order predicate calculus. Its programs are First Order Logic theorems. Its interpreter is an automated theorem prover. The motivation for Prolog is the ability to program a computer using the syntax and semantics of First Order Logic, to be able to prove the truth values of statements in a formal language automatically, with a computer. It has nothing to do with Erlang, a functional programming language designed to program telephony switches. Any similarity is superficial: Erlang expressions are not definite clauses; everything in a Prolog program is a definite clause, modulo punctuation. Knowing Erlang will not help you learn Prolog just because the syntax looks similar. You can forget about that right now- that's the misconception I'm trying to correct. Don't encourage people to try to understand Prolog that way because you will only cause them pain.
Take the site you link to as an example. It tries to bodge together Prolog with Erlang and Elixir in a "side-by-side reference sheet" that includes rows for "assignment" and "parallel assignment" using =/2. That's the unification predicate! Prolog does not have assignment! Just imagine the suffering of a novice programmer trying to use their knowledge of assignment, in Erlang or any language, to understand the following:
?- X = a, X = b.
false.
That's just setting up programming students to fail, to fail to understand, to fail to learn- and to only succeed in blaming Prolog for being a stupid, painful language that is hard to learn. Of course it's hard to learn! If you go around telling people that they can learn it more easily if they know Erlang!>> Your arguments of grouping/comparing widely dissimilar languages are somewhat disingenuous.
No, the point is that they are widely dissimilar and that you won't understand that if you just stop at the syntax. Like the site you link to, where someone clearly made an effort to memorise syntax but completely failed to understand semantics.
Semantics shmantics! The attitude I see here is the one that Peter Norvig criticises in "Teach yourself programming in 10 years": try to find a shortcut around the hard stuff so you don't have to use the brain. You don't learn anything that way.
Re: Ask HN: What's Prolog like in 2024?
#278Earlier quoted context omitted.
First, my other comments for reference; https://news.ycombinator.com/item?id=41013798 and https://news.ycombinator.com/item?id=41015406 I had explicitly stated above that "he conceived Erlang as Prolog-Ideas+Functional/Procedural+Concurrency+Fault-Tolerance." Here i am not making an equivalence between Prolog and Erlang but emphasizing the inspiration that Prolog provided for the design of Erlang (that is what is to…
>> It is in this sense that Prolog to Erlang comparisons should be understood. What I'm saying is that this is the entirely wrong thing to focus on, i.e. syntactic similarities. Prolog is a language of the logic programming paradigm, one of the first ones. Its syntax is that of (a restriction of) the first order predicate calculus. Its programs are First Order Logic theorems. Its interpreter is an automated theorem p…