nepaliko.js
v1.0.0
Published
A programming language that uses Nepali syntax
Maintainers
Readme
nepaliko.js
This is the fun programming language. Do Programming in Nepali Language, kind of Nepangrezi.
Installation
First, make sure you have Node.js installed. If not, install it from nodejs.org
Clone this repository:
git clone https://github.com/yourusername/nepaliko.js.git
cd nepaliko.js- Install dependencies:
npm install- Make the CLI executable:
chmod +x src/cli.js- Create a global link to the nepaliko command:
sudo ln -s "$(pwd)/src/cli.js" /usr/local/bin/nepalikoUsage
Create a new file (example.nepaliko)
This is the example where namaste is the entrypoint for the program and program must end with dhanyabad. Anything outside of it will be ignored.
Run
Output
Language Features
Variables
Variables can be declared using yo keyword:
Types
- Numbers:
yo a = 2; - Strings:
yo b = "Hello";oryo c = 'World'; - Boolean:
yo d = thik;(true) oryo e = bethik;(false) - Null:
yo f = khali;
Conditions
Use yadi for if statements and nabhaye for else:
Loops
Use jaba samma for while loops:
How It Works
The nepaliko.js interpreter works in several stages:
Lexical Analysis (Tokenizer)
- Converts source code into tokens
- Recognizes keywords like
namaste,dhanyabad,yo,bhana, etc. - Handles operators, identifiers, and literals
Parsing (Parser)
- Converts tokens into an Abstract Syntax Tree (AST)
- Validates syntax and structure
- Creates nodes for different program elements (variables, conditions, loops)
Interpretation (Interpreter)
- Walks through the AST
- Converts nepaliko syntax to JavaScript
- Handles variable scoping and operations
Execution
- The generated JavaScript is executed using Node.js
- Results are displayed in the console
Example Translation
Nepaliko code:
Gets translated to JavaScript:
Contributing
Feel free to contribute to this project by:
- Forking the repository
- Creating a feature branch
- Making your changes
- Submitting a pull request
License
MIT License - feel free to use this project for any purpose.
