Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a prolog that can be run in JavaScript in the browser [duplicate]

I am looking for a version of prolog that can be run in JavaScript in a browser. That is I want to be able to use prolog to embed logical operations in a javascript web application

like image 832
Zachary K Avatar asked Mar 22 '15 15:03

Zachary K


People also ask

What is Prolog in JavaScript?

Asynchronous predicates Tau Prolog has been developed following a non-blocking, callback-based approach, allowing you, for instance, to sleep the main thread or to do AJAX requests without blocking the browser.

What is tau Prolog?

A Prolog interpreter in JavaScript Tau Prolog is a client-side Prolog interpreter fully implemented in JavaScript, whose development has been directed by the ISO Prolog Standard.


1 Answers

It's relatively easy to implement a prolog-like in languages that support generators. If you can use es6, you might find the implementation here interesting: https://curiosity-driven.org/prolog-interpreter

The first example of this I came across only worked on firefox but was called yield prolog: http://yieldprolog.sourceforge.net/

like image 61
kybernetikos Avatar answered Oct 23 '22 21:10

kybernetikos