Your first program
Save the following as hello.j:
jennifer
# hello.j
use io;
def x as int init 21;
io.printf("%d\n", $x + $x);Run it:
sh
jennifer run hello.jYou should see 42.
What just happened
use io;enables theiolibrary (nothing auto-loads).def x as int init 21;declares an integer variable namedxand initializes it to21. Using a variable takes the$prefix:$x.io.printf("%d\n", $x + $x)formats21 + 21as a decimal integer and prints it.
Top-level statements run in source order; there is no required entry-point function. Reusable code goes into functions (func), called explicitly.