Open Source · v6.0 Stable

Code in the
Language of Nepal

NeLang is an open-source programming language with Nepali-inspired keywords, Python-like syntax, and a lightweight bytecode interpreter. Built for education, localization, and cultural accessibility.

14+ Keywords
v6.0 Latest Stable
pip Install Method
.nl File Extension
main.nl
karya main():
    name = lina("Enter your name: ")

    yadi name != "":
        lekha("Namaste", name)
    tyasovaye:
        lekha("Hello World")

main()
NeLang Logo

About NeLang

NeLang is an open-source programming language that maps native Nepali keywords onto a Python-powered bytecode compiler engine. It preserves Python's clean, indentation-based structure while replacing English keywords with culturally meaningful Nepali equivalents.

Core Philosophy: Programming logic is universal, but syntax should feel close to home. NeLang lowers the barrier to entry for Nepali-speaking learners and developers by making code read like their native language.

Did you know? NeLang compiles to Python bytecode under the hood, meaning it's compatible with Python's standard library and runs with the same performance characteristics.

Installation

Install NeLang globally via pip. Requires Python 3.8 or higher. The installer registers a global nelang command.

1
Install via pip
bash
pip install nelang
2
Create your first file
bash
touch hello.nl
3
Run your script
bash
nelang run hello.nl

System Support

NeLang runs on all major operating systems. Requires Python 3.8+ installed as a dependency.

Windows 10/11
macOS 11+
Linux (Ubuntu, Debian, Arch)
RequirementMinimumRecommended
Python3.83.11+
pip21.0Latest
VS Code ExtensionOptionalRecommended

Keywords Reference

All NeLang keywords map directly to Python equivalents. The table below shows each keyword, its Python counterpart, and meaning.

NeLangPythonMeaningCategory
karyadeffunction / actionFunctions
firtareturnreturn / give backFunctions
yadiifif / in caseControl Flow
tyasovayeelseotherwiseControl Flow
jabawhilewhile / as long asControl Flow
lagiforfor / iterateControl Flow
vitraininside / withinControl Flow
lekhaprintwrite / outputI/O
linainputtake / receiveI/O
lyaauimportbring / fetchModules
satyaTruetrue / correctBoolean
jhutoFalsefalse / wrongBoolean
raandand / alsoLogical
waoror / eitherLogical
hoinanotnot / negativeLogical

Variables & Types

Variables in NeLang are dynamically typed — no declaration keyword needed. Assign any value using =. NeLang supports integers, floats, strings, booleans, and lists.

Variables
x = 10
name = "Sagarmatha"
pi = 3.14
Print lekha
lekha("Hello")
lekha("Val:", x)
Input lina
name = lina("Enter: ")
Lists
nums = [1, 2, 3]
items = ["a", "b"]
Boolean
active = satya
done = jhuto
Comments
# yo comment ho
# This is a comment

Conditionals

Use yadi (if) and tyasovaye (else) to control execution flow. Indentation defines the block scope — no braces needed.

nelang
x = 10

yadi x > 5:
    lekha("Thulo")     # Greater
tyasovaye:
    lekha("Sano")      # Smaller
Tip: Logical operators ra (and), wa (or), and hoina (not) can be chained inside condition expressions.

Loops

NeLang supports two loop constructs: jaba (while) for condition-based iteration and lagi...vitra (for...in) for traversing lists.

nelang — while loop
x = 0
jaba x < 5:
    lekha(x)
    x = x + 1
nelang — for loop
nums = [10, 20, 30]
lagi n vitra nums:
    lekha(n)

Functions

Define reusable blocks using karya. Return values with firta. Functions support parameters and can call each other recursively.

nelang
karya multiply(a, b):
    firta a * b

result = multiply(4, 5)
lekha(result)   # 20

Code Examples

Real-world programs demonstrating NeLang's capabilities from beginner to intermediate level.

Hello World

nelang
name = "Sagarmatha"
lekha("Mount:", name)

List Iteration

nelang
nums = [10, 20, 30]
lagi number vitra nums:
    lekha("Item:", number)

Function with Return

nelang
karya multiply(a, b):
    firta a * b

result = multiply(4, 5)
lekha(result)

Real-World: Circle Area with Math Module

nelang
lyaau math

karya compute_circle_area(radius):
    yadi radius <= 0:
        lekha("Invalid radius")
        firta 0
    tyasovaye:
        firta math.pi * math.pow(radius, 2)

r = 5
lekha("Area:", compute_circle_area(r))

Interactive: Name Greeter

nelang
karya greet():
    name = lina("Tapai ko naam ke ho? ")
    yadi name != "":
        lekha("Namaste,", name)
    tyasovaye:
        lekha("Yo naam ho?")

greet()

CLI Commands

NeLang's CLI provides a clean interface for running scripts, inspecting version info, and debugging output.

nelang run <file.nl>
Compiles and executes a .nl source file. Supports the --debug flag to print AST nodes and intermediate token stream.
nelang run --debug <file.nl>
Runs the file with debug mode enabled — prints token stream, AST, and runtime trace to stdout.
nelang version
Outputs the installed NeLang version string and build metadata from the pip package manifest.
nelang help
Prints a formatted help manual listing all available subcommands with usage examples.

Features

Nepali-Inspired Keywords
Every control structure and builtin maps to a Nepali word, making code naturally readable to Nepali speakers.
Python-like Syntax
Indentation-based blocks, no semicolons, and familiar structure. If you know Python, you'll feel right at home.
Bytecode Compiled
NeLang compiles directly to Python bytecode — zero tree-walking overhead. Fast execution with no intermediary interpreter lag.
Standard Library Access
Use lyaau to import any Python standard library module (math, random, os) directly in NeLang scripts.
VS Code Extension
Syntax highlighting, color themes, and editor support available as a VS Code extension. Shipped in v6.0.
Education-First Design
Designed to lower cognitive load for Nepali-speaking learners entering programming for the first time.

Roadmap

Upcoming features planned for NeLang's future releases.

VS Code Extension with syntax highlighting v6.0 ✓
Classes and object-oriented programming support
Extensible module registry and package definitions
Official remote package manager (NePak)
Error messages displayed in Nepali language