Complete AILANG hello world tutorial - create, check, and run
Executes a complete AILANG tutorial to create, verify, and run a hello world program.
/plugin marketplace add sunholo-data/ailang_bootstrap/plugin install sunholo-data-ailang@sunholo-data/ailang_bootstrapThis is a complete hands-on tutorial to verify AILANG works.
First, get the AILANG syntax reference:
ailang prompt | head -50
This outputs the syntax rules. The full prompt is ~200 lines - you now have AILANG syntax in context.
Create a file named hello.ail with this content:
module hello
export func main() -> () ! {IO} {
print("Hello from AILANG!")
}
ailang check hello.ail
Expected output:
→ Type checking hello.ail...
→ Effect checking...
✓ No errors found!
ailang run --caps IO --entry main hello.ail
Expected output:
→ Type checking...
→ Effect checking...
✓ Running hello.ail
Hello from AILANG!
ailang builtins list | head -10
Should show available builtin functions.
If all steps complete without errors, AILANG is working correctly.
Execute each step above in order:
ailang prompt | head -50 to verify CLI workshello.ail file with the content shownailang check hello.ailailang run --caps IO --entry main hello.ail| Command | Purpose |
|---|---|
ailang prompt | Get syntax reference |
ailang check FILE | Type-check without running |
ailang run --caps X --entry main FILE | Run with capabilities |
ailang builtins list | List available functions |
ailang examples search "query" | Find working code examples (v0.6.2+) |
ailang repl | Interactive REPL |
| Capability | When Needed |
|---|---|
IO | print, println, readLine |
FS | readFile, writeFile |
Net | httpGet, httpPost |
Clock | now, sleep |
AI | call (AI effect) |