A ZIP-style Prolog VM for trilog (github.com)

22 points by triska 2 days ago

donutdonot 4 hours ago

Prolog is such a weird yet interesting language. Fun times having to program it back in University.

Are there any modern use cases of prolog left, or is it more of academic interest?

chamomeal 2 hours ago

I think I’ve been finding use cases at work. Features that I could build with prolog that I don’t think I could build with other languages. Fill-in-the-blank configuration problems that are somewhere between a normal database query and constraint satisfaction. I haven’t made anything beyond a POC though.

I also think there’s a lot of potential to build smaller internal tools with prolog. Prolog + LLMs are a really good match. I think the broad usefulness of prolog has been bottlenecked in the past by the finding/sourcing/formatting correct data, but even cheap LLMs can turn information into prolog facts. You can do all sorts of really neat stuff with a teeny prolog core, and a lot of LLM sourced data.

Like for instance, I made a very rough model of how certain data flows through our many services. Queues, indexers, caches. Came up with a few predicates that describe what a race condition is, what stale data is, then let Claude loose on the codebase to fill in all of the facts. Then in a couple queries, I indeed found a few race conditions and stale data!

sehugg 2 hours ago

Dialog is an interactive fiction programming language with Prolog-style evaluation, but rules are sort of S-exprs: https://dialog-if.github.io/manual/dialog/1c04-dev/lang/exec...

Mikhail_Edoshin 3 hours ago

There was a comparison of user expectations in web and database search. Database users expect the search result to include all relevant data, exclude all non-relevant data, and to get an explanation if something look out of place. Web users' expectations are lower, they accept false positives and omissions as long as some elements of the result seem to be correct.

Prolog is like a database. It is mechanical. AI is like web search (which it essentially is).

ducktective 4 hours ago

I also ask, is there any modern use cases of GOFAI left? Is it even a good pre-requisite to study for modern LLMs and gen-AI?

shakna 3 hours ago

The same use case it originally had? "Here's some incomplete data, show me all possible paths it could take."

SQL is fine if there are interlinks supporting the direction of your search. But those relationships frequently end up one-way, unless the architect both fights for it, and actually exists.