Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

An embeddable dynamic programming language for Rust.

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
NotificationsYou must be signed in to change notification settings

rune-rs/rune

rune logo


Visit the site 🌐Read the book 📖

rune

githubcrates.iodocs.rsbuild statuschat on discord

The Rune Language, an embeddable dynamic programming language for Rust.


Contributing

If you want to help out, please have a look atOpen Issues.


Highlights of Rune


Rune scripts

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.


Running scripts from Rust

You can find more examplesin theexamples 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-APACHE
MIT
LICENSE-MIT

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Contributors44


[8]ページ先頭

©2009-2025 Movatter.jp