16

Do you know of any good javascript library for logic programming?

I'm interested in something like jsprolog, but I want to use javascript to communicate with the lib, and not a different language (such as prolog in this case).

Many thanks.

4
  • 1
    Have you looked at Python? It has a syntax very similar (IMO a bit more readable) than that language you linked to, and there are JS implementations of a subset of Python. Commented Sep 28, 2011 at 15:51
  • 2
    Not sure I have explained myself clearly enough. Extracting the meaning of what I tried to say: Desired paradigm: logic programming; Desired language: javascript; Desired syntax: javascript. Commented Oct 9, 2011 at 17:48
  • See this related discussion about JavaScript implementations of Prolog: stackoverflow.com/questions/15435462/… Commented Mar 16, 2015 at 21:03
  • 1
    @try-catch-finally As far as I know, these operators do not provide logic programming features in JavaScript. Commented Sep 26, 2016 at 2:19

4 Answers 4

4

In addition to jsprolog, there are several JavaScript libraries for logic programming:

Of course, there are also several C++ libraries for logic programming that could be automatically ported into JavaScript using Emscripten.

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

Comments

2

There are a bunch of other languages that compile to javascript: https://github.com/jashkenas/coffee-script/wiki/List-of-languages-that-compile-to-JS

It is possible (although not probable!) one of those has a javascript friendly API AND a suitable library that can by "compiled" into JavaScript.

Exactly what you aren't looking for, and probably a time waster :)

2 Comments

Yes, I am aware of this list. Not what I'm looking for. Thanks though.
Hopefully that link is useful to someone else coming to this thread.
2

Please check out (JSL) https://www.npmjs.com/package/lib-jsl.

From the overview document, JSL is a JSON based logic programming library meant for embedded use in JS programs. It uses JSON as its syntax as well as I/O method

Comments

1

There is a new tool, a generic compiler adding any effect to JS, including logic programming, there is an example of prolog append: https://github.com/awto/mfjs-samples/tree/master/unify

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.