Getting Started

Install and compile NaC in minutes. Start building amazing things.

1 Prerequisites

Before installing NaC, make sure you have the following:

💡 Quick Check: Run gcc --version to verify your GCC installation.

2 Download NaC

Clone the repository from GitHub:


git clone https://github.com/naclang/nac.git
cd nac

3 Compile the Interpreter

Compile the NaC interpreter using GCC:

Platform-Specific Instructions

Windows (MinGW / MSYS2)

# Using MinGW
gcc -o nac.exe nac.c -lm -lwinhttp

# Add to PATH (optional)
set PATH=%PATH%;C:\path\to\nac


Linux / macOS

# Compile
gcc -o nac nac.c -lm -lcurl

# Make executable
chmod +x nac

# Optional: Install system-wide
sudo cp nac /usr/local/bin/

4 Verify Installation

Run your first NaC program:


./nac examples/test.nac
✅ Success! If you see the output, NaC is working correctly.

5 Try More Examples

Explore the examples directory for more sample programs:


# Factorial calculation
./nac examples/factorial.nac

# Number guessing game
./nac examples/guess.nac

# Prime number check
./nac examples/prime.nac

# Fibonacci sequence
./nac examples/fibonacci.nac

# HTTP example
./nac examples/http.nac

# Array operations
./nac examples/arrays.nac

# Sorting algorithm
./nac examples/bubble_sort.nac

Compilation Options

Advanced compilation options for optimization:

Debug Build

gcc -g -o...

Optimized Build

gcc -O3...

Static Build (Portable)

gcc -static...

Troubleshooting

Common Issues

Error: "undefined reference to 'sqrt'"
Solution: Make sure to include the -lm flag when compiling.
Error: "gcc: command not found"
Solution: Install GCC using your package manager:
• Ubuntu/Debian: sudo apt install build-essential
• Fedora: sudo dnf install gcc
• macOS: xcode-select --install
Error: "Permission denied"
Solution: Run chmod +x nac to make the binary executable.

Next Steps

Now that you have NaC installed, here's what to do next:

Read Full Documentation →