Janet Notes and Examples

Executables and Running Janet


args to pass to janet

main function


Load a module on the command line

To run janet, load a foo.janet (or foo.so) module from the cwd, and drop you into the repl:

janet -l ./foo

You’ll then be able to access the foo module’s public bindings without any “foo/” prefix. This can handy for testing a module if you don’t have a repl-driven workflow set up.

Note, janet -r foo.janet executes foo.janet, but doesn’t load it into the repl environment.

Build a Standalone Executable

You can also compile your Janet programs into standalone executables. todo Janet interpreter baked-in to a C program. This can be useful to make distribution of your program more convenient.