Nabi 0.1.3 출시, 2026년 11월 22일 →

규칙은 분명하게,
나비처럼 자유롭게.

닫힌 합 타입, null 없음, 시그니처에 드러나는 에러를 갖춘 컴파일 언어.

$ curl -fsSL https://nabi.sh | sh

macOS(Apple 실리콘), Linux, FreeBSD. 또는 압축 파일.

가이드 읽기또는 브라우저에서 써 보기

컴파일러가 대신 확인하는 것

합 타입의 모든 경우

값이 i32 | str | bool이면 match는 셋을 모두 다뤄야 합니다. 하나를 빠뜨리거나 나중에 경우를 더하면, 컴파일러가 어느 갈래도 다루지 않는 경우를 짚어 줍니다.

가이드 5장: 합 타입과 none
src/main.nabi실행 ↗
fn describe(v: i32 | str | bool) -> str {
    match v {
        n: i32 => f"integer {n}",
        s: str => f"string {s}",
    }
}

fn main() {
    println(describe(true));
}
$ nabi run
   Compiling describe (.)
error[E0098]: non-exhaustive match on `bool | i32 | str`: `bool` not covered
  --> src/main.nabi:2:5
   |
 2 |     match v {
   |     ^^^^^^^^^
   |
   = help: add `x: bool => ..`
error: could not build describe (1 error, 0 warnings)
터미널의 nabi run: 이 프로그램에 대해 nabic이 알려 주는 내용

없을 수도 있는 값

null은 없습니다. 없을 수도 있는 값의 타입은 T?이고, 없을 때 어떻게 할지 코드에 적습니다. ??로 기본값을 주거나 if let으로 갈래를 나눕니다.

가이드: ??와 ?.로 기본값 주기
src/main.nabi실행 ↗
fn find(xs: List<i32>, target: i32) -> usize? {
    for i in 0..xs.len() {
        if xs[i] == target { return i; }
    }
    none
}

fn main() {
    let at: usize = find([70, 90], 90);
    println(at);
}
$ nabi run
   Compiling find (.)
error[E0040]: mismatched types: `let at` expects `usize`, found `usize | none`
  --> src/main.nabi:9:21
   |
 9 |     let at: usize = find([70, 90], 90);
   |                     ^^^^^^^^^^^^^^^^^^
   |
   = help: `find([70, 90], 90)` may be none: write `find([70, 90], 90) ?? 0`, or `if let x = find([70, 90], 90) { .. }`
error: could not build find (1 error, 0 warnings)
터미널의 nabi run: 이 프로그램에 대해 nabic이 알려 주는 내용

미리 보이는 에러

실패할 수 있는 함수는 throws로 그렇다고 밝히고, 그 함수를 부르는 곳마다 try가 붙습니다. 코드를 읽기만 해도 에러가 나올 수 있는 곳이 모두 보입니다.

가이드 10장: 에러 처리
src/main.nabi실행 ↗
fn parse_age(s: str) throws -> i32 {
    let n: i32 = try s.parse();
    if n < 0 { throw f"age {n} is negative"; }
    n
}

fn main() {
    let age = parse_age("-1");
    println(age);
}
$ nabi run
   Compiling ages (.)
error[E0062]: this call can throw `any Error` and must be marked with `try` (`try f()`; `try? f()` / `try! f()` to drop / panic on the error)
  --> src/main.nabi:8:15
   |
 8 |     let age = parse_age("-1");
   |               ^^^^^^^^^^^^^^^
error: could not build ages (1 error, 0 warnings)
터미널의 nabi run: 이 프로그램에 대해 nabic이 알려 주는 내용

패키지 쓰기

Nabi 프로젝트가 내는 패키지는 툴체인과 함께 설치됩니다. JSON과 HTTP, 표, 통계, 그래프 등이 있습니다. use를 쓰고 실행하면 nabi가 패키지를 매니페스트에 넣어 줍니다. 내려받기도 네트워크도 필요 없습니다. 레지스트리의 다른 패키지는 nabi add <이름> 한 줄이면 됩니다.

main.nabi
use json::parse;

let v = try parse("{\"lang\": \"nabi\", \"year\": 2026}");
println(v.get("lang")?.as_str() ?? "");
$ nabi run main.nabi
       Added json ^0.1 (official)
nabi
터미널의 nabi run: json이 공식 패키지로 추가되고, 프로그램이 nabi를 출력합니다

읽어 볼 프로그램

완성된 프로그램 21개. 문서를 검사할 때마다 하나하나 빌드하고 실행합니다.

예제 21개 모두 보기

설치

툴체인 하나에 다 들어 있습니다. 자체 코드 생성기와 링커를 갖춘 컴파일러, 패키지 도구, REPL, Jupyter 커널, 언어 서버, 공식 패키지. 따로 설치할 것이 없습니다.

# macOS (Apple silicon), Linux, FreeBSD
curl -fsSL https://nabi.sh | sh

# Windows (x64, arm64), PowerShell에서
powershell -ExecutionPolicy Bypass -c "irm https://nabi.sh/install.ps1 | iex"

# Nix
nix profile install github:nabi-lang/nabi
0.1.3 압축 파일
macOSaarch64-apple-darwinApple 실리콘.tar.xz24 MB
Windowsx86_64-pc-windows-msvcx64, Windows 11.zip70 MB
Windowsaarch64-pc-windows-msvcarm64, Windows 11.zip68 MB
Linuxx86_64-unknown-linux-gnuglibc 2.34 이상.tar.xz26 MB
Linuxaarch64-unknown-linux-gnuglibc 2.34 이상.tar.xz24 MB
Linuxx86_64-unknown-linux-musl정적 링크, 모든 배포판.tar.xz26 MB
Linuxaarch64-unknown-linux-musl정적 링크, 모든 배포판.tar.xz24 MB
FreeBSDx86_64-unknown-freebsdFreeBSD 14 이상.tar.xz26 MB

체크섬, 다른 형식, 교차 컴파일 대상: 내려받기.

0.1.3의 새 기능

2026년 11월 22일

발표 전체 변경 기록
  • nabi audit reads nabi.lock and reports each pinned package that a packages.nabi-lang.org advisory affects, with the advisory ID, summary, severity and the version to update to (for example nabi update json). It exits 0 when nothing is affected, 1 when something is, and 2 when it cannot check, so CI can run it as a gate.
  • --json prints machine-readable output, --ignore <ID> skips an advisory, and --offline uses only the cached advisory list. The list is cached for an hour; without a network, an older cache is used with a warning. Path and git dependencies are skipped and listed as not checked.