Perro is an experimental, open-source game engine written in Rust, designed as a modern alternative to engines like Unreal, Godot, and Unity.
It focuses on performance, flexibility, and ease of use with a unique multi-language scripting system:
- πΆ Pup DSL β a beginner-friendly, lightweight scripting language that compiles to Rust for native performance.
- π¨ FUR (Flexible UI Rules) β a declarative UI system with layouts, panels, and boxing for easy UI design.
- π Multi-Language Scripts β write gameplay in Pup, C#, TypeScript, or pure Rust β everything transpiles to Rust under the hood.
- π¦ Type-Safe Transpilation β full type checking and casting during code generation.
- β‘ Optimized Release Builds β scripts and assets statically link into your final binary.
- π Cross-Script Communication β global signal system + accessing functions and variables on scripts attached to other nodes.
Clone the repository and build from source:
git clone https://github.com/PerroEngine/Perro.git
cd perro
cargo run -p perro_devThis launches the Perro Editor in dev mode.
- Create a new project via the Project Manager
- Write scripts in Pup, C#, TypeScript, or Rust
- Design UI with FUR
- Hit Play β Perro automatically:
- Transpiles your scripts β Rust
- Compiles Rust β DLL (dev mode)
- Hot-loads the DLL into the running game
- Make changes β recompile (~1β3s on decent hardware) β see updates instantly
Pup is Perro's built-in scripting language β simple, readable, and compiles to Rust.
Currently supports variables, functions, and cross-script communication:
@script Player extends Sprite2D
var speed = 7.5
var is_moving = false
fn init() {
print("Player is ready!")
}
fn set_speed(new_speed: float) {
speed = new_speed
}
fn update() {
var delta = Time.get_delta()
self.position.x += speed * delta
}
You can write scripts in multiple languages. Languages using Tree Sitter for parsing have their full syntax supported:
- Pup (native DSL, hand-written parser)
- C# (full syntax via Tree Sitter CST β Perro AST; not all AST bindings implemented yet)
- TypeScript (planned, same Tree Sitter pipeline)
- Rust (direct, no transpilation)
The transpilation pipeline:
- Parse β Tree Sitter CST β Perro AST (or native parser for Pup)
- Codegen β AST β type-checked Rust
- Compile β Rust β DLL (Dev) or static binary (Release)
- Load β DLL hot-load (Dev) or direct calls (Release)
FUR is Perro's declarative UI system for building layouts and UI panels.
[UI]
[Panel bg=sea-5 padding=4]
[Text font-weight=bold text-color=white text-size=xl]
Hello Perro!
[/Text]
[/Panel]
[/UI]
Current Features:
- Layouts and child layouts
- Panels and boxing
- Styling and padding
See perro_editor/res/fur for real examples of FUR in use.
- Scripts are transpiled to Rust, compiled into a DLL
- Engine loads the DLL at runtime
- Make changes β recompile (~1β3s) β see updates instantly without restarting
- All scripts transpile β Rust
- Statically linked into final binary
- Result:
- Single executable (no DLLs, no source included)
- Optimized machine code from LLVM
- Your source scripts are protected
This repository contains the Perro engine source code. To build and work on the engine itself:
- Rust (GNU preferred as that's what ships with the editor binary for compilation)
- Cargo
perro/
βββ perro_core/ # Core engine (structs, scene, render graph)
βββ perro_dev/ # Dev wrapper binary (loads DLLs, runs projects with --path)
βββ perro_editor/ # Editor game project
β βββ .perro/
β β βββ project/ # Editor project crate
β β βββ scripts/ # Editor scripts crate (contains transpiled rust + builds DLL)
β βββ res/ # Resources (FUR files, scenes, assets, scripts)
βββ examples/ # Example game projects
Open the Editor in Dev Mode:
cargo run -p perro_devThis:
- Compiles
perro_core - Compiles
perro_editor/scriptsβ DLL - Runs the editor with hot-loadable scripts
Build the Core Alone:
cargo build -p perro_coreAll projects share a build cache (the main workspace target/ in source mode), so the core only compiles once.
The editors are pinned to specific versions of the toolchain, (eg. 1.0 => 1.90.0), toolchains will not be updated each engine update, as to not clog the end user's system with multiple toolchains they don't need. (1.0 and 1.1 could support the same toolchain, even if users update it only is installed once)
Project Compatibility:
- Old projects use their original editor version by default
- The Project Manager auto-updates to the latest version
- You can manually upgrade a project to a newer editor version if desired
- Older editor versions remain available for projects that haven't upgraded
- β Scripting system (Pup, C# via Tree Sitter CST)
- β Signal system & cross-script communication
- β Type checking and casting during Rust codegen
- β C# β Rust transpilation (Tree Sitter β AST β codegen)
- β DLL loading & dynamic script loading
- β FUR layouts, panels, child layouts, and boxing
- π Pup DSL expansion (control flow, standard library)
- π C# AST bindings completion
- π TypeScript support (Tree Sitter pipeline)
- π FUR runtime editing & editor viewer
- π Scene editor
- π Asset pipeline
Contributions are welcome! You can work on:
- Engine β
perro_core(rendering, scene, runtime) - Editor β Edit the source code and UI of the editor at
perro_editor/res - Scripting β Pup DSL expansion, transpiler improvements, new language support as needed
- Tooling β build system, asset pipeline
See CONTRIBUTING.md for guidelines.
Perro is licensed under the Apache 2.0 License. See LICENSE for details.
Every developer needs a loyal partner, just like a dog β and that's what Perro means in Spanish.