Skip to content

Latest commit

 

History

History
30 lines (23 loc) · 739 Bytes

README.md

File metadata and controls

30 lines (23 loc) · 739 Bytes

scryer

This is a Typescript package that embeds Scryer Prolog.

Experimental, API will change. Currently it's (roughly) based on trealla-js's API.

npm install scryer
import { init, Prolog } from "scryer";

await init();

const pl = new Prolog();
const query = pl.query("X = 1 ; X = 2.");
for (const answer of query) {
	console.log(answer.bindings);
}

For browsers, you can use esm.sh or other CDNs to import it directly:

<script type="module">
import { init, Prolog } from "https://esm.sh/scryer"; // ideally add version info to the URL, e.g. [email protected]
await init();
// query stuff
</script>