by ynik · 3y ago · 0 comments
C# has had `enumerable.AsParallel()` since .NET 4.0 (2010). Rust has rayon `input.par_iter()`.
rayon is a 3rd party library though, not part of the language itself, compared to the Java streams discussed here.
With C# I'm not sure if .NET can be called a library or not? All C# tooling ships with .NET by default or not?
> In other mature languages, streams are very rigid and feel non-composable
I'd like to see some motivating examples that make me say to myself, "Yeah, Java's got a neat trick there".
In this regard, while it is nice that PLINQ and various `Parallel`-related APIs come out of box in C#, it is a marginal difference with Rust where building parallel loops is `cargo add rayon` away.
In addition, multiple versions of transitive dependencies can coexist in Rust without conflicting with each other, there is no such risk.
When talking about projects in the wild, sure. But if we're specifically talking about language features, then "something being a part of the language" is wildly different than "installable 3rd party library".
Sometimes, it is a scar tissue from dealing with NIH syndrome too - at least you can use the OOB tools for combating with it, but the NIH itself it the actual source of people being resistant to adopting proven and good solutions developed by community.
.NET is the only language ecosystem that is comparable to Java, as they are a kind of yin/yang between themselves.