nim-lang / needed-libraries

This repository contains a list a needed libraries.
112 stars 5 forks source link

Embedded logic programming #88

Open zah opened 5 years ago

zah commented 5 years ago

Nim can feature a logic programming engine embedded into the language as a DSL (it's possible to make it work both at compile-time and run-time). A popular minimalistic approach available in other languages is the miniKanren engine:

https://github.com/clojure/core.logic https://github.com/logpy/logpy

A more sophisticated engines are also possible, but may require more work. See the following explanation for the differences between Kanren and a fully-featured Prolog engine:

https://stackoverflow.com/questions/28467011/what-are-the-main-technical-differences-between-prolog-and-minikanren-with-resp

ponyatov commented 4 years ago

Maybe this can be done in yield/generators implementation described here: http://yieldprolog.sourceforge.net/

I don't test it, maybe coroutines implements backtracking in a parallel can be tried as implementation base.