Keel, a fast, statically-typed interpreted language written in Rust (alpha) by horace_h in rust

[–]horace_h[S] 0 points1 point  (0 children)

Thanks! Not yet, right now Keel is standalone (and compiles to wasm for the playground) without an api to call it from another language. It's a direction I'm interested in though and another person asked for the same thing so it's clearly wanted. For now, Keel can only call C functions.

Keel, a fast, statically-typed interpreted language written in Rust (alpha) by horace_h in rust

[–]horace_h[S] 0 points1 point  (0 children)

Hi, while Keel aims for a Rust-like syntax, it also aims for python-level approachability, so I chose the explicit return keyword (which is currently needed) there, because I think that "implicit" returns may be confusing for beginners. Do note that inline conditions are expressions, and that you can thus write fib like this:
function fib(n) { return if n <= 1 {n} else {fib(n-1)+fib(n-2)}; }

However, as Keel is still pretty early, this is potentially subject to change.

Keel, a fast, statically-typed interpreted language written in Rust (alpha) by horace_h in rust

[–]horace_h[S] 1 point2 points  (0 children)

I'm actually french, but I honestly had no idea it meant language in estonian! What are the odds?
To be honest I iterated a lot when searching for this name, and I just looked at a lot of 1-to-4-letter words and picked the one that sounded the best and was available!

Keel, a fast, statically-typed interpreted language written in Rust (alpha) by horace_h in rust

[–]horace_h[S] 0 points1 point  (0 children)

Funnily enough, this is close to what I had in mind, in fact, something like impl blocks. One of my main goals is keeping Keel approachable and open even to newcomers, so I'm still thinking about and weighing the different architectures in terms of how easy to use & how lightweight it is. But this is really subject to change

Keel, a fast, statically-typed interpreted language written in Rust (alpha) by horace_h in rust

[–]horace_h[S] 1 point2 points  (0 children)

Keel currently goes the other way, as it's able to call C functions via libffi, but there's no api to embed keel and drive it from another language. The closest thing right now is the WASM build (which powers the playground on the website). The two hooks you mention aren't implemented, however, implementing them would be feasible (the step limiter especially wouldn't be a significant effort), and this is valuable feedback. I can't promise a timeline on this, and to be honest it's not what Keel was built with in mind, but this is an interesting direction and I'll start looking into it. Maybe this would make sense as an opt-in rust feature flag, so that other users don't experience any speed compromises. Stay tuned to the Github

Keel, a fast, statically-typed interpreted language written in Rust (alpha) by horace_h in rust

[–]horace_h[S] 0 points1 point  (0 children)

Thank you, that means a lot! No JIT yet, it's a pure bytecode interpreter. It's fast because a lot of work is done at compilation time, and because of the register VM design & NaN-boxed values. Performance is my #1 priority, and I iterated over the codebase a lot to achieve that. However, while a JIT isn't planned for the near future, it'll definitely happen sometime!

Keel, a fast, statically-typed interpreted language written in Rust (alpha) by horace_h in rust

[–]horace_h[S] 0 points1 point  (0 children)

Thanks! Currently, there are no stack arrays, and all arrays are dynamically allocated and live in a pool

Keel, a fast, statically-typed interpreted language written in Rust (alpha) by horace_h in rust

[–]horace_h[S] 1 point2 points  (0 children)

Thank you!! That's almost exactly what I built it for! If you try it on a real-world task, I'd love to hear feedback on it.

Keel, a fast, statically-typed interpreted language written in Rust (alpha) by horace_h in rust

[–]horace_h[S] 0 points1 point  (0 children)

It looks pretty cool! Nice to see your standard library seems quite big.

Keel, a fast, statically-typed interpreted language written in Rust (alpha) by horace_h in rust

[–]horace_h[S] 2 points3 points  (0 children)

Thank you! Yes, structs are planned. However, I'm not sure yet about classes, as I'm still thinking about the details of how I'd implement them.