logoalt Hacker News

onlyrealcuzzo • today at 3:06 PM • 3 replies • view on HN

> Crystal is like a typed Ruby with the performance and concurrency flow of Go.

I'm not up to date, but the scheduling engine was far behind Go in terms of parallelism. Crystal was always quite good at concurrency.

But Go is popular because it's so good at parallelism (and relatively safe with a garbage collector).

I know Crystal has been working on this for the last few releases, but I'd be surprised if it's matching Go on parallelism.

Go's runtime is quite the engineering feat.

It can often outperform hand-optimized Rust in worst-case parallel workloads (p99), despite Rust having a number of pretty huge advantages...


Replies

giancarlostoro • today at 3:42 PM

Goroutines are roughly 2kb in memory, and Crystal fibers are roughly 4KB, which is insane in any regard. I think Crystal is really interesting and worth considering, especially if you want something native that has OOP, I really would love to see Crystal used more in general.

➕ show 1 reply
goatlover • today at 4:22 PM

Does it outperform Erlang/OTP?

DetroitThrow • today at 3:17 PM

>It can often outperform hand-optimized Rust in worst-case parallel workloads (p99), despite Rust having a number of pretty huge advantages...

I will say this comes with the asterisk that it heavily depends on what your concurrent system/problems looks like!

...but more often than not when dealing with web problems and network IO, the shape of concurrency/parallelism I need looks exactly like Goroutines, and even as someone who uses Rust/tokio daily: the Go runtime is an incredibly engineered system that usually beats Rust in my experience for application dev tasks.

Anyways, I love Crystal's syntax around concurrency! I wish we lived in a world where it had tons of Google engineers optimizing the runtime :)