4 ms·
I was expecting it to be like P5 but worse (why would you use Rust for that kind of coding?? do I actually care about memory safety in my sketches?) Shockingly
by xmcqdpt2 4y ago
I was expecting it to be like P5 but worse (why would you use Rust for that kind of coding?? do I actually care about memory safety in my sketches?) Shockingly the code looks totally reasonable! Im very impressed.
I guess there is a lot of copy happening under the hood (cf the source for Draw) but the result is a very straightforward syntax. I might give it a try instead of going back to P5.
- mattrighetti 4y agoWell, I don’t use Rust for memory safety alone. That would be pretty reductive. I like the language, the syntax and all the cool math crates that I’m used to from other projects.
- nkrisc 4y agoI’m just a hobbyist developer, and I really don’t need Rust’s safety or even speed for anything I do. I don’t even need a compiled executable. Instead I keep coming back to it because of the language itself. Its particular flavor of the type system, traits, generics, error handling, and syntax I just love. It just seems so well thought out and any time I’m using any other language I find myself missing many of Rust’s features. As someone who’s generally pretty scatter-brained I really love the strictness of Rust.
- tasn 4y agoI couldn't agree more. We switch our codebase from Python to Rust and it made things easier, not harder!
- kilgnad 4y agoI find the move semantics and borrow checker actually reduces expressiveness and modularity. You didn't mention this in your list of good features. I think these are the main hurdles preventing full on popularity. It's arguably not a "hurdle" per say but it is preventing popularity imo.
- nkrisc 4y agoIt definitely does slow things down at the early stages, I find. But it’s time you’ll spend either way: now, or debugging later. Personally I find the borrow checker to be a useful guardrail as I would certainly write code with all kinds of memory related bugs without it.
- kilgnad 4y agoI'm not referring to the challenge of coding with this style. I am referring to actual trade offs. It increases safety at the expense of modularity and expressivity by a huge amount. The trap door to get around it, is to implement the copy trait, but the point of rust is to minimize this action as much as possible for speed.
- zozbot234 4y agoRust supports copy-on-write, so the amount of copies can probably be kept quite low with no real impact on surface syntax. Anyway, the case for Rust is that it combines memory safety and performance. JavaScript is memory safe enough, but creative coding can be quite demanding from a performance POV.
- scotty79 4y ago> why would you use Rust for that kind of coding?? Why people keep asking that? Rust is a very good language even if you don't care about safety at all and barely care about the speed. Value semantics gives you completely unique capabilities when working with complex objects. It fits all applications.