4 ms·
Hey,folks who are working with Prolog - what sort of work are you doing?
by joeatwork 4y ago
Hey,folks who are working with Prolog - what sort of work are you doing?
- triska 4y agoThere was a recent thread Prolog at work with many interesting links and posts: https://news.ycombinator.com/item?id=34164221 https://news.ycombinator.com/item?id=34164221
- YeGoblynQueenne 4y agoI work on an ancient, legacy system that manages company car rentals, written in Visual Prolog. Visual Prolog is an ojbect-oriented, typed, compiled, version of Prolog, so it's very, very different than ordinary Prolog ("ordinary" for me anyway). To be honest, it's not the most exciting system to be working on. It's basically using Prolog to encode business rules and perform calculations that you would sometimes expect to see in a spreadsheet (but then, there are parallels between logic programming and spreadsheets, e.g. see [1,2]). Prolog of course is a great language for that sort of use. On the other hand, I think the idea of turning Prolog into an object-oriented language is the worst idea of all times. I mean, when I quit my job in the industry to do a PhD, a big draw was that I could work with Prolog, but not OOP. And now I'm back in the industry working with an OOP Prolog. Resistance is futile. The fun part is that the project I'm working on has been developed over 20 years by multiple people with very, ah, let's say varied opinions on the necessity of maintainability of old code. There are missing sources, old configurations that break compilation, no structured comments whatsoever, no version control (NO VERSION CONTROL!!! AAAAAH!!!), about 1/10th of the LOCs are commented-out for reasons unknown and unspecified in any comments, and so on, so forth. So it's really cool to work with. I absolutely love digital archeology! :D _________________ [1] https://www.j-paine.org/spreadsheet_structure_discovery.html https://www.j-paine.org/spreadsheet_structure_discovery.html [2] https://dl.acm.org/doi/10.1145/67449.67466 https://dl.acm.org/doi/10.1145/67449.67466
- pjmlp 4y agoNow that is a name I didn't saw for a while. I remember the ads in Dr Dobbs! Thanks for sharing.
- mst 4y agoI keep seriously considering trying https://logtalk.org/ https://logtalk.org/ to get myself object orientation in prolog - haven't done so yet, expressing no opinion as to whether it's a good idea in practice, but it definitely looks like it'd be fun to play with.
- YeGoblynQueenne 4y agoWell, Paulo (Moura, logtalk maintainer) has done an amazing job and I don't want to disparage it. I still think it's a bad idea to make an OOP Prolog. I think it's a bad idea to do anything to Prolog to make it more like something else. Prolog is a unique jewel of computer science, with unique flaws and unique virtues, and I am pretty convinced that there is nothing that can make it better, without breaking the delicate balances that make it absolutely amazing the way it is. There have been many efforts to "make a better Prolog" (never explicitly articulated like that), for example, Answer Set Programming, or Datalog, I guess. Everytime someone tries to do that, they break Prolog irreparably: Datalog and ASP can't even use lists; ASP has to ground the entire program and then hand off to an NP-complete solver. As to OOP, I think I'm not alone when I say that I've seen the horrors that people create when given the freedom to instantiate their classes, and I will never unsee them. A great idea, but so was the Industrial Revolution, and now we have climate change.
- crabbone 4y agoI didn't succeed in convincing my bosses to adopt a testing framework written in Prolog, but, technically, I worked in Prolog for almost half a year when working on this proposal. This, however, was 5+ years ago. For this purpose I used Golog (a very simple, and not very performant Prolog interpreter written in Go). We had already a lot of infrastructure code written in Go, so it would've been a big problem if we couldn't reuse it during migration. I extended the interpreter in two major ways: 1. Marshalling of structs from Go to Prolog and back. 2. Made most of the meta-predicates parallizable. The second was meant to be an essential improvement over existing testing framework because it struggled with deploying tests in a large distributed system, running them while allowing various communication patterns and collecting results. The system that was supposed to be tested in this way was a distributed parallel filesystem. The kind of tests I was hoping to leverage with my proposed framework were along the lines of: let multiple users perform various filesystem-related operations on the shared filesystem tree while connecting from different physical nodes and see if anything goes wrong. The system worked enough for a demo, but was never approved for real use.
- YeGoblynQueenne 4y agoSorry to hear that. It sounds like a project that would have been very rewarding to work on. I for one would have liked to hear more about the parallelisation of meta-predicates, that sounds cool.