8 ms·
I've jumped on plenty of hype trains of new languages over the last 20 years. Rust is the first one that made we actually worry that I might have to eventually
by mrits 6y ago
I've jumped on plenty of hype trains of new languages over the last 20 years. Rust is the first one that made we actually worry that I might have to eventually switch back to different language in the future. In addition, it's the first language that doesn't have me use Python for quick shell scripting or small prototypes. It's a pleasure to code in.
- papaf 6y agoit's the first language that doesn't have me use Python for quick shell scripting or small prototypes How do you define quick? Python has a large standard library and so you don't have to hunt for functionality on crates.io and then download/compile -- I have written scripts faster than that.
- nicoburns 6y agoIf you know that a crate exists then you can simply `cargo add foo` and have it download in the background while you get on with writing your script. If you don't know that it exists then you'll have to find it the first time, but you have that problem with python standard library modules too. Writing scripts with Rust likely will be slower than Python, but I don't really buy that having functionality in crates is part of that.
- papaf 6y agoIf you don't know that it exists then you'll have to find it the first time, but you have that problem with python standard library modules too. Except that, if its in the standard library, you don't have to choose between multiple implementations. I have written scripts faster than I have chosen dependencies.
- deleted 6y ago[deleted]
- nicoburns 6y agoIf I want to make an HTTP request in Python, which module should I use? There is a built in one (more than one I believe), but the official docs link out to a 3rd party module https://docs.python.org/3/library/http.client.html https://docs.python.org/3/library/http.client.html
- papaf 6y agoI think things are beginning to get a bit surreal. People arguing that Rust is a better scripting language than Python and now with one particular poor example in the Python standard library means the chaos of crates.io is a comparable solution in terms of reducing choice. Rust is a great C++ alternative. But seriously, the community has cult like marketing.
- nicoburns 6y agoFWIW, I agree with you that Python is better that Rust for scripting (I was not the OP), but finding a crate in Rust is generally a matter of googling "Rust http client" or "Rust regex" and reading the top result. Not exactly hard, and in my experience something that I end up doing in every single language including Python, because using the standard library directly is often not the correct choice.
- swsieber 6y agoAnd there's the Rust cookbook. I view the cookbook as sort of a recommended extended std.
- bluejekyll 6y ago> But seriously, the community has cult like marketing. What in your opinion makes one language cult-like vs. another that many people like and recommend to others? Cults generally have a very negative impact on those who are members vs. the leaders. Usually the members of cults are taken advantage of and are only there to support the people at the top. The Rust community is very far from anything cult-like.
- mmcgaha 6y agoThe Python standard library is amazing. A few weeks ago, I wrote a program that provides a SMTP relay, mail storage, and web UI for managing email sequencing. The only dependency that it pulled in was pywin32 so it could run as a windows service; if it ran on a Linux box, there wouldn't be a single dependency. Not including integration testing, the whole deal was two days of work. If I had to pull in and evaluate external libraries I would have spent two days just working out the details of which libraries to select. At least for now, I don't think anything can replace Python for prototyping an idea.
- dehrmann 6y ago> The Python standard library is amazing. I generally agree, but it has some weird holes. There isn't an OrderedSet, it doesn't have a binary tree like Java's TreeMap, its HTTP client isn't great (people mostly use Requests), and there's a lot still missing from its asyncio library. > web UI for managing email sequencing You built a web UI without even using Flask?!
- kavalg 6y agoI can only second that. People would say that Python is a lot slower than Rust and I would agree, but the slowest software I've seen in my life is the one that never gets released ;)
- eloff 6y agoI love rust, but Python is still my goto for scripting, small tasks, calculations, etc. It's more convenient for nearly all tasks of that shape. I remember telling my uni professor about that 15 years ago, but she swore by using C for that purpose. It's what you know I suppose, but if you know both languages, Python is much better suited to the task.
- bluejekyll 6y ago> Python is much better suited to the task. This is not an objective opinion, but subjective. People generally appreciate different things about different languages, and it’s entirely possible for some who knows both languages to disagree with you here. For quick CLI tools, my favorite thing about Rust is that it has really high quality command line parsers available in the community, and they are type safe. I’m not suggesting that your opinion is wrong, only that the way you phrased it implies that many people could come to the same objective opinion, while there’s plenty of evidence that folks pick languages they enjoy and prioritize different things than you might.
- eloff 6y agoThere's this political correct thing where people act like there's no objective truth and everything is subjective. That's just not how reality works, there is usually an objective truth even when we can't agree on what it is. You can use a hammer and a screwdriver for putting screws into drywall, but one tool is objectively better, under most conditions, regardless of your personal opinion. Python is superior to C and Rust for most kinds of scripting tasks, given equal mastery of both. It has a REPL, it doesn't have a compile time, it has a great batteries included standard library. There are plenty of specific tasks that will be exceptions, but that's my subjective opinion. I also think it's closer to the objective truth - and that people who have a different opinion are simply wrong. I'm not afraid of calling it how I see it. I could be wrong here, but I don't think that's the smart money bet.
- steveklabnik 6y agoI mean, I should probably turn this comment into a blog post, but https://news.ycombinator.com/item?id=22712441 https://news.ycombinator.com/item?id=22712441 That Python and that Rust are not very far off from each other. Rust is surprisingly good at these tasks for people who already know Rust. It's not as far out as you seem to think. That being said, I am quite sure that Rust is not going to take over as a scripting language or something. But at the same time, it is not completely ridiculous to write some Rust for these sorts of tasks if you're already comfy, and if the libraries are there.
- lmm 6y agoHad you ever used an ML-family language before Rust? I hear lots of excitement about Rust but it seems to mostly be about things that I already have in the languages I was using.
- rapsey 6y agoThe point is Rust has those features without a VM and no performance sacrifices. Its purpose is a C/C++ replacement.
- lmm 6y agoFor some people that's important, sure. But a lot of the people getting excited about Rust seem not to need those things at all; the person I replied to was talking about Python of all things.
- rapsey 6y agoBecause Rust also brings other benefits like a thriving community, a rich and powerful package management and ease of deployment of solutions. Rust made quite a lot of really good design decisions.
- lmm 6y agoYou're still answering a different question from the one I asked.
- masklinn 6y agoIt is a good answer though: yes many of the exciting features of rust long predate it (and rust never made a secret of it), but rust packages them in a much more convenient and accessible form e.g. I’ve borked Haskell stacks as often as I’ve used it and every time I check back on it I’m supposed to use a different thing, never had that issue with rust.
- Jetrel 6y ago