4 ms·
mark, which type of applications is prolog amazing for?
by noloblo 4y ago
mark, which type of applications is prolog amazing for?
- crabbone 4y agoNot Mark. The obvious answer: knowledge base. Prolog is the best database I know when it comes to encoding complex relationships and querying for complicated answers. Less obvious: parsing. It's very easy to write parsers in Prolog. I wrote Protobuf and Thrift parsers in it (for the schema, not the binary payload) and each one took about a day of work. I didn't use those parsers in commercial settings, but I did write a parser in Prolog to help me to generate Swagger from some RoR structured comments (I don't know Ruby, but could figure out what was in the comments). Another ways I used Prolog in practice and would use it more: software testing. Prolog lends itself very well to describing the model of SUT and to "parametrization" of testing. I was very close to using Prolog in this capacity, and worked for almost half a year on a proposal for replacement of the company's existing tests with something based on Prolog, but eventually failed to convince my bosses that it would work (same arguments as always, basically, "water from the toilet").
- YeGoblynQueenne 4y agoSorry, I'm curious, what is "water from the toilet"? A quick search of the internet turns up nothing very clear.
- crabbone 4y agoIt's a reference to Brawndo marketing campaign, a sugary soda drink from the movie Idiocracy. The marketing campaign discouraged buyers from using water for drinking and irrigation which caused famine because the audience was not good at critical thinking but very susceptible to marketing tricks. Whenever there was a question of using water s.a. to water the crops, everyone would ask with disgust if they intend to use the same water that's used in the toilet. This is the attitude I've encountered a lot when dealing with trends in technology. For example, there's hatred of XML suit of tools and formats. And it is so entrenched and especially more so with people who have a very superficial understanding of the subject, who also happen to be the majority of the target audience. Thus, every time when a project requires a simple to parse format with schema validation, powerful querying mechanisms, extensibility... while XMLs easily checks all those boxes, developers will tie themselves into knots only to avoid using it making all sorts of ridiculous claims about XML. I'm not specifically advocating for the use of XML, and I believe there are better formats... unfortunately those would be an even harder sell :) I'm just using XML as an example of something that should've been a no-brainer for many trivial tasks, and yet it's been avoided like a plague for superficial reasons.
- YeGoblynQueenne 4y agoOh, I see, thanks! I've watched Idiocracy but I guess I didn't make the connection. Good on you for avoiding spoilers also ;) And that's a good point about entrenched opinions in tech. On the positive side, this kind of thing creates an imbalance that opens opportunities. For example, I managed to start a PhD in Inductive Logic Programming at a good university, when my academic record up to that point had been average, and I suspect that was mainly because I applied for research in an area where there are very few applications, namely Inductive Logic Programming: even now everyone's running the other way, towards deep learning :D