Quick Start¶
To install Juvix, follow the instructions in the installation guide.
After installation, run juvix --help
to see the list of commands.
Run Juvix doctor to check your system setup:
juvix doctor
CLI Usage Examples¶
Create a new package:
juvix init
Evaluate a source file:
juvix eval path/to/source.juvix
Compile a source file into a native executable:
juvix compile native path/to/source.juvix
Compile a source file into a Nockma binary:
juvix compile anoma path/to/source.juvix
Launch the REPL:
juvix repl
Typecheck a source file:
juvix typecheck path/to/source.juvix
Generate HTML representations of a source file and its imports:
juvix html --recursive path/to/source.juvix
The Hello World example¶
This is the Juvix source code of the traditional Hello World program.
-- HelloWorld.juvix
module HelloWorld;
import Stdlib.Prelude open;
main : IO := printStringLn "hello world!";
To compile and run a binary generated by Juvix, save the source code to
a file called HelloWorld.juvix
and run the following command from the
directory containing it:
juvix compile native HelloWorld.juvix
./HelloWorld
You should see the output: hello world!
.
You can also evaluate the file without compiling it first by executing
juvix eval HelloWorld.juvix
The output should be the same : hello world!
.