4 ms·
This is a deeply weird comparison. Insufferably lazy "eating the world" headline aside, Python is incredibly popular because its runtime performance is "good e
by tptacek 6y ago
This is a deeply weird comparison.
Insufferably lazy "eating the world" headline aside, Python is incredibly popular because its runtime performance is "good enough" for a huge fraction of applications, its safety guarantees are leagues better than C/C++, and it's deliberately simple to write (it was designed in part as a pedagogical language).
Rust's performance is leagues better than Python's, it's safety guarantees are better by degrees, and it is substantially harder to write than Python, not just because it requires a more sophisticated understanding how how programs are constructed and verified, but also because it requires developers to think carefully about memory management.
I fully expect Rust to "eat the world" of C/C++ code over the next 10 years, and look forward to a time where we'll look askance at kernel code still written in C. It will no doubt be important in a bunch of performance-critical settings (AAA gaming, browsers, network infrastructure) as well.
But Rust will never "eat the world" of general applications (that is, the overwhelming majority of applications), because Python is good enough across all axes for these applications. It would be engineering malpractice for most companies to rewrite working Python applications in Rust. That was not the case for C-to-Python (or even PHP-to-Python) rewrites.
In case this isn't obvious to anyone reading this thread --- though I'd be surprised --- the reason Rust is in the Linux kernel, while Python isn't, is that Rust was designed to be interoperable with kernels and browsers, and Python, like most other languages that have ambitious runtimes, was not. It's not an indication of Rust's popularity, but rather just Rust doing something it was designed to do.
(Rust is plenty popular.)
- baby 6y agoJavascript did this.
- tptacek 6y agoSure, I mean, in my head, Python, Ruby, and Javascript are all lumped together (though Python appears to be by far the most popular of them in commercial settings).
- Aeolun 6y agoI’ve really only seen python used in academics and data processing.
- tptacek 6y agoIn the almost 4 years I spent doing security for startups, Python was overwhelmingly the most popular language, not just among clients but among every startup we talked to. That's not counting data science teams. (I'm not really a Python fan, for what it's worth.)
- AmericanChopper 6y agoMy recent experiences with startup consulting have involved a lot more new node projects than new python ones. Though I also lump those three languages together as all doing mostly the same thing.
- baby 6y agoThey are close contestant for sure, but don't underestimate the popularity of Javascript among developers: https://madnight.github.io/githut/#/pull_requests/2020/2 https://madnight.github.io/githut/#/pull_requests/2020/2
- nitrogen 6y agoThere are more niches, industries, and developer cultures than any one of us can fathom.
- person_of_color 6y agoOk, you've convinced me. What's the best way to learn Rust in 2020?
- tptacek 6y agoThe Rust book, which is free online, an idea of a simple program you might have written in some other language, and a text editor.
- daenz 6y agoI think you're misunderstanding the comparison to Python. I am saying Rust will eat the world in the space that it fits in, which is still relatively large, in the same way that Python did, in the space that Python fits in. Not that Rust will take over very high level languages too.
- tptacek 6y agoThe reason I was moved to comment is that I think it's actually not that large a space (the one that Rust plays in). Instead, I think it's just that the applications in that space loom large in our consciousness, because we all use and pay attention to kernels and browsers. And I expect the space of applications "languages like Python" play in to grow over time, and Rust's to shrink, not just because computers will get faster but because the runtimes for those languages will get cleverer (see, for instance, what's happening with Javascript).
- TylerE 6y agoI think nim is the really interesting one to watch here... Compared to rust it offers, say, 99% of the performance and 70% of the safety while really being almost as easy as python.
- entha_saava 6y agoBut do you have a HackerNews spamming taskforce that mentions nim in every comment?
- nindalf 6y agoPlease don’t comment like this. Snarky accusations like this are impossible to respond to and are against the HN guidelines.
- nilkn 6y agoI would actually like to make the exact opposite prediction. A generation of developers grew up on Python, Ruby, etc., rather than C, and they were all brought up on this notion that performance doesn't matter much anymore because computers keep getting faster. But the problems we're solving with computers keep getting harder (in terms of the amount of computation required). These days, I can comfortably state that I prefer Rust over Python, even for simple programs. I prefer it because the type system is much more useful than Python 3 with mypy, the performance is extraordinary out of the box, the language is often just as expressive, and I rarely have any actual issues with the borrow checker. I also prefer it because I've had far too many experiences with Python where supposedly performance didn't matter... until it did and Python was no longer appropriate. I think we're entering into a generation of languages where things like Rust are going to start really seriously displacing C++, and as more people learn them they're even going to start displacing supposedly easier languages. Right now, few folks are going to learn Rust as an alternative to Python. But once they're exposed to it for other work and realize how productive they are, there's just going to be less of a need to reach for Python over time.
- JoshTriplett 6y agoAs a Rust developer, I completely agree. I'd like to see Rust fully supplant C++ and C, but I don't expect it to fully supplant scripting languages, and I definitely wouldn't suggest rewriting working Python in Rust unless you need to improve performance or scalability, or you're having serious maintainability problems. Let many languages bloom.
- correct_horse 6y agoShoutout to the lovely pyo3 library for letting you incrementally rewrite small parts of your Python in Rust.
- blandflakes 6y agoYes! The number of settings where $RUST_COMPETITORS are applicable is simply smaller than the number of settings where a high-level, dynamic or at least garbage-collected language is applicable. It's hard for me to imagine having a real justification for building services in Rust given the relative productivity of those high-level languages. This is basically the reason I haven't picked it up for any personal projects, either. I admire the goals, but my interests don't call for a C++ killer.
- fctorial 6y ago> Python is incredibly popular because its runtime performance is "good enough" for a huge fraction of applications Is there anything slower than pure python?
- t-writescode 6y agoRuby.
- riwsky 6y agoyes: human beings. For basically everything we can feasibly ask python to do, it can do that thing faster than we could on our own; few are the things that we need done faster than that.
- devenblake 6y agoInterpreted BASIC, of which (in my opinion) Python is the spiritual successor. I took an online class in college on Python and one of the assignments required the program to scan a plaintext wordlist for a word. I hesitantly made Python load in the entire wordlist and split it by newlines into values in a list, before something like "if word in wordlist". I fully expected my computer to grind to a halt because the interpreted language was loading in a four megabyte textfile, and I expected to have to make a much more complicated function to scan to see whether the word was in the list. I ran it and it ran in less than a second before printing whatever I put to signal that it worked. I didn't believe it so I ran it again with the same result. Python is like BASIC if it was stable enough to be mission-critical and fast enough to work where it needs to. My previous experience with interpreted languages was with TI-BASIC and it blew my mind that my laptop was powerful enough to do something that fast. Sure, it's slow, but if you really need speed you're better off writing something in something like C or FORTRAN (or Rust now) anyway.
- cheez 6y agoI'm pretty sure that's exactly what he meant.
- jariel 6y agoPython is high level 'tool' - accessible to grad students from various fields looking to do 'some things' with 'data'. Rust is effectively for 'software developers'. Also: ", because Python is good enough across all axes for these applications.", no, Python is good for a variety of things, but not remotely for every thing. Javascript/Typescript, C#, Java and its offspring, and probably Golang, are going nowhere. And of course Swift. Finally: incumbency is more powerful than anyone expects. If C/C++ 'works' in any given scenario, it will be difficult to replace. So many embedded systems, so much hardware out there. Think of how much C++ Code Adobe has invested in. Think of the massive array of sophisticated Autocad products all written in C++. They are not going to be refactored. The native parts of the JVM, Oracle DB, the list goes on. I predict in 10 years 'greenfield' projects might favour Rust, but many won't.
- Reelin 6y ago> incumbency is more powerful than anyone expects I agree, and would also point out that the competitors aren't static targets. D seems to be well on its way to getting a borrow checker. Well written C++20 looks nothing like C++98. Etc.
- wolco 6y agoPHP to Python rewrites? That seems more foolish then Python to Rudt. I have seen a few Python to PHP rewrites. Python is taught in school instead of java now which took over c/c++ as the default language.
- remexre 6y ago> Python is incredibly popular because its runtime performance is "good enough" for a huge fraction of application > But Rust will never "eat the world" of general applications (that is, the overwhelming majority of applications), because Python is good enough across all axes for these applications. It would be engineering malpractice for most companies to rewrite working Python applications in Rust. That was not the case for C-to-Python (or even PHP-to-Python) rewrites. I dunno, I sort of hope that there'll be good and resource-light application development frameworks in Rust that do "eat the world." I spent most of a summer two years back using an (at that point) 12-year-old machine without X for both my personal and work computing. I did browsing with w3m+imlib2, images and PDFs with fbi and fbpdf (iirc), and fbterm (and tmux) as a terminal emulator. That was leagues more responsive than the firefox/eog/zathura/konsole setup I reverted to once the school year started (and I needed to run webapps again). If you're familiar with https://en.wikipedia.org/wiki/Wirth's_law https://en.wikipedia.org/wiki/Wirth's_law I think it applies really strongly to this case, and it's gotten remarkably worse as programmers have switched to making general applications with Python and Electron at the same time as single-threaded clock speeds have slowed down.