
Pure Ruby gem implemention of a Prolog-like DSL for AI and logical programming - vinnyglennon
https://github.com/preston/ruby-prolog
======
memexy
This is pretty cool. One thing I have thought about is using some kind of RPC
mechanism to leverage an actual Prolog runtime instead of re-implementing it
in the embedding language. So instead of embedding backtracking, memoization,
constraint propagation, and other logic techniques in Ruby we just leverage a
running Prolog process and send it the facts and definitions and let the
existing runtime do all the necessary computation and then serialize the
results and send them back to Ruby.

The reason for this is that Ruby is unlikely to be faster than an optimized
implementation of Prolog like SWI-PL ([https://www.swi-
prolog.org/](https://www.swi-prolog.org/)). Most Prolog implementations
already feel like databases so it would be similar to interacting with a
database but instead of SQL (MySQL, Postgres, etc.) we can use the full
capabilities of a Prolog implementation.

Edit: Looks like the author thought of something similar about serializing the
database and loading it into a Prolog runtime.

> Then you can do a quick copy/paste into an environment like Tau Prolog's
> sandbox or SWISH and run some queries.

