Skip to content

Tooling Overview

The Nic compiler (nicc) provides a complete development toolchain for building, running, and debugging Nic programs.

Quick Reference

CommandDescription
nicc buildBuild a project from nic.toml
nicc runBuild and run (JIT by default)
nicc new <name>Create a new project
nicc initInitialize project in current directory
nicc lspStart Language Server Protocol server
nicc bindgenGenerate Nic bindings from C headers
nicc <file.nic>Compile single file (legacy mode)

Getting Started

Create a New Project

bash
nicc new myproject
cd myproject
nicc build

This creates:

myproject/
├── nic.toml      # Project configuration
└── src/
    └── main.nic  # Entry point

Run Your Project

bash
# JIT compilation (fast, default)
nicc run

# Native compilation
nicc run --build

# Pass arguments to your program
nicc run -- arg1 arg2

Single-File Mode

For quick experiments without a project:

bash
# Compile to executable
nicc myfile.nic -c -o myprogram
./myprogram

# Inspect AST/SAST/LLVM
nicc --ast myfile.nic
nicc --sast myfile.nic
nicc --llvm myfile.nic

Installation

The Nic compiler and standard library are installed via:

bash
make install

This installs:

  • The nicc executable to your PATH
  • Standard library to ~/.nicc/std/
  • Prelude to ~/.nicc/prelude.nic

Verify Installation

bash
nicc --version
ls ~/.nicc/std/

In This Section

Environment Variables

VariableDescription
NIC_STD_PATHOverride standard library location (root containing std/)
NICC_LSP_DEBUGEnable LSP debug logging (1 to enable)

Development Workflow

  1. Create project: nicc new myproject
  2. Edit code: Use VS Code with Nic extension for syntax highlighting and LSP
  3. Build: nicc build (or just nicc run for quick iteration)
  4. Debug: Use --ast, --sast, --llvm flags to inspect compilation stages
  5. Profile: Use --debug for parser tracing

See Also

Released under the MIT License.