Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Something I would like to see is Prolog/logic programming embedded in a general purpose programming language, rather than as a standalone system.

Racket and Perl 6 are the only small userbase languages in the last 8-10 years to amaze me with their feature sets and to make me want to learn them just for the sake of experiencing them.



Probably doesn’t fit what you mean by mainstream, but even so: https://github.com/clojure/core.logic

> A logic programming library for Clojure & ClojureScript. core.logic offers Prolog-like relational programming, constraint logic programming, and nominal logic programming for Clojure.


This is cool but less what I'm looking for, which is to actually write Prolog inside my Clojure source, or be able to include a Prolog file.

Minikanren seems to be closer to the mark, and I thank the commenters who pointed it out!


I think you oversaw that core.logic is basically a minikanren (plus c-kanren, plus alpha-kanren) implementation in clojure instead of scheme; it even points to the papers and to The Reasoned Schemer for documentation and reference.

That is, saying that minikanren seems to be closer to the mark than core.logic is a little bit nonsensical (please read that in a good sense!)


You're right, although I think what I was actually wrong about was what minikanren is (probably by looking at examples in languages I was less familiar with).

I don't want to do logic programming in clojure (or whatever other language), I want to do logic programming in Prolog and drop it into my clojure project and have to do as little plumbing as possible.

The nearest analogy I can come up with is LINQ. In the examples in [1] the experience of the developer is closer to writing SQL in the middle of a C# or VB file, rather than having a good C# database query library.

[1] https://docs.microsoft.com/en-us/dotnet/csharp/programming-g...


Please note that Perl 6 has been renamed to Raku (https://raku.org using the #rakulang tag on social media). Although the emphasis has been on stability and efficiency improvements, some advances have been made in the concurrency department (react whenever) since then. And a project is now underway that will result in macros becoming first class citizens in Raku.



There is probably a logic programming system for your favorite language. MiniKanren might not be exactly what you want, but even then there's probably something Prologgy too.


Just to name two less know but interesting languages with that feature:

http://shenlanguage.org/

https://flix.dev/#/


> Something I would like to see is Prolog/logic programming embedded in a general purpose programming language, rather than as a standalone system.

That's super common, both as bridges to Prolog systems from other host languages and as implementations of Prolog semantics (or a subset like Datalog) as libraries in other host languages; also MiniKanren is available for many host languages.


That's been a regular thing to do for many years. There are systems in Python, many systems for various Lisps, even a few in C++.


Have a look at minikanren : )


Lisp has several. Screamer comes to mind.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: