Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

tlang

tlang is a lightweight tool that lets you run algorithms directly—without writing full implementation code.

Instead of coding the algorithm manually, you simply write the logic in a .algo file, and tlang converts it into executable code.

[!NOTE]Version: v1 (Weekend project)

🚀 Installation

Install tlang directly from GitHub using pip:

Bash

pip install git+https://github.com/tdizhere/tlang.git

📄 How to Use

  1. Write your algorithm in a .algo file (currently supports arrays only).

  2. Run it using the command line:

Bash

tlang .filenamealgo

📌 Example

Create a file named example.algo and write your algorithm steps. Then, execute it:

Bash

tlang example.algo

🧠 Logic (How it works)

tlang acts as a translator between human-readable algorithm logic and real code.

  1. Parsing: It reads the steps written in your .algo file.

  2. Translation: It parses the logic and converts the steps into executable Python code.

  3. Execution: It runs the generated code instantly, allowing you to test logic without manual implementation.

Feature Supported Notes
Algorithm Header ALGORITHM <Name> required
Input Declaration INPUT a, b, ...
SET Statement SET x = expr
RETURN Statement Exactly one RETURN required
IF Statement IF cond THEN ... END IF
FOR EACH Loop FOR EACH x IN arr ... END FOR
Nested Blocks Nested IF/LOOP supported
Arithmetic Operators + - * / %
Comparison Operators == != > < >= <=
Execution Trace Output Shows step-by-step trace
Function Calls Blocked for security
Attribute Access Blocked for security
Boolean Operators and, or, not blocked
Chained Comparisons 1 < x < 5 blocked
Lists / Dicts / Sets in expr Not allowed in expressions
User-defined Functions Not supported yet

⚙️ Notes

  • Version 1: This is an initial release.

  • Support: Currently supports array-based algorithms only.

  • Project Scope: Designed as a simple weekend project aimed at simplifying algorithm execution and prototyping.

About

Tlang (Tiny Algorithm Language) is a lightweight, beginner-friendly interpreter designed to execute algorithm-style pseudo-code directly as a programming language. Instead of writing full-fledged code in Python or Java, you can write clean algorithmic steps using simple English-like syntax, and Tlang will execute it.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages