Thanks to Jeff for this little tool, writeJSLog/1, which writes a
external parser of sort for converting Prolog source into the internal
representation of JScriptLog.
The only trick is that, to write out variable names, you need
to convert Var to newVariable('Var'). For an example, see the
test/0 predicate at the end that converts queens/3 from "UI.js".
This code runs in the JLog applet, or other Prolog.