https://github.com/nexuls/weird-lang
This is Weird Lang, a fun little experiment that lets you code in Hinglish. It's basically a goofy way to learn and play with programming concepts.
https://github.com/nexuls/weird-lang
ast custon-language syntax-tree weired-lang
Last synced: 12 days ago
JSON representation
This is Weird Lang, a fun little experiment that lets you code in Hinglish. It's basically a goofy way to learn and play with programming concepts.
- Host: GitHub
- URL: https://github.com/nexuls/weird-lang
- Owner: nexuls
- Created: 2024-03-16T19:09:16.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-16T19:24:13.000Z (over 2 years ago)
- Last Synced: 2026-07-12T19:43:28.727Z (12 days ago)
- Topics: ast, custon-language, syntax-tree, weired-lang
- Language: TypeScript
- Homepage:
- Size: 17.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
```
██╗ ██╗███████╗██╗██████╗ ██████╗ ██╗ █████╗ ███╗ ██╗ ██████╗
██║ ██║██╔════╝██║██╔══██╗██╔══██╗ ██║ ██╔══██╗████╗ ██║██╔════╝
██║ █╗ ██║█████╗ ██║██████╔╝██║ ██║ ██║ ███████║██╔██╗ ██║██║ ███╗
██║███╗██║██╔══╝ ██║██╔══██╗██║ ██║ ██║ ██╔══██║██║╚██╗██║██║ ██║
╚███╔███╔╝███████╗██║██║ ██║██████╔╝ ███████╗██║ ██║██║ ╚████║╚██████╔╝
╚══╝╚══╝ ╚══════╝╚═╝╚═╝ ╚═╝╚═════╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═════╝
```
Hey there! This is Weird Lang, a fun little experiment that lets you code in Hinglish. It's basically a goofy way to learn and play with programming concepts.
We're still building and improving Weird Lang, so there's a lot more to come! In the meantime, feel free to explore what's here and even add your own weird and wonderful ideas! We welcome anyone who wants to contribute and help make Weird Lang even more awesome.
This README will show you:
- How to get started with Weird Lang (it's easy!)
- The basics of Weird Lang's syntax (don't worry, it's pretty straightforward)
- How to contribute your own code and ideas (we love collaboration!)
Let's get weird with code!
---
## Getting Started
This project uses typescript for type-safety. Also nodemon helps in developement experience.
To get started -
- Pull this repo locally or download the zip.
- Run `yarn install` to install all required dependencies.
- Change the filename in the `src/index.ts` file.
- Run `yarn dev` or `yarn start` to compile the code.
- Check the new folder `/tests/` with all outputs.
Try chenging or writing your own code with the extension `.wl` or use the demos.
## Weird Lang Syntax
This experimental codebase lets you code in Hinglish language what makes it weired. Although the syntax are very simple, yet you need to know them.
1. The line ends with `;` which is must to use.
2. It is globally asynchronous. Means you can directly use `await` statement in it. (Statement not added yet)
3. Brackets are not necessory unless its a new block.
| syntax | work | example |
| ------ | ------------ | ----------------------------------- |
| socho | declearation | `socho a = 5.5;` |
| likho | print | `` likho `Hello ${name}`; `` |
| pucho | input | `pucho name "What is your name: ";` |
| agar | condition | `agar { }` |
Rest keywords are yet to be done. You can see the whole list in `src/reserved.ts` file. All the operators are ready to be used.
See the `equals` operator works differently in different cases.
`socho a equals 20;` Here it is an assignment operator. The following code converts into `let a = 20;`
```
agar a equals 20 {
likho "a is 20";
}
```
Here it is a conditional operator. The following converts into -
```
if (a == 20) {
console.log("a is 20");
}
```
---
## Inspiration
The experimental project is inspired by [Piyush Garg's video on building Own Programming Language](https://youtu.be/rTuTLc_u6qw?si=G6nTqRRZsDTZpT4K).
