01 Installation and first use

Stardust builds from this repository with Nix. You need Git, Nix with the nix-command and flakes features enabled, and access to the repositories named by the flake inputs. The build uses pinned compiler and library versions. The Odin flake defines Linux and macOS targets for x86-64 and ARM64. Native process, stream, network and terminal services currently support Linux.

1.1. Build or install the command

From a checkout of the repository:

git clone https://git.bitflip.ai/stardustdb/mentat.git
cd mentat
nix build .#stardust
./result/bin/stardust --help

The executable is result/bin/stardust. Keep the Nix store paths reachable: this build uses the Nix runtime environment. Copying the executable alone is not a portable installation on a machine without its runtime dependencies.

To put stardust on your Nix profile's command path, run this from the checkout:

nix profile add .#stardust
stardust --help

To run without adding it to a profile, use nix run . -- --help. The stardust package installs the command-line tool. Build the shared library separately as described in Building the ABI library.

1.2. Run a DUST program

Save one expression in a file and evaluate it:

printf '(+ 20 22)\n' > hello.dust
./result/bin/stardust eval hello.dust

The result is 42. Start an interactive session with ./result/bin/stardust repl. Use the DUST reference for syntax and functions, and the command table for conversion, formatting, persistent databases and editor connections.

1.3. Build in the development shell

From the repository root:

nix develop
cd implementations/odin
task build
./build/stardust --help

task build produces the optimized, stripped CLI at implementations/odin/build/stardust relative to the repository root. The compiler uses -o:speed; this command also generates the prelude and native bridges. Use the pinned shell rather than a separately installed Odin compiler.

For an embedded application, continue with Embedding and ABI.