5 ms·
Why? No, really, subjectively Prolog looks lovely to me, but sort of "Chapter 0" explaining why should people learn Prolog and how they can apply it practically
by qwerty456127 8y ago
Why? No, really, subjectively Prolog looks lovely to me, but sort of "Chapter 0" explaining why should people learn Prolog and how they can apply it practically could make an awesome addition.
- worldsayshi 8y agoYes. I'd love to know more about real world use cases.
- tom_mellior 8y agohttps://en.wikipedia.org/wiki/Amadeus_IT_Group https://en.wikipedia.org/wiki/Amadeus_IT_Group More than 200 million airline bookings, 850 million total (travel and hotel) bookings per year. They are known to run their airline reservation system on Sicstus Prolog, though I don't know how well that is publicly documented in writing.
- deleted 8y ago[deleted]
- YeGoblynQueenne 8y agoWhy learn something new? To increase your knowledge. If that's not reason enough then nothing else is.
- ineedasername 8y agoThat's an ungenerous interpretation of the question. Consider this variation: Why learn Prolog instead of spending the finite commodity of time to learn something that may be equally engaging on an intellectual level but also more practical? To me, that variation is implicit within such a question. Edit: I'm reasoning from the HN comment guidelines [0]: "Please respond to the strongest plausible interpretation of what someone says, not a weaker one that's easier to criticize. Assume good faith." This guideline is in fact a restatement of one of the fundamental principles of reasoned discourse, the principle of charity [1] [0] https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newsguidelines.html [1] https://en.wikipedia.org/wiki/Principle_of_charity https://en.wikipedia.org/wiki/Principle_of_charity
- deleted 8y ago[deleted]
- YeGoblynQueenne 8y ago>> Consider this variation: Why learn Prolog instead of spending the finite commodity of time to learn something that may be equally engaging on an intellectual level but also more practical? I have to ask- like what? Are we talking about the next javascript framework, here, or about, I don't know, modal logics or category theory? I know a guy who got an internship at ARM during a PhD in modal logic, so, far as I can tell, modal logic is both intellectually engaging and also practical, as in useful, in practice (to be blunt: to land you a job). Is that what you are talking about?
- ineedasername 8y agoSure, that seems a good example, and brings up a point I didn't mention: practicality can be a very contextual quality. Generally though I think it's fair to interpret any question of "why should I bother learning X" not as a statement that nothing should be learned unless there's a direct benefit, but instead as the question "what are the practical applications of X". I think most people here would agree that learning for learning's sake can be fruitful & rewarding, so there's no reason to assume otherwise in response so such a question.
- YeGoblynQueenne 8y agoI don't understand what you're saying. If the OP's question was "what are the practical applications of X", then obviously he didn't consider it that learning for the sake of learning is useful.
- ineedasername 8y agoWhy say the OP obviously didn't consider learning for learning's sake useful? I see nothing obvious there. Asking for practical applications does not logically preclude the OP also appreciating learning for learning's sake, and I see nothing else in their post to imply their stance on it one way or the other. As such I choose the more charitable interpretation.
- adinb 8y agoBut why should I learn it over the zillion other things that I'm trying to learn? Especially since I have only so much time for non-practical skills.
- brudgers 8y agoProlog has been around for a long time (in computing terms). It will probably be around a long time from now (in programming terms). Prolog won't bit rust sitting in your toolbox in the same way that ASP, Flash, and MacOS did.
- ineedasername 8y agoPretty much what I came here to ask. I remember learning a bit of prolog about 20 years ago at University, but even then my impression from the instructor was that it was not used much outside of some limited academic settings. I seem to recall from that same instructor that most use cases for prolog had been subsumed by Lisp.
- worldsayshi 8y agoYes. I'd love to know more about real world use cases. Edit: Found some relevant threads and links: https://news.ycombinator.com/item?id=9248107 https://news.ycombinator.com/item?id=9248107 https://www.youtube.com/watch?v=G_eYTctGZw8 https://www.youtube.com/watch?v=G_eYTctGZw8
- brudgers 8y agoAs an abstraction, think of a Prolog program as a collection of facts and running a Prolog program as a query against those facts. Or basically a Prolog program as a static (or read oriented) database. Or describing a set of rules. Rolling back, as a declarative language in the database abstraction, the programmer can run queries with verbs that model the domain instead of SQL's generic WHERE, FROM, SELECT, etc. The price is that all facts have only three parts...like RDF [1] so maybe the programmer comes out ahead on design of the data relations. Not all workloads are close to read-only databases. But some are, and Prolog allows writing such programs without the low level abstractions of the relational model using higher level DSL's. [1]: https://en.wikipedia.org/wiki/Resource_Description_Framework https://en.wikipedia.org/wiki/Resource_Description_Framework
- YeGoblynQueenne 8y ago>> The price is that all facts have only three parts...like RDF [1] Prolog "facts" can have any number of arguments. The only way I can think of reconciling Prolog facts with your comment about "only three parts ... like RDF" is that Prolog facts are first-order predicates which consist of a predicate symbol, a vector of arguments and a pair of enclosing parentheses. Is that what you meant?
- deleted 8y ago[deleted]
- qwerty456127 8y agoHow does storing facts in the source code instead of a database make any practical sense? I mean I can hardly imagine a real-life scenario where the number of facts is so small.
- deleted 8y ago[deleted]
- deleted 8y ago[deleted]
- 8y ago
- bjourne 8y agoBecause Prolog bends your brain and getting your brain bent is fun. :) In the real world there are few applications of Prolog. Part of the reason is that Prolog doesn't mesh very well with functional programming constructs which are very popular in data processing. Another part of it is that the execution model doesn't match many real world problems. For example, in a document retrieval system you might want to find the 10 documents that most closely match an input query. Describing that as a constraint programming problem (Prolog excels at those) is not easy.
- rixed 8y agoThe more areas of knowledge one has some familiarity with and the more often one is able to recognize that most of the daily adversities we face are just random incarnations of well known general problems (sometimes you'd better ignore the "academic" solution due to local circumstances, but not always). Many time a programmer will be faced with a problem which solution is to collect a set of facts and ask arbitrary questions against those. Unless one has had some exposure with prolog, one may not recognize this problem and may start designing a custom inferior system, either from scratch or based on unfit tech. Real life example: I worked once for a very respectable company where we had been given the project of devising a system that would assess the trustworthiness of accesses to some sensitive application based on a ever expanding set of data collected about users, their devices, locations, and so on. We wanted the rules governing access to be defined and refined with time by the security department. So I thought that would be a good fit for some prolog-like database and looked for one; and I could actually find one that checked all the boxes: usable as a library from C++, could update the dataset and the rules without interruption, compiled the queries down to machine code to withstand our gazillions of queries-per-secs, developed indoors (to counter the NIH syndrome), and instead of FALSE the lib would also return some metadata that could be used to produce a meaningful error message. A prototype was build in 2 weeks or so, involving 1.5 person, one of which had never used prolog before. Had never used it but knew about it. Otherwise, you can be certain that a very different path would have been taken: to hire a whole team of engineers to develop from scratch and for a very long time their very own capability system/data storage system/error reporting system that would have been less flexible and much slower, required restart for reconfiguration, etc. You can be certain of it because that's the path the company actually decided to follow, to the great benefit of those involved, who've all been rewarded with a promotion for such an undertaking :-)