#language-interpreter #interpreter #compiler #relo

nightly app relo

A custom programming language with a readable syntax (RELO)

3 releases

new 0.1.2 Apr 13, 2025
0.1.1 Apr 12, 2025
0.1.0 Apr 12, 2025

#215 in Programming languages

Download history 112/week @ 2025-04-06

116 downloads per month

MIT license

115KB
2.5K SLoC

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!







Dependencies

~4โ€“10MB
~98K SLoC