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
draft run main.draftExpected Output
Hello, world!Explanation
action main()defines the program entry pointwrite(...)prints text to the consolefin actioncloses 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.