5 ms·
> Python is much better suited to the task. This is not an objective opinion, but subjective. People generally appreciate different things about different lang
by 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.
- eloff 6y agoI shouldn't be surprised to see you defending Rust here :) I do see a lot of similarities between Rust and Python. I don't agree that it's better than Python for most short scripting tasks - but I will grant your point that it's not completely ridiculous either, not by a long shot.
- steveklabnik 6y agoHonestly, I am surprised; if you go read my old Hacker News comments, you'll see me saying that I don't think Rust will ever make sense for the backend of websites. I have been pleasantly surprised as things have developed.
- eloff 6y agoI don't have anywhere near your level of experience with Rust. But yeah that's been surprising to me too. I still think I'd rank it behind Go and Python for a typical website backend - but it depends on the project and the team. The more people involved, the more things the type system will save you from, and the more you benefit from being able to build powerful abstractions - which offsets the relatively higher "tax" on productivity with it. Rust is one of the better choices for backend web development today, a sentence I also find surprising just to write. Honestly, probably the biggest thing holding it back for that use case is not the language itself but lack of adoption. It's tougher to hire for, and has a less mature ecosystem. I feel the momentum is there and that will change over the next 5 years or so.
- steveklabnik 6y agoYep, I would agree with all of this. Some Oxide folks have talked about our experiences with Rust as web backend stuff, it's linked in the post but https://blog.jessfraz.com/post/the-automated-cio/ https://blog.jessfraz.com/post/the-automated-cio/ and https://twitter.com/ahl/status/1308421852931461126 https://twitter.com/ahl/status/1308421852931461126 We had to build a bunch of stuff because as you say, the ecosystem isn't super mature at times.
- bluejekyll 6y ago> 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. This is a poor analogy. Programming languages are used for writing programs. You suggest that Python is objectively superior in one context "scripting" than other programming languages. There are languages that are not cross-platform, that would fit that, there are languages like PL/SQL that are limited to databases, those are not practical for many program development efforts. In this context, we're really talking about two different types of hammers, perhaps one has a claw and the other does not, but they are both fairly portable and can target nearly all the same platforms. But if Python is objectively better than these other general purpose languages, does that imply that there are areas where Python is not superior to these languages? Would it suggest that folks who've been successful even when choosing Python in those cases objectively made the wrong choice?
- eloff 6y ago> In this context, we're really talking about two different types of hammers, perhaps one has a claw and the other does not, but they are both fairly portable and can target nearly all the same platforms. It's an analogy, but one tool is going to be faster and easier to use. So let's say a screwdriver vs an electric screwdriver. > But if Python is objectively better than these other general purpose languages, does that imply that there are areas where Python is not superior to these languages? Yes. There are a lot of areas where Python is inferior. In fact I'm using Rust right now for a project despite having over 15 years experience with Python. Programming languages are tools and they're better or worse suited to different tasks. There is no one language to rule them all - yet anyway. > Would it suggest that folks who've been successful even when choosing Python in those cases objectively made the wrong choice? Yes. That you were successful does not fully validate your decision about choice of programming language. It just means it wasn't that bad. It does not mean it was the optimal choice.
- eloff 6y agoI'm surprised people disagree with anything I said in this comment. It all seems like common sense, bordering on the obvious.
- hannofcart 6y agoThe only difference between a 'scripting task' and a 'serious programing task' as far as I can see is what you perceive as the scope of the project as you embark on it. I have had small 'scripting' tasks that are successful accrue enough feature creep over time and turn into a 10000 line behemoth (as far as quick and dirty scripts go). And at that point, you start hoping you hadn't slapped it together with the haste that you did and miss the easy refactorability that Rust gives you.
- eloff 6y agoYes. Some time between whipping up a little prototype and getting to 10k lines of code, you may want to reconsider the architecture and language of the solution. That is not a reason to start off thinking it will get that big, so you have to over engineer it, because the vast majority of scripts don't. You design to the most likely scenario.
- forrestthewoods 6y agoI agree that Python is better and easier for quick scripting job. Every single time my “quick” Python script has turned into something I use for more than a week I say “damn I wish I had written this in Rust”.
- eloff 6y agoWrite one to throw away. Nothing wrong with rewriting in rust now that you understand the problem better.
- FpUser 6y agoWhen you say that 1L of distilled water at some temperature weighs 1 kg I'll take it as more or less objective. When somebody says that general purpose language is superior just because it has REPL and no compile time I take it as purely subjective. Some languages/implementation while producing native code have perceptually instantaneous compile time, so here is your REPL. And they scale as the task grow way better then Python. I think it is just your private /subjective opinion and it is not any better than mine.
- Jetrel 6y agoI have to believe there's a block of people out there who just assume "nigh-instantaneous compile time" is a bit of a bigfoot. Or maybe they assume that, if you have that, why wouldn't you make the jump to writing a REPL, since the hard part is done... Just making some guesses.
- FpUser 6y agoNo , I would not "make the jump to writing REPL". I was addressing this: "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" To me it makes the impression that you are conflating here, hence my answer about REPL. Technically of course REPL is different from having "no compile time". In any case I do not really consider opinion about Python being the better one for scripting tasks as anything but subjective.
- Jetrel 6y agoAs we mentioned before, those weren't my opinions, just my guesses about other people's opinions.
- wtetzner 6y agoOCaml more or less has both. Very fast compile times, but also REPL support. It however does not have Python's batteries-included standard library. Luckily Opam is starting to make that less of an issue.
- 6y ago