├── book ├── .gitignore ├── src │ ├── string_literals.md │ ├── deprecated.md │ ├── advanced.md │ ├── concepts.md │ ├── try_operator.md │ ├── streams.md │ ├── dynamic_types.md │ ├── structs.md │ └── hot_reloading.md ├── book.toml └── README.md ├── crates ├── rune │ ├── .gitignore │ ├── Rune.toml │ ├── src │ │ ├── tests │ │ │ ├── workspace │ │ │ │ ├── package-a │ │ │ │ │ ├── Rune.toml │ │ │ │ │ ├── src │ │ │ │ │ │ ├── lib.rn │ │ │ │ │ │ ├── main.rn │ │ │ │ │ │ └── bin │ │ │ │ │ │ │ ├── named-executable.rn │ │ │ │ │ │ │ └── multi-file-executable │ │ │ │ │ │ │ ├── main.rn │ │ │ │ │ │ │ └── module │ │ │ │ │ │ │ └── mod.rn │ │ │ │ │ ├── tests │ │ │ │ │ │ ├── fire │ │ │ │ │ │ │ ├── lib.rn │ │ │ │ │ │ │ └── main.rn │ │ │ │ │ │ └── smoke.rn │ │ │ │ │ ├── examples │ │ │ │ │ │ ├── simple.rn │ │ │ │ │ │ └── multi-file-example │ │ │ │ │ │ │ ├── lib.rn │ │ │ │ │ │ │ └── main.rn │ │ │ │ │ └── benches │ │ │ │ │ │ ├── multi-file-bench │ │ │ │ │ │ ├── main.rn │ │ │ │ │ │ └── collatz.rn │ │ │ │ │ │ └── collatz.rn │ │ │ │ ├── nested │ │ │ │ │ └── package-b │ │ │ │ │ │ ├── Rune.toml │ │ │ │ │ │ ├── src │ │ │ │ │ │ ├── lib.rn │ │ │ │ │ │ ├── main.rn │ │ │ │ │ │ └── bin │ │ │ │ │ │ │ ├── named-executable.rn │ │ │ │ │ │ │ └── multi-file-executable │ │ │ │ │ │ │ ├── main.rn │ │ │ │ │ │ │ └── module │ │ │ │ │ │ │ └── mod.rn │ │ │ │ │ │ ├── tests │ │ │ │ │ │ ├── fire │ │ │ │ │ │ │ ├── lib.rn │ │ │ │ │ │ │ └── main.rn │ │ │ │ │ │ └── smoke.rn │ │ │ │ │ │ ├── examples │ │ │ │ │ │ ├── simple.rn │ │ │ │ │ │ └── multi-file-example │ │ │ │ │ │ │ ├── lib.rn │ │ │ │ │ │ │ └── main.rn │ │ │ │ │ │ └── benches │ │ │ │ │ │ ├── multi-file-bench │ │ │ │ │ │ ├── main.rn │ │ │ │ │ │ └── collatz.rn │ │ │ │ │ │ └── collatz.rn │ │ │ │ └── Rune.toml │ │ │ ├── vm_blocks.rs │ │ │ ├── vm_not_used.rs │ │ │ ├── bug_428.rs │ │ │ ├── vm_assign_exprs.rs │ │ │ ├── vm_async_block.rs │ │ │ ├── compiler_fn.rs │ │ │ ├── esoteric_impls.rs │ │ │ ├── compiler_expr_assign.rs │ │ │ ├── vm_test_mod.rs │ │ │ ├── bug_454.rs │ │ │ ├── vm_result.rs │ │ │ ├── compiler_warnings.rs │ │ │ ├── continue_.rs │ │ │ ├── unreachable.rs │ │ │ ├── bug_422.rs │ │ │ ├── result.rs │ │ │ ├── rename_type.rs │ │ │ ├── bug_417.rs │ │ │ ├── capture.rs │ │ │ ├── static_typing.rs │ │ │ ├── comments.rs │ │ │ ├── binary.rs │ │ │ ├── compiler_patterns.rs │ │ │ ├── wildcard_imports.rs │ │ │ ├── vm_try.rs │ │ │ ├── vm_test_instance_fns.rs │ │ │ ├── f64.rs │ │ │ ├── compiler_literals.rs │ │ │ ├── moved.rs │ │ │ ├── compiler_use.rs │ │ │ ├── macros │ │ │ │ └── stringy_math.rs │ │ │ └── option.rs │ │ ├── hashbrown │ │ │ └── mod.rs │ │ ├── runtime │ │ │ ├── slice.rs │ │ │ ├── env │ │ │ │ └── std.rs │ │ │ ├── budget │ │ │ │ ├── std.rs │ │ │ │ └── no_std.rs │ │ │ ├── steps_between.rs │ │ │ ├── protocol.rs │ │ │ ├── iterator.rs │ │ │ └── select.rs │ │ ├── doc │ │ │ ├── static │ │ │ │ ├── fonts │ │ │ │ │ ├── FiraSans-Medium.woff2 │ │ │ │ │ ├── FiraSans-Regular.woff2 │ │ │ │ │ ├── SourceSerif4-Bold.woff2 │ │ │ │ │ ├── SourceCodePro-It.ttf.woff2 │ │ │ │ │ ├── SourceCodePro-Regular.woff2 │ │ │ │ │ ├── SourceSerif4-Regular.woff2 │ │ │ │ │ ├── SourceCodePro-Semibold.woff2 │ │ │ │ │ └── NanumBarunGothic-Regular.woff2 │ │ │ │ ├── macro.html.hbs │ │ │ │ ├── index.html.hbs │ │ │ │ ├── function.html.hbs │ │ │ │ └── layout.html.hbs │ │ │ ├── build │ │ │ │ └── js.rs │ │ │ └── mod.rs │ │ ├── hir │ │ │ ├── interpreter.rs │ │ │ ├── mod.rs │ │ │ └── arena │ │ │ │ └── tests.rs │ │ ├── item.rs │ │ ├── parse │ │ │ ├── traits.rs │ │ │ ├── resolve.rs │ │ │ ├── peek.rs │ │ │ └── id.rs │ │ ├── modules │ │ │ ├── macros.rs │ │ │ ├── hash.rs │ │ │ ├── i64.rs │ │ │ ├── u64.rs │ │ │ ├── num.rs │ │ │ ├── stream.rs │ │ │ ├── collections │ │ │ │ └── mod.rs │ │ │ └── slice.rs │ │ ├── languageserver │ │ │ ├── fs.rs │ │ │ └── tests.rs │ │ ├── cli │ │ │ └── languageserver.rs │ │ ├── ast │ │ │ ├── to_ast.rs │ │ │ ├── expr_vec.rs │ │ │ ├── utils.rs │ │ │ ├── expr_try.rs │ │ │ ├── prelude.rs │ │ │ ├── fn_arg.rs │ │ │ ├── expr_empty.rs │ │ │ ├── expr_assign.rs │ │ │ ├── tests.rs │ │ │ ├── expr_lit.rs │ │ │ ├── expr_group.rs │ │ │ ├── expr_await.rs │ │ │ ├── expr_continue.rs │ │ │ ├── expr_return.rs │ │ │ ├── expr_index.rs │ │ │ ├── expr_yield.rs │ │ │ ├── condition.rs │ │ │ ├── expr_call.rs │ │ │ ├── expr_break.rs │ │ │ ├── expr_loop.rs │ │ │ ├── expr_while.rs │ │ │ └── rn_type.rs │ │ ├── compile │ │ │ ├── v1 │ │ │ │ ├── mod.rs │ │ │ │ └── display_named.rs │ │ │ └── names │ │ │ │ └── tests.rs │ │ ├── module │ │ │ └── install_with.rs │ │ ├── ace │ │ │ ├── static │ │ │ │ └── rune-completer.js │ │ │ └── mod.rs │ │ ├── location.rs │ │ ├── workspace │ │ │ ├── glob │ │ │ │ └── tests.rs │ │ │ └── mod.rs │ │ ├── shared │ │ │ ├── gen.rs │ │ │ └── assert_send.rs │ │ ├── musli.rs │ │ └── serde.rs │ ├── tests │ │ ├── ui.rs │ │ ├── tuples.rn │ │ ├── ui │ │ │ ├── install_with_compat.rs │ │ │ └── install_with_compat.stderr │ │ ├── imports.rn │ │ ├── modules_inline.rn │ │ ├── char.rn │ │ ├── function_pointers.rn │ │ ├── modules_vis.rn │ │ ├── int_ops.rn │ │ ├── const.rn │ │ ├── reordering.rn │ │ ├── lazy_and_or.rn │ │ ├── float.rn │ │ ├── instance.rn │ │ ├── types.rn │ │ ├── non_ascii_idents.rn │ │ ├── option.rn │ │ ├── variants.rn │ │ ├── bug_838.rn │ │ ├── result.rn │ │ ├── try.rn │ │ ├── esoteric_impls.rn │ │ ├── typed_tuple.rn │ │ ├── blocks.rn │ │ ├── basics.rn │ │ └── select.rn │ └── benches │ │ ├── fib.rn │ │ └── primes.rn ├── rune-alloc │ ├── .gitignore │ ├── third-party │ │ └── .gitignore │ ├── src │ │ ├── serde │ │ │ └── mod.rs │ │ ├── option │ │ │ ├── mod.rs │ │ │ └── ext.rs │ │ ├── hint.rs │ │ ├── tests.rs │ │ ├── iter │ │ │ ├── mod.rs │ │ │ ├── join.rs │ │ │ └── try_cloned.rs │ │ ├── fmt │ │ │ └── impls.rs │ │ ├── btree │ │ │ ├── set_val.rs │ │ │ └── mod.rs │ │ ├── vec_deque │ │ │ └── macros.rs │ │ ├── limit │ │ │ ├── std.rs │ │ │ └── no_std.rs │ │ ├── testing │ │ │ └── rng.rs │ │ ├── callable.rs │ │ └── vec │ │ │ └── set_len_on_drop.rs │ └── tools │ │ └── import.ps1 ├── rune-wasm │ ├── .gitignore │ ├── rune.js │ ├── module.js │ ├── rollup.config.mjs │ ├── package.json │ └── src │ │ └── time.rs ├── rune-macros │ ├── tests │ │ └── derive.rs │ ├── src │ │ └── path_in.rs │ └── Cargo.toml ├── rune-core │ └── src │ │ ├── item.rs │ │ └── hash │ │ └── into_hash.rs ├── rune-modules │ └── src │ │ └── rand │ │ ├── error.rs │ │ └── os_error.rs ├── rune-cli │ ├── build.rs │ └── Cargo.toml ├── rune-languageserver │ ├── build.rs │ └── Cargo.toml ├── rune-alloc-macros │ └── Cargo.toml ├── rune-tracing-macros │ └── Cargo.toml └── rune-tracing │ └── Cargo.toml ├── site ├── .gitignore ├── content │ ├── play.md │ ├── posts │ │ ├── 2023-10-10-my-project-cli.png │ │ ├── 2023-10-10-is-alphabetic-doc.png │ │ └── _index.md │ └── rune.md ├── static │ └── img │ │ └── logo.png ├── templates │ ├── shortcodes │ │ ├── quote.html │ │ ├── vm.html │ │ └── yt.html │ ├── index.html │ ├── page.html │ └── post.html ├── sass │ ├── _shortcodes.scss │ └── _vars.scss ├── theme.toml └── config.toml ├── editors └── code │ ├── .yarnrc │ ├── .gitignore │ ├── assets │ ├── icon.png │ └── logo.png │ ├── .vscodeignore │ ├── LICENSE.md │ ├── src │ ├── test │ │ ├── suite │ │ │ ├── extension.test.ts │ │ │ └── index.ts │ │ └── runTest.ts │ ├── persistent_state.ts │ └── extension.ts │ ├── .vscode │ ├── settings.json │ ├── launch.json │ └── tasks.json │ ├── .eslintrc.json │ ├── tsconfig.json │ ├── language-configuration.json │ └── LICENSE-MIT ├── scripts ├── book │ ├── the_stack │ │ ├── add.rn │ │ └── call_and_add.rn │ ├── getting_started │ │ ├── hello_world.rn │ │ └── dbg.rn │ ├── items_imports │ │ ├── bar.rn │ │ ├── foo │ │ │ └── mod.rn │ │ ├── missing_item.rn.fail │ │ ├── modules.rn │ │ ├── example_import.rn │ │ ├── inline_modules.rn │ │ └── item_keywords.rn │ ├── compiler_guide │ │ ├── closures.rn │ │ └── dead_code.rn │ ├── template_literals │ │ ├── not_a_template.rn │ │ └── basic_template.rn │ ├── functions │ │ ├── main_function.rn │ │ └── return_value.rn │ ├── tuples │ │ ├── basic_tuples.rn │ │ ├── tuple_masquerade.rn │ │ └── tuple_patterns.rn │ ├── types │ │ ├── bad_type_check.rn │ │ ├── type_check.rn │ │ ├── type_check_patterns.rn │ │ └── types.rn │ ├── primitives │ │ ├── copy.rn │ │ └── primitives.rn │ ├── control_flow │ │ ├── conditional.rn │ │ ├── conditional_else.rn │ │ ├── conditional_else_ifs.rn │ │ ├── numbers_game.rn │ │ └── first_match.rn │ ├── loops │ │ ├── loop_forever.rn │ │ ├── loop_break.rn │ │ └── while_loop.rn │ ├── vectors │ │ ├── vectors_rev.rn │ │ └── vectors.rn │ ├── variables │ │ ├── variables.rn │ │ ├── take_argument.rn │ │ ├── shared_ownership.rn │ │ └── is_readable.rn │ ├── instance_functions │ │ └── missing_instance_fn.rn │ ├── closures │ │ ├── basic_closure.rn │ │ ├── closure_move.rn.fail │ │ └── function_pointers.rn │ ├── pattern_matching │ │ ├── bind.rn │ │ ├── ignore.rn │ │ ├── rest_pattern.rn │ │ ├── fast_cars.rn │ │ └── big_match.rn │ ├── generators │ │ ├── states.rn │ │ ├── error.rn │ │ ├── fib_generator.rn │ │ ├── bootup.rn │ │ └── send_values.rn │ ├── async │ │ ├── async_blocks.rn │ │ ├── async_closure.rn │ │ ├── async_http.rn │ │ ├── async_http_timeout.rn │ │ └── async_http_concurrent.rn │ ├── dynamic_types │ │ └── greeting.rn │ ├── enums │ │ └── count_numbers.rn │ ├── try_operator │ │ └── basic_try.rn │ ├── objects │ │ ├── objects.rn │ │ └── json.rn │ ├── streams │ │ └── basic_stream.rn │ └── structs │ │ ├── user_database.rn │ │ └── struct_matching.rn ├── hello_world.rn ├── broken.rn ├── constant_expr.rn ├── json.rn ├── arrays.rn ├── reverse_iterator.rn ├── not_used.rn ├── signal.rn ├── fib.rn ├── numbers.rn ├── objects.rn ├── generator_as_iter.rn ├── compile-fail │ └── experimental_macro_error.rn.fail ├── strings.rn ├── primes.rn ├── rand.rn ├── http.rn ├── doc.rn ├── generator_resume.rn ├── async.rn └── controls.rn ├── no-std ├── .gitignore └── Cargo.toml ├── tools ├── builder │ ├── .gitignore │ ├── README.md │ └── Cargo.toml ├── site │ ├── .gitignore │ ├── README.md │ ├── Cargo.toml │ └── src │ │ └── main.rs └── generate │ ├── .gitignore │ ├── Cargo.toml │ └── README.md ├── examples ├── examples │ ├── test │ │ ├── module.rn │ │ └── main.rn │ ├── function_hash.rs │ └── lookup_function.rs ├── Rune.toml ├── ace │ ├── .gitignore │ └── README.md ├── README.md ├── scripts │ └── change_me.rn └── Cargo.toml ├── assets ├── icon.png ├── icon.xcf ├── logo.xcf └── social.png ├── benches ├── Rune.toml ├── Cargo.toml ├── README.md └── benches │ └── benchmarks │ └── external_functions.rs ├── .gitattributes ├── Rune.toml ├── .gitignore └── Cargo.toml /book/.gitignore: -------------------------------------------------------------------------------- 1 | book 2 | -------------------------------------------------------------------------------- /crates/rune/.gitignore: -------------------------------------------------------------------------------- 1 | /wip/ 2 | -------------------------------------------------------------------------------- /site/.gitignore: -------------------------------------------------------------------------------- 1 | public/* 2 | static/js -------------------------------------------------------------------------------- /crates/rune-alloc/.gitignore: -------------------------------------------------------------------------------- 1 | /patches/ 2 | -------------------------------------------------------------------------------- /editors/code/.yarnrc: -------------------------------------------------------------------------------- 1 | --ignore-engines true -------------------------------------------------------------------------------- /scripts/book/the_stack/add.rn: -------------------------------------------------------------------------------- 1 | 1 + 3 2 | -------------------------------------------------------------------------------- /crates/rune-alloc/third-party/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | -------------------------------------------------------------------------------- /no-std/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | /Cargo.lock 3 | -------------------------------------------------------------------------------- /crates/rune-wasm/.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /out -------------------------------------------------------------------------------- /scripts/hello_world.rn: -------------------------------------------------------------------------------- 1 | println!("Hello World"); 2 | -------------------------------------------------------------------------------- /tools/builder/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | /Cargo.lock 3 | -------------------------------------------------------------------------------- /tools/site/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | /Cargo.lock 3 | -------------------------------------------------------------------------------- /tools/generate/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | /Cargo.lock 3 | -------------------------------------------------------------------------------- /crates/rune-alloc/src/serde/mod.rs: -------------------------------------------------------------------------------- 1 | mod de; 2 | mod ser; 3 | -------------------------------------------------------------------------------- /scripts/broken.rn: -------------------------------------------------------------------------------- 1 | let v = [1, 2, 3, 4]; 2 | 3 | dbg!(v); 4 | -------------------------------------------------------------------------------- /examples/examples/test/module.rn: -------------------------------------------------------------------------------- 1 | pub fn test() { 2 | 42 3 | } 4 | -------------------------------------------------------------------------------- /scripts/book/getting_started/hello_world.rn: -------------------------------------------------------------------------------- 1 | println!("Hello World"); 2 | -------------------------------------------------------------------------------- /scripts/book/items_imports/bar.rn: -------------------------------------------------------------------------------- 1 | pub fn number() { 2 | 1 3 | } 4 | -------------------------------------------------------------------------------- /assets/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rune-rs/rune/HEAD/assets/icon.png -------------------------------------------------------------------------------- /assets/icon.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rune-rs/rune/HEAD/assets/icon.xcf -------------------------------------------------------------------------------- /assets/logo.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rune-rs/rune/HEAD/assets/logo.xcf -------------------------------------------------------------------------------- /crates/rune/Rune.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rune" 3 | version = "0.0.0" 4 | -------------------------------------------------------------------------------- /examples/Rune.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "examples" 3 | version = "0.0.0" 4 | -------------------------------------------------------------------------------- /scripts/book/items_imports/foo/mod.rn: -------------------------------------------------------------------------------- 1 | pub fn number() { 2 | 2 3 | } 4 | -------------------------------------------------------------------------------- /site/content/play.md: -------------------------------------------------------------------------------- 1 | +++ 2 | template = "play.html" 3 | +++ 4 | 5 | The REP -------------------------------------------------------------------------------- /assets/social.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rune-rs/rune/HEAD/assets/social.png -------------------------------------------------------------------------------- /benches/Rune.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rune-benches" 3 | version = "0.0.0" 4 | -------------------------------------------------------------------------------- /scripts/constant_expr.rn: -------------------------------------------------------------------------------- 1 | const VALUE = 0b001 << 3; 2 | 3 | dbg!(VALUE == 8); 4 | -------------------------------------------------------------------------------- /scripts/json.rn: -------------------------------------------------------------------------------- 1 | let data = json::from_string("{\"key\": 42}"); 2 | dbg!(data); 3 | -------------------------------------------------------------------------------- /scripts/arrays.rn: -------------------------------------------------------------------------------- 1 | let a = [1, 2, 3, 4]; 2 | let b = [5, 6, 7, 8]; 3 | dbg!(a, b); 4 | -------------------------------------------------------------------------------- /scripts/book/compiler_guide/closures.rn: -------------------------------------------------------------------------------- 1 | let callable = || 42; 2 | dbg!(callable()); 3 | -------------------------------------------------------------------------------- /scripts/reverse_iterator.rn: -------------------------------------------------------------------------------- 1 | for v in (0..10).iter().rev() { 2 | dbg!(v); 3 | } 4 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | **/generated.rs linguist-generated=true 2 | **/generated.rs -diff -merge 3 | -------------------------------------------------------------------------------- /crates/rune-alloc/src/option/mod.rs: -------------------------------------------------------------------------------- 1 | pub use self::ext::OptionExt; 2 | pub(crate) mod ext; 3 | -------------------------------------------------------------------------------- /examples/ace/.gitignore: -------------------------------------------------------------------------------- 1 | rune-autocomplete.js 2 | rune-mode.js 3 | rune-highlight-rules.js 4 | -------------------------------------------------------------------------------- /scripts/book/template_literals/not_a_template.rn: -------------------------------------------------------------------------------- 1 | let vec = [1, 2, 3]; 2 | dbg!(`${vec}`); 3 | -------------------------------------------------------------------------------- /crates/rune/src/tests/workspace/package-a/Rune.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "a" 3 | version = "0.0.0" -------------------------------------------------------------------------------- /crates/rune/src/tests/workspace/package-a/src/lib.rn: -------------------------------------------------------------------------------- 1 | pub fn get_name() { 2 | "a/lib" 3 | } 4 | -------------------------------------------------------------------------------- /editors/code/.gitignore: -------------------------------------------------------------------------------- 1 | out 2 | dist 3 | server 4 | node_modules 5 | .vscode-test/ 6 | *.vsix 7 | -------------------------------------------------------------------------------- /scripts/book/functions/main_function.rn: -------------------------------------------------------------------------------- 1 | pub fn main() { 2 | println!("Hello World"); 3 | } 4 | -------------------------------------------------------------------------------- /scripts/book/tuples/basic_tuples.rn: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | (1, "test") 3 | } 4 | 5 | dbg!(foo()); 6 | -------------------------------------------------------------------------------- /site/static/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rune-rs/rune/HEAD/site/static/img/logo.png -------------------------------------------------------------------------------- /scripts/book/items_imports/missing_item.rn.fail: -------------------------------------------------------------------------------- 1 | pub fn main() { 2 | let foo = Foo::new(); 3 | } 4 | -------------------------------------------------------------------------------- /scripts/book/template_literals/basic_template.rn: -------------------------------------------------------------------------------- 1 | let age = 30; 2 | dbg!(`I am ${age} years old!`); 3 | -------------------------------------------------------------------------------- /scripts/not_used.rn: -------------------------------------------------------------------------------- 1 | "hello world"; 2 | 'a'; 3 | [42, 42]; 4 | #{ "foo": 42, "bar": [1, 2, 3, 4] }; 5 | -------------------------------------------------------------------------------- /tools/site/README.md: -------------------------------------------------------------------------------- 1 | # site 2 | 3 | A small utility to build the guts of https://rune-rs.github.io 4 | -------------------------------------------------------------------------------- /crates/rune/src/tests/workspace/nested/package-b/Rune.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "b" 3 | version = "0.0.0" -------------------------------------------------------------------------------- /crates/rune/src/tests/workspace/nested/package-b/src/lib.rn: -------------------------------------------------------------------------------- 1 | pub fn get_name() { 2 | "b/lib" 3 | } 4 | -------------------------------------------------------------------------------- /editors/code/assets/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rune-rs/rune/HEAD/editors/code/assets/icon.png -------------------------------------------------------------------------------- /editors/code/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rune-rs/rune/HEAD/editors/code/assets/logo.png -------------------------------------------------------------------------------- /scripts/book/types/bad_type_check.rn: -------------------------------------------------------------------------------- 1 | assert!(["hello", "world"] is String, "vectors should be strings"); 2 | -------------------------------------------------------------------------------- /tools/builder/README.md: -------------------------------------------------------------------------------- 1 | # builder 2 | 3 | A utility project for building and packaging Rune binaries. 4 | -------------------------------------------------------------------------------- /Rune.toml: -------------------------------------------------------------------------------- 1 | [workspace] 2 | members = [ 3 | "benches", 4 | "examples", 5 | "crates/rune", 6 | ] 7 | -------------------------------------------------------------------------------- /crates/rune/src/tests/workspace/package-a/src/main.rn: -------------------------------------------------------------------------------- 1 | pub fn main() { 2 | println!("running a/bin") 3 | } 4 | -------------------------------------------------------------------------------- /scripts/book/items_imports/modules.rn: -------------------------------------------------------------------------------- 1 | mod foo; 2 | mod bar; 3 | 4 | dbg!(foo::number() + bar::number()); 5 | -------------------------------------------------------------------------------- /crates/rune/src/hashbrown/mod.rs: -------------------------------------------------------------------------------- 1 | pub(crate) use self::table::{IterRef, KeysRef, Table, ValuesRef}; 2 | mod table; 3 | -------------------------------------------------------------------------------- /crates/rune/src/tests/workspace/package-a/tests/fire/lib.rn: -------------------------------------------------------------------------------- 1 | pub(super) fn check() { 2 | assert!(true) 3 | } 4 | -------------------------------------------------------------------------------- /scripts/book/primitives/copy.rn: -------------------------------------------------------------------------------- 1 | let a = 1; 2 | let b = a; 3 | a = 2; 4 | println!("{a}"); 5 | println!("{b}"); 6 | -------------------------------------------------------------------------------- /scripts/book/the_stack/call_and_add.rn: -------------------------------------------------------------------------------- 1 | fn foo(a, b) { 2 | a + b 3 | } 4 | 5 | let a = 3; 6 | foo(1, 2) + a 7 | -------------------------------------------------------------------------------- /book/src/string_literals.md: -------------------------------------------------------------------------------- 1 | You're probably looking for the section about [Template literals](template_literals.md). 2 | -------------------------------------------------------------------------------- /crates/rune/src/tests/workspace/nested/package-b/src/main.rn: -------------------------------------------------------------------------------- 1 | pub fn main() { 2 | println!("running b/bin") 3 | } 4 | -------------------------------------------------------------------------------- /crates/rune/src/tests/workspace/nested/package-b/tests/fire/lib.rn: -------------------------------------------------------------------------------- 1 | pub(super) fn check() { 2 | assert!(true) 3 | } 4 | -------------------------------------------------------------------------------- /crates/rune/src/tests/workspace/package-a/examples/simple.rn: -------------------------------------------------------------------------------- 1 | pub fn main() { 2 | println!("running a/simple") 3 | } 4 | -------------------------------------------------------------------------------- /scripts/signal.rn: -------------------------------------------------------------------------------- 1 | println!("Waiting for ctrl-c"); 2 | signal::ctrl_c().await?; 3 | println!("Received ctrl-c event"); 4 | -------------------------------------------------------------------------------- /crates/rune/src/runtime/slice.rs: -------------------------------------------------------------------------------- 1 | //! Types for working with slices. 2 | 3 | mod iter; 4 | pub(crate) use self::iter::Iter; 5 | -------------------------------------------------------------------------------- /crates/rune/src/tests/workspace/Rune.toml: -------------------------------------------------------------------------------- 1 | [workspace] 2 | members = [ 3 | "package-a", 4 | "nested/package-b" 5 | ] 6 | -------------------------------------------------------------------------------- /crates/rune/src/tests/workspace/nested/package-b/examples/simple.rn: -------------------------------------------------------------------------------- 1 | pub fn main() { 2 | println!("running b/simple") 3 | } 4 | -------------------------------------------------------------------------------- /crates/rune/src/tests/workspace/package-a/tests/fire/main.rn: -------------------------------------------------------------------------------- 1 | mod lib; 2 | 3 | #[test] 4 | fn fire() { 5 | lib::check(); 6 | } 7 | -------------------------------------------------------------------------------- /examples/examples/test/main.rn: -------------------------------------------------------------------------------- 1 | mod module; 2 | 3 | pub fn main() { 4 | println!("A simple example: {}", module::test()); 5 | } 6 | -------------------------------------------------------------------------------- /crates/rune/src/tests/workspace/nested/package-b/tests/fire/main.rn: -------------------------------------------------------------------------------- 1 | mod lib; 2 | 3 | #[test] 4 | fn fire() { 5 | lib::check(); 6 | } 7 | -------------------------------------------------------------------------------- /crates/rune/src/tests/workspace/package-a/src/bin/named-executable.rn: -------------------------------------------------------------------------------- 1 | pub fn main() { 2 | println!("running a/named-executable"); 3 | } 4 | -------------------------------------------------------------------------------- /examples/README.md: -------------------------------------------------------------------------------- 1 | # rune examples 2 | 3 | See: 4 | 5 | * [examples] - wide range of rust code examples. 6 | * [ace] - ace editor integration. -------------------------------------------------------------------------------- /scripts/book/compiler_guide/dead_code.rn: -------------------------------------------------------------------------------- 1 | return foo(); 2 | 3 | fn foo() { 4 | 2 5 | } 6 | 7 | fn bar() { 8 | 3 9 | } 10 | -------------------------------------------------------------------------------- /scripts/book/control_flow/conditional.rn: -------------------------------------------------------------------------------- 1 | let number = 3; 2 | 3 | if number < 5 { 4 | println!("The number is smaller than 5"); 5 | } 6 | -------------------------------------------------------------------------------- /scripts/book/items_imports/example_import.rn: -------------------------------------------------------------------------------- 1 | use std::iter::once; 2 | 3 | let it = once(0); 4 | 5 | dbg!(it.next()); 6 | dbg!(it.next()); 7 | -------------------------------------------------------------------------------- /crates/rune/src/tests/workspace/package-a/examples/multi-file-example/lib.rn: -------------------------------------------------------------------------------- 1 | pub(super) fn get_name() { 2 | "a/multi-file-example" 3 | } 4 | -------------------------------------------------------------------------------- /site/content/posts/2023-10-10-my-project-cli.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rune-rs/rune/HEAD/site/content/posts/2023-10-10-my-project-cli.png -------------------------------------------------------------------------------- /crates/rune/src/tests/workspace/nested/package-b/examples/multi-file-example/lib.rn: -------------------------------------------------------------------------------- 1 | pub(super) fn get_name() { 2 | "b/multi-file-example" 3 | } 4 | -------------------------------------------------------------------------------- /crates/rune/src/tests/workspace/nested/package-b/src/bin/named-executable.rn: -------------------------------------------------------------------------------- 1 | pub fn main() { 2 | println!("running b/named-executable"); 3 | } 4 | -------------------------------------------------------------------------------- /site/content/posts/2023-10-10-is-alphabetic-doc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rune-rs/rune/HEAD/site/content/posts/2023-10-10-is-alphabetic-doc.png -------------------------------------------------------------------------------- /crates/rune/src/doc/static/fonts/FiraSans-Medium.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rune-rs/rune/HEAD/crates/rune/src/doc/static/fonts/FiraSans-Medium.woff2 -------------------------------------------------------------------------------- /crates/rune/src/doc/static/fonts/FiraSans-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rune-rs/rune/HEAD/crates/rune/src/doc/static/fonts/FiraSans-Regular.woff2 -------------------------------------------------------------------------------- /crates/rune/src/tests/workspace/package-a/src/bin/multi-file-executable/main.rn: -------------------------------------------------------------------------------- 1 | mod module; 2 | 3 | pub fn main() { 4 | module::print_name(); 5 | } 6 | -------------------------------------------------------------------------------- /scripts/book/primitives/primitives.rn: -------------------------------------------------------------------------------- 1 | let a = String::from("Hello"); 2 | let b = a; 3 | a.push_str(" World"); 4 | println!("{a}"); 5 | println!("{b}"); 6 | -------------------------------------------------------------------------------- /site/templates/shortcodes/quote.html: -------------------------------------------------------------------------------- 1 |
2 | {{body}}7 | -------------------------------------------------------------------------------- /crates/rune/src/doc/static/fonts/SourceSerif4-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rune-rs/rune/HEAD/crates/rune/src/doc/static/fonts/SourceSerif4-Bold.woff2 -------------------------------------------------------------------------------- /crates/rune/src/tests/workspace/nested/package-b/src/bin/multi-file-executable/main.rn: -------------------------------------------------------------------------------- 1 | mod module; 2 | 3 | pub fn main() { 4 | module::print_name(); 5 | } 6 | -------------------------------------------------------------------------------- /book/book.toml: -------------------------------------------------------------------------------- 1 | [book] 2 | authors = ["John-John Tedro"] 3 | language = "en" 4 | multilingual = false 5 | src = "src" 6 | title = "The Rune Programming Language" 7 | -------------------------------------------------------------------------------- /crates/rune-wasm/rune.js: -------------------------------------------------------------------------------- 1 | import wasm from "./Cargo.toml"; 2 | 3 | export async function init() { 4 | module = await wasm(); 5 | } 6 | 7 | export var module = null; -------------------------------------------------------------------------------- /crates/rune/src/doc/static/fonts/SourceCodePro-It.ttf.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rune-rs/rune/HEAD/crates/rune/src/doc/static/fonts/SourceCodePro-It.ttf.woff2 -------------------------------------------------------------------------------- /crates/rune/src/doc/static/fonts/SourceCodePro-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rune-rs/rune/HEAD/crates/rune/src/doc/static/fonts/SourceCodePro-Regular.woff2 -------------------------------------------------------------------------------- /crates/rune/src/doc/static/fonts/SourceSerif4-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rune-rs/rune/HEAD/crates/rune/src/doc/static/fonts/SourceSerif4-Regular.woff2 -------------------------------------------------------------------------------- /crates/rune/tests/ui.rs: -------------------------------------------------------------------------------- 1 | #![cfg(not(miri))] 2 | 3 | #[test] 4 | fn ui() { 5 | let t = trybuild::TestCases::new(); 6 | t.compile_fail("tests/ui/*.rs"); 7 | } 8 | -------------------------------------------------------------------------------- /scripts/book/loops/loop_forever.rn: -------------------------------------------------------------------------------- 1 | use time::Duration; 2 | 3 | loop { 4 | println!("Hello forever!"); 5 | time::sleep(Duration::from_secs(1)).await; 6 | } 7 | -------------------------------------------------------------------------------- /scripts/fib.rn: -------------------------------------------------------------------------------- 1 | fn fib(n) { 2 | if n <= 1 { 3 | n 4 | } else { 5 | fib(n - 1) + fib(n - 2) 6 | } 7 | } 8 | 9 | dbg!(fib(15)); 10 | -------------------------------------------------------------------------------- /crates/rune/src/doc/static/fonts/SourceCodePro-Semibold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rune-rs/rune/HEAD/crates/rune/src/doc/static/fonts/SourceCodePro-Semibold.woff2 -------------------------------------------------------------------------------- /crates/rune/src/tests/workspace/package-a/examples/multi-file-example/main.rn: -------------------------------------------------------------------------------- 1 | mod lib; 2 | 3 | pub fn main() { 4 | println!("running {}", lib::get_name()); 5 | } 6 | -------------------------------------------------------------------------------- /scripts/book/tuples/tuple_masquerade.rn: -------------------------------------------------------------------------------- 1 | let values = ("Now", "You", "See", "Me"); 2 | dbg!(values); 3 | 4 | values.2 = "Don't"; 5 | values.3 = "!"; 6 | dbg!(values); 7 | -------------------------------------------------------------------------------- /scripts/numbers.rn: -------------------------------------------------------------------------------- 1 | dbg!(0.223e2 + 2.to_f64()); 2 | dbg!((0.223e2).to_integer() + 2); 3 | 4 | let a = 42; 5 | 6 | if a is i64 { 7 | dbg!("a is an integer"); 8 | } 9 | -------------------------------------------------------------------------------- /book/src/deprecated.md: -------------------------------------------------------------------------------- 1 | # Deprecated 2 | 3 | These are section of the book which have been deprecated for one reason or 4 | another, but we still want to provide links to. 5 | -------------------------------------------------------------------------------- /crates/rune/src/doc/static/fonts/NanumBarunGothic-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rune-rs/rune/HEAD/crates/rune/src/doc/static/fonts/NanumBarunGothic-Regular.woff2 -------------------------------------------------------------------------------- /crates/rune/src/tests/workspace/nested/package-b/examples/multi-file-example/main.rn: -------------------------------------------------------------------------------- 1 | mod lib; 2 | 3 | pub fn main() { 4 | println!("running {}", lib::get_name()); 5 | } 6 | -------------------------------------------------------------------------------- /crates/rune/src/tests/workspace/package-a/src/bin/multi-file-executable/module/mod.rn: -------------------------------------------------------------------------------- 1 | pub(super) fn print_name() { 2 | println!("running a/multi-file-executable") 3 | } 4 | -------------------------------------------------------------------------------- /crates/rune/src/tests/workspace/nested/package-b/src/bin/multi-file-executable/module/mod.rn: -------------------------------------------------------------------------------- 1 | pub(super) fn print_name() { 2 | println!("running b/multi-file-executable") 3 | } 4 | -------------------------------------------------------------------------------- /scripts/book/vectors/vectors_rev.rn: -------------------------------------------------------------------------------- 1 | pub fn main() { 2 | let values = ["Hello", 42]; 3 | 4 | for v in values.iter().rev() { 5 | println!("{}", v); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /crates/rune-wasm/module.js: -------------------------------------------------------------------------------- 1 | /// Hook used to construct an async sleep function. 2 | export function js_sleep(ms) { 3 | return new Promise(resolve => setTimeout(resolve, ms)); 4 | } 5 | -------------------------------------------------------------------------------- /examples/scripts/change_me.rn: -------------------------------------------------------------------------------- 1 | pub fn hello() { 2 | println!("{}: Hello world!", file!()); 3 | } 4 | 5 | pub fn goodbye() { 6 | println!("{}: Goodbye world!", file!()); 7 | } 8 | -------------------------------------------------------------------------------- /scripts/book/variables/variables.rn: -------------------------------------------------------------------------------- 1 | pub fn main() { 2 | let x = 5; 3 | println!("The value of x is: {}", x); 4 | x = 6; 5 | println!("The value of x is: {}", x); 6 | } 7 | -------------------------------------------------------------------------------- /site/content/rune.md: -------------------------------------------------------------------------------- 1 | +++ 2 | [extra] 3 | classes = "center" 4 | +++ 5 | 6 | ### The page you're looking for has been moved! 7 | 8 | You're probably looking for [The Rune Book](/book/). -------------------------------------------------------------------------------- /site/content/posts/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | sort_by = "date" 3 | paginate_by = 5 4 | paginate_path = "page" 5 | template = "posts.html" 6 | page_template = "post.html" 7 | render = true 8 | +++ 9 | -------------------------------------------------------------------------------- /scripts/book/instance_functions/missing_instance_fn.rn: -------------------------------------------------------------------------------- 1 | struct Foo; 2 | 3 | impl Foo { 4 | fn new() { 5 | Foo 6 | } 7 | } 8 | 9 | let foo = Foo::new(); 10 | foo.bar(); 11 | -------------------------------------------------------------------------------- /scripts/book/closures/basic_closure.rn: -------------------------------------------------------------------------------- 1 | fn work(op) { 2 | op(1, 2) 3 | } 4 | 5 | let n = 1; 6 | println!("Result: {}", work(|a, b| n + a + b)); 7 | println!("Result: {}", work(|a, b| n + a * b)); 8 | -------------------------------------------------------------------------------- /scripts/book/pattern_matching/bind.rn: -------------------------------------------------------------------------------- 1 | fn test_ignore(vector) { 2 | match vector { 3 | [_, b] => println!("Second item in vector is {}.", b), 4 | } 5 | } 6 | 7 | test_ignore([1, 2]); 8 | -------------------------------------------------------------------------------- /scripts/book/pattern_matching/ignore.rn: -------------------------------------------------------------------------------- 1 | fn test_ignore(vector) { 2 | match vector { 3 | [_, 2] => println!("Second item in vector is 2."), 4 | } 5 | } 6 | 7 | test_ignore([1, 2]); 8 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /Cargo.lock 2 | /target 3 | /*.lua 4 | /*.py 5 | /scripts/test.rn 6 | /.vscode/spellright.dict 7 | *.rnc 8 | /.idea 9 | /flamegraph.svg 10 | /perf.data 11 | /perf.data.* 12 | /*.log 13 | -------------------------------------------------------------------------------- /scripts/book/control_flow/conditional_else.rn: -------------------------------------------------------------------------------- 1 | let number = 3; 2 | 3 | if number < 5 { 4 | println!("the number is smaller than 5"); 5 | } else { 6 | println!("the number is 5 or bigger"); 7 | } 8 | -------------------------------------------------------------------------------- /scripts/objects.rn: -------------------------------------------------------------------------------- 1 | let object = #{ "foo": 42 }; 2 | object["bar"] = object["foo"] + 1; 3 | object = #{ "foo": 1 }; 4 | let object = #{ "bar": 2 }; 5 | let a = object.get("foo"); 6 | 7 | dbg!(object, a); 8 | -------------------------------------------------------------------------------- /crates/rune/tests/tuples.rn: -------------------------------------------------------------------------------- 1 | #[test] 2 | fn modify_tuple() { 3 | let m = ("Now", "You", "See", "Me"); 4 | m.2 = "Don't"; 5 | m.3 = "!"; 6 | assert_eq!(`${m.0} ${m.1} ${m.2}${m.3}`, "Now You Don't!"); 7 | } 8 | -------------------------------------------------------------------------------- /crates/rune/src/tests/workspace/package-a/benches/multi-file-bench/main.rn: -------------------------------------------------------------------------------- 1 | mod collatz; 2 | 3 | #[bench] 4 | pub fn bench_collatz(b) { 5 | b.iter(|| { 6 | assert!(collatz::helper(1000, 0) == 111) 7 | }) 8 | } 9 | -------------------------------------------------------------------------------- /crates/rune/src/tests/workspace/nested/package-b/benches/multi-file-bench/main.rn: -------------------------------------------------------------------------------- 1 | mod collatz; 2 | 3 | #[bench] 4 | pub fn bench_collatz(b) { 5 | b.iter(|| { 6 | assert!(collatz::helper(1000, 0) == 111) 7 | }) 8 | } 9 | -------------------------------------------------------------------------------- /scripts/book/closures/closure_move.rn.fail: -------------------------------------------------------------------------------- 1 | fn work(op) { 2 | op(1, 2) 3 | } 4 | 5 | pub fn main() { 6 | let n = 1; 7 | println!("Result: {}", work(move |a, b| n + a + b)); 8 | assert!(!is_readable(n)); 9 | } 10 | -------------------------------------------------------------------------------- /scripts/generator_as_iter.rn: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | yield 1; 3 | yield 2; 4 | yield 3; 5 | } 6 | 7 | let gen = foo(); 8 | 9 | while let Some(value) = gen.next() { 10 | println!("from generator: {}", value); 11 | } 12 | -------------------------------------------------------------------------------- /crates/rune/src/hir/interpreter.rs: -------------------------------------------------------------------------------- 1 | use crate::alloc::HashMap; 2 | use crate::runtime::Value; 3 | 4 | /// HIR interpreter. 5 | #[allow(unused)] 6 | pub(crate) struct Interpreter<'hir> { 7 | variables: HashMap<&'hir str, Value>, 8 | } 9 | -------------------------------------------------------------------------------- /scripts/book/generators/states.rn: -------------------------------------------------------------------------------- 1 | fn print_once() { 2 | let out = yield 1; 3 | println!("{:?}", out); 4 | 2 5 | } 6 | 7 | let printer = print_once(); 8 | dbg!(printer.resume(())); 9 | dbg!(printer.resume("John")); 10 | -------------------------------------------------------------------------------- /scripts/book/tuples/tuple_patterns.rn: -------------------------------------------------------------------------------- 1 | match ("test", 1) { 2 | ("test", n) => { 3 | dbg!("the first part was a number:", n); 4 | } 5 | _ => { 6 | dbg!("matched something we did not understand"); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /site/templates/index.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | {% import "macros.html" as macros %} 3 | 4 | {% block content %} 5 |
3 | {% if author %} 4 | -- {{ author }} 5 | {% endif %} 6 |
(path: P) -> io::Result
6 | where
7 | Self: Sized,
8 | A: Allocator,
9 | {
10 | /// Try to join the given value in the given allocator.
11 | fn try_join_in(iter: I, sep: S, alloc: A) -> ResultFunction {{literal module}}::{{name}}
Overview{{ page.title }}
19 | {{ macros::frontmatter(classes="frontmatter-page", author=page.extra.author, date=page.date, word_count=page.word_count, read_time=page.reading_time) }}
20 | {{ page.content | safe }}
21 | {% endblock post %}
22 | (ordering: &Ordering, serializer: S) -> Result