13 ms·
Announcing Rust 1.2
- alexro 11y agoIsn't Rust the next C?
- steveklabnik 11y agoThat depends on what you think of as being the core of C. Or, for example, some see Rust as the next C++, which is itself the next C, so is Rust _transitively_ the next C? Programming languages never die, so I don't have a personal opinion on this point, exactly. For me, I would only write C code if I was working on a C project, or if I couldn't get a Rust compiler for the target platform. My starting point would be Rust, it would have to be disqualified for me to use C. Then again, I am the most biased person possible... (and also prefer C to C++) But regardless, C will never, ever die, so talk of Rust 'killing' or 'replacing' C is misguided, in my opinion.
- tinco 11y agoI'd consider a language dead if there were no (or very little) new projects being done in it. For example you might say COBOL is alive because many financial institutions still run COBOL services, but you'd be hard pressed to find someone who would advocate to start a new standalone COBOL project. (Queue person who started a COBOL project last week..) In that sense, I think Rust has a real shot at at least severely wounding C++ or at least opening the door for the real C++ killer (it might be that Rust is a smidgen too strict in the mut ref department to really kill C++, I'm encountering a lot of push back from experienced C++ devs). We're talking about a 15 year timescale though, so that's at least 3 era's of computing.
- dragonwriter 11y ago> In that sense, I think Rust has a real shot at at least severely wounding C++ or at least opening the door for the real C++ killer (it might be that Rust is a smidgen too strict in the mut ref department to really kill C++, I'm encountering a lot of push back from experienced C++ devs). Experienced X devs pushing back against Y doesn't mean that Y isn't going to displace X; the big factor in displacement isn't whether experienced devs will voluntarily shift (even if Y does displace X, the experienced X devs have the most vested interest, and will be among the last to voluntarily move to Y.)
- steveklabnik 11y ago> I'm encountering a lot of push back from experienced C++ devs Yeah, this bit is really interesting. It seems fairly split, though I'm not sure in what ratio. Some C++ devs are really into it, but others are very opposed. When you're used to total freedom, but then the compiler yells at you, there can be frustration... We've also seen a _tremendous_ amount of interest from people who don't strongly identify as a 'systems programmer' at present. RustCamp was last weekend, and the audience is very broad. It's a classic "growing the pie" situation: Rust may or may not take away some of C++'s audience, but it very well just might make the pool of systems programmers significantly larger. We'll see!
- BonsaiDen 11y ago> We've also seen a _tremendous_ amount of interest from people who don't strongly identify as a 'systems programmer' at present. Can't underline this enough, as a long time WebDev with a lot of JavaScript, Python and Lua experience, Rust really feels like a door opener into the bare metal* world. Especially as a Node Dev I felt right at home with Cargo. And as someone who only rarely touches C/C++, having the compiler scream at me for the first 10 days or so was probably the best "tutorial" about memory management and ownership I've ever "read" :) Rust really made me think a lot deeper about who / where and when stuff will be owned and eventually destroyed. Overall, the language, cargo and everything around them fit so well together, learning it has been a real joy so far :) * Well I've also done Z80 assembler on GameBoy before but that's probably not what people today would consider "bare metal" these days.
- andresmanz 11y agoFor me it's not really the freedom. I already said that elsewhere, but: I don't mind when the compiler yells at me. I just don't like the compiler to criticize my coding style by default. Initially, I liked Rust because it reminded me of C++. But then I began reading the book and basically it was full of statements about the coding style I prefer (and will keep) being bad. That's an incredibly stupid reason, but it kind of keeps me away from the language. But it's also the fact that C++ still is very widespread and has tons of libraries. I wouldn't say never, of course. I'm looking forward to using Rust. Just not now.
- vezzy-fnord 11y agoI actually think that the scenario of Rust versus C++ is going to be quite interesting to see unravel, precisely because I don't think one is going to definitively weaken the other, but both be on their respective tails. This is because of the abnormally dramatic evolution C++ has seen over the past 5 years or so, and is hectically continuing. Though this has pretty much definitively made C++ too large for any single person, and there are some fundamental semantics that ensure Rust will always have the high ground in some areas, the lines related to functionality are getting blurrier.
- bitbckt 11y ago"Cue", not "queue". :)
- GFK_of_xmaspast 11y ago"Programming languages never die" There have been literally thousands of programming languages over the years ( https://en.wikipedia.org/wiki/List_of_programming_languages https://en.wikipedia.org/wiki/List_of_programming_languages ) and I can't imagine that more than a handful (which most people itt can name) have survived from the 50s, 60s, and 70s.
- steveklabnik 11y agoMaybe I should say "Programming languages that were used at wide scale never die." My "mojikun" brainfuck variant is certainly dead, but then again, it was never really 'alive' either.
- tbirdz 11y agoThis may be a bit like hair-splitting, but the language doesn't die, only the implementation does. As long as the language was specified in enough detail, a new compiler could be written for it, and be able to compile the old source code in the language. There is an interesting parallel to natural human languages here as well, a language like Latin is considered dead because no one speaks it as a primary language, but humanity still has the ability to translate and understand Latin texts. The same applies to say Egyptian Heiroglyphics as well. In any case it's interesting to think about.
- nulltype 11y agoSpiritually it seems to be a replacement for C++. If you're using C++ for something, Rust seems like a well-thought-out C++. If you're using C for something, then probably not, for the same reasons you are not using C++.
- pcwalton 11y agoIf you're using C and encountering memory safety problems, however, then you may want to consider Rust. Moving to C++ from C offers a small safety benefit and a large expressiveness benefit at the cost of a very large complexity drawback. Moving to Rust from C, on the other hand, offers a large safety benefit and a large expressiveness benefit at the cost of a significant complexity drawback. (I think Rust as a language is less complex than C++, and the complexity of C/C++ undefined behavior rules completely vanishes in safe Rust.)
- dlanouette 11y agoCan you elaborate on what you mean by the "very large/significant complexity drawback"? From what I've seen (which is admittedly small) Rust is much less complex than either C or C++.
- JoshTriplett 11y agoRust is a larger language than C, though far smaller than C++. More importantly, with Rust you should expect to spend more of your time convincing the compiler that you've written correct code, which requires a reasonable understanding of Rust semantics. (The compiler makes that fairly easy, but it can still be a bit of a shock when you're staring at code that seems obviously correct to you but the compiler has no way to know that.) On the other hand, once you do convince the compiler, you have an excellent chance that the code actually is correct, and you'll spend far less time chasing down crazy runtime bugs.
- selestify 11y ago> On the other hand, once you do convince the compiler, you have an excellent chance that the code actually is correct, and you'll spend far less time chasing down crazy runtime bugs. That's what I love about Haskell as well. Know of any other languages like this?
- kibwen 11y agoRust is suitable for a great deal of what C is used for (extending higher-level languages, writing language-agnostic libraries, embedded development, etc.) but Rust will likely never support as wide a variety of obscure platforms as C does. That said, Rust already supports Linux, OS X, Windows, and Android as first-class citizens, and support for FreeBSD, iOS, PSP, and lots of embedded and ARM platforms is currently provided by the community.
- spike021 11y agoPSP?
- kibwen 11y agohttps://fnordig.de/2014/12/03/a-story-of-hacking-or-rust-on-the-psp/ https://fnordig.de/2014/12/03/a-story-of-hacking-or-rust-on-...
- spike021 11y agoThat's pretty cool! I haven't been in on the PSP "scene" in years. Nice to see things are still going on there.
- mtinkerhess 11y agoPlayStation Portable, the predecessor to the PS Vita.
- spike021 11y agoYeah. Wasn't sure if that's what the abbreviation was for. I miss hacking and making PSP homebrew.
- masklinn 11y agoAnd C remains the linga franca of FFIs so that's there to stay.
- 11y ago
- deleted 11y ago[deleted]
- falcolas 11y agoHow long until every minor Rust release is no longer a front page event on HN? Nothing against the language, but this doesn't really offer a whole lot in terms of discussion; reflected by the (current) point totals: 102 points and 4 comments.
- acomjean 11y agoI'm not even a rust user (tried it out a little haven't had the time..). I really enjoy the rust posts here though. Watching the language evolve has been interesting for me. Its an interesting language for a variety of reasons. Those that did a lot of c/c++ programing are probably the biggest fans. This post wasn't the greatest, but good to see where things are going/ improvements being made.
- adrusi 11y agoNormally I avoid making comments that are essentially upvotes, but I wanted to make it clear that acomjean is not an unusual case. I also haven't really used Rust much, but I've followed it's development since the 0.3 days when it was a completely different language. I find the kind of design ideas that go into it very interesting and I get especially excited by the fact that it's actually a serious language now. I think Rust strikes a chord with a lot of people, even those with no investment in it.
- smt88 11y agoI become irrationally excited whenever I see a Rust release announcement, so I hope they keep popping up to the front page!
- arthursilva 11y agoCan't we discuss the new/changed/deprecated items?
- falcolas 11y agoDoesn't really look like it. Of the current conversations, only two are related to the the topic of changes, the rest are generic questions or thoughts about rust.
- ThePhysicist 11y agoI am currently evaluating Rust for a project where speed is important (I am working with graph data in the context of code analysis). Although I find Rust very appealing I still see C++ as the better option, mostly because I fear that Rust would lack good suppport libraries (e.g. for talking to DBs, generating/parsing data formats such as JSON or for generating cryprographic hashes) and that I would end up implementing many of those myself. As of today, many Rust wrapper libraries (e.g. for BerkeleyDB) seem to be written by a single author, which makes me wonder about their stability and maturity even more. I wonder if this is an irrational fear though. Has anyone here implemented a large project with many external dependencies (DB, data serialization, interfacing with other programming languages etc.) in Rust? If so, what were your learnings and would you do it again? I find that the discussion about whether a programming language is "good" or not always focuses on the core features of that language and less on the actual system of support libraries that are available for it and that make it actually useful in a real-world setting.
- steveklabnik 11y agoThere are certainly library deficiencies, but we do have good Postgres bindings, and multiple JSON generating/parsing crates. Young ecosystems: lots of opportunity, but 'opportunity' also means pain for those on the other side of the chasm...
- smt88 11y agoI can't answer personally, but these might help: https://doc.rust-lang.org/book/ffi.html https://doc.rust-lang.org/book/ffi.html https://www.reddit.com/r/rust/comments/3axeu8/whats_the_story_for_binding_to_c_libraries/ https://www.reddit.com/r/rust/comments/3axeu8/whats_the_stor... I guess the answer is that it depends on what libraries you'll need.
- sinatra 11y agoThe examples you gave (DB, JSON, etc) are big enough that there would be decent support for those in Rust. But, your concern is definitely valid for more niche requirements. If your primary concern is availability, stability, maturity etc of a language's ecosystem, then IMHO, you should not choose a language as new as Rust. Rust is currently in the "early adopter" phase, and it is going to go through the same issues (and excitement) that most early adopters do in any field.
- kibwen 11y ago1.2 is great (the nascent MSVC support is especially promising), but I'm most excited by the ongoing work in nightly to completely overhaul the compiler middle-end. The high-level overview is that the middle-end is being refactored to operate on its own intermediate representation instead of the raw AST, which should open the door to a whole host of improvements in compiler speed and code generation. It's technical debt whose bill is long overdue. :)
- ewillbefull 11y agoWill the MIR/HIR stuff also help with adding features? I'm thinking of things like non-lexical scoping/SEME regions/etc. which might be easier to implement with it.
- steveklabnik 11y agoWhen I started reading your comment, I was ready to respond with "yes, one example is non-lexical lifetimes", sooo :) Another is compiler plugins: it's much easier to stabilize an MIR than it is to stabilize the compiler's internal functions.
- pcwalton 11y agoYes, MIR will help with non-lexical borrows.
- dbaupp 11y agoYep, the MIR allows the compiler to understand control flow more accurately and more precisely. Non-lexical lifetimes in particular are one of the big features that the MIR should help enable.
- grayrest 11y agoDoes it open the door to being able to incrementally update the representation and have the compiler used as a library for IDE support?
- steveklabnik 11y ago
- tacone 11y agoThe improvement in build speed is just exciting. Thank you to anybody that made it possible.
- ewillbefull 11y agoNice to see bors in the contributor list!
- steveklabnik 11y agoBots are people too! /r/botsrights! :)
- haberman 11y agoMy current dream: Rust compiling to C, WebAssembly, .NET and JVM. We could finally have a fast, powerful, memory-safe language that can run anywhere without requiring a runtime or GC.
- deleted 11y ago[deleted]
- brson 11y agoThis will happen. Rust is going to be the language that runs everywhere, easily, and interops with everything. In the next year or two Rust devs will be able to easily build and test for Linux, Windows, Android, OS X, iOS, and asm.js/webasm from a single unified toolset.
- haberman 11y agoYour statement is so optimistic that I am almost worried you are being sarcastic and making fun of me. :) Is this really going to happen? I notice you left C, JVM, and .NET off the list. What's the story for how you could run Rust on a JVM, or on a platform that has nothing but a C compiler?
- GFK_of_xmaspast 11y agowhat platforms in 2015 only have a c compiler (and not, for example, an assembler)
- haberman 11y agoAn assembler is probably pretty common. But assemblers aren't standardized or portable. I can believe that the Rust toolchain is pretty portable. But it's also big. Say someone wants to install my software on some weird platform like, say QNX. I'm not comfortable saying that step 1 for installing my (relatively small and simple) thing is: install the (very large and complex) Rust toolchain. I want to be able to ship C source that will compile anywhere. Though I am comfortable needing two separate C sources: a 32-bit source and a 64-bit source.
- Animats 11y agoWell, as I usually do when a new Rust comes out, I tried recompiling some programs that used to work. So far, not so good: > cargo clean; cargo update; cargo build; Updating registry `https://github.com/rust-lang/crates.io-index` Compiling libc v0.1.8 Compiling regex-syntax v0.2.1 Compiling memchr v0.1.3 Compiling aho-corasick v0.3.0 Compiling regex v0.1.41 /home/john/.cargo/registry/src/github.com-0a35038f75765ae4/regex-0.1.41/src/lib.rs:394:34: 394:51 error: #[feature] may not be used on the stable release channel /home/john/.cargo/registry/src/github.com-0a35038f75765ae4/regex-0.1.41/src/lib.rs:394 #![cfg_attr(feature = "pattern", feature(pattern))] ^~~~~~~~~~~~~~~~~ error: aborting due to previous error Could not compile `regex`. Looks like Rust 1.2 broke Rust's regular expression module. Somebody isn't running enough regression tests.
- steveklabnik 11y agoHm, this looks like a nightly vs stable issue, are you sure you weren't on nightly before? Or, maybe something has turned on the 'pattern' feature, which is nightly only, accidentally.
- dbaupp 11y agoThe `cfg_attr` explicitly means that the `feature(pattern)` (the problem here) only gets activated when someone opts into it by activating regex's `pattern` feature, and by activating it they're opting-in to being nightly-only, i.e. outside the core stability guarantees of the stable releases. Could you post your Cargo.toml?
- Animats 11y ago[package] name = "hello_world" version = "0.0.1" authors = [ "John Nagle <nagle@animats.com>" ] [[bin]] name = "hello_world"
- steveklabnik 11y agoThat doesn't have any dependencies listed, how is it pulling in regex and such? Adding a [dependencies] regex = "*" and building works fine here... hm. (also that [[bin]] section is just repeating the defaults, you don't strictly need it)
- deleted 11y ago[deleted]
- listic 11y agoWhich projects are the most notable Rust users as of today?
- nathan7 11y agoMaidSafe (http://maidsafe.net http://maidsafe.net) and Skylight (https://skylight.io https://skylight.io) are both written in Rust, Maidsafe having recently moved to it from C++.
- kibwen 11y agoIn addition to nathan7's answer, there's also terminal.com (and I'm assuming here that we're not counting Mozilla's usage of Rust in Servo (and soon Firefox)). There are other companies putting various pieces of Rust code through their paces and we have outreach programs to help these companies in their explorations (I don't like name-dropping before announcements are fully ready, I'll be able to say more later this year). In general though, remember what a young language Rust is (May wasn't that long ago!) and understand that large and notable projects take time to appear. Docker didn't appear until Go 1.0 was one year old, for example.