import { mkPrimeBank } from './coyimg/primebank';
// export { buildImage };
export const buildImage = (builder, output) => {
const [renderer, bank] = mkPrimeBank();
builder(bank);
output.write(renderer());
};
[wleslie@sanderson:~/projects/capimg/jessie]
12:27:19 $ node --experimental-vm-modules src/modulesystem2.mjs file://./src/nothing.mjs
info: -------template--------
undefined:1: "import { mkPrimeBank } from './coyimg/primebank';
-------
looking for safeModule, EOL_COMMENT, MULTILINE_COMMENT
error: Syntax error at 48 ";" #0:48 Error
at /home/wleslie/projects/jessica/node_modules/@michaelfig/slog/dist/slog.cjs.js:118:25
at tag [as error] (/home/wleslie/projects/jessica/node_modules/@michaelfig/slog/dist/slog.cjs.js:69:20)
at file:///home/wleslie/projects/jessica/lib/boot-peg.js:88:13
at Object.start (data:severalpagesofbase64:14:13)
at baseCurry (file:///home/wleslie/projects/jessica/lib/boot-peg.js:592:23)
at templateTag (file:///home/wleslie/projects/jessica/lib/boot-peg.js:572:21)
at tagged (file:///home/wleslie/projects/jessica/lib/tag-string.js:30:12)
at Object.runModule (file:///home/wleslie/projects/jessica/lib/boot-jessica.js:62:22)
at runModule (file:///home/wleslie/projects/capimg/jessie/src/modulesystem2.mjs:50:24)
at loadRoot (file:///home/wleslie/projects/capimg/jessie/src/modulesystem2.mjs:53:28)
node:internal/modules/run_main:107
triggerUncaughtException(
^
error: Syntax error at 48 ";" #0:48
(Use `node --trace-uncaught ...` to show where the exception was thrown)
Node.js v24.11.1
Hi, William!TL;DR: Jessica is dead! Long live @jessie.js/parse and https://es-meta.github.io/playground/ !I really haven't done very much with Jessica's implementation of Jessie. Instead, I've only ever used it for building ASTs for other little languages. Note that the latest "23rd of August" commit was August 23rd, 2023! It's likely that you were tripped up by my (foolhardy) inclusion of an experimental `insulate` reserved word (and later attempts to hardwire `harden`) built into the syntax. This would be much better handled via static analysis.The scant time I've put in since then has been to reconstruct Jessica's parser machinery in https://github.com/endojs/Jessie/tree/main/packages/parse. The basic PEG stuff is usable, but I haven't gotten far enough up polishing the stack of parsers from peg -> json -> json5* -> justin -> jessie. (* I am here). This building-a-language-from-first-principles approach is a fun toy, but it needs much better test suites and tooling. The personal goal I've set for this stack is to write minimal static verifiers of these languages (with good error recovery for interactive use) that I could adapt as plugins to other tools like ESLint or Prettier.Beyond that, I'd rather just verify some input source code and then pass it off to other software in order to interpret it.My current dream is to create machine-readable annotation files describing each JSON-to-Jessie subset in relation to a given EcmaScript standard's text. Then we could teach https://es-meta.github.io/ how to read those annotations to build a toolchain for each subset.Maybe not what you wanted to hear, but I haven't had a lot of free time. :PCheers,Michael.