4 ms·
GC is not a feature in all cases, and without GC you must manually handle allocation and deallocation in some cases, C or C++ let you free of lifetime annotatio
by hokkos 10y ago
GC is not a feature in all cases, and without GC you must manually handle allocation and deallocation in some cases, C or C++ let you free of lifetime annotations at the cost of crashes, Swift force you to use counted pointers and Rust force you in a semantic that forbid errors at the cost of some lifetime allocation that you consider ugly. But it is still shorter than copy pasted Go code to simulate generics, and multiple "err, res" that stains the code.
- Thaxll 10y agoMy point is a lot of people use Python because it's a simple and powerful language, Rust is not a simple language at all. And the performance it brings is not enough to make the decision to switch language in most cases.
- seangrogg 10y agoIt's not about "switching" languages - it's about making sure the languages you do use solve the problems you care about. Honestly, nobody cares what language you use as an individual other than perhaps your coworkers.
- kbenson 10y agoI'm not sure what you're arguing. The article didn't advise people to switch from Python to Rust. It simply gave information that people that are considering it. The last paragraph even echoes some of your sentiment. > And the performance it brings is not enough to make the decision to switch language in most cases. That's assuming a lot. Nearly 10x the speed is extremely useful for some people. Presumably if you are rewriting your Python code in Rust or Go, you've already identified performance as a big reason to do so, and that gain would be extremely useful.
- Thaxll 10y ago"Rewriting anything takes a lot of time and causes lots of bugs, going from Python to less expressive language means an increased maintenance burden. But if for some reason, you still want to rewrite it, please don’t pick Go. Rust is better in pretty much every way." I mean it's pretty much 'never use Go'
- kbenson 10y agoYeah, the article boils down to "If you feel the need to rewrite your python in a statically typed language, and it's between Rust and Go, don't use Go, because the cost of implementing in Rust is roughly equivalent, but the performance gains are much higher." I think with all the evidence presented, that's an eminently defensible position. Get twice the performance of Go (in this case, obviously it will be very dependent on project) for not much more effort, when you've already made the choice to rewrite for performance.
- deleted 10y ago[deleted]
- RussianCow 10y agoRust isn't trying to be "simple", it's trying to solve a specific problem. If you don't need a systems language that has exceptional memory safety, then Rust simply isn't the right language for you. That doesn't make it "horrible" for those who actually need it.
- pcwalton 10y agoMost programs don't need to max out the performance of the CPU. So what? There are a lot that do.
- topspin 10y agoYou're not expected to decide to switch to anything. I deal with at least four distinct programming languages every single day I have the good fortune to regain consciousness. Both Python and Rust are often among them. Feel free to learn more than one programming language; no one is expecting you to 'switch.'
- geofft 10y ago> C or C++ let you free of lifetime annotations at the cost of crashes This is so very true. A lot of my time as a professional C and C++ developer is spent trying to figure out exactly how long some previous programmer intended a value to live, whether it can be safely accessed in this context without a lock, etc. The ugliness of <'b, 'a: 'b> is vastly preferable to segfaults or corruption in production and days of debugging. Anyway, time for me to go back to staring at why this machine isn't reinstalling because wget is hitting a null pointer dereference, but I'm sure wget's code is very pretty.
- Manishearth 10y agoI basically sigh with relief whenever I'm wrangling with some data in a large c++ codebase and discover that it is refcounted (which tends to be the case for most data where the question of possibly holding it past the lifetime arises). In rust, my reaction is the opposite -- I'm skeptical of every Rc I see and part of my mind immediately tries to see if it can be gotten rid of.