Search

Hello World

The simplest Draft program. A starting point for new developers.

Hello World

The simplest Draft program that prints “Hello, world!” to the console.

Code

action main()
write("Hello, world!")
fin action.

Run

Terminal window
draft run main.draft

Expected Output

Hello, world!

Explanation

  • action main() defines the program entry point
  • write(...) prints text to the console
  • fin action closes the action block

Variations

Print multiple lines:

action main()
write("Hello, Draft!")
write("Native, fast, and simple.")
fin action.

Use variables:

action main()
@greeting = "Hello, world!"
write(greeting)
fin action.