Quick Start
Get hica running and compile your first program in a few minutes.
Prerequisites
Install Koka version 3.2 or newer.
Install hica
Linux / macOS / Chromebook
curl -fsSL https://cladam.github.io/hica/install.sh | sh
This downloads the latest release binary and installs it to ~/.local/bin.
Make sure that directory is on your PATH.
To install elsewhere:
curl -fsSL https://cladam.github.io/hica/install.sh | HICA_INSTALL_DIR=/usr/local/bin sh
Windows (PowerShell)
irm https://cladam.github.io/hica/install.ps1 | iex
This installs hica to %LOCALAPPDATA%\hica and adds it to your user PATH.
Override the install directory with $env:HICA_INSTALL_DIR.
Verify the installation:
hica --version
Build from source
git clone https://github.com/cladam/hica.git
cd hica
koka -O2 -ilib/klap -isrc src/main.kk -o hica
chmod +x hica
./hica --version
Run Your First Programs
Create hello.hc:
fun main() {
println("Hello, world!")
}
Then build and run it:
./hica run hello.hc
Output:
Hello, world!
run transpiles the file to Koka, compiles it, and executes the result.
CLI Commands
| Command | Description |
|---|---|
hica run <file> |
Compile and run a .hc file |
hica build <file> |
Compile a .hc file and build a binary |
hica check <file> |
Analyse a .hc file and report errors |
hica fmt <file> |
Format a .hc file according to the style guide |
hica clean |
Remove generated build artifacts |
hica new <name> |
Create a new hica project |
hica init |
Initialise a project in the current directory |
hica help <command> |
Show help for a command |
Short aliases work too: hica r, hica b, hica c, hica f.
Use --check with fmt to verify formatting without changing the file (exits 1 if changes needed):
hica fmt --check hello.hc
Try the Examples
The repo ships with ready-to-run examples:
./hica run examples/hello.hc
./hica run examples/fizzbuzz.hc
./hica run examples/pipe.hc
./hica run examples/match.hc
./hica run examples/closures.hc
Multi-file Projects
Split code across files with import. Mark shared functions with pub:
// helpers.hc
pub fun double(x) => x * 2
// main.hc
import "helpers"
fun main() {
println(double(5))
}
See the Language Reference for selective imports and re-exporting.
Next Steps
- Learn hica: 36 standalone programs, each teaching one concept. Run them, modify them, break them.
- Language Reference: every syntax detail, for when you need the precise rules.
- Standard Library: all built-in functions covering strings, lists, math, and more.