Every Violet program starts with a main function. The simplest possible program:

  fn main(): void {
    debug.print("Hello, Violet!\n");
}
  

With access to process context — arguments, environment, allocator, scheduler:

  const process = import("std/process");
const debug   = import("std/debug");

fn main(ctx: process.Context): !void {
    debug.print("Hello, {}!\n", .{ctx.args[0]});
}
  

!void means this function can fail. The ! prefix is Violet’s error union syntax — more on this in Chapter 7.