rhai icon indicating copy to clipboard operation
rhai copied to clipboard

Rhai standard library.

Open LordMZTE opened this issue 2 years ago • 12 comments

There currently seems to be no plugin/library that allows giving rhai scripts full system access by allowing them to do things like spawning subprocesses or doing filesystem operations. Is something like this planned as an optional feature or has someone already made this as a seperate crate?

LordMZTE avatar Sep 23 '21 13:09 LordMZTE

Not really. It was originally planned but nobody sorta got around to it...

In fact, the entire Rhai plugins system was originally written just so that such a sys library could be developed...

schungx avatar Sep 23 '21 13:09 schungx

Seeking contributors to build up Rhai's standard library.

schungx avatar Nov 01 '21 02:11 schungx

When I chose the script engine, I found that there is a standard module. We can learn from it

rune_modules

cn-kali-team avatar Dec 29 '21 05:12 cn-kali-team

It is true. It does leave something to be desired.

I agree that having a basic standard module is a quite urgent need.

schungx avatar Dec 29 '21 08:12 schungx

Jazz's standard fs library and fs-extras library are adequate for Jazz Flute, the standard application framework. The other crates that are integrated by default in the scripting environment can also be found in the bindings directory.

rhai's RandomPackage makes it look pretty easy to integrate with Jazz.

naturallymitchell avatar Dec 29 '21 19:12 naturallymitchell

@dankope has indicated that he'd work on this... let me see if this mention is enough to assign this issue to him...

EDIT: Hmmm.... looks like no. @dankope, would you make a comment here so I can assign you?

schungx avatar Sep 29 '22 06:09 schungx

EDIT: Hmmm.... looks like no. @dankope, would you make a comment here so I can assign you?

Should be able to assign me now, hopefully.

emesare avatar Sep 29 '22 13:09 emesare

First package done! Please try it out and leave feedback on what should be changed/fixed, thanks. https://github.com/rhaiscript/rhai-fs

The next package will most likely be networking. The networking package will only use what is available in the rust std library to ensure compatibility.

emesare avatar Oct 13 '22 18:10 emesare

Any updates on the networking package?

eliabieri avatar Mar 06 '23 15:03 eliabieri

Any updates on the networking package?

Hi, thank you for asking, I have been busy lately however I should have some time next week to get it in a good shape for publishing, thanks again for taking the time to ask.

emesare avatar Mar 11 '23 01:03 emesare

The networking package has been pushed to the preliminary stage (aka not in the rhai org yet) here: https://github.com/emesare/rhai-net! Currently it supports TCP server and client functionality however there is quite a bit still yet to be done, I will have the issues for it filled out later tomorrow hopefully, so everyone is on the same page as to what to expect. My goal is to have it be extensible via other rust packages for example an HTTP client rhai package could include this and use its SharedTcpStream to retrieve an open stream to then read/write from.

emesare avatar Mar 18 '23 02:03 emesare

@eliabieri I wonder if the networking package is still progressing?

schungx avatar Nov 29 '23 04:11 schungx