Quick Start
To install Juvix, follow the instructions in the Installation How-to.
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
Compile a source file into an executable:
juvix compile path/to/source.juvix
Compile a source file into a WebAssembly binary:
juvix compile -t wasm 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;
open import Stdlib.Prelude;
main : IO;
main := printStringLn "hello world!";
end;
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 HelloWorld.juvix
./HelloWorld
You should see the output: hello world!
The source code can also be compiled to a WebAssembly binary. This
requires some additional setup. See the Installation
How-to for more
information. You can also run juvix doctor
to check your setup.
juvix compile --target wasm HelloWorld.juvix
wasmer HelloWorld.wasm