17

Javascript seems to become popular as an implementation language for other programming languages. The article Lightweight compilation of (C)LP to JavaScript. ICLP 2012 drew my attention on this.

There are a lot of proof-of-concept prototypes for Prolog systems written in Javascript around on the Web.

What are current, actively maintained, preferably ISO conforming Prolog systems written in Javascript?

4
  • 2
    This question seems to be a poll and is therefore not suitable for SO. Commented Mar 15, 2013 at 14:54
  • @FelixKling: There are similar questions for other languages: Like stackoverflow.com/questions/1817010/… Commented Mar 15, 2013 at 14:55
  • 5
    This was back in 2009... rules were different back then. Commented Mar 15, 2013 at 14:56
  • 3
    Asm.js could help bringing raw performance to this topic Commented May 30, 2013 at 9:05

1 Answer 1

14

The only Prolog in JavaScript I know is YieldProlog, but I haven't tried it extensively, just the code available in QueryEditor.

I was hoping than using the yield construct it was lightweight (I used extensively such construct in C#, and I found it - paired to lambda - rather powerful).

But when I inspected (summarily) the source, I found it really complex, despite the assumptions.

edit

I've found recently these contributions, that seem really interesting: proscript and proscript2.

edit

a new implementation available:

Tau Prolog, brought to my attention from Jan on SWI mailing list

edit

Something new, hhprolog, a pure Prolog engine, based on code and documentation provided by Paul Tarau, ported by me to Javascript. So, available in both browsers and NodeJS.

The project is still preliminary, mostly needed is to bootstrap to interpreter: right now (pre)compiling Prolog to the (novel) virtual machine must be accomplished with SWI-Prolog installed, properly configured (JPL needed).

To implement such bootstrapping, I would probably need to implement negation, to reuse Paul' interface, or - better - attempt to implement something staying in the pure paradigm. In particular, only unbounded integer arithmetic (again by Paul Tarau, there is some Python code available - I will try lazily to port to Javascript).

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

3 Comments

Can you explain me what "Yield Prolog lets you embed Prolog programs directly in Python, C# [1] or Javascript" actually means? Are these 3 languages? Or what?
I think it 'compiles' clauses: the docs pages are extensive...
Yield Prolog appears to be compatible with the latest version of Firefox, but not Google Chrome. Fortunately, there are several other logic programming systems that have been implemented in JavaScript.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.