Features • Get Started • Installation • Usage • Syntax • Example • Dev
A Tiny Interpreted language written in Rust, featuring variable declarations, arithmetic operations, conditional statements, and control flow. The name Poo originates from Guinea Pig translated from Burmese.
- Arithmetic Expressions: Supports addition, subtraction, multiplication, and division with correct operator precedence.
- Variable Declarations: Uses
pookeyword for variable declarations. - Mutable Variables: Like in Rust, all variables are immutable by default. Uses
mutfor mutable variables. - Conditional Statements: Includes
if,else, andeliffor branching. - Control Flow: Supports
whileandfor inloops andreturnstatements. - Custom Operators:
- Assignment operator:
<< - Arrow operator:
>>
- Assignment operator:
- Lexer, Parser, and Interpreter: A full pipeline from tokenizing source code to executing it.
For instructions on installing PooLang on your platform, visit our project site via https://shayyz-code.github.io/poolang. We provide automated installers for all platforms.
Recommended:
brew install shayyz-code/tap/pooor
npm install @shayyz-code/poo@latestLinux / macOS
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/shayyz-code/poolang/releases/latest/download/poo-installer.sh | shWindows
powershell -ExecutionPolicy Bypass -c "irm https://github.com/shayyz-code/poolang/releases/latest/download/poo-installer.ps1 | iex"poo --help- Rust and Cargo installed. If you don't have them installed, follow the Rust installation guide.
-
Clone the repository:
git clone https://github.com/shayyz-code/poolang.git cd poolang -
Install with cargo:
cargo install --path .
You can use the interpreter to run files containing your custom language code.
To run the interpreter on a source file:
cargo run <path_to_your_source_file>Example:
cargo run app.pooThe CLI uses typed checked execution (run_file_checked) and prints structured error kinds (Io, Parse, Runtime) with a non-zero exit code on failure.
Releases are automated with GitHub Actions + cargo-dist and publish:
- Multi-platform binaries (Linux, macOS, Windows)
- Optimized installers (Shell, PowerShell)
- Homebrew formula updates to
shayyz-code/tap(shayyz-code/homebrew-tap) - Scoop manifest updates to
shayyz-code/scoop-bucket
Release flow:
- Update version in
Cargo.toml. - Create and push a version tag (example:
v0.1.5). - The
Releaseworkflow builds all artifacts, creates a GitHub Release, and handles downstream publishing.
CI checks:
- Pull requests and pushes to
mainrun build + tests on Linux, macOS, and Windows. - Unix runners also validate installer script syntax (
sh -n install.sh).
The language features basic syntax for arithmetic, variable declarations, and control flow:
poo x << 10;
poo mut y << 5 + 2 * 3;
poo result << x + y * 2 - 10 / 2;
if x > y {
return x;
} else {
return y;
}
use std::pout;
poo mut count << 0;
while count < 10 {
count << count + 1;
}
for i in 0..3 {
pout("Hello, World ", i);
}
use std::pout;
poof getName () >> string {
poo name << "Shayy";
return name;
}
pout(getName());
Here is a sample program in my PooLang:
use std::pout;
poo a << 5.0 * 1.0 - 1.0 * 3.0;
poo b << 2 / 2;
poo mut d << true;
d << false;
poof getHelloWorld () >> string {
return "Hello, World!";
}
for i in 0..2 {
pout("Hello, Poo!", i);
}
pout(getHelloWorld());
Expected Output:
Hello, Poo!0
Hello, Poo!1
Hello, World!
Current executable specs live in tests/language_specs.rs:
spec_lexer_skips_inline_comment_blockspec_parser_respects_multiplication_precedencespec_interpreter_executes_program_to_return_valuespec_checked_api_returns_typed_error_on_parse_failurespec_checked_api_returns_typed_error_on_runtime_failurespec_checked_file_api_returns_io_error_for_missing_filespec_checked_file_api_executes_valid_file- loop coverage (
forrange,forrange withstep,forvector,while) - control-flow coverage (
if/elif/else) - struct coverage (instance methods, inheritance method lookup)
Run them with:
cargo test- Expose core modules as a reusable library API (
src/lib.rs). - Keep CLI thin by delegating execution to library entrypoints.
- Upgrade crate to Rust Edition 2024.
- Introduce checked execution APIs with typed error kinds (
Io,Parse,Runtime). - Replace panic-driven parser/interpreter internals with native
Resultpropagation. - Split large parser and interpreter files into focused submodules.
- Add integration specs for structs, methods, inheritance, and loops.
.
├── src
│ ├── lib.rs # Reusable library API
│ ├── lexer.rs # Lexical analysis (tokenizer)
│ ├── parser.rs # Parsing logic
│ ├── interpreter.rs # Interpreter for executing code
│ ├── ast.rs # Abstract Syntax Tree (AST) definitions
│ ├── errors.rs # Typed error definitions
│ └── main.rs # Entry point
├── examples # Sample code
│ ├── donut.poo
│ └── app.poo
├── tests
│ └── language_specs.rs # TDD integration specs
└── Cargo.toml # Project configuration
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
PooLang is licensed under the MIT License. See LICENSE for details.
Hand-Crafted by Shayy
