Live data from Hacker News

Show HN: Writing an HTTP server in Prolog

jamesbvaughan.com

21–30 of 74 posts

Re: Show HN: Writing an HTTP server in Prolog

#22
post #6

There is a revival of Datalog, a subset of Prolog, in relational databases and RAD. E.g., see LogicBlox or Datomic. I always think Datalog should have taken a big chunk of SQL's market. And I wish something like Mozart/Oz was more mainstream so that we could implement subsystems using logic programming wherever needed.

Chris Granger's Eve is based on Datalog. Perhaps his work is finally what breaks out the logic programming prolog paradigm.

Re: Show HN: Writing an HTTP server in Prolog

#24
post #13

Earlier quoted context omitted.

The class I was taking kind of blew my mind when I saw how you can solve some problems in such cool ways with Prolog, but I would certainly admit that this server isn't exactly the kind of use it's best suited for.

Python's set class and comprehension syntax can get you much of the declarative power of Prolog.

that's a tiny subset of what Prolog can do

Re: Show HN: Writing an HTTP server in Prolog

#26

James, check out Mercury next as it's a faster, better Prolog with some industrial use. https://mercurylang.org

That looks really cool. To be honest I hadn't planned to use Prolog too much beyond this project, but I'll give Mercury a try if I decide to dive deeper into logic programming. Thanks!

Re: Show HN: Writing an HTTP server in Prolog

#27

In one of my first jobs out of college, I got assigned to figure out how to make the Tivoli Enterprise Console do something useful. They gave up on the IGS guys and picked me because I took a class that used Prolog in my sophomore year. IBM bundled some ancient prolog dialect (copyright 1991 iirc) and the product was a mess. But it was a great time... a coworker and I came up with a way to persist facts to DB2 and de…

The embedded Prolog was ProLog by BIM, from BIM Systems, which was the Belgian-based competitor to a US-based company called Quintus, in Mountain View; both offered high-end Prolog systems for Unix.

One of the things that ProLog by BIM had was the ability to have Prolog use Oracle or Sybase databases as if they were Prolog's own native database (Spooky23, if you see this, I was wondering if that helped you use DB2 in this fashion when doing your Tivoli work or did you roll your own from scratch?)

Anyway, Tivoli apparently created a macro language, TEC, that was then compiled down to Prolog to run.

Here's an opinionated look at TEC and the decision to use Prolog:

http://www.softpanorama.org/Admin/Tivoli/TEC/tec_rules_progr...

Some more info/perspectives from back-when about Tivoli's use of Prolog:

https://groups.google.com/forum/#!topic/comp.lang.prolog/LgM...

Re: Show HN: Writing an HTTP server in Prolog

#28
post #6

There is a revival of Datalog, a subset of Prolog, in relational databases and RAD. E.g., see LogicBlox or Datomic. I always think Datalog should have taken a big chunk of SQL's market. And I wish something like Mozart/Oz was more mainstream so that we could implement subsystems using logic programming wherever needed.

Chris Granger's Eve is based on Datalog. Perhaps his work is finally what breaks out the logic programming prolog paradigm.

Chris Granger is charismatic, but not particularly insightful. It would be better if he found a mentor.

Re: Show HN: Writing an HTTP server in Prolog

#29
post #13

Earlier quoted context omitted.

The class I was taking kind of blew my mind when I saw how you can solve some problems in such cool ways with Prolog, but I would certainly admit that this server isn't exactly the kind of use it's best suited for.

Python's set class and comprehension syntax can get you much of the declarative power of Prolog.

How so? I mean, there are logic libraries available for python to be sure. But the "set class and comprehension syntax" are two features only tangentially related to logic programming. Using them alone doesn't get you inference, or even unification.

Re: Show HN: Writing an HTTP server in Prolog

#30

Earlier quoted context omitted.

Any particular reason you think Prolog should be abandoned? I think it looks like very nice language for untyped, high-level programming.

My understanding is that there's a very limited amount of research going into Prolog so it ends up being incredibly slow for larger tasks. And a lot of it's functionality can be done via standard SQL so there's not a ton of use cases for it.

Prolog implementations are still the fastest, most researched, and most practical logic languages out there. I don't know what the alternative would be, besides something fundamentally less powerful, like datalog or sql.

SQL only gets you so far. For example, you can't do something as straight forward as logic based arithmetic in SQL.

Post reply on HN