Closed schungx closed 3 years ago
Oh wow, there's been a lot of neat development that eluded my sight. That's awesome :D I'll see if I can help with some of these in the future!
Kudos to the team that laid all the superb groundwork beforehand!
I'm probably spending way more time on this than I really should... but...
it seems like the language is at a reasonably stable state with most of the low hanging fruits already picked. To speed up Rhai further will really require some hefty architectural changes, time for which may be productively spent on implementing other useful features instead.
So... what feature do you fancy to be added to Rhai next?
I would probably pick one of the following:
eval_expr
and eval_stmt
as predicted. there are no more low-hanging fruits...Is version 1.0 (or next intermediate semver-incompatible version) a good chance to fix Cargo features to be positive instead of negative?
I am still divided on this - on the one hand, it may break a lot of existing code. On the other hand, it conforms to "standard".
I think I'll let the community ponder it more before deciding to change it for 1.0...
@schungx Personally I would vote for this one:
first-class functions and closures
Even having first-class functions without closures would be very good. This is something I need to make structural data constructions more concise in my project that is using rhai extensively.
I would suggest a syntax in a form conformed with Rust, so something like |x, y, z| (x + y) / z
and/or |x, y, z| {let sum = x + y; sum / z}
.
Will be happy to help with this implementation if you need more hands. LMK. Thanks!
Actually I've already put in place all the mechanism needed to parse the closure syntax.
The current idea is |x, y, z| expr
will create an anonymous function based on the hash of the function body. Say it is fn $abcdefg1234567$(x, y, z)
. Then it will replace the closure with Fn("$abcdefg1234567$")
.
Then other than not being able to capture the running environment, this will look almost like standard OOP.
Anonymous functions (not closures) support already in, together with the ability to curry a function.
Full closures with capturing merged in.
This is thanks to the work of @Eliah-Lakhin
And I want to say thank you to @schungx for his great work in development and maintenance of Rhai! Without his help in stabilizing of my prototype and implementing of other related features it wouldn't be possible to deliver this feature that fast.
Rhai in my opinion is the most promising and well maintained embedded scripting project in Rust ecosystem.
Plugins system (powered by procedural macros) merged in.
Thanks to @jhwgh1968
Documentation: https://schungx.github.io/rhai/vnext/plugins/index.html
A minor new feature lands: try
... catch
statements.
https://schungx.github.io/rhai/vnext/language/try-catch.html
A try
block catches most catchable errors, other than non-catchable ones... well...
The particular implementation technique of treating return values and loop breaks from the very beginning of this repo translates well to implementing this, which took very little time and very little code for perhaps a high impact new language feature.
Deprecating this list in favor of new feature requests as new issues.
pre 1.0
1.0
rhaifmt
formatter.closed
no-std
(https://github.com/jonathandturner/rhai/issues/19) closed by https://github.com/jonathandturner/rhai/pull/103eval
closed by https://github.com/jonathandturner/rhai/pull/110in
operator (https://github.com/jonathandturner/rhai/issues/124) closed by https://github.com/jonathandturner/rhai/pull/128serde
support (https://github.com/jonathandturner/rhai/issues/174) closed by https://github.com/jonathandturner/rhai/issues/176panic
the whole system (https://github.com/jonathandturner/rhai/issues/102)mdbook
to convert theREADME
into The Rhai BookEngine
and environment (https://github.com/jonathandturner/rhai/issues/19#issuecomment-593901726) closed by https://github.com/jonathandturner/rhai/pull/176