Complete Reference

nlangDocumentation

Master nlang programming with our comprehensive guide. From syntax basics to advanced memory safety, learn how to write expressive, safe, and performant code.

Complete Guide
Code Examples
Interactive

Documentation

Complete nlang reference

Introduction

Language Basics

Data Structures

Libraries

Advanced

Overview

nlang is a modern systems programming language that combines Python-like syntax with Rust-like safety features. It compiles to native machine code using LLVM and provides zero-cost abstractions with memory safety.

Examples

Hello World

Your first nlang program

import std;

def main() {
    store message = "Hello, World!";
    println(message);
    println("Welcome to nlang programming!");
}

This demonstrates the basic structure of an nlang program with imports, functions, variable declaration, and output.

Quick Example

A more comprehensive example

import std;

def greet(name: string) {
    print("Hello, ");
    print(name);
    println("!");
}

def main() {
    greet("nlang developer");
    store year = 2024;
    println("Welcome to nlang in ", year);
}

Shows function definitions, type annotations, and basic string manipulation.

Important Notes

  • All nlang programs start with 'import std' to access standard library functions
  • Variables are declared with the 'store' keyword
  • Functions are defined with 'def' keyword