7 ms·
I have recently performed a relatively simple development by using programming languages on which I had low-to-to-no experience: Perl (low), Ruby (no), Rust (no
by nukeop 9y ago
I have recently performed a relatively simple development by using programming languages on which I had low-to-to-no experience: Perl (low), Ruby (no), Rust (no) and Go (no). Note that I am quite adaptable on the programming language front and that this small experiment was precisely meant to showcase these adaptability skills. Rust was, by far, the most difficult-to-learn, difficult-to-research, counter-intuitive, unfriendly, constrained, unappealing, etc. of all of them. Warnings and errors appeared systematically and, despite their verbosity, were rarely helpful.
The most ironic part is that so many restrictions and problems are likely to provoke people to rely on whatever option happens to work, which might not be the best/safest one. Being so concerned about making sure that the generated code is extremely safe no matter what by sacrificing flexibility and user friendliness is far from ideal. Restrictions and prohibitions have always to be seen as an in-the-worst-case-scenario resource, not as a primary solution; much less when dealing with something as complex as programming, a very powerful tool supposed to be managed by knowledgeable individuals. The higher the freedom, the better the results delivered by a sensible/knowledgeable person. Unless Rust changes a lot, I don't see it going anywhere. It might get some support from theoretical/academical/inside-whatever-bubble circles, but seriously doubt that developers with real-world experience can like or even accept most of what this language represents.
- mkesper 9y agoRust is a direct contender to C and C++, not to script or GC languages. Please compare apples to apples.
- zzzcpan 9y agoOnly for some code it's not apples to apples. For most code GC is not a big deal and the languages just offer different tradeoffs. Perl, for example, has XS for performance critical code, which is essentially C or C++. But the ecosystem is big enough that you don't necessarily need to write any C code yourself. And all of this is not even relevant to usability issues he tries to discuss.
- ZenoArrow 9y agoFor some languages, that distinction doesn't seem to apply. For example, it seems that the D language can be treated as both a scripting language and a system language, as the speed of compilation + execution can be comparable to that of scripting languages. For evidence of this, take a look at the first D versus Python comparison in this article, note that both scripts have comparable execution times (both finished running in under a second): http://tech.adroll.com/blog/data/2014/11/17/d-is-for-data-science.html http://tech.adroll.com/blog/data/2014/11/17/d-is-for-data-sc... It should be noted that D has a number of different compilers, offering the user the choice between compilation speed and optimisation.
- pcwalton 9y agoThere are effectively two Ds: one that's garbage collected and one that's manually memory managed and unsafe. I don't think you can really consider them equivalent: there's always a large difference in development friction when you move from a managed environment to an unmanaged one.
- ZenoArrow 9y ago> "There are effectively two Ds" Could you not also say there are effectively two Rusts? https://doc.rust-lang.org/book/second-edition/ch19-01-unsafe-rust.html https://doc.rust-lang.org/book/second-edition/ch19-01-unsafe... "Rust has a second language hiding out inside of it, unsafe Rust, which does not enforce these memory safety guarantees. Unsafe Rust works just like regular Rust does, but it gives you extra superpowers not available in safe Rust code." By the way, I don't say this as a criticism, I admire what the Rust team are doing, and will be glad to check out the language again in the future.
- steveklabnik 9y agoYou can, but there is a big difference: betterC is a subset of D, whereas unsafe Rust is a superset of safe Rust. That is, when you use unsafe, you don't lose any language features. When you drop into betterC, you do lose a bunch of stuff from D.
- bvinc 9y ago> The higher the freedom, the better the results delivered by a sensible/knowledgeable person. Experience has shown this hypothesis to be false, especially concerning low level systems programming languages and security issues.
- aisofteng 9y agoNeither of you has said explicitly what you mean by "better" and likely have different measures in mind when saying it here.
- sifoo 9y agoUntil we have as much code written in Rust as is currently implemented in C, experience hasn't shown anything. The same claims and promises have been made for C++ in relation to vanilla C for ages, and it's just not true. An experienced C coder (which arguably takes longer to achieve) will perform as good as a C++ coder of equal skill level. All they do is trade complexity and convenience for simplicity and flexibility; it's a matter of preference, not life and death.
- Jweb_Guru 9y agoThis working group literally just proved that a significant subset of Rust is safer than any comparable subset of C++. This isn't a matter of opinion. What more proof do you actually want than a formal proof? I seriously wonder what people think the whole point of this paper was.
- sifoo 9y agoEmpirical? It's the only kind that really matters in the end. Any idiot can see that Rust is safer in theory, but reality is where the action is. I'm guessing unsafe doesn't constitute a significant subset then, since it's worse than C++. And that's the point, Rust is not going to threaten C or C++ without plenty of unsafe code being written in Rust.
- nercury 9y agoYou have successfuly uncovered that Rust is a fundamentally different programming language, instead of a variation of the same. I feel that having learned Rust, any new language similar to Rust would have way lower learning curve. It is quite similar to the jump required from imperative to a funtional language. We may be missing a good name for a paradigm the Rust falls into.
- bushin 9y agoEsoteric programming language :)
- pjmlp 9y agoHave a look at Idris, ATS, Liquid Haskell, F* or Cyclone, then maybe you will appreciate Rust from another angle.
- nickpsecurity 9y agoAchieving Rust's safety in C took separation logic with the best tool probably being VCC from Microsoft. I encourage anyone that thinks the borrow checker is unnecessarily hard or alternative languages would be easy to try doing an existing Rust library or app in VCC with separation logic. Also, if applicable, ensure it passes soubd, static analysis to be free of any defects Rust's design would stop in that library that C doesnt. Then you'll appreciate the work languages like Cyclone and then Rust save you. There's other models published and in development that might make the next one a bit easier. Yet, separation logic is the proper comparison to borrow checker and most programmers didnt try to learn it.
- StavrosK 9y agoThe main difference that I've seen between C and Rust compiler errors is that, with C, my reaction is "goddamnit, you know what I mean, why can't you just accept it?!", whereas with Rust my reaction is "oh yes, I see how that may cause problems".
- pcwalton 9y ago> The most ironic part is that so many restrictions and problems are likely to provoke people to rely on whatever option happens to work, which might not be the best/safest one. Programs written in Rust are empirically safer than programs written in C or C++. > The higher the freedom, the better the results delivered by a sensible/knowledgeable person. If that were true, then C and C++ code would be safer and more secure than programs written in memory-safe languages. Obviously, that's not the case. > seriously doubt that developers with real-world experience can like or even accept most of what this language represents. Lots of developers with real-world experience, including me, use Rust all the time without any more problems than they would have in any other language.
- nukeop 9y agoI don't see too many job offers for Rust developers, I see plenty for C and C++ though.
- gpm 9y agoWith the exception of swift - which has the distinct advantage of being one of two languages you can write programs in for the most popular (? probably true since Android's market share is scattered across many models) piece of consumer hardware in the world - I can't think of a language of similar age to or younger than rust with as many job ads. You see plenty for C/C++ because they've existed forever, have a huge amount of code written in them, and a huge number of programmers who already know them. Just like with Cobal you will almost certainly see plenty for C/C++ many years into the future. That doesn't really say much about Rust.
- catach 9y agoThe youth of the language should be a reasonable predictor of that difference, alone. It may indeed turn out that the way Rust's learning curve is front-loaded will prevent it from breaking into the mainstream, but that's a separate issue from developers deciding it's unsuitable for work after they learn it.
- namelost 9y ago> > The most ironic part is that so many restrictions and problems are likely to provoke people to rely on whatever option happens to work, which might not be the best/safest one > Programs written in Rust are empirically safer than programs written in C or C++. But Rust defines safety as being safe from the kinds of errors that the Rust compiler is capable of making one safe from (buffer overflows, race conditions, undefined behaviour, etc). If one if distracted by trying to satisfy the borrow checker, they might overlook a logical error. People have limited concentration, patience and perseverance and usually have to work to deadlines. Rust is great for writing high-performance code, or code that needs to be parallelised within a single process. However if performance is not a concern then a statically typed language with a GC is usually a better choice.
- algesten 9y agoI'm sorry you found Rust hard, but it really is a world apart from Perl. I started learning programming using assembly (Motorola 68k), and then went a different professional route (via Java and Javascript). Rust to me is back to basics. There is a stack, and there is a heap. Many languages mask this from you, but notably C/C++ doesn't, and although it's a notch up in complexity from Perl, the control you get over these aspects lets you write code that is equivalent to C/C++ in performance. Something Perl/Go can do for you under some scenarios, but mostly not. Granted, not everyone needs/wants to understand or work closer to the system.
- sifoo 9y agoAnd not everyone who needs/wants that is going to prefer Rust's complexity and rigidness to the simplicity and flexibility of C, or the even more complex yet more flexible C++. It's preferences, priorities; not black or white; no one has any right to force anyone to do anything. As long as humans are in the loop we're going to have bugs, what kinds of bugs will depend on priorities.