2022-09-15 11:17:19 +00:00
|
|
|
#!/usr/bin/env node
|
|
|
|
const s = require("@quri/squiggle-lang");
|
|
|
|
|
|
|
|
const p = s.SqProject.create();
|
|
|
|
|
|
|
|
const src = process.argv[2];
|
|
|
|
if (!src) {
|
|
|
|
throw new Error("Expected src");
|
|
|
|
}
|
|
|
|
console.log(`Running ${src}`);
|
|
|
|
p.setSource("a", src);
|
|
|
|
p.run("a");
|
|
|
|
|
|
|
|
const result = p.getResult("a");
|
|
|
|
console.log(result.tag, result.value.toString());
|
|
|
|
|
|
|
|
const bindings = p.getBindings("a");
|
2022-09-16 20:30:44 +00:00
|
|
|
console.log(bindings.toString());
|