3 ms·
> Rust demonstrated that memory safety and speed aren’t mutually exclusive. memory safety, speed, ergonomics pick two.
by amelius 4y ago
> Rust demonstrated that memory safety and speed aren’t mutually exclusive.
memory safety, speed, ergonomics
pick two.
- randall 4y agoThis is fair.
- LoganDark 4y agoI think Rust is fairly ergonomic, but that's because it happens to work really well with my mental model. I was able to pick it up and produce a multithreaded path tracer in about two weeks. What are some ergonomic issues, in your opinion?
- pdimitar 4y agoThat's generously assuming that C is ergonomic. Which it is not.
- saulrh 4y agoRust is a heck of a lot more ergonomic than many unsafe languages I've used, so I'm not sure I agree. In fact, it's probably the most ergonomic fast language I've ever used. Zig was pretty close but it had its own issues.
- WanderPanda 4y agoYou don‘t have to pick two, you can also just pick one Looking at you Bjarne
- brundolf 4y agoRust has made some headway in ergonomics too. Obviously the borrow-checker pulls it down quite a bit, but in other areas it makes up a lot of ground: tooling, language features like match expressions, traits (being able to hang new methods off of existing structs) and trait derivations, type inference, and then all the stuff third-party frameworks can do with macros (using something like Rocket isn't too far off from using Flask) There's still a tradeoff, but they push the boundaries quite a bit
- bqmjjx0kac 4y agoRust is least ergonomic when you're fighting with the borrow checker. It might be an interesting strategy to wrap shared objects with Gc<> or Rc<> by default to sidestep the fight. Once you've discovered the slowest parts of your codebase, you could refactor to replace Gc/Rc with zero-cost borrows or well-placed copies. I haven't tried this myself, but I'm surprised it isn't the standard operating procedure for (non-embedded) Rust programmers.
- amelius 4y agoWe should probably have functional programming by default for sanity, wrapping Rust inside it for the speed in inner loops.
- bqmjjx0kac 4y agoHmm, functional in what sense? Like functions should be pure by default, optionally annotated `impure` or something?
- amelius 4y agoIn the sense of allowing at least closures that are garbage collected (without them you can't idiomatically program in a modern functional style)
- btown 4y agoI think one of the issues is that Rc and Gc are not particularly ergonomic! Used at scale, they add noise/non-readability to any screen of code (Rc::clone, the various approaches for Gc in [0], for instance) that simply wouldn't be there in a dynamic language. Now, one might argue that this explicitness is good! But it's definitely an extra bunch of things to type when you're building something where you don't care about memory management. [0] https://manishearth.github.io/blog/2021/04/05/a-tour-of-safe-tracing-gc-designs-in-rust/ https://manishearth.github.io/blog/2021/04/05/a-tour-of-safe...
- zozbot234 4y ago
- avgcorrection 4y agoBeing able to pick two is still an improvement!
- Existenceblinks 4y agoRust binary size is not pretty either.