Для большинства программистов и решаемых ими задач выигрыша у Rust по сравнению с Go не будет. Причины использования: Primarily, for this particular project, the heap size is the issue. One of the games in this project is optimizing how little memory and compute you can use to manage 1GB (or 1PB) of data. We utilize lots of tricks like perfect hash tables, extensive bit-packing, etc. Lots of odd, custom, inline and cache-friendly data structures. We also keeps lots of things on the stack when we can to take pressure off the VM system. We do some lockfree object pooling stuff for big byte vectors, which are common allocations in a block storage system. It's much easier to do these particular kinds of optimizations using C++ or Rust. In addition to basic memory reasons, saving a bit of CPU was a useful secondary goal, and that goal has been achieved. The project also has a fair amount of FFI work with various C libraries, and a kernel component. Rust makes it very easy and zero-cost to work closely with those libraries/environments.Также новость скромно умалчивает о том, что Dropbox использовала Rust для одной единственной подсистемы: Actually, full disclosure, we really just rewrote a couple of components in Rust. Most of Magic Pocket (the distributed storage system) is still written in golang. При этом - Python is our primary development language for most stuff at Dropbox. - Mobile development and UI code use whatever is appropriate for each platform. - Go is the primary language for Infrastructure, meaning fairly deep-backend stuff: databases, storage systems, message pipelines, search indices etc. - Rust is used on Magic Pocket (which is within Infrastructure).
|