A rusty dynamically typed scripting language
Notice: This is very early stage in development. Breaking changes will happen!
arr := [a, b, c]
obj := {x: a, y: b}
n := 5.3
t := true
Arc<Mutex<Any>>
fn foo() { ... }
fn foo() -> { ... return x }
fn foo(a, b: 'a) { a.x = b }
fn id(x: 'return) -> { return x }
a = 2.0 // ERROR: Expected assigning to number
a.x := 0
and checks existence and type with a.x = 0
foo(bar: b)
is equal to foo_bar(b)
a := if b < c { 0 } else { 1 }
for i := 0; i < 10; i += 1 { ... }
loop { ... }
loop { break }
loop { continue }
'a: loop { break 'a }
'a: loop { continue 'a }
return
as a variable without exiting return = 8
m := unwrap(load("script.dyon"))
then call(m, "main", [])
m := unwrap(load(source: "script.dyon", imports: [window, graphics]))
Module::add
none()
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 moduleDyon is a hypothetical particle predicted by several grand unified theories in physics with both eletrical and magnetic charge. See wikipedia article for more information.
The name Dyon fits because, just like the particle, there are things that are yet to be discovered. However, it was not born out of a grand new vision about language design, but is the result of exploring and testing new stuff.
Sven Nilsen started this project in early 2016. The idea was to make a simple, but convenient scripting language that integrated well with Rust.
Main goals:
Sub goals:
Non-goals:
Licensed under either of * Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0) * MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT) at your option.
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.