Why in 2020 should I learn Prolog?
swi-prolog.discourse.group
swi-prolog.discourse.group
>> Learning any language in enough depth will take time away from learning something else. So you need to figure out your priorities first.
> I doubt that will hold. In my understanding (but I might be wrong) this has been disproved for natural languages, i.e., (most) children learning more natural languages do not perform worse on their mother tongue except for a brief period were they tend to mix languages.
> Likewise, learning Prolog provides you with a different perspective on programming that, once understood, can be applied to other languages as well. For example, I tend to put a lot of “knowledge” in data structures and use a small program using this data to do the job rather than using endless if-then-else, also when programming in C or JavaScript (my main imperative languages).
I'm reminded of Richard O'Keefe's comment, in the context about a decision about which PLs to teach in 1992, "Rob Hagan at Monash had shown that you could teach students more COBOL with one semester of Scheme and one semester of COBOL than you could with three semesters of COBOL."
More than that, for each related language you learn, the nth additional is easier. After French, Italian and Spanish, you will be able to read Portuguese almost fluently, without any specific study. People like that who write/speak often do mix things up, admittedly. But it tends to go away with regular exposure. To carry forward the metaphor, I'd argue most if not all computer languages are closely related in the same way Spanish and French are.
I kept this in mind as I've continued my education in computer programming, and it's true. Once you get familiar with three or four different languages, even the weird ones come a lot easier.
As a language (at least SWI-Prolog), it's missing some niceties that I took for granted: e.g., a function's output is always to a C-style output variable, all "context" variables must be passed around in recursive calls, etc.
There are several well-regarded books on Prolog that also feel quite antiquated in their concerns: authors taking pains to build elaborate conventions around function naming and argument ordering, etc.
Aside from its unusual features, Prolog really feels like a language from the early 90s, with a small, static standard library you might memorize, and authors offering "helpful tips" around functions with slightly different names in "commercial systems."
Though I agree that prolog seems like it came from the 90's; I especially agree with that "functions with slightly different names" bit.
?- length(X, 3).
X = [_1586, _1592, _1598].
?-
- because you need it,
- because you want it.
So you might consider learning the tool enough to understand when and where to deploy it.
> Like every Python in every 2021.