Hello World
Run a Calor program without an AI subscription or a project file. Then inspect the generated C# in an optional console project. Agent integration is optional.
Prerequisites
Install the .NET 10 SDK (not just the runtime), then install Calor:
dotnet tool install -g calor
Make sure calor --version works in your terminal. If it does not, follow the
tool PATH troubleshooting steps.
The commands below work in a terminal on macOS or Linux; the one file-removal
command has a PowerShell alternative.
Create a new directory
Start in an empty directory, separate from any existing application:
mkdir HelloCalor
cd HelloCalor
Save your source
Save this exact text in a UTF-8 file named Program.calr inside HelloCalor:
§M{m001:HelloApp}
§F{f001:Main:pub} () -> void
§E{cw}
§P "Hello from Calor!"
§M declares the module, §F declares Main, and §E{cw} declares console
output. The indented §P statement prints the message.
Run without a project
calor run Program.calr
Expected program output:
Hello from Calor!
calor run compiles the file and builds a managed workspace before executing
it. This is the shortest first-run path; no calor init or agent edits are needed.
Optional: inspect a .NET project
In the same new HelloCalor directory, create a console project:
dotnet new console --name HelloApp --output .
The template creates a top-level Program.cs that prints Hello, World!.
Remove only that freshly generated template file before adding Calor's
entry point. Otherwise .NET runs the template instead of your Calor Main.
Do not delete an existing application's entry point: adopt Calor through
existing-project integration instead.
On macOS or Linux:
rm Program.cs
In PowerShell, use Remove-Item Program.cs instead.
Generate C# and run the console project:
calor --input Program.calr --output Program.g.cs
dotnet run --no-launch-profile
The program prints exactly Hello from Calor!, as in the standalone path.
Open Program.g.cs to inspect the emitted C#. This manual example deliberately
does not use calor init: after changing Program.calr, rerun the compiler
command before dotnet run.
For automatic MSBuild compilation, use calor init instead of maintaining a
manual generated file. Remove only the Program.g.cs generated by this example
before switching, to avoid compiling the same entry point twice.
Optional: integrate an agent
Once your program runs, choose an agent integration. You can use Claude, Codex, Gemini, GitHub Copilot, or continue without an agent. Review generated code and contracts regardless of which tool wrote them.
Next Steps
- Syntax Reference — understand modules, functions, types, and contracts.
- Existing project setup — automate Calor compilation with MSBuild.
- CLI Reference — explore compilation, execution, and optional verification.