| Crates.io | slothlang |
| lib.rs | slothlang |
| version | 1.4.0 |
| created_at | 2022-07-30 15:27:47.174022+00 |
| updated_at | 2023-04-11 20:02:09.659627+00 |
| description | A weird, slow and a bit moldy interpreted programming language |
| homepage | |
| repository | https://github.com/MyselfLeo/sloth |
| max_upload_size | |
| id | 635582 |
| size | 225,512 |
Sloth is an interpreted programming language, implemented in Rust. Its syntax is inspired by C-like languages, Rust, Python, and Lisp-like languages.
I do not ensure the stability of the language: use it at your own risk!
// Return the factorial of @0
define factorial: num -> num {
@return = 1;
i = 2;
while <= i @0 {
@return = * @return i;
i = + i 1;
};
}
define @main: num -> num {
print(factorial(@0) "\n");
}
Some fundamentals of the Sloth syntax:
@: @main, @self, @return...@return@self@0, @1, etc.Sloth does not provide common features like else blocks, for loops, etc. There is no error management yet, no compiled module yet, etc.
However, you can overload operators! 🎉
Install using cargo:
$ cargo install slothlang
I may provide executables in the future.
Sloth is licensed under the Apache-2.0 License.