A rusty dynamically typed scripting language
APACHE-2.0 License
Bot releases are hidden (Show)
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.
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-typemsg := wait_next()
for waiting for next message from in-typeSingle-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]})
}
Published by bvssvni about 8 years ago
New features:
sec[bool]
and sec[f64]
for better type safety for secretsPublished by bvssvni over 8 years ago
New features:
vec2
/vec3
/vec4
un-loops||
and &&