3 ms·
"I can comfortably state that I prefer Rust over Python, even for simple programs" That's fine but that will never be generally true because Python is a high l
by jariel 6y ago
"I can comfortably state that I prefer Rust over Python, even for simple programs"
That's fine but that will never be generally true because Python is a high level language that will always have 10x more developers using it, including your Data Science prof, the high school kids learning 'basic programming', and all the AI researchers.
And the tons of devs doing stuff for which Python just makes more sense.
- nine_k 6y agoI don't think it's appropriate to call a language with an advanced and useful type system, expressive syntax out of box, and reasonable macro support a "low level" language. Python, in comparison, lacks a lot. But it has a very low barrier of entry: the syntax is English-like, you can start doing something with very little knowledge of advanced features, and everything is easy to inspect and play with in a REPL.
- jariel 6y ago"advanced and useful type system, expressive syntax out of box, and reasonable macro support" Those things are nice, but don't have anything to do really with the question here. Rust is designed to be 'close to the metal' and due to that fact, and a few other things - it's an 'advanced' programming language. Javascript, Python (and PHP at least today but that's changing) will have 10x a greater user base than Rust ever will. In the Enterprise, Java and C# are going nowhere. Rust will be the domain of only a specific set of software developers, and they will share that space with C++.
- tptacek 6y agoRespectfully, I feel like you're dancing around what Python has that Rust does not. It's not the "English-like syntax" (with its invisible syntax errors). It's that Python, like most modern languages, manages memory automatically, and Rust does not. Rust doesn't for good reason! Not just zero-cost abstraction, but also, because for the applications it's designed for, it makes controlling memory much easier. There are ways in which writing a Rust program is probably easier than writing a Java program, in Rust's stomping grounds. It's just that it doesn't make things easier anywhere else.
- paavohtl 6y agoI don't disagree with your premise, but I disagree with the claim that Rust doesn't automatically manage memory. Rust absolutely does automatic memory management - that's one of the main motivations behind the ownership/lifetime system. For instance, when you create a vector, the standard library will automatically allocate, re-allocate, clone and/or deallocate the buffer when necessary. What Rust doesn't do is to decide for you how to pass or share that memory between different parts of your program - it just provides you with options. One could argue that this should also be under the automatic memory management -umbrella, and I wouldn't necessarily disagree. But I don't think it's fair to say that Rust doesn't have automatic memory management. I would also argue that for many simpler programs you can get away with basically paying no attention to memory management. If your program is a simple pipeline which reads some input, applies some processing and produces an output, your code might not look substantially different from any GC-based language. That doesn't mean Rust is an easy language or even a good idea to use for these kinds of programs, but I would argue that a developer proficient in both Rust and Python could write the same (simple, pipeline-like) program in either language with comparable time and effort.
- nine_k 6y agoRust is a high enough level programming language to have a GC as a library. You can go with Rc and Arc all over the place, and have a Python-style ref-counting GC. OTOH Go is a lower-level, less expressive language with a built-in GC memory management. To me, the level of a language is the level of abstraction one can comfortably reach with the language, and not being close to the metal or not.