3 ms·
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 person
by YeGoblynQueenne 9y ago
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.
In what sense is all that not "general purpose"?
______________
[1] http://www.swi-prolog.org/pldoc/doc_for?object=section(%27packages/http.html%27) http://www.swi-prolog.org/pldoc/doc_for?object=section(%27pa...
[2] http://www.swi-prolog.org/pldoc/man?section=www_browser http://www.swi-prolog.org/pldoc/man?section=www_browser
[3] http://www.swi-prolog.org/pldoc/man?section=optparse http://www.swi-prolog.org/pldoc/man?section=optparse
[5] http://www.swi-prolog.org/pldoc/man?section=prologpack http://www.swi-prolog.org/pldoc/man?section=prologpack
[7] http://www.swi-prolog.org/pldoc/man?section=registry http://www.swi-prolog.org/pldoc/man?section=registry
[8] http://www.swi-prolog.org/pldoc/man?section=simplex http://www.swi-prolog.org/pldoc/man?section=simplex
[9] http://www.swi-prolog.org/pldoc/man?section=threadpool http://www.swi-prolog.org/pldoc/man?section=threadpool
- dragonwriter 9y agoGPs issue seemed to be that it wasn't a great or popular language for general use, not that it isn't a general purpose language.
- YeGoblynQueenne 9y agoThe 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.
- dragonwriter 9y agoYes. The mistake is thinking "is not currently a great general-purpose language" implies "not currently a general-purpose language".
- YeGoblynQueenne 9y agoSorry, but that's not a mistake. That's the common-sense reading of the title. Your reading is much less likely.
- dragonwriter 9y agoYour reading makes the word "great" superfluous. Its not "common sense" to read a qualifier out of the question asked.
- YeGoblynQueenne 9y agoThat literally is what common sense is all about.
- miguelrochefort 9y agoI 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.