Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracking issue for new features #100

Closed
schungx opened this issue Mar 3, 2020 · 13 comments
Closed

Tracking issue for new features #100

schungx opened this issue Mar 3, 2020 · 13 comments

Comments

@schungx
Copy link
Collaborator

schungx commented Mar 3, 2020

pre 1.0

1.0

closed

@luciusmagn
Copy link
Collaborator

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!

@schungx
Copy link
Collaborator Author

schungx commented Apr 24, 2020

Kudos to the team that laid all the superb groundwork beforehand!

@schungx
Copy link
Collaborator Author

schungx commented Jun 1, 2020

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:

  • first-class functions and closures
  • string interpolation (and maybe overhaul entirely the way strings are handled, or mis-handled right now) - but do people really use Rhai for heavy strings-manipulation?
  • threads/fibers/actors? coroutines?
  • go-for-it: byte-codes. I profiled a number of benchmarks and it seems like most of the time are now spent in eval_expr and eval_stmt as predicted. there are no more low-hanging fruits...

@vi
Copy link

vi commented Jul 10, 2020

Is version 1.0 (or next intermediate semver-incompatible version) a good chance to fix Cargo features to be positive instead of negative?

@schungx
Copy link
Collaborator Author

schungx commented Jul 10, 2020

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...

@Eliah-Lakhin
Copy link
Contributor

@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!

@schungx
Copy link
Collaborator Author

schungx commented Jul 17, 2020

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.

@schungx
Copy link
Collaborator Author

schungx commented Jul 23, 2020

Anonymous functions (not closures) support already in, together with the ability to curry a function.

@schungx
Copy link
Collaborator Author

schungx commented Aug 4, 2020

Full closures with capturing merged in.

This is thanks to the work of @Eliah-Lakhin

@Eliah-Lakhin
Copy link
Contributor

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.

@schungx
Copy link
Collaborator Author

schungx commented Aug 31, 2020

Plugins system (powered by procedural macros) merged in.

Thanks to @jhwgh1968

Documentation: https://schungx.github.io/rhai/vnext/plugins/index.html

@schungx
Copy link
Collaborator Author

schungx commented Oct 21, 2020

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.

@schungx
Copy link
Collaborator Author

schungx commented Jan 6, 2021

Deprecating this list in favor of new feature requests as new issues.

@schungx schungx closed this as completed Jan 6, 2021
@schungx schungx unpinned this issue Jan 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants