Neat use of Janet. You could also save the whole environment so you don’t have to stuff everything into stuff.
I actually tried that. The solution is found after I already wrote the article. The Janet’s official documentation about embedding is not working.
The solution is already in the source code. I didn’t mention it because it’s complicated.
const core_env = janet.Environment.init(null);
const env = emptyEnvorinment(); // just an empty table
env.proto = core_env;
Janet side: (make-image (curenv))