7

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

4
  • 7
    A very interesting question, originally asked by false over here. (Notice that questions that are not of the form "How do I do X?" are considered "not constructive" on SO.) Commented Mar 22, 2015 at 16:10
  • 1
    Just to mention "javascript" is probably not enough to narrow it down. Here's a question about executing a shell command from javascript. If you can do that, then you could execute a Prolog interpreter. But most or all of the concerns and conditions mentioned in the linked question/answers apply. Commented Mar 22, 2015 at 17:05
  • 6
    How about Pengines? pengines.swi-prolog.org/docs/index.html Not exactly what you are looking for but should be able to do the job... Commented Mar 22, 2015 at 17:30
  • 1
    As Boris states, Pengines would probably be your best bet. Commented Apr 8, 2015 at 12:54

1 Answer 1

3

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/

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.