Spyke

Syndicated from the fediverse. Read and engage on the original instance.

View original on lemmy.ml
golang·Go programming language discussionbyvi21

Goish: A Rust runtime for Go people

I guess Goish might be hated by many Rust fans and Go fans. Anyway, below is the example taken from its website.

use goish::{go, KB};
use goish::sync::WaitGroup;

#[goish::main]
fn main() {
    let wg = &WaitGroup::new();
    wg.Add(1_000_000);

    for i in 0..1_000_000 {
        // Explicit 2 KiB stack, sub-page allocated from the chunked
        // stackpool - the opt-in for extreme spawn density. Everyday
        // code just writes go!(move || ...) and never sizes a stack.
        go!(stack(2 * KB), move || {
            do_work(i);
            wg.Done();
        });
    }

    wg.Wait();
}
Goish: A Rust runtime for Go peoplehttps://goish.cogentica.ai/Open linkView original on lemmy.ml
2

2 replies

lemmy.ml

is there one for python or ruby people?

1
vi21reply

I have never seen any. However, Rust itself borrows many things from Python, e.g. self, module system.

2

You reached the end

Goish: A Rust runtime for Go people | Spyke