Marie
A toy programming language in rust
Install / Use
/learn @lechatthecat/MarieREADME
About
This is a toy scripting programming language
You can also see example file here: example/test.mr
This one is still very much incomplete but JIT enabled version is here:
https://github.com/lechatthecat/marie/tree/feature/improve_performance
You can run test scripts by:
$ cargo run --quiet -- example/test.mr
This command is same for develop branch too.
Example
fn hello () {
print("Hello World");
}
hello();
fn test (mut abc) {
let test = "hey";
print(test);
print(abc);
}
test(1);
fn fib(n) {
if (n < 2) return n;
return fib(n - 1) + fib(n - 2);
}
let before = clock();
print(fib(15));
let after = clock();
print(after - before << "ms");
You can return values like in rust:
fn test() {
"hey guys"
}
print(test());
Please note that you need "mut" for mutable variables.
fn test () {
let mut test = "hey"; // here
test = "hello";
print(test);
}
test();
How instance is created:
class A {
pub name = "john";
pub weight = 10;
pub fn f() {
return "cat";
}
}
let a = new A();
print(a.name);
print(a.f());
Please note that, if you don't use "pub", the properties automatically become private.
"+" cannot be used for String concatenation.
String concatenation is done like this:
fn test () {
let myfrined = "john";
let test = "hey, " << myfrined; // here
print(test);
}
test();
Why? Well, isn't it annoying when string-type numbers are unintentionally concatenated when you want to calculate it?
Please run cargo test and see test cases for more examples.
How to use
$ git clone https://github.com/lechatthecat/marie.git
$ cd marie
$ cargo build --release
$ cargo run --quiet --release example/test.mr
For debug run, use
$ cargo run --quiet -- example/test.mr
or
$ cargo run --quiet -- --debug example/test.mr
Related Skills
himalaya
347.6kCLI to manage emails via IMAP/SMTP. Use `himalaya` to list, read, write, reply, forward, search, and organize emails from the terminal. Supports multiple accounts and message composition with MML (MIME Meta Language).
node-connect
347.6kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
taskflow
347.6kname: taskflow description: Use when work should span one or more detached tasks but still behave like one job with a single owner context. TaskFlow is the durable flow substrate under authoring layer
frontend-design
108.4kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
