3 ms·
I'm "A disciple of another sect", a Prolog programmer and I'm always a bit nonplussed when LISP adepts praise the simplicity of their preferred language for tak
by YeGoblynQueenne 3y ago
I'm "A disciple of another sect", a Prolog programmer and I'm always a bit nonplussed when LISP adepts praise the simplicity of their preferred language for taking only (checks again) seven primitives to represent every function. That sounds like 6 primitives too many. In Prolog, there is one "primitive", the definite clause, and it is all the syntax of the language.
Quickly-quickly, a logic program is a conjunction of definite clauses, a definite clause is a clause with at most one positive literal, a clause is a disjunction of literals, a literal is an atom or its negation, an atom is a predicate symbol followed by n terms, a term is a constant, a variable, or a function symbol followed by m terms, where n, m are the arities of the atom and the term.
That's all you need to express any computable program. And note well that Prolog is a language created to be usable, and used in practice to write everyday programs such as the web server running the SWI-Prolog documentation website [1]; not some Turing tarpit that only exists to be studied under glass, or put on a pedestal and worshipped for its useless purity. It is not Brainfuck, it is not Haskell, it is, I dare say, the C of the non-imperative languages: simple, pragmatic, usable, to the point.
Now, I understand why LISP adepts praise the abstraction and power of their language: compared to, say, Java, or, from its own time, COBOL, or FORTRAN, LISP is certainly a leap ahead in modernity, in thinking about programming as computation. And, garbage collection, of course. Yes yes yes. But - all the special syntax! Seven primitives! Why is all that necessary?
Imperative languages are so exasperating to use sometimes _because_ they have all that special syntax, purportedly to "make it easy" to fulfill everyday programming tasks. But, may the gods help the unwary prorgammer who strays from the beaten path, as laid out in Stack Overflow. Special-puprose syntax is a straight-jacket, an oxymoron, an attempt to liberate the programmer by tying her hands behind her back. A language like LISP, that prides itself of being a completely different paradigm should not brag for its special purpose syntax, but try to get rid of it. Lest it become Haskell.
___________
[1] https://www.swi-prolog.org/pldoc/doc_for?object=section(%27packages/http.html%27) https://www.swi-prolog.org/pldoc/doc_for?object=section(%27p...