A beginner-friendly interpreted programming language.
Project description
๐ YO Language
YO โ A Programming Language That Talks Like You
๐ What is YO?
YO is a beginner-friendly, dynamic programming language designed to make coding intuitive and fun. Built from scratch in Python, it prioritizes readability with conversational syntax and color-coded, actionable error diagnostics. It offers nested environments for functions, an interactive REPL mode, and built-in standard libraries for math, text, and lists.
โ๏ธ Quick Install
YO runs on Python 3.10+. To install the required dependencies (primarily for colorized formatting), run:
pip install colorama
๐ Hello World
Create a file named hello.yo and add the following code:
make greeting = "Hello World!"
say greeting
๐ Syntax Cheatsheet
1. Variables (make)
Declares a new variable. Reassign variables without the make keyword.
make name = "Yogesh"
name = "Yogesh Kumar"
2. Print Output (say)
Prints text or numbers to the console.
say "My name is " + name
3. Conditionals (when)
Executes code blocks based on conditions.
make age = 21
when age >= 18 {
say "You are an adult"
} else {
say "You are a minor"
}
4. Counted Loops (repeat)
Loops a block of code a specific number of times.
repeat 3 times {
say "YO!"
}
5. List Loops (for each)
Iterates over elements in a list.
for each num in [1, 2, 3] {
say num
}
6. Functions (task)
Declares reusable tasks with arguments and return statements.
task add(a, b) {
return a + b
}
make sum = add(5, 10)
say sum
๐ Running YO
Run a Script
To run a .yo file, use the yo.py runner:
python yo.py myfile.yo
# OR
python yo.py run myfile.yo
Interactive REPL Mode
Running yo.py with no arguments boots up interactive mode:
python yo.py
YO v1.0 โ Interactive Mode
Type 'exit' to quit, 'clear' to reset variables
yo> make x = 5
yo> say x
5
yo> exit
๐ Standard Libraries
Load built-in standard libraries using the use keyword.
๐งฎ Math Library
Exposes: round, floor, ceil, power, sqrt, random, abs, min, max.
use math
say math.sqrt(25) # Outputs 5.0
๐ค Text Library
Exposes: upper, lower, length, reverse, has, trim, split, replace, starts_with, ends_with.
use text
say text.upper("hello") # Outputs HELLO
๐ List Library
Exposes: count, add, remove, sort, reverse, first, last, has, join.
use list
make my_list = [3, 1, 2]
say list.sort(my_list) # Outputs [1, 2, 3]
๐ Project Structure
yo-lang/
โโโ stdlib/ # Standard Library Python modules
โ โโโ list_lib.py # List primitives
โ โโโ math_lib.py # Mathematical primitives
โ โโโ text_lib.py # String primitives
โโโ tests/ # Sample YO scripts
โ โโโ test1.yo # Basics test
โ โโโ test2.yo # Functions and lists test
โ โโโ test3.yo # Standard libraries test
โโโ environment.py # Environment variable scope tracking
โโโ errors.py # Color-coded error styling & formatting
โโโ interpreter.py # AST execution engine
โโโ lexer.py # Handwritten scanner & tokenizer
โโโ parser.py # Handwritten recursive descent parser
โโโ README.md # Project documentation
โโโ yo.py # CLI & REPL entrypoint
๐ Built By
- Yogesh Taparia - UEM Jaipur CSE
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file yo_lang-1.0.0.tar.gz.
File metadata
- Download URL: yo_lang-1.0.0.tar.gz
- Upload date:
- Size: 15.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b1113544272ddc9da77002f60877cd56c9141a2fcffe5960c9588df2e7412209
|
|
| MD5 |
b967db7a16e4ad8e7ab0aa7b5dc3e80f
|
|
| BLAKE2b-256 |
cd9c585b959a0bf76e83532efdb5986c80c4598c370338bfad797c6eb8a05e78
|
File details
Details for the file yo_lang-1.0.0-py3-none-any.whl.
File metadata
- Download URL: yo_lang-1.0.0-py3-none-any.whl
- Upload date:
- Size: 14.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
89e4ec32da510a17681c06c5d826a3b5768c961201970b04106d497871b25e4f
|
|
| MD5 |
8c9ec2116eddec733c5a0411682a56ce
|
|
| BLAKE2b-256 |
980e88b3a33ccbbbeea798c5bac36d720748e7c4d2c0723dda8d8f29e7de5e0d
|