Python-like syntax. Nepali-inspired logic.
NeLang is a statically designed Python transpiler and custom AST runner utilizing Nepali-centric keywords and familiar Pythonic formatting. It embraces Python's beautiful indentation-based formatting rules while injecting localized cultural terminologies.
NeLang exists to bridge modern language capabilities to Nepali syntax readers—perfect for localized logic mapping, education, and general-purpose development applications.
- Nepali-inspired Keywords: Syntax mapped cleanly against translated logical components for cultural clarity.
- Python-like Syntax: Drop braces and semi-colons. Maintain visual uniformity through strict structural indentation checks.
- Easy to Learn: Built extensively focusing on the simplest AST paths, reducing onboarding cognitive load globally.
- Native Bytecode Compilation: Executes securely over
ast.Moduleconfigurations mirroring Python C speed. - Built-in Standard Library: Integrates underlying math and string capabilities implicitly.
You can install NeLang locally via pip.
- Clone the repository:
git clone https://github.com/ompandey07/Nelang.git
cd Nelang- Install the package locally:
pip install -e .To execute a NeLang script, use the run command followed by the .nl file.
nelang run filename.nlVariables in NeLang are dynamically typed and can be assigned directly.
name = "Sagarmatha"
x = 10Outputs data to the standard console.
lekha("Hello, World!")
lekha("Value is:", x)Conditional blocks using standard indentation.
yadi x > 5:
lekha("Thulo")
tyasovaye:
lekha("Sano")Standard while loop bounds.
x = 0
jaba x < 5:
lekha(x)
x = x + 1Define closures implicitly capturing scoped arguments.
karya greet(name):
lekha("Namaste", name)Escapes active functional closures resolving back to the caller.
karya multiply(a, b):
firta a * bLiteral semantic truth states mapping to True and False.
is_valid = satya
has_failed = jhutoLogical connectors enabling chain evaluations (and, or, not).
yadi satya ra hoina jhuto:
lekha("Logic works!")Standard contiguous collections.
nums = [1, 2, 3]Iterate securely over sequence collections.
lagi x vitra nums:
lekha(x)Polls raw standard inputs for user string data.
name = lina("Enter name: ")Ignores lexical structures from the execution tree.
# yo comment ho
lekha("Executing...")karya main():
lekha("Namaste, World!")
main()nums = [10, 20, 30]
lagi number vitra nums:
lekha("Item:", number)karya calculate_area(width, height):
firta width * height
lekha("Area:", calculate_area(5, 10))lyaau math
karya compute_circle(radius):
yadi radius <= 0:
lekha("Invalid radius")
firta 0
tyasovaye:
firta math.pi * math.pow(radius, 2)
r = 5
lekha("Area:", compute_circle(r))The nelang command-line utility supports structural subcommands to assist debugging and execution.
nelang run file.nl- Executes a NeLang script natively caching the AST bytecode into memory. Include--debugfor tokenized logging mapping.nelang version- Exposes the locally bounded framework version globally registered.nelang help- Renders the integrated helpful manual listing explicitly available tools.
nelang/
├── nelang/
│ ├── ast_nodes.py # Abstract tree hierarchical mapping
│ ├── compiler.py # Custom Native Bytecode generator
│ ├── errors.py # Standardized exception bounds
│ ├── interpreter.py # Runtime execution mapping
│ ├── lexer.py # Sequence filtering
│ └── parser.py # Recursive descent logic tracking
├── vscode-nelang/ # VS Code syntax highlighting extension
├── docs/ # Documentation references
├── setup.py # Packaging distributions
└── README.md # Project definition layout
- Implement Classes and Object Instantiation mechanisms.
- Standardize extensible module registry layout definitions.
- Set up an official remote Package Manager pipeline infrastructure.
- Expand standard library built-ins for explicit HTTP processing.
Contributions to NeLang are highly encouraged! When integrating, please follow our structural indentation standards securely. Make sure tests pass prior to submitting PR configurations bounding into the AST parsers cleanly.
To get started:
- Fork the repository.
- Create a structural hotfix branch:
git checkout -b feature/new-syntax - Commit optimizations.
- Push and submit a Pull Request.
This project is licensed under the MIT License. See the LICENSE file for details.
