relo

Crates.iorelo
lib.rsrelo
version0.1.2
created_at2025-04-12 05:17:46.673616+00
updated_at2025-04-13 08:47:17.855235+00
descriptionA custom programming language with a readable syntax (RELO).
homepagehttps://github.com/abdul061/RELO-Programming-language
repositoryhttps://github.com/abdul061/RELO-Programming-language
max_upload_size
id1630635
size146,790
(abdul061)

documentation

README

License: MIT

# RELO

A custom-built programming language interpreter and compiler written in Rust, designed to resemble simple English-like syntax such as:

  • VARIABLE x IS 10;
  • x ASSIGN x + 1;
  • DISPLAY "Hello";
  • WHEN condition { ... } OTHERWISE { ... } DONE;
  • CREATE FUNCTION myfunc { ... } END_FN;

## ๐Ÿš€ Features

  • โœ… Custom syntax with human-readable keywords (like IS, ASSIGN, DISPLAY, START, END)
  • โœ… Support for:
    • Variable declarations and assignment
    • Conditionals (WHEN, OTHERWISE)
    • Loops (REPEAT, LOOP, QUIT)
    • Functions (CREATE FUNCTION, CALL, RETURN)
  • โœ… Two execution modes:
    • Tree-walk interpreter
    • Bytecode compiler + virtual machine
  • โœ… Rust-powered lexer, parser, and runtime
  • โœ… Benchmark-ready with cargo run --release

๐Ÿ“‚ Project Structure

.
โ”œโ”€โ”€ lexer/         # Tokenizer for custom keywords and literals
โ”œโ”€โ”€ parser/        # Builds AST from tokens
โ”œโ”€โ”€ interpreter/   # Tree-walk interpreter
โ”œโ”€โ”€ compiler/      # Compiler to bytecode
โ”œโ”€โ”€ vm/            # Stack-based virtual machine
โ”œโ”€โ”€ main.rs        # Program entry point
โ””โ”€โ”€ README.md

**๐Ÿงช Example Program**

START
    VARIABLE i IS 1;
    LOOP i Start 1 End 5 {
        DISPLAY i;
        i ASSIGN i + 1;
    } DONE;
END
Edit
START
    VARIABLE i IS 1;
    LOOP i Start 1 End 5 {
        DISPLAY i;
        i ASSIGN i + 1;
    } DONE;
END
**๐Ÿƒ Running the Project
๐Ÿ”ง Debug (for development)**

cargo run
**โšก Release (optimized for speed)**
bash

cargo run --release
๐Ÿ•’ Measure performance
Execution time is printed automatically after the program finishes.

**โœ๏ธ Author**
Abdul Mubarak H
๐Ÿ“ง abdulmubarak682@gmail.com

****๐Ÿ“œ License****
MIT License โ€” Free to use, modify, and distribute.



---

Would you like me to:
- Add badges (build status, language, license)?
- Create sample test files?
- Include contribution or usage guidelines?

Let me know and I can customize it even further!







Commit count: 11

cargo fmt