Quick Start
This guide walks through the fastest ways to get useful output from Arden.
The goal is not just to run one file, but to understand the normal workflow shape:
- run a single file
- inspect it with
check,fmt, andprofile - create a project
- move into project-aware
info,test, andbuild
1. Run A Single File
Create hello.arden:
import std.io.*;
function main(): None {
println("Hello, Arden!");
return None;
}
Run it:
arden run hello.arden
Useful companion commands:
arden check hello.arden
arden compile hello.arden
arden fmt hello.arden
arden lint hello.arden
arden profile hello.arden
What each one is for:
runbuilds and executes the filecheckstops before native code generationcompileemits a native artifact without running itfmtnormalizes formattinglintreports static findingsprofilegives a one-run timing summary
2. Look At A Slightly Larger Program
Once the hello-world path works, try something with a loop and state:
import std.io.*;
function main(): None {
name: String = "Arden";
mut counter: Integer = 0;
println("Starting count for {name}...");
while (counter < 5) {
counter += 1;
println("Count: {counter}");
}
println("Done!");
return None;
}
Run it:
arden run program.arden
If you want more than this, jump straight to:
examples/04_control_flow.ardenexamples/10_ownership.ardenexamples/14_async.arden
Reference index:
3. Create A Project
arden new my_project
cd my_project
arden run
That generates:
arden.tomlsrc/main.ardenREADME.md
Inspect the resolved config:
arden info
At that point you are using project mode rather than ad-hoc single-file compilation.
4. Understand arden.toml
The generated project config is the source of truth for:
- project name and version
- entry file
- full source file list
- output file name
- optimization level
- output kind
Minimal example:
name = "my_project"
version = "0.1.0"
entry = "src/main.arden"
files = ["src/main.arden"]
output = "my_project"
opt_level = "3"
output_kind = "bin"
As you add files, update files = [...] explicitly. Arden project mode does not rely on vague directory scanning.
Reference:
5. Pass Program Arguments
arden run forwards trailing arguments to the compiled program.
arden run hello.arden one two three
Inside Arden, read them with:
Args.count()Args.get(index)
Reference:
6. Use The Built-In Tooling
Arden bundles several common workflows:
arden fmt .
arden fix src/main.arden
arden test
arden bench hello.arden --iterations 5
arden bindgen sample.h -o bindings.arden
That matters because once you are in a project you do not need separate unrelated wrappers for formatting, testing, and simple performance checks.
Reference:
7. Use A Shebang Script
On Unix-like systems:
#!/usr/bin/env arden
import std.io.*;
function main(): None {
println("hello");
return None;
}
This is useful for quick tooling scripts where creating a whole project would be overkill.
8. Common First-Day Workflow
A realistic first session often looks like this:
arden new scratchpad
cd scratchpad
arden info
arden run
arden check --timings
arden test
arden build --release
That sequence exercises the main project commands without requiring any extra repo-specific setup.
If Something Fails Early
The most common setup problems are toolchain related:
- LLVM or Clang missing
- linker mismatch (
moldon Linux,lldon macOS/Windows) ardennot on your shell path yet
Use:
arden --help
arden info
and compare your machine against: