Tooling Overview
The Nic compiler (nicc) provides a complete development toolchain for building, running, and debugging Nic programs.
Quick Reference
| Command | Description |
|---|---|
nicc build | Build a project from nic.toml |
nicc run | Build and run (JIT by default) |
nicc new <name> | Create a new project |
nicc init | Initialize project in current directory |
nicc lsp | Start Language Server Protocol server |
nicc bindgen | Generate 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 buildThis creates:
myproject/
├── nic.toml # Project configuration
└── src/
└── main.nic # Entry pointRun Your Project
bash
# JIT compilation (fast, default)
nicc run
# Native compilation
nicc run --build
# Pass arguments to your program
nicc run -- arg1 arg2Single-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.nicInstallation
The Nic compiler and standard library are installed via:
bash
make installThis installs:
- The
niccexecutable to your PATH - Standard library to
~/.nicc/std/ - Prelude to
~/.nicc/prelude.nic
Verify Installation
bash
nicc --version
ls ~/.nicc/std/In This Section
- CLI Commands - Complete command reference
- Project Configuration - nic.toml format and options
- C Bindings (bindgen) - Generate Nic FFI from C headers
- Debugging - Parser tracing, error formats, inspection flags
- Editor Support (LSP) - IDE integration and features
Environment Variables
| Variable | Description |
|---|---|
NIC_STD_PATH | Override standard library location (root containing std/) |
NICC_LSP_DEBUG | Enable LSP debug logging (1 to enable) |
Development Workflow
- Create project:
nicc new myproject - Edit code: Use VS Code with Nic extension for syntax highlighting and LSP
- Build:
nicc build(or justnicc runfor quick iteration) - Debug: Use
--ast,--sast,--llvmflags to inspect compilation stages - Profile: Use
--debugfor parser tracing