9 ms·
Rust 0.8 released
- saosebastiao 13y agoAnybody know when there will be a regex library?
- chrismorgan 13y agoSome time, some time. It would really be appreciated. If you want to try working on it yourself, come join the community! You'll get lots of help with it when you need it.
- zokier 13y agorust has relatively nice FFI, so I suspect using PCRE shouldn't be too difficult.
- skorgu 13y agoOr re2 [0] [0] https://code.google.com/p/re2/ https://code.google.com/p/re2/
- chrismorgan 13y agoSee also https://github.com/mozilla/rust/issues/3591 https://github.com/mozilla/rust/issues/3591, where re2 is graydon's expressed preference. (graydon was the project leader at that point; more recently brson has taken up that mantle.)
- bjz_ 13y agoThose interested in using Rust for game development can check out our list of resources: https://github.com/mozilla/rust/wiki/Computer-Graphics-and-Game-Development https://github.com/mozilla/rust/wiki/Computer-Graphics-and-G... If you want to chat feel free to stop by `#rust-gamedev` on irc.mozilla.org. We're very nice!
- dbaupp 13y agoThere's also #rust and #servo on the same server. We're very very nice!
- mcpherrinm 13y agoRemember that Rust is still a rapidly changing language, and releases have very little connotation of stability, support, or any other guarantees. They're released on a schedule, not by features. They're useful to be able to refer to periods of time in Rust's rapidly changing lifetime, but not much beyond that.
- mscottmcbee 13y agoSo 1.0 will be released at a certain time regardless of features?
- steveklabnik 13y ago10 is the number that comes after 9, so I'd expect a 0.10. Rust has SemVer baked into its standard library, and the package manager (hopefully soon) will assume SemVer.
- wmf 13y agoSo I guess the version number is not intended to give any hint about how close Rust is to being frozen.
- steveklabnik 13y agoThat is correct. Please see my comment here: https://news.ycombinator.com/item?id=6454497 https://news.ycombinator.com/item?id=6454497
- ris 13y agoA package manager? Oh god.
- steveklabnik 13y agoYup. rustpkg is a build tool that knows how to pull in dependencies and build them, too. It is of course not mandatory, and won't really be used to distribute binary versions of Rust programs, just the source.
- metajack 13y agoRelease notes are here: https://github.com/mozilla/rust/wiki/Doc-detailed-release-notes https://github.com/mozilla/rust/wiki/Doc-detailed-release-no...
- chrismorgan 13y agoIf you were wanting to use Rust but also wanted to use HTTP (client or server), I've got https://github.com/chris-morgan/rust-http https://github.com/chris-morgan/rust-http which has rapidly become the de facto HTTP library (although it started after Rust 0.7 was released). It's far from complete—but that's an opportunity for you to join in, if you want.
- erkose 13y ago"far from complete" and "de facto HTTP library" doesn't say much for rust.
- spicyj 13y agoRust isn't, and doesn't pretend to be, production ready so it's pointless to judge it as if it were.
- chrismorgan 13y agoIt's good enough that the Servo team decided to use its client (and now do), but the approach I've taken (implementing the HTTP spec thoroughly, putting Rust's type system to good use) will take quite a long time before it's really polished (e.g. we must implement types for every type of header, rather than just using strings and leaving it to users to interpret them [often incorrectly]). It's still a little experimental, but it's the only really serious HTTP library there is for Rust out there. Just wait until it's done. It will be a really great HTTP library.
- chamakits 13y agoI haven't taken a look at your library, but as a developer that has always wondered "Why use strings for these things that could be enums, contants, or types?" in API's, I appreciate your effort and your thoroughness.
- chrismorgan 13y agoThat's been my feeling exactly, and why I was delighted that Rust didn't have HTTP support yet. That follows through to many other aspects of e.g. web frameworks; there's a lot there where string typing is used. When rust-http is stable enough, I'll be getting on to my dream framework which will be astonishingly safe and bamboozlingly quick (to start and to run, if not quite to compile), incorporating and extending various ideas at present only present in Haskell frameworks and a couple of other similar language-frameworks (e.g. Ur/Web). It'll be fun! I've been mostly a Python developer hitherto, but I'd never have tried something like this in Python—it simply wouldn't work. You need a type system like Rust's before it can work, but then it really works.
- continuations 13y agoIs there an actively developed web framework for Rust, kind of like Revel for Go? I have a toy web project I'm starting. Would love to play with Rust.
- steveklabnik 13y agoNot yet. As chrismorgan points out above, the http library is still being developed, once it's more stable, web frameworks can be built on top of that.
- zokier 13y agoWouldn't web frameworks be using something like fastcgi rather than raw http?
- chrismorgan 13y agoWhy? FastCGI is slow. Controlling the entire HTTP stack is fast, and makes deployment much easier (only one piece of software to configure, not two or three).
- steveklabnik 13y agoFastcgi has a lot of limitations. We have a clean slate here, might as well shoot for the stars. Of course, if someone wants, they can totally do something via FastCGI too.
- yla 13y agoiterators like Ruby! sounds cool.
- devx 13y agoIf they make their next-gen browser using Rust, I hope they make it 64-bit-only, and optimize it as much as possible for x64 and ARMv8. None of that "support back to Windows XP!" stuff. It wouldn't be necessary (will still have Firefox a few years longer for that), and it would just hold them back in terms development time, maintenance, performance and security. Then it would be not just great PR for their "highly-optimized no legacy cruft 64-bit browser", but would also give people a reason to switch from Firefox to it. It would also give Mozilla an excuse to not make a 64-bit Firefox anymore. I assume it's going to take them at least 2-3 years to do it (if they ever plan to release it), and by then Microsoft will probably release a 64-bit only Windows 9, iOS will be 64-only, too (probably not relevant to Mozilla, but could be in the future), and at least half of all Android smartphone users will have ARMv8-based devices. Mozilla should take full advantage of this, and really push for performance (and security), and they should only make it available from Android 5.0 (probably the first 64-bit Android version) and Windows 7 x64. Support for Linux kernel should probably start with no lower than 3.10 LTS (contains all the ARMv8 support).
- metajack 13y agoYou make good points, and the Servo team is doing more or less as you described. Our primary target is 64bit and we plan to leave behind lots of legacy stuff. The extra parallelism we're after also enables new things too. For example, Servo runs cross-origin and sandboxed iframes in parallel.
- marshray 13y agoNote that Windows XP 64 bit was a thing. :-) Very few of today's apps actually benefit from having more than 3GB of address space. Nothing on my desktop PC is using more than 300MB at the moment. All else being equal, 32 bits will be more efficient, particularly on portable devices which tend to have far less memory bandwidth.
- jfb 13y agoAll other things are not equal, however.
- glesica 13y agoI've messed around with Rust a little and I love what I see! The documentation is still poor (understandable given how quickly the target is moving) but that seems to be changing. This is a really exciting, multi-paradigm language and I wish Mozilla all the best in developing it further!
- steveklabnik 13y agoIve been making it my mission to improve the docs, especially as the language settles down. Any suggestions welcome, here or via email.
- saosebastiao 13y ago1) I think I've had 4 different people try to explain lifetimes to me and I still don't think I understand. 2) The use of pointer dereferencing in closures is still quite confusing to me. For example, from the tutorial: let square = |x: int| -> uint { (x * x) as uint }; no pointer dereferencing, yet: [1, 2, 3].map(|x| if *x > max { max = *x }); uses pointer dereferencing. I can't figure out any rhyme or reason behind it. 3) How do you create traits that can be automatically derived? How do you implement a default method? 4) How do you create and use macros, and in what situations are they the appropriate solution over other forms? (I'm used to using macros in lispy languages, but using them as pervasively in other languages seems to be a form of code smell).
- pitterpatter 13y agoMaybe this will be useful to understanding lifetimes: http://static.rust-lang.org/doc/0.8/tutorial-borrowed-ptr.html http://static.rust-lang.org/doc/0.8/tutorial-borrowed-ptr.ht... As for the pointer dereferencing, perhaps putting the type there will make it clearer: [1, 2, 3].map(|x: &int| if *x > max { max = *x }); Now you can see that x isn't actually an int but a reference to one. As for automatically derived traits, those are actually slightly more powerful macros implemented in the compiler itself. You can see it at rust/src/libsyntax/ext/*. For default methods, you just put the code you want in the trait itself. Like so: trait Animal { fn sound(&self) -> ~str; fn make_sound(&self) { println(self.sound()); } } The make_sound method is what's called a default method. If you implemented that trait, at the very least you would have to define the sound method and if you wanted to, you could override the default make_sound method. Macros are actually created with another macro called macro_rules. I'll defer to the tutorial for them: http://static.rust-lang.org/doc/0.8/tutorial-macros.html http://static.rust-lang.org/doc/0.8/tutorial-macros.html
- ww520 13y agoRust is pretty good as a language but things are still changing a lot, especially on the library side. I did a project in Rust as a learning exercise. The language is easy to pick and I was able to hit the ground running from the start. The major learning hurdle I think is the memory model, which is different from most languages out there. Here's my first Rust project after two weeks of on and off hacking. It's a Memcached client library implementing the Memcached protocols in pure Rust. https://github.com/williamw520/rustymem https://github.com/williamw520/rustymem
- calinet6 13y agoI just want to note, if you ever release something (anything, be it a version or a whole startup), copy their first paragraph intro! I didn't know what Rust was, but after just 8 seconds I did. Fantastic and all too rare.
- dodyg 13y agoWhat do people use for editing Rust source code?
- steveklabnik 13y agoWe have syntax files for vim, emacs, kate, gedit. https://github.com/mozilla/rust/tree/929b75e220f6fced42dcfe2146700ceba1e2cebe/src/etc https://github.com/mozilla/rust/tree/929b75e220f6fced42dcfe2...
- ww520 13y agoI use Emacs and just build with make in command line. The compile errors are pretty good to figure things out.
- portmanteaufu 13y agoCongrats on all the progress, guys! I'm really looking forward to getting to work with Rust. I have a couple of questions: Is the new fixed-stack FFI arrangement the end goal, or is it a stepping stone to a different system? It seems as though always using a big, fixed stack would cause performance/memory issues. Could the compiler detect which Rust fn's call extern "C" functions so I don't have to write annotations? Thanks!
- kibwen 13y agoFixed-stack is not the end goal. The intent is to migrate back towards small, growable stacks. There were long discussions over how "smart" the extern stack-size strategy should be. The current arrangement is, as ever, a compromise. In practice, most people writing bindings to C from Rust will wrap the C call into a very thin wrapper function whose job is to handle type conversions and managing the necessary `unsafe` bits. The hope is that putting the annotation on these wrapper functions won't be very onerous, with the result that any Rust code that calls the wrapper functions won't ever have to bothered with remembering the annotations.
- portmanteaufu 13y agoMakes sense, thanks! As an outsider it can be tricky to know which things in the release notes are "This feature is ready" vs "This is simply the present state of things."
- steveklabnik 13y agoRust is basically entirely 'this is simply the present state of things.' :)
- chrismorgan 13y agoPlus there's also rather a lot of non-codified knowledge about what's happening and going to happen. But if you pay much attention to the mailing list and stay in #rust you'll pick up an awful lot of it.
- pjmlp 13y agoCongratulations! When will we be able to compile Rust using a standard LLVM instalation, instead of compiling LLVM with it? My poor netbook takes almost 3 hours to compile it. :(