Hello World

This is the traditional Hello World program for Jane:

file class Program; // A file statement configures the file
// file class defines the containing class of a program, so you don't have to wrap everything in class Program { ... }

// This is in fact a comment, as standard in many languages it starts with a double slash
// Compiler ignores everything in a line after a double slash

// Woah! A main function! This is where everything gets executed in an executable
// -s means it's static, thus doesn't need an instance to be called
fn -s Main() -> i32 {
    Jane.Tty.WriteLn("Hello World!");
}

Alternatively for single script files the main function and wrapping class can be omitted:

Tty.WriteLn("Hello World!");

Tty represents the Console (Tty stands for Teletypewriter). The Tty object can receive the WriteLn call, which draws the supplied string on the Standard output and appends a newline.

To compile you will need the jane compiler

$ shjc hello.jn

makes hello / hello.exe

$ ./hello Hello World!