Raven is a modern programming language and interpreter built with Rust, combining the best features of Rust, Python, C++, Java, and Go. It's designed to be fast, safe, expressive, and simpleβwithout compromising power or performance.
π Raven v1.1.0 is now available! A complete, production-ready programming language with professional CLI interface.
Raven aims to be:
- π₯ Fast like C++
- π‘οΈ Memory-safe like Rust
- π§ Readable like Python
- π§± Scalable like Java
- π― Simple like Go
Whether you're writing system-level code or high-level applications, Raven is built to be your go-to toolβmodern, efficient, and elegant.
- β Memory safety without garbage collection
- β Clean, beginner-friendly syntax
- β First-class support for concurrency and async
- β Built-in package manager and formatter
- β Cross-platform compiler written in Rust
- β Helpful, beginner-friendly compiler errors
Raven v1.1.0 is complete! All core features implemented:
- Tokenizer / Lexer - Complete with comments, strings, numbers, identifiers
- Parser - Full support for all language constructs
- AST Generation - Complete abstract syntax tree
- Type Checking - Static type validation with error reporting
- Interpreter - Tree-walking interpreter with full execution
- CLI Tool - Complete command-line interface
- Variables & Types - int, float, String, bool, arrays
- Control Flow - if/else, while, for loops
- Functions - Parameters, return types, recursion
- String Operations - Concatenation, methods, formatting
- Array Operations - Literals, indexing, methods (push, pop, slice, join)
- Built-in Functions - print, input, format, len, type
- File I/O - read_file, write_file, append_file, file_exists
- Comments - Single-line (//) and multi-line (/* */)
- Module System - import/export functionality
- REPL - Interactive Read-Eval-Print Loop
- Error Reporting - Comprehensive error messages with line/column info
- Operator Precedence - Correct expression evaluation
- Variable Scoping - Proper scope management
- Method Chaining - Object.method1().method2() support
- Structs - User-defined data structures with fields
- Enums - User-defined types with variants and string conversion
- Complex Assignments - object.field[index] = value support
- Professional CLI - Python-style interface (raven file.rv, raven)
- int - 64-bit signed integers
- float - 64-bit floating-point numbers
- String - UTF-8 strings with rich operations
- bool - Boolean values (true/false)
- Arrays - Dynamic arrays with type safety
- Structs - User-defined data structures with named fields
- Enums - User-defined types with named variants
- if/else - Conditional statements
- while - Loop with condition
- for - C-style for loops
- Functions - Parameters, return types, recursion
- Concatenation -
+operator - Methods -
slice(),split(),replace() - Formatting -
format()with placeholders - Length -
len()function
- Literals -
[1, 2, 3]syntax - Indexing -
array[0]access - Methods -
push(),pop(),slice(),join() - Bounds checking - Automatic array bounds validation
- print() - Output with formatting
- input() - User input
- format() - String formatting with
{}placeholders - len() - Length of strings and arrays
- type() - Type information
- read_file() - Read file contents
- write_file() - Write to file
- append_file() - Append to file
- file_exists() - Check file existence
- Static Typing - All variables must have explicit types
- Type Checking - Compile-time type validation
- Error Reporting - Detailed error messages with line/column info
- Comments - Single-line (
//) and multi-line (/* */) - Module System -
import/exportfunctionality - REPL - Interactive development environment
- Method Chaining -
object.method1().method2()support
# Clone the repository
git clone https://github.com/martian56/raven.git
cd raven
# Build the project
cargo build --release
# The binary will be at target/release/raven (or raven.exe on Windows)# Run a Raven program (Python-style interface)
raven program.rv
# Interactive REPL mode
raven
# Show verbose output (tokens, AST, type checking)
raven program.rv -v
# Only check syntax and types (don't execute)
raven program.rv -c
# Show the Abstract Syntax Tree
raven program.rv --show-astlet message: String = "Hello, Raven!";
print(message);
let name: String = "Raven";
let age: int = 25;
let height: float = 5.9;
let isActive: bool = true;
print(format("Name: {}, Age: {}, Height: {}", name, age, height));
let numbers: int[] = [1, 2, 3, 4, 5];
numbers.push(6);
print(numbers); // [1, 2, 3, 4, 5, 6]
let text: String = "Hello World";
let words: String[] = text.split(" ");
print(len(words)); // 2
let joined: String = words.join("-");
print(joined); // "Hello-World"
let age: int = 25;
if (age < 18) {
print("Too young");
} else {
if (age < 30) {
print("Young adult");
} else {
print("Mature");
}
}
// While loop
let i: int = 0;
while (i < 5) {
print(i);
i = i + 1;
}
// For loop
for (let j: int = 0; j < 5; j = j + 1) {
print(j);
}
fun add(a: int, b: int) -> int {
return a + b;
}
let result: int = add(10, 5);
print(result); // 15
// Struct definition
struct Person {
name: String,
age: int,
isActive: bool
}
// Enum definition
enum HttpStatus {
OK,
NotFound,
InternalError
}
// Usage
let person: Person = Person { name: "Alice", age: 25, isActive: true };
let status: HttpStatus = HttpStatus::OK;
// String to enum conversion (useful for JSON parsing)
let jsonStatus: String = "NotFound";
let parsedStatus: HttpStatus = enum_from_string("HttpStatus", jsonStatus);
print(format("Person: {}, Status: {}", person.name, status));
let content: String = "Hello from Raven!";
write_file("output.txt", content);
if (file_exists("output.txt")) {
let data: String = read_file("output.txt");
print(data);
}
raven
raven> let name: String = "World";
raven> print(format("Hello, {}!", name));
Hello, World!
raven> Check out examples/working_calculator.rv for a full-featured application showcasing:
- Interactive menu system
- Calculator with arithmetic operations
- Text processor with string operations
- Number analysis with mathematical functions
- User input/output and file operations
More examples available in the examples/ directory!
Raven v1.1.0 is complete and ready for use! Contributions are welcome for:
- π Bug fixes and improvements
- π Documentation enhancements
- π§ͺ Additional test cases
- π Performance optimizations
- π¦ Standard library modules
Feel free to β star the project and open issues for suggestions!
MIT License. See LICENSE for details.
Made with β€οΈ and rustc by @martian56