News for hackers. Stuff that matters.
Re:Learn Prolog Now by zemptime on Wednesday November 12, 2025 @11:53AM (#45902466)
I've wished for the same kind of 'embed prolog in my ruby' for enumerating all possible cases, all invalid cases, etc in test suites. Interesting to know it's not just me!
Re:Learn Prolog Now by dflock on Wednesday November 12, 2025 @12:01PM (#45902588)
There are a bunch of libraries that will do this - here's one example of a python one: https://github.com/yuce/pyswip - and a ruby one: https://github.com/preston/ruby-prolog
Re:Learn Prolog Now by zemptime on Wednesday November 12, 2025 @12:15PM (#45902772)
I did try ruby-prolog. The deeper issue is that its just not prolog. Writing in actual prolog affords a lot of clarity and concision which would be quite noisy in ruby-prolog. To me, the difference was stark enough it wasn't worth any convenience already being in ruby was worth.
Re:Learn Prolog Now by dragonwriter on Thursday November 13, 2025 @12:35PM (#45917818)
Porolog might be more to your liking.

https://www.rubydoc.info/gems/porolog#porolog-wiki

Re:Learn Prolog Now by naasking on Wednesday November 12, 2025 @11:59AM (#45902555)
Maybe try a Ruby Kanren implementation:

https://minikanren.org/

uKanren is conceptually small and simple, here's a Ruby implementation: https://github.com/jsl/ruby_ukanren