A language meant for easy Math operations!
Clone the repo, and run:
cargo run -- <file-name>.mth
In this language you can:
- Declare variables:
x = 2 * 5 + 1
y = x * 2
- Declare functions:
f(x) = x * 2
g(x, y) = x + 1 / y
- For-like loop--the from-to-as loop:
from 0 to 10 as x {
# Stuff...
}
You can also use a custom step (defaults to 1.0):
from 0 to 10 as x with step 2 {
# Stuff...
}
- Use lists and iterate over them with a for-in loop:
x = [1, 2, 3]
for y in x {
y
}
- Print expressions:
f(x) = x * 2 - 2
from 0 to 10 as x {
f(x) # The result will be printed out! btw this is a comment, this will be ignored
}
- Built-in functions (sin, cos, tan, ...)
- Constants (PI, TAU, GOLDEN RATIO, ...)
- C-like macros to config interpretation (e.g. set angle mode to degrees, radian, or grad, ...)