Remix.run Logo
xigoi 6 days 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/

veqq 5 days ago | parent | next [-]

Tangentially, image-based development is possible, reloading images into the REPL for more interesting workflows: https://alexalejandre.com/notes/exploring-janet/#image-based... but it's a WIP.

fuzztester 6 days ago | parent | prev [-]

So after all those steps, it is actually compiled native code that you run?

xigoi 5 days ago | parent [-]

Yes, 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.