Skip to content

Repository files navigation

NepaliCode banner

🇳🇵 NepaliCode

A Nepali-first programming language and mobile developer workspace.
Learn, write, run, debug, and explore NepaliCode programs from a focused Android IDE.

Latest release Workflow status MIT License GitHub stars

Animated NepaliCode mobile IDE showcase

NepaliCode is an open-source project led by Diwas Khatri and the NepaliSource community. It combines a Nepali-inspired language, an evolving runtime, and a modern Android coding environment designed for learners, makers, and contributors.

✨ Why NepaliCode?

Programming should feel approachable in the language people think in. NepaliCode keeps familiar programming ideas while introducing a clean, Nepali-inspired syntax layer. The long-term goal is not a keyword-only translation of another language; it is a genuine language and developer ecosystem with its own runtime, tools, documentation, and learning experience.1

The current Android application brings that idea to a mobile-first workflow: edit .np files, run programs in a terminal-style REPL, inspect diagnostics, browse files, explore packages, and learn through examples without leaving the app.

🚀 Highlights

Area What NepaliCode brings
Nepali-first language Readable keywords such as yedi, natra, kaam, firta, lyau, and ko_lagi, alongside familiar programming concepts.
Mobile IDE Kotlin + Jetpack Compose interface with editor, project files, terminal/REPL, guide, package manager, and web/automation surfaces.
Language engine Lexer, parser, AST, interpreter, runtime values, environment handling, linting, tokenization, highlighting, and completion foundations.
Developer workflow Project scripts, file operations, syntax-aware editing, diagnostics, themes, and a focused dark developer UI.
Growing ecosystem Planned CLI, NPPM package manager, HTTP/API tools, browser automation, database APIs, formatter, linter, debugger, LSP, and NepaliCode Studio.
Learning by doing Small examples, visible runtime output, helpful errors, and a language design that welcomes experimentation.

📱 Mobile IDE showcase

The repository now includes the supplied mobile screenshots as versioned local assets, so the README remains stable even if external image hosting changes. The animated preview above cycles through the same screens in a compact GIF.

1. Terminal and HTTP response

The terminal view shows a NepaliCode program making an HTTP request, printing a successful response, parsing a title, and returning to the REPL for the next expression.

NepaliCode terminal showing an HTTP response and REPL

2. API demo workflow

The API demo runs nepali api_demo.np, reports an HTTP 200 response, prints the response body, and exposes the parsed result directly inside the mobile terminal.

NepaliCode API demo running in the mobile terminal

3. Editor and REPL workspace

The editor workspace keeps source code, the Nepali Terminal & REPL, suggestion chips, and the bottom navigation in one compact flow for mobile development.

NepaliCode mobile editor and REPL workspace

4. Diagnostics that teach

The mobile IDE surfaces syntax errors close to the failing program and pairs them with a direct suggestion, helping beginners understand what to fix instead of hiding the failure behind a generic crash.

NepaliCode syntax diagnostics in the mobile IDE

5. NPPM package manager

The NPPM screen presents NepaliCode packages such as anurodh, web, browser, automation, and database with version and installation state visible at a glance.

NepaliCode NPPM package manager with installed packages

🌟 Latest mobile features

The latest mobile build extends NepaliCode beyond the editor and REPL with a more complete learning and automation workspace. The new screens document the features that contributors can explore in the Android app.

Animated showcase of the latest NepaliCode mobile features

Feature What is now documented in the mobile UI
Command palette and actions Searchable actions for saving the active file, creating a new .np file, deleting source files, and AI-assisted actions such as Explain Code and Optimize & Modernize.
Code Examples & Demos Guided examples for object-oriented classes, CSV and filesystem work, security hashing, and nepali.toml project configuration.
High-density editor A mobile-first editor with tabs, run controls, syntax-aware source editing, quick symbol/operator keys, terminal access, and the Code, Web/Auto, Files, NPPM, and Guide destinations.
HTTP and automation The in-app direction combines the anurodh HTTP interface with browser automation workflows and visible terminal output.
NPPM package manager Package cards and dependency metadata connect the mobile workspace to nepali.toml, standard-library modules, and the wider NepaliCode ecosystem.
Syntax Reference A built-in guide credits Diwas Khatri, explains dual Nepali/English syntax, maps keywords such as kaamdef, and describes the compiler/tokenizer, HTTP Anurodh, browser automation, and SQLite direction.

