Profile
Back to NewsBack
GitHub Trending 3 min
Reader Mode
ballerina-nutcracker/ballerina: Native Ballerina Interpreter

ballerina-nutcracker/ballerina: Native Ballerina Interpreter

20 hours ago

Ballerina Nutcracker

A native interpreter for the Ballerina programming language.

Release</a> Native CI</a> codecov</a> License</a> Discord</a>

Website  ·  Playground  ·  Language spec  ·  Developing  ·  Architecture  ·  Roadmap


Ballerina is an open-source, cloud-native programming language optimized for integration, with built-in support for JSON and XML, first-class constructs for services and concurrency, and structural typing. It is developed and supported by WSO2 and the wider Ballerina community. Try the language in your browser on the Ballerina Playground.

Ballerina Nutcracker compiles Ballerina source to Ballerina Intermediate Representation (BIR) and interprets the BIR directly. Written in Go, it ships as one bal binary — no separate runtime, nothing to warm up — which keeps startup fast and the footprint small for short-lived cloud-native workloads such as CLIs, functions, and sidecars.

[!IMPORTANT]
Nutcracker is under active development and does not yet support the whole language. For production use today, reach for Ballerina Swan Lake — the official distribution, which supports the full language.

Architecture

!Ballerina Nutcracker architecture: the bal CLI (new, run, pack, build, push, version) is the entry point. parser/ produces st/; nodebuilder/ produces ast/. semantics/ resolves types; desugar/ and birgen/ lower to BIR. The runtime interprets BIR. Native stdlib uses extern calls; pure-Ballerina modules run as BIR. PAL is platform/pal; palnative is on the host OS and pal_wasm.go on the browser. The central cache is the on-disk default for dependency resolution; bal push writes the local repository.

Almost everything that ships in the bal binary is a Go package. The central cache, the local repository, the host OS, and the browser sit outside it. See ARCHITECTURE.md for how the diagram maps onto source directories.

Getting started

Download a binary from the latest release, or build from source with Go 1.27 or later:

git clone https://github.com/ballerina-nutcracker/ballerina.git
cd ballerina
go build -o bal ./cli/cmd

Create and run your first program:

./bal new hello
./bal run hello
import ballerina/io;

public function main() { io:println("Hello, World!"); }

| Command | Description | | --- | --- | | bal new | Create a new package (-t