4 ms·
Using Rust to scale Elixir for 11M concurrent users (2019)
- RcouF1uZ4gsC 4y ago> and using the guarantees of Rust is guaranteed not to crash the VM or leak memory. Very interesting article. However, I do no think that Rust guarantees not to leak memory. It guarantees to double frees or dangling pointers, but it does not guarantee no leaks. One example would be making a cycle using Rc.
- slaymaker1907 4y agoIt's even easier than that, just use Box::leak.
- deleted 4y ago[deleted]
- drunkenmagician 4y agofrom 2019 also https://news.ycombinator.com/item?id=19944747 https://news.ycombinator.com/item?id=19944747 https://news.ycombinator.com/item?id=25053553 https://news.ycombinator.com/item?id=25053553 https://news.ycombinator.com/item?id=32477012 https://news.ycombinator.com/item?id=32477012 https://news.ycombinator.com/item?id=19940865 https://news.ycombinator.com/item?id=19940865
- deleted 4y ago[deleted]
- nicoburns 4y agoRust really shines for FFI use cases. You get all the same performance benefits you would get with C, but: - It’s a safe language so you don’t have to worry about crashing your program or introducing UB. - You don’t have to deal with the pain of C compiler toolchains. Need you’re code to work on multiple platforms? It will likely just work out of the box. - It has a lot better abstraction capabilities than C, so you get a higher level interface to the host objects. - It has a great package ecosystem which you can take advantage of. Sometimes your native module could be as simple as exposing a few methods from a prewritten library. Once you go down this road, it can be very tempting to write the whole thing in Rust (which can work well too), but if you’ve got an existing code base, or some higher level code you want to keep in a more flexible language, then I think the Rust + scripting language of choice combo is hard to beat.
- anko 4y agoi'd love to know the operations they were doing and what they used the sorted sets for. I find for this type of thing, if the ids of the users are integers you can often use a bitset and optimise the crap out of it via SIMD. If memory is a huge concern, or if the data is super sparse you can use a roaring bitset.