Re:(Logic) Prolog, Erlang, Elixir a side-by-side reference s...
by pjmlp on Friday May 31, 2024 @02:07AM
(#40531972)
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.
Re:(Logic) Prolog, Erlang, Elixir a side-by-side reference s...
by kazinator on Saturday June 01, 2024 @01:05AM
(#40543032)
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.
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