1. Mobile editor and command palette

The action palette makes common mobile workflows discoverable: save the active file, create a new .np source file, remove a source file, and explore AI-assisted code explanations or modernization actions.

NepaliCode mobile editor with searchable command palette

2. Code Examples & Demos

The examples catalog turns the mobile app into a guided learning surface with focused scripts for kakshya classes, CSV and filesystem operations, suraksha cryptography, and nepali.toml project manifests.

NepaliCode Code Examples and Demos dialog

3. Editor and terminal workflow

The editor keeps source code, run controls, the Nepali terminal, quick-input keys, and bottom navigation close together so a learner can move from code to output without leaving the mobile workspace.

NepaliCode editor and terminal workflow

4. Source execution state

This screen documents the run-oriented editor state: a selected .np file, the high-density code surface, execution controls, and the terminal/navigation shell used to inspect program results.

NepaliCode source execution and output screen

5. Package management

NPPM presents packages and dependency metadata in a mobile-friendly card layout. The package workflow is designed to connect installed modules with a project’s nepali.toml manifest.

NepaliCode NPPM package manager screen

6. NepaliLang Syntax Reference

The built-in reference screen documents the project identity and language philosophy. It identifies Diwas Khatri as lead developer, describes the .np language as a dual Nepali/English syntax experience, and highlights the compiler/tokenizer, HTTP Anurodh, browser automation, and SQLite engine direction.

NepaliCode Syntax Reference guide credited to Diwas Khatri

🧪 Language examples

A small program is intentionally familiar:

a = 3
b = 4

c = a + b

print(c)
7

Nepali-inspired control flow stays readable while preserving a conventional block structure:

yedi age >= 18:
    print("Adult")
natra:
    print("Minor")

Functions and loops use the same approachable vocabulary:

kaam jod(a, b):
    firta a + b

print(jod(10, 20))

ko_lagi i ma range(1, 6):
    print(i)

🇳🇵 नेपाली Quick Start Tutorial

यो छोटो tutorial ले NepaliCode मा पहिलो .np program कसरी बनाउने, चलाउने, र विस्तार गर्ने भनेर देखाउँछ। NepaliCode अहिले alpha चरणमा भएकाले केही command र module हरू experimental वा planned हुन सक्छन्।1

१. Project तयार गर्नुहोस्

पहिले NepaliCode project को folder बनाउनुहोस् र एउटा main.np file सिर्जना गर्नुहोस्:

mkdir mero-project
cd mero-project
touch main.np

यदि package workflow प्रयोग गर्न चाहनुहुन्छ भने NPPM बाट project सुरु गर्न सक्नुहुन्छ:

nppm init

२. पहिलो program लेख्नुहोस्

main.np मा तलको code राख्नुहोस्। print() ले terminal मा message देखाउँछ।

naam = "नेपाल"
print("नमस्ते", naam)

३. Program चलाउनुहोस्

Project folder बाट .np file चलाउनुहोस्:

nepali run main.np

अपेक्षित output:

नमस्ते नेपाल

Interactive प्रयोगका लागि REPL खोल्न सकिन्छ:

nepali repl

४. Variable र गणना प्रयोग गर्नुहोस्

NepaliCode मा variable assignment सरल छ। ganit जस्तो standard-library module प्रयोग गर्ने direction पनि project notes मा प्रस्तावित छ।

pahilo = 12
dosro = 8
jamma = pahilo + dosro

print("जम्मा:", jamma)

५. निर्णय र loop लेख्नुहोस्

yedi को अर्थ if, natra को अर्थ else, र ko_lagi को अर्थ for हो।

umera = 20

yedi umera >= 18:
    print("तपाईं वयस्क हुनुहुन्छ")
natra:
    print("तपाईं अझै नाबालिग हुनुहुन्छ")

ko_lagi sankhya ma range(1, 4):
    print("गन्ती:", sankhya)

६. Function बनाएर code पुनः प्रयोग गर्नुहोस्

Function बनाउन kaam र value फर्काउन firta प्रयोग गर्नुहोस्:

kaam swagat(naam):
    firta "नमस्ते " + naam

