CreatorSiSo/rym
Personal programming language project
⚠️ This is just a hobby project. It is very far from being production ready! ⚠️
Rym is a statically typed programming language inspired by Rust, Swift, Python and others.
It focuses on ease of use and should just work™.
Big thanks to Robert Nystrom and his book crafting interpreters which inspired me to start and continue working on this language.
fn main() {
for i in 0..=100 {
println(game(i));
}
}
fn game(x: UInt) -> String {
let rule = { acc, num, word ->
if ((x % num) == 0) acc ++ word else acc
};
let default_rule = { acc ->
if (acc == "") acc else x.to_string()
};
String.new()
.rule(3, "Fizz")
.rule(5, "Buzz")
.rule(7, "Splash")
.default_rule()
}
fn main() -> Result<(), Error> {
let msg = "Hello World";
println(msg);
let num = 2/4 * (10 - 1);
println("Number: $num");
const msg = msg + "!";
println("Combined: $msg $num");
}
Early returns when unwrapping Tryables
fn main() -> Result<String, SpecificError> {
let chained = maybe_error().try;
// Same as:
let expanded = match maybe_error() {
Ok(val) => Ok(val.to_string()),
err => return err,
}
// ...
Ok(chained)
}
The language should be as powerful as possible while only providing a small set of consistent features. (Kind of like Go)
Apart from that Rym just gets used to try out a bunch of my ideas... I am trying my best to combine all of them in a meaningful manner =)
TODO
The project is split into many crates that are part of one Cargo workspace:
crates/rymx ⇒ command line tool for executing .rym files and to run the repl
For now just cargo test, there is no special setup.