Live data from Hacker News

Why Learn Prolog in 2021?

dstrohmaier.com

11–20 of 171 posts

Re: Why Learn Prolog in 2021?

#11
post #9

This inspired me. What's the best book for modern prolog?

The blog post refers to this: https://www.metalevel.at/prolog

By book, I meant a dead tree version that I can read in bed or in a sofa. I'm not great at taking in large amounts of new information from a website. Sorry if I wasn't specific on that.

Re: Why Learn Prolog in 2021?

#12
post #3

what are some good resources to learn Prolog

Here are some resources:

https://github.com/klaussinani/awesome-prolog#resources

I recall going through the Adventure in Prolog one (free online resource) a while ago and enjoying it, helped direct a lot of exploration into the Prolog language and its capabilities for me. I have Clocksin & Mellish's Programming in Prolog (2003, 5th ed.) and liked it as a good introduction (or more expansion, I had dabbled in it previously and "knew" the language but not the full depth of it). I've read good things about The Art of Prolog by Sterling and Shapiro, but have not read it.

Re: Why Learn Prolog in 2021?

#13

This inspired me. What's the best book for modern prolog?

For starting out I'd recommend Clause and Effect by Clocksin. It's a very short but practical introduction with really good examples along the way (including symbolic differentiation and FFT).

Re: Why Learn Prolog in 2021?

#14
How do you guys think about the opportunity cost of learning dead/dying/new/unpopular languages? Even with newer languages that are gaining popularity and are likely to be used in the future, I struggle to justify the time investment. I could be wrong but some of my concerns are:

- my time is better spent getting deeper into some more popular language that I already know to some extent

- unused skills deteriorate with time so by adding a new language that you don't need professionally right now, you also need to add the future time and effort of practicing and maintaining that skill

- I could be wrong but I feel that it's a red flag to have too many of the more esoteric languages on your resume.

I do enjoy tinkering with a new language but very often it just feels like a distraction.

Thoughts?

Re: Why Learn Prolog in 2021?

#15
post #8

I wonder... is it still justified to learn Prolog now? Aren't there better alternatives for logic programming in many other common programming languages? I mean http://minikanren.org/

How is this a better alternative?

A major attraction of Prolog is that one can remove almost arbitrary parts of any pure program and still infer useful conclusions that hold for the original program. For example, one can remove a clause and thereby make the program more specific. One can remove a goal and thus make the program more general.

This is possible due to the way the language is designed, the interplay of syntax and semantics enables this. The program fragments serve as explanations that can be shown to programmers to pinpoint mistakes in the code. Thus, when narrowing down mistakes, it becomes possible to focus on smaller portions of the code that are therefore easier to understand.

Re: Why Learn Prolog in 2021?

#16

This inspired me. What's the best book for modern prolog?

I liked "The Art of Prolog" for learning. And then if you dive deeper, "The Craft of Prolog". I'm curiously amused that the price for used versions on Amazon is so high.

https://mitpress.mit.edu/books/art-prolog-second-edition

https://isbn.nu/0262192500

https://mitpress.mit.edu/books/craft-prolog

https://isbn.nu/9780262512275

Re: Why Learn Prolog in 2021?

#17
> To be honest, at the moment such problems are too rare to justify learning Prolog. But I don’t believe that this has to remain so.

And then the whole following section on unfulfilled potential.. Is there any reason to believe the paradigm will somehow come into its own in the future? The way this question was addressed by the article was way too wishy-washy for my taste.

Re: Why Learn Prolog in 2021?

#18
post #14

How do you guys think about the opportunity cost of learning dead/dying/new/unpopular languages? Even with newer languages that are gaining popularity and are likely to be used in the future, I struggle to justify the time investment. I could be wrong but some of my concerns are: - my time is better spent getting deeper into some more popular language that I already know to some extent - unused skills deteriorate wit…

Learning another language with basically the exact same mental model behind them is not as worthy to spend time on. But learning a language with an entirely different paradigm is really eye opener and will make you a better programmer even if you’ll never write a line of code in it. For example, learning Haskell is a really good way to learn about FP and then you can easily apply it in a not strictly FP language.

Prolog is interesting because it is really niche, and “learning it” as in solving a few easy problems will definitely not take much time but will add another way to think about a problem to your toolkit.

Re: Why Learn Prolog in 2021?

#19
post #14

How do you guys think about the opportunity cost of learning dead/dying/new/unpopular languages? Even with newer languages that are gaining popularity and are likely to be used in the future, I struggle to justify the time investment. I could be wrong but some of my concerns are: - my time is better spent getting deeper into some more popular language that I already know to some extent - unused skills deteriorate wit…

Prolog isn't dead, it's just resting. Actually, people find practical uses for it still though it tends to be domain specific.

Look at the alternatives. If there's a practical alternative to the language/material that has reasonably widespread use and can be counted on to be present in 5-20 years, go for the alternative. If you have a need for something that's been put through its paces for 40 years and is battle tested with well-supported compilers, consider the "dead language".

And you can always leave languages off your resume.

Re: Why Learn Prolog in 2021?

#20
post #14

How do you guys think about the opportunity cost of learning dead/dying/new/unpopular languages? Even with newer languages that are gaining popularity and are likely to be used in the future, I struggle to justify the time investment. I could be wrong but some of my concerns are: - my time is better spent getting deeper into some more popular language that I already know to some extent - unused skills deteriorate wit…

I'm curious about this as well, though in a more general sense than just PLs.

There are already so many modern/useful things I want to learn that it's hard to justify learning something because it's 'beautiful' or purely intellectually stimulating.

Post reply on HN