by i0exception on 8/15/22, 11:30 PM with 5 comments
by drunkenmagician on 8/16/22, 3:16 AM
by nicoburns on 8/16/22, 3:23 AM
- 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.
by RcouF1uZ4gsC on 8/16/22, 1:44 AM
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.
by anko on 8/16/22, 10:40 AM