Prolog is already a general-purpose language. So is any Turing complete
language, by definition. Whether it's a "great" such language or not is kind
of a personal tastes thing.
As to why it's not more popular, I've thought about this very ofen and I don't
have an answer. What I know for sure is it's never going to become more
popular until people move on from that silly soundbite about its "general
purpose"-ness, which never made any sense to begin with.
People program "general purpose" stuff in languages that are much worse for
"programming in the large" than Prolog. Most of the big operating systems are
written in C, large swathes of game code is in some assembly language or
other, about 60% of enterprise code is in Java and most supercomputing code is
in FORTRAN fer chrissake. Not to mention, all of the internet is in
javascript, a language that was originally meant just for writing small
snippets of code to manage buttons and text fields and stuff. You're not going
to tell me that javascript is "general purpose"?
Prolog is already a general-purpose language. All you need to do is have a look at the library section in the Swi-Prolog documentation. Besides the usual suspects (constraint logic, tabling, lambdas and such and of course parsing all possible text-based formats ever in time dt) we find a bunch of diverse libraries:
An http package for all your client/server needs [1]
A library for opening web-pages in a browser in a system-agnostic manner [2]
A library for command-line parsing [3]
An RDF parser and a semantic web library
A package manager [5]
A random numbers generation library
A library for manipulating the Windows registry [7]
A library for solving linear programming problems [8]
A thread pool management library [9]
And a whole lot of support for a bunch of other stuff like corouting, multithreaded applications, a profiler, terminal control, an ODBC interface, an interface to Protocol Buffers, bindings to zlib, GNU readline, and so on and so forth.
The question asked is "what would it take for Prolog to become a great general-purpose language". That sounds like they think it isn't. If that wasn't meant OK, but that's definitely what it reads like.
I meant to say "what would it take for people to think of Prolog as a great general-purpose language?".
I have never used Prolog for anything serious, but I think it has great potential and I really want to like it. It almost looks like the perfect programming model, and I want to understand why it's not.
What you're asking is something that the logic programming community has asked itself very often, but it's very hard to answer with any certainty.
One thing that should be noted is that Prolog was very popular, for a brief period of time, in the 1980's. For instance, check out this year's TIOBE index report:
If you scroll down to the section titled "Very Long Term History" you'll see Prolog listed as the 3d most popular language in 1987 (behind Lisp in second place and C in first, and before C++ in fourth). By 1992, it had dropped to 14th place and then it was pretty much all downhill from there.
As a personal anecdote, I've read a number of Prolog texbtooks from the late '80s and early '90s that begin with saying that it is very important to learn Prolog because it is sure to become a very popular language in the future.
In other words, Prolog did have its time in the sun. But then it fell from grace.
As far as I can tell, the most likely narrative to explain this meteoric change in fortunes is the one that pins the blame on the association of Prolog and logic programming to the Japanese Fifth Generation Computer project. This (theoretical) explanation of the rise and fall in popularity of Prolog is proposed here:
In short, how this story goes is that, when Japan chose to use logic programming for its Fifth Generation Computer project, which was seen as potentially extremely disruptive by the West, companies and academics in Europe and the USA suddendly took a great interest in Prolog, thinking that the Japanese must know something they didn't. Then, when the Japanese project flopped, it took Prolog with it.
I stress again it's just a theory, but, to me in any case, it's at least very plausible.
As to why it's not more popular, I've thought about this very ofen and I don't have an answer. What I know for sure is it's never going to become more popular until people move on from that silly soundbite about its "general purpose"-ness, which never made any sense to begin with.
People program "general purpose" stuff in languages that are much worse for "programming in the large" than Prolog. Most of the big operating systems are written in C, large swathes of game code is in some assembly language or other, about 60% of enterprise code is in Java and most supercomputing code is in FORTRAN fer chrissake. Not to mention, all of the internet is in javascript, a language that was originally meant just for writing small snippets of code to manage buttons and text fields and stuff. You're not going to tell me that javascript is "general purpose"?
Prolog is already a general-purpose language. All you need to do is have a look at the library section in the Swi-Prolog documentation. Besides the usual suspects (constraint logic, tabling, lambdas and such and of course parsing all possible text-based formats ever in time dt) we find a bunch of diverse libraries:
An http package for all your client/server needs [1]
A library for opening web-pages in a browser in a system-agnostic manner [2]
A library for command-line parsing [3]
An RDF parser and a semantic web library
A package manager [5]
A random numbers generation library
A library for manipulating the Windows registry [7]
A library for solving linear programming problems [8]
A thread pool management library [9]
And a whole lot of support for a bunch of other stuff like corouting, multithreaded applications, a profiler, terminal control, an ODBC interface, an interface to Protocol Buffers, bindings to zlib, GNU readline, and so on and so forth.
In what sense is all that not "general purpose"?
______________
[1] http://www.swi-prolog.org/pldoc/doc_for?object=section(%27pa...
[2] http://www.swi-prolog.org/pldoc/man?section=www_browser
[3] http://www.swi-prolog.org/pldoc/man?section=optparse
[5] http://www.swi-prolog.org/pldoc/man?section=prologpack
[7] http://www.swi-prolog.org/pldoc/man?section=registry
[8] http://www.swi-prolog.org/pldoc/man?section=simplex
[9] http://www.swi-prolog.org/pldoc/man?section=threadpool