| Crates.io | dyon |
| lib.rs | dyon |
| version | 0.49.2 |
| created_at | 2016-02-18 23:42:55.355837+00 |
| updated_at | 2025-02-17 12:08:07.955855+00 |
| description | A rusty dynamically typed scripting language |
| homepage | https://github.com/pistondevelopers/dyon |
| repository | https://github.com/pistondevelopers/dyon.git |
| max_upload_size | |
| id | 4209 |
| size | 1,101,667 |
A rusty dynamically typed scripting language
fn main() {
println("hello world!")
}
Tutorial
Dyon-Interactive
Dyon Snippets
/r/dyon
Dyon script files end with .dyon.
To install Dyon REPL, type:
cargo install --example dyon dyon
Then, to run the Dyon REPL, type:
dyon
To run Dyon script files from command line, type:
cargo install --example dyonrun dyon
Then, to run a script file you type:
dyonrun <file.dyon>
Dyon for Atom
Dyon for Vim
Dyon for Visual Studio Code

arr := [a, b, c] with lookup arr[0] and lookup with array of indices arr[[0, 0]]obj := {x: a, y: b}n := 5.3t := truelink { 1 2 "hi" false }Arc<Mutex<Any>>fn foo() { ... } and with return fn foo() -> { ... return x }f(x) = x / (x - 1)ns program::example::testfn foo(mut a, b: 'a) { a.x = b }fn id(x: 'return) -> { return x }fn foo(mut a) { bar(mut a) }a = 2.0 // ERROR: Expected assigning to numbera.x := 0 and checks existence and type with a.x = 0foo(bar: b) is equal to foo__bar(b)a := if b < c { 0 } else { 1 }for i := 0; i < 10; i += 1 { ... }for i 10 { ... } and with offset for i [2, 10) { ... }for i { println(list[i]) }for i, j { println(list[i][j]) }∑/sum, ∏/prod, min, max, sift, ∃/any, ∀/all loopswhy(any i { list[i] > 3 })loop { ... }loop { break } and unlabeled continue loop { continue }'a: loop { break 'a } and labeled continue 'a: loop { continue 'a }return as a variable without exiting return = 8m := unwrap(load("script.dyon")) then call(m, "main", [])m := unwrap(load(source: "script.dyon", imports: [window, graphics]))Module::addnone() or some(x)ok(x) or err(x)? operator to propagate errors, e.g. x := foo()?, maps option to result automaticallyunwrap(x) prints trace of propagated errorfunctions() returns sorted list of all available functions in a modulefn could(list: []) -> f64fn players() -> [Player str] { ... }fn render() ~ world { ... }go thread := go foo()receiver := in foo with for-in loops for x in a {print(x[0]}\(x) = x + 1\(x) = (grab a) + xfn intersect(a: [] => [], b: [] => []) -> [] { ... }(vec4) -> vec4f32 precision (x, y, z, w)f32 precision mat4 {1,2,3,4; 5,6,7,8; 9,10,11,12; 13,14,15,16}vec4 i f(i)f(xy v)(yxz v, 1)#fab3eedyon_fn!{fn say_hello() { println!("hi!"); }}Dyon is a hypothetical particle predicted by several grand unified theories in physics with both electrical and magnetic charge. See this Wikipedia article for more information.
The name Dyon fits because, just like the particle, there are things that are yet to be discovered about language design. However, this language was not born out of a grand new vision, but is the result of exploring and testing new ideas.
Sven Nilsen started this project in early 2016. The idea was to make a simple, but convenient scripting language that integrated well with Rust.
? operatorMain goals:
Performance will be optimized for the cycle:
coding -> parsing -> running -> debugging -> coding
Sub goals:
Non-goals:
Licensed under either of
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you shall be dual licensed as above, without any additional terms or conditions.