Dyon Versions Save

A rusty dynamically typed scripting language

v0.36

5 years ago

This version adds a way to communicate between threads in Dyon.

The design is very simple: Any loaded function can be turned into a channel. A new thread can subscribe to input data sent to a function, without having to communicate any new information with the other threads. One thread can listen in on the conversation after other threads have started. This allows reloading diagnostic tools at run-time without ever stopping the whole program. It also functions as a log feature: All data that is sent to a function can be recorded and analyzed later, which makes debugging of multiple threads easier. This can also be used in single-thread applications. The in-type uses Rust's std::sync::mpsc::Receiver which can also be used by external Rust functions.

  • in-types e.g. x := in foo to receive inputs when any thread calls foo
  • for msg in x { ... } loop (same for sum/prod/min/max/any/all/sift/link)
  • msg := next() for next message from in-type
  • msg := wait_next() for waiting for next message from in-type

Single-thread example:

fn log(a: f64) {}
fn main() {
    xs := in log
    for i 10 {log(i)}
    println(sum x in xs {x[0]})
}

Multi-thread example:

fn log(a: f64) {}
fn finish() {}
fn bar() -> bool {
    return = true
    for i 10 {log(i)}
    finish()
}
fn main() {
    xs := in log
    done := in finish
    _ := go bar()
    _ := wait_next(done)
    println(sum x in xs {x[0]})
}

v0.9

7 years ago

New features:

  • Better integration with Rust objects
  • sec[bool] and sec[f64] for better type safety for secrets

v0.8

7 years ago

New features:

  • Infer range from loops
  • Packed loops
  • Secrets
  • Current objects (using hidden dynamical scope)
  • Ad-hoc types
  • Link type
  • Unpack and swizzle 4D vectors
  • vec2/vec3/vec4 un-loops
  • Closures
  • Grab expressions
  • Lazy || and &&
  • Lots of bug fixes
  • Better type inference