- Notifications
You must be signed in to change notification settings - Fork99
An embeddable dynamic programming language for Rust.
License
Apache-2.0, MIT licenses found
Licenses found
Apache-2.0
LICENSE-APACHEMIT
LICENSE-MITNotificationsYou must be signed in to change notification settings
rune-rs/rune
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Visit the site 🌐—Read the book 📖
The Rune Language, an embeddable dynamic programming language for Rust.
If you want to help out, please have a look atOpen Issues.
- Runs a compact representation of the language on top of an efficientstack-based virtual machine.
- CleanRust integration 💻.
- Multithreaded 📖 execution.
- Hot reloading 📖.
- Memory safe throughreference counting 📖.
- Awesome macros 📖 andTemplate literals 📖.
- Try operators 📖 andPattern matching 📖.
- Structs and enums 📖 with associated data andfunctions.
- Dynamic containers likevectors 📖,objects📖, andtuples 📖 all without-of-the-boxserde support 💻.
- First-classasync support 📖 withGenerators 📖.
- Dynamicinstance functions 📖.
- Stack isolation 📖 between function calls.
You can run Rune programs with the bundled CLI:
cargo run --bin rune -- run scripts/hello_world.rn
If you want to see detailed diagnostics of your program while it's running,you can use:
cargo run --bin rune -- run scripts/hello_world.rn --dump --trace
See--help
for more information.
You can find more examplesin the
examples
folder.
The following is a complete example, including rich diagnostics usingtermcolor
. It can be made much simpler if this is not needed.
use rune::{Context,Diagnostics,Source,Sources,Vm};use rune::termcolor::{ColorChoice,StandardStream};use rune::sync::Arc;let context =Context::with_default_modules()?;letmut sources =Sources::new();sources.insert(Source::memory("pub fn add(a, b) { a + b }")?);letmut diagnostics =Diagnostics::new();let result = rune::prepare(&mut sources).with_context(&context).with_diagnostics(&mut diagnostics).build_vm();if !diagnostics.is_empty(){letmut writer =StandardStream::stderr(ColorChoice::Always); diagnostics.emit(&mut writer,&sources)?;}letmut vm = result?;let output = vm.call(["add"],(10i64,20i64))?;let output:i64 = rune::from_value(output)?;println!("{}", output);
About
An embeddable dynamic programming language for Rust.
Topics
Resources
License
Apache-2.0, MIT licenses found
Licenses found
Apache-2.0
LICENSE-APACHEMIT
LICENSE-MITCode of conduct
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.