|
|
|
|
|
by vvanders
3689 days ago
|
|
You really owe it to yourself to give Rust a shot. A lot of things that you've encoded in convention(as any good C++ programmer should) are right there at the language level. Ownership? You get an awesome sliding scale of Borrow Checker <-> Boxed <-> Rc/Arc Mutation? Covered in Copy+Clone/Cell <-> &/&mut <-> RefCell Thread Safety? Sync + Send guarantee that things which need to stay on a specific thread cannot be shared. Combine that with Sum Types, Pattern Matching and much stronger functional constructs makes for a very compelling language. |
|
Go has GoRoutines, which are light threads; they can be executed on multiple CPU threads, but by default Go only allocates one CPU thread per physical CPU, even if you allocate tens of thousands of GoRoutines.
For the kind of networking server code I'm writing, light threading is far more efficient than using an OS thread per connection. 25-50x faster at higher server loads.
That's why I've ignored Rust to date; if Rust has light threading built in, but no one is talking about it (haven't found anything but real threads in my quick Google searches), then I'll take a look. Otherwise it will need to wait for me to have a task that Rust would be good for, and I'll stick with Go and TypeScript for the problems I'm solving right now.