This is 'Ludi' an experimental programming language. Inspired by APL, it is focused on multidimensional arrays, and has a number of basic features that you can play around with in the interpreter. I am logging and documenting the developement at twilson.xyz
> let x = [4 3 2];
> let y = 5;
> print(x*y)
20 15 10
> let z = reshape(iota(8), [2 2 2])
> print(z)
1 2
3 4
5 6
7 8
> fn inc(x) { x+1 }
> print(inc(1));
2
> print(inc([0 0 1]));
1 1 2
> print(inc(z));
2 3
4 5
6 7
8 9
With a standard Rust toolchain it the interpreter can be built and run:
cargo run -p interpreter
- Interpreter (80%)
- Type checking (75%)
- Code generation (50%)
- Optimizations (10%)
- Rust 2021 edition
- LLVM 18 and MLIR via the
melior
crate- It is recommended that you clone & build
melior
in the same directory as you put this one
- It is recommended that you clone & build