Introducing Rue: A New Programming Language
programming languages
Discover Rue, a new programming language balancing the control of Rust with the simplicity of Go, featuring memory safety, a familiar syntax, and fast native compilation.
Rue is a modern programming language designed to strike a balance between the low-level control offered by Rust and the high-level simplicity found in Go.
Explore Rue's capabilities and read the official specification to get started.
Key Features of Rue
- Memory Safety: Rue aims for robust memory safety without relying on a garbage collector or requiring manual memory management. Please note this feature is currently a work in progress.
- Simple Syntax: Rue offers a simple and familiar syntax, drawing inspiration from various programming languages. Developers with experience in other languages will find Rue intuitive and easy to learn.
- Fast Compilation: Benefit from fast compilation times as Rue directly compiles to native code.
Hello, Rue: A Classic Example
The following code demonstrates a classic Fibonacci sequence implementation in Rue, showcasing its syntax and structure:
fn fib(n: i32) -> i32 {
if n <= 1 {
n
} else {
fib(n - 1) + fib(n - 2)
}
}
fn main() -> i32 {
// Print the first 20 Fibonacci numbers
let mut i = 0;
while i < 20 {
@dbg(fib(i));
i = i + 1;
}
// Return fib(10) = 55
fib(10)
}