4 ms·
From the book you linked: > But in order to produce native code, jpm actually: > 1. Compiles your Janet source code into an “image.” > 2. Embeds the contents
by xigoi 1y ago
From the book you linked:
> But in order to produce native code, jpm actually:
> 1. Compiles your Janet source code into an “image.”
> 2. Embeds the contents of that image into a .c file that also links in the Janet runtime and interpreter.
> 3. Compiles that .c file using your system’s C compiler.
https://janet.guide/compilation-and-imagination/ https://janet.guide/compilation-and-imagination/
- fuzztester 1y agoSo after all those steps, it is actually compiled native code that you run?
- xigoi 1y agoYes, but the code portion of the executable is really the Janet interpreter, while your code lives in the data segment and is not in the native form.
- veqq 1y agoTangentially, image-based development is possible, reloading images into the REPL for more interesting workflows: https://alexalejandre.com/notes/exploring-janet/#image-based-development https://alexalejandre.com/notes/exploring-janet/#image-based... but it's a WIP.