Comment by tannhaeuser

1 year ago

Prolog is a (the) language based on the logic programming paradigm that also has a procedural interpretation. It's particularly useful for any kind of combinatorical exploration. Quantum Prolog is touting Prolog for "Planning, optimization, diagnostics, and complex configuration" [1] with an extensive example problem for discrete sea freight container shipping optimization (and also for a particular form of Machine Learning).

Prolog was originally invented for parsing natural language (in 1972-ish rule-/logic basic formalisms not LLM or anything fancy), and thus has convenient built-in recursive-decent parsing with backtracking built-in into the language semantics, but also has bottom-up parsing facilities for defining operator precedence parsers. That's why it's very convenient for building DSLs, logical domain knowledge bases, and programming language prototypes such as for Erlang.

[1]: https://quantumprolog.sgml.io

Back on my university days, we used to have a professor that wouldn't allow Prolog or Lisp for the compiler development projects, as the implementation language, because it would be super easy.

  • It would only be super easy due to the requirements being easily enough that the exercises are doable by students using blub languages.

    You could easily require Lisp and Prolog, and have the coursework be brutal.

    I don't know. I mean, if the difficulty in the course stems from wrestling with code that would be easy to do in Lisp, what are you really learning?

    The compiler course I took at university used C and Yacc. In retrospect, the programming work was more of a software-engineering-in-C exercise, with a side attraction related to compiling.

    Since a quarter century plus later finds me coding embedded firmware in C, it was valuable from a vocational point of view.