sandesh = swagat("साथी")
print(sandesh)

७. अर्को चरण

अब तपाईंले lyau बाट module import गर्न, koshish/samau बाट error handle गर्न, file बाट notes save गर्न, र anurodh बाट HTTP request प्रयोग गर्न सक्नुहुन्छ। Project मा भएका advanced examples हेर्नुहोस्, अनि आफ्नो syntax example, test, वा documentation contribution का रूपमा पठाउनुहोस्।

ध्यान दिनुहोस्: यो tutorial को भाषा र code examples NepaliCode को supplied design notes मा आधारित छन्। Runtime मा उपलब्ध command वा module फरक हुन सक्छ, त्यसैले प्रयोग गर्दा project को current implementation र release notes पनि जाँच गर्नुहोस्.1

🔥 Advanced .np examples

The following examples show the intended direction of NepaliCode beyond basic expressions. They are useful as language-design references and learning examples; module APIs may remain experimental or planned while the runtime is still in alpha.1

HTTP and JSON-style API work with anurodh

lyau anurodh

kaam fetch_title(url):
    koshish:
        res = anurodh.get(url)
        yedi res.status == 200:
            firta res.text
        natra:
            print("Request failed:", res.status)
            firta khali
    samau error:
        print("Network error:", error)
        firta khali
    antya:
        print("Request complete")

body = fetch_title("https://example.com")
print(body)

File operations and reusable functions

lyau file

kaam save_note(path, message):
    file.write(path, message)
    print("Saved:", path)

kaam read_note(path):
    yedi file.exists(path):
        firta file.read(path)
    firta "No note found"

save_note("notes.txt", "Namaste Nepal")
print(read_note("notes.txt"))

Browser automation workflow

lyau browser

page = browser.khol("https://example.com")
page.click("Login")
page.type("email", "demo@example.com")
page.click("Submit")
page.wait(2)
page.screenshot("login-result.png")
page.close()

Browser automation is intended for authorized development, QA, testing, and personal workflows. Always respect the target service's terms and permissions.

Database access

lyau database

db = database.open("app.db")
rows = db.query("SELECT * FROM users")

ko_lagi user ma rows:
    print(user)

db.close()

Nepali-style error handling and conditions

koshish:
    age = 21
    yedi age >= 18 ra age < 60:
        print("Working age")
    athawa age >= 60:
        print("Senior citizen")
    natra:
        print("Underage")
samau error:
    print("Could not evaluate age:", error)
antya:
    print("Finished")

A small package workflow

nppm init
nppm install anurodh
nppm list
nepali run main.np
nepali test
nepali lint
nepali format

A project can declare its metadata in nepali.toml:

[project]
name = "myapp"
version = "0.1.0"
language = "nepalicode"

[dependencies]

Status note: NepaliCode is in an early/alpha stage. Examples and APIs in the design notes may be implemented, experimental, or planned; they should not be read as a promise that every module is available in the current build.1

🇳🇵 Nepali-inspired syntax

NepaliCode Familiar equivalent
yedi if
natra else
athawa elif
jabasamma while
ko_lagi / ma for / in
kaam / firta def / return
kakshya class
lyau / bata import / from
koshish / samau / antya try / except / finally
ra / wa / hoina and / or / not
sacho / jhut / khali True / False / None
rok / agadi break / continue

English-style syntax may remain available where appropriate, so developers can learn gradually without being forced into a single style.1

🌐 Ecosystem direction

The project is being developed in layers. The language core comes first, followed by runtime capabilities, standard-library modules, developer tooling, mobile workflows, and a broader ecosystem.1

NepaliCode source
        │
        ▼
      Lexer ──► Parser ──► AST
                              │
             ┌────────────────┼────────────────┐
             ▼                ▼                ▼
         Runtime          Formatter            LSP
             │                │                │
             ▼                ▼                ▼
       Standard library   Editor tools    Completion & actions
             │
             ▼
     CLI · NPPM · Studio · Android

The planned standard-library direction includes ganit, samaya, json, file, folder, anurodh, web, browser, automation, database, network, and other practical modules. For example, the anurodh HTTP/API interface is designed around familiar operations such as get, post, put, patch, delete, download, and upload.1

🧩 VS Code syntax highlighting

NepaliCode now includes a lightweight VS Code extension integration for .np files. The extension registers the NepaliCode language mode, adds TextMate syntax highlighting for Nepali and English keywords, functions, strings, numbers, constants, operators, comments, built-ins, and modules, and provides editor conveniences such as auto-closing brackets, indentation rules, folding markers, and starter snippets.

The extension source lives in extensions/nepalicode. To package and install it locally:

npm install --global @vscode/vsce
cd extensions/nepalicode
vsce package
code --install-extension nepalicode-language-support-0.1.0.vsix

After installation, open any .np file and select NepaliCode as the language mode if VS Code does not detect it automatically. The extension provides editor highlighting only; execution still belongs to the NepaliCode runtime and CLI.

🛠️ Technology stack

NepaliCode is an Android Studio project built with Kotlin, Jetpack Compose, Material 3, AndroidX, and Gradle Kotlin DSL. The UI and language engine are separated so that Android presentation work can evolve independently from language tooling.

app/src/main/java/com/nepalicode/dev/
├── nepalicode/data          Project and file data models
├── nepalicode/editor        Themes, tokenizer, highlighter, completion, editor tools
├── nepalicode/ui            Main screens and ViewModel-driven app flows
├── nepalicode/ui/components Reusable Compose dialogs and UI components
├── nepalilang/core          Lexer, parser, AST, interpreter, linter, runtime values
└── ui/theme                  Compose colors, typography, and application theme

📦 Getting started

Requirements

Install Android Studio with Android SDK Platform 36, Android Build Tools 36, and a Java 21-compatible development environment. AI-powered features may require a local Gemini API key; keep secrets in .env and never commit credentials.

Clone and configure

git clone https://github.com/NepaliSource/NepaliCode.git
cd NepaliCode
cp .env.example .env
# Add local values only when an optional AI feature needs them.

Build and test

./gradlew assembleDebug
./gradlew assembleRelease
./gradlew test

The debug APK is written to app/build/outputs/apk/debug/app-debug.apk. For production releases, use your own protected signing key and pass signing values through environment variables.

🗺️ Roadmap

Horizon Focus
Now Stabilize the mobile editor, language runtime, project files, themes, diagnostics, and educational examples.
Next Improve completion quality, expand standard-library capabilities, strengthen tests, and refine the terminal and package workflows.
Later Grow the CLI, NPPM registry, formatter, linter, debugger, language server, desktop Studio, project sharing, and release channels.

🤝 Contributing

Contributions are welcome across language design, compiler/runtime correctness, Compose UI, accessibility, Android performance, tests, examples, documentation, translations, and developer tooling. Start with CONTRIBUTING.md, review the Code of Conduct, and open an issue before large architectural changes.

Focused pull requests are easier to review. A useful language change normally includes a small example, parser coverage, interpreter behavior, diagnostics, and documentation for learners.

👨‍💻 Maintainers, organization, and credits

NepaliCode is developed by Diwas Khatri with the NepaliSource organization and community. The project combines language design, Android engineering, compiler/runtime work, documentation, and developer education in one open-source effort.

Public project information Details
Lead developer Diwas Khatri
Developer profile @diwaskhatri07
Public contact shown in the app guide diwaskhatri935@gmail.com
Organization NepaliSource
Repository NepaliSource/NepaliCode
Language identity NepaliLang / NepaliCode, .np source files
Application package com.nepalicode.dev
Android application direction High-density mobile IDE, compiler/tokenizer, dual Nepali/English syntax, HTTP Anurodh, browser automation, and SQLite engine
Release channel GitHub Releases
License MIT License

The project welcomes contributions from language designers, Android developers, compiler/runtime contributors, educators, translators, documentation writers, and anyone who wants to make Nepali-first programming more accessible. Please credit new examples and feature work clearly, keep experimental APIs labeled, and follow the repository contribution guidelines.

🔖 Project tags

nepalicode · nepali-programming-language · android-ide · kotlin · jetpack-compose · material3 · compiler · interpreter · repl · developer-tools · education · open-source · nepali-tech

References

NepaliCode footer banner

Built with Kotlin, Compose, curiosity, and a commitment to Nepali-first developer tools.

Releases

Packages

Contributors

Languages