Getting started
Install Iris, create your first workspace, and run a small command-line application with Node.js.
Before you begin
You’ll need Node.js 22.5.0 or later (with npm), Git, and an internet connection for your first workspace and build.
Iris uses Spago to resolve and download PureScript packages. Install it and check that your tools are available:
npm install --global spago@1.0.4node --versionv22.23.3git --versiongit version 2.55.0spago --version1.0.4The outputs in this guide are examples. Versions and Registry package sets may differ on your machine.
You don’t need to install the official purs compiler. Iris compiles your code and supplies the compatibility shim Spago needs.
Install Iris
Run the installer for your platform. It downloads the latest stable Iris release.
curl -fsSL https://iris-lang.com/install.sh | shUse “Show source” to inspect the script before running it. Then make sure the installation directory is on your PATH and check the compiler:
iris --versioniris 0.1.5A GitHub CLI (gh) with attestation support lets the installer verify release provenance. Without it, the installer warns and continues without verification.
To install a particular release or choose another directory, see Installation.
Create a workspace
Create an empty directory outside any existing Spago workspace, then initialize it. iris new works in the current directory and uses its name for your package.
mkdir hello-iriscd hello-irisiris newCreated package `hello-iris` with package set 81.3.0.
Run `iris build` to get started.Iris asks Spago for a compatible Registry package set and creates these files:
spago.yaml— your package’s dependencies and pinned Registry package set. The starter includes prelude, effect, and console.src/Main.purs— your application’s main module.test/Test/Main.purs— a starter test module..gitignore— keeps generated output and package caches out of Git.
Run the remaining commands from hello-iris.
Write your program
Open src/Main.purs in your editor and replace the generated contents with:
module Main where import Prelude import Effect (Effect)import Effect.Console (log) main :: Effect Unitmain = do log "Hello, Iris!"Main is the default entry-point module. The imports bring in the standard Prelude, the Effect type, and the console’s log function.
main :: Effect Unit says that main performs effects without returning a useful value. The do block contains the action that prints your greeting.
Compile your workspace
Save your file and compile the workspace:
iris buildReading Spago workspace configuration...
✓ Selecting package to build: hello-iris
Downloading dependencies...
No lockfile found, generating it...
Lockfile written to spago.lock. Please commit this file.Spago fetches the dependencies, then Iris type-checks and compiles your source to JavaScript in output/. Your main module becomes output/Main/index.js. The first build needs network access; later builds reuse cached packages and incremental compiler results.
Run your application
Run the application with Node.js:
iris runReading Spago workspace configuration...
✓ Selecting package to build: hello-iris
Downloading dependencies...
Hello, Iris!iris run builds the workspace before calling the main function in Main. Your greeting appears after the build messages.
That’s your first Iris application. Change the greeting, save the file, and run iris run again to compile and execute the change.
Where to go next
- Set up your editor. Install the VS Code extension or connect another editor to the Iris language server.
- Keep compiling as you edit. Run
iris watchin another terminal to rebuild on save. It compiles changes but doesn’t rerun your application. - Explore the CLI. Run
iris --helporiris run --helpto see available commands and options. - Find a library. Browse packages, modules, and type signatures on Pursuit.