Hacker News new | ask | show | jobs
by ainar-g 2629 days ago
That's a peculiar opinion. Usually, whenever discussion comes to parsing and codecs, people like to mention how the problem P could be solved with a purely functional language L so much more elegantly. And yes, logic and purely functional languages are not the same, but they seem to be very close relatives.
1 comments

I mentioned to my Haskell teacher in uni that I did 2 years of intensive Prolog for an AI course at another uni and so that I grasp the basics or ‘everything recursion’ (mind you, this is 25 years or so ago). He got angry and said the two have nothing in common and if I believe that I definitely should pay more attention. It was weird as I did not say they are alike; just that they share some concepts which are usually hard to understand for imperative programmers, but, after 2 years of breathing Prolog really are second nature.
Sibling comment is spot on. Your "teacher" was either not well informed or dealing with some issues himself.

To cathartically let go of that experience, I suggest reading up on Curry, the logical language extension to Haskell: https://en.wikipedia.org/wiki/Curry_(programming_language)

Honestly, that speaks more about the teacher's personal issues than it does about the similarities between logic and purely functional programming. I'm sorry that you had to experience that.
Waaaaaat. There's so much in Haskell's type system that is also in logic programming. Like Hindley-Milner type inference and type class instance resolution.