Hello World
Hello World
Section titled “Hello World”Write and run your first Jac program in 2 minutes.
Your First Program
Section titled “Your First Program”Create a file named hello.jac:
with entry { print("Hello, World!");}Run it:
jac hello.jacOutput:
Hello, World!Congratulations! You just wrote your first Jac program.
Understanding the Code
Section titled “Understanding the Code”with entry { print("Hello, World!");}| Part | Meaning |
|---|---|
with entry | The program’s starting point (like main() in other languages) |
{ } | Code block (Jac uses braces, not indentation) |
print() | Built-in function to output text |
; | Statement terminator (required in Jac) |
Run a Full-Stack App
Section titled “Run a Full-Stack App”Want to go beyond a single file? Jac can scaffold a complete full-stack application in one command.
With the jac-client plugin installed, run:
jac create example --use fullstackcd examplejac addjac start main.jacThis creates a full-stack project with a Jac backend and a React frontend, ready to go at http://localhost:8000.
Run Community Jacpacks
Section titled “Run Community Jacpacks”Jacpacks are ready-made Jac project templates you can spin up instantly. Since --use accepts a URL, you can run any jacpack directly from GitHub:
jac create my-todo --use https://raw.githubusercontent.com/jaseci-labs/jacpacks/main/multi-user-todo-app/multi-user-todo-app.jacpackcd my-todojac addjac start main.jacHere are some jacpacks to try:
| Jacpack | Description |
|---|---|
multi-user-todo-app | Full-stack authenticated todo application |
multi-user-todo-meals-app | Todo app + AI meal planner powered by Jac’s AI integration |
AI_Study_Helper | Educational platform with specialized AI agents |
TasteTalk | Restaurant feedback management system |
jac-gpt | Documentation assistant for the Jac language |
jac-playground | Browser-based Jac code editor |
Algo | Voice-enabled personal AI assistant |
Want to try one with AI built in? The multi-user-todo-meals-app uses Jac’s AI integration features to generate smart shopping lists with costs and nutritional info. It works out of the box with an Anthropic API key:
export ANTHROPIC_API_KEY="your-key-here"jac create meals-app --use https://raw.githubusercontent.com/jaseci-labs/jacpacks/main/multi-user-todo-meals-app/multi-user-todo-meals-app.jacpackcd meals-appjac addjac start main.jacTo use any of the other jacpacks, just swap the URL:
jac create my-app --use https://raw.githubusercontent.com/jaseci-labs/jacpacks/main/<jacpack-name>/<jacpack-name>.jacpackNext Steps
Section titled “Next Steps”Ready for something more substantial?
- Core Concepts - Codespaces, OSP, and compiler-integrated AI
- Build Your First App - Build a complete full-stack AI app in Jac
- byLLM Quickstart - Integrating AI in your Jac code.
- Jac vs Traditional Stack - See how Jac compares side-by-side
- Next Steps - Choose a learning path based on your goals