|
|
|
|
|
by yaantc
4780 days ago
|
|
In both cases I wouldn't say that learning the syntax is the problem. The challenge IMHO lies in the different execution models. And there starting with LISP is likely a good idea, as it's less different than Prolog. It's functional, but still imperative. While in Prolog the switch to declarative programming is more disruptive in my experience (and mind blowing / expanding). The hard thing in Prolog is that for a non trivial program (and not even a big one) it becomes necessary to understand how the underlying engine works on your code rules in order to be efficient. I had a real case where reordering a few statements meant going from ~15mn to find the first solution to a problem to a split second for all 7 ones! What helped me with Prolog is viewing the runtime as an engine searching through a possibilities space for a solution fulfilling the program requirements (constraints). The trick is then to layout the requirements to fail early during the search, so that the engine doesn't waste time exploring doomed parts of the space of possibilities. |
|