Skip to content

RustScript is a functional scripting language with as much relation to Rust as JavaScript has to Java.

License

Notifications You must be signed in to change notification settings

WilliamRagstad/RustScript

 
 

Repository files navigation

Deprecated

View the latest development here: https://github.com/mkhan45/RustScript2



RustScript is a scripting language with as much relation to Rust as JavaScript has to Java.

GitHub release (latest by date) GitHub downloads all releases Lines of code All Contributors


📥 Install

Download the latest version of this version of the RustScript CLI tool, or view all releases.


Usage

🔌Run

Don't forget to download the latest version from above, and install the RustScript toolchain as described in the README.md installation instructions file that comes pre-packaged.

Run the rsc command with either the --help or -h option to show the user manual or help page for the CLI tool. Execute scripts using the following command.

rsc hello.rs world.rs

Or if you haven't installed the native CLI binaries, run the rsc.jar file using:

java -jar rsc.jar hello.rs

🔨 Build

If you want to build RustScript on your own. Install the WiX Toolset (dist/tools/wix311.exe) and run the build.bat script from the root directory to build the Cli.java class into the standalone executables to dist/bin/.

You can also simply compile the class files by running the compile.bat script from the root directory, and run any module using java Repl for example.

Documentation

Learn more about the RustScript language by visiting the links below! A good tip is to download the rsc CLI tool and start playing around with the examples yourself!

REPL

Start the interactive REPL command tool by running rsc -r or rsc --repl. Once started, a little > will appear prompting for an expression to evaluate. You can run anything here as long as it is kept on one line. Expression can be easily separated by semi-colons ;, and their result will be displayed belowed.

There are also a set of custom commands used when moving around in the local file system. This is done to make it easier to navigate to files that you want to import variables from into your session.

Commands

Command Arguments Description
pwd Display the current working directory
ls List all files in the current working directory
cd [path] Change current working directory

Community

The RustScript language is developed by a group of volunteers. To further support the project, we welcome any and all feedback, contributions and engagement!

✨ Contributors

Thanks goes to these wonderful people (emoji key):


William Rågstad

🚧 ⚠️ 💻 🎨

Mikail Khan

📖 ⚠️ 💻

Mike Samuel

📖

This project follows the all-contributors specification. Contributions of any kind welcome!

Logo Credits

The logo is a modified image by Smashicons from Flaticon. The original images can be found here or in the assets folder.

License

RustScript is free and open source! All code in this repository is dual-licensed under either:

at your option. This means you can select the license you prefer! This dual-licensing approach is the de-facto standard in the Rust ecosystem and there are very good reasons to include both. Read more about Rusts license model here.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

You can join our community discord server and chat with the dev team! All feedback and support is greatly appreciated!