🚀 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 Taparia"
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
🔍 Error Messages: YO vs Python
YO was designed with beginner-friendly error messages to help first-time coders fix bugs faster. While Python stops at the first error with a traceback, YO collects multiple errors, suggests inline fixes (like typo corrections), and provides a built-in interactive explanation tool (yo explain).
See the full side-by-side comparison, design philosophy, and study results in comparison.md.
🎓 Built By
- Yogesh Taparia - UEM Jaipur CSE
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
Release files for yo-lang 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| yo_lang-1.1.0.tar.gz | 21.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| yo_lang-1.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 41.0 kB
Release files / yo_lang-1.1.0.tar.gz
| Download URL | yo_lang-1.1.0.tar.gz |
|---|---|
| Size | 21.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9a4e74adceea33812d1c10d94f89e867cb59620ec81abb47a280ce2216c6c319
|
|
BLAKE2b-256 checksum How to use checksums |
b7f3d507326b93cf0e952e529e85ecd03f3920fe44d8e82bd76dd8e556f55b7c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|
Release files / yo_lang-1.1.0-py3-none-any.whl
| Download URL | yo_lang-1.1.0-py3-none-any.whl |
|---|---|
| Size | 19.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c0023970a774e30727dc54698fe94fad624c2885ced672eab2919a45df44c37c
|
|
BLAKE2b-256 checksum How to use checksums |
d634fea6fce60a9dc4397607010d6fcb590288287991d5be567f4984fbc79fba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|