Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

>I still remember first hearing about Rust and how it was using Green Threads, [...] I never did look up why they gave up on Green threads

It's because green threads have unavoidable performance costs. I collected various threads that has Rust contributors explaining the costs they didn't want to pay: https://news.ycombinator.com/item?id=39062953

A language like Go is willing to pay those performance costs because they deliberately sit at a higher level of abstraction than lower-level Rust.

Each chose different tradeoffs for different goals:

- Golang : green threads worth the perf cost to gain higher productivity (goroutines, channels, etc) for the type of programs that Go programmers like to write

- Rust : green threads are not worth the perf cost so as to not sacrifice the best possible performance for the type of programs Rust programmers like to write

You can't have a language+runtime that satisfies both camps 100% perfectly. The language designer must choose the tradeoff. But because this tradeoff decision is not blatantly well-known and disseminated ... it also perpetually confuses Language X proponents on why Language Y didn't do the same thing as Language X.



Thank you for this! This is exactly why I posted my comment, I was hoping someone would share some insight about Rust.


What do Go channels do that takes advantage of their green threads?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: