3 ms·
I've really become quite a Rust fanboy, although I haven't written tons of code in it. IMO, it's considerably more accessible than Haskell or a ML-family. I'm
by pnathan 14y ago
I've really become quite a Rust fanboy, although I haven't written tons of code in it.
IMO, it's considerably more accessible than Haskell or a ML-family. I'm not precisely sure why, but it seems to "make sense" in a very straightforward way. Some of it I think is lessons-learned from older languages, some of it might be the syntax, some of it just might be mental fit.
Certainly - and this is a huge deal - I could realistically see using Rust in an enterprise scenario where we don't null pointer exceptions but we do want type safety yet we don't want to buy into Java or go full functional programmer with Haskell. Of course that's a few years out, but, but but! That's cool!
I look forward to using this latest version and working away on writing Rust at home. :-)
- chimeracoder 14y ago> I've really become quite a Rust fanboy, although I haven't written tons of code in it. As someone who's been meaning to try it out for a while, I have a couple of questions for you. First, how did you get started? I found the tutorial decent, but after reading through it, I didn't feel like I could quite jump in and start writing code. By contrast, I never actually read the Go spec/tutorials; I did a brief run through the sample web application and was able to write everything else right away (filling in from the documentation as needed, of course). Second, how did you come to understand the memory model? I consider myself more familiar in both functional programming and memory management than average, but I found the memory model to be a bit of a conceptual hurdle (even though I'm attracted to the approach on a philosophical level). Having such a unique memory model makes it a little tough to simply get started writing code right away. Finally, how do you find the libraries in different areas? Web applications? Scientific computation? This isn't really an across-the-board question, since certain areas will probably be more complete than others, but what kind of applications are currently easiest to write in Rust when getting started? EDIT: I understand they're different languages with different goals, but I'm comparing everything to Go just because they're both emerging languages that I started to try to pick up around the same time. I found Go much easier to get going with (no pun intended), but I'm looking to catch up with Rust as well.
- kodablah 14y agoNot the person you replied to, but I can give some idea... >First, how did you get started? I always find a project I kinda want to do, and apply the language to it, not the other way around. In my case, I need to read JVM .class files [1] >Second, how did you come to understand the memory model? The compiler is really strict and won't let you do certain things without explicitly stating (copying, changing pointer types, etc). Basically you have to ask yourself what you're doing w/ the data, then apply the box you want. >Finally, how do you find the libraries in different areas? Cargo is all there is [2]. Obviously the ecosystem is thin right now, but it's really easy to wrap C libs. As for what's easiest, not exactly sure, it's a pretty general purpose language, but pretty low level. [1] - https://github.com/cretz/patina https://github.com/cretz/patina [2] - https://github.com/mozilla/cargo-central https://github.com/mozilla/cargo-central
- thomaslee 14y agoRE: the memory model, I wrote a blog post on it because I had the same trouble. Folks seem to have found it pretty helpful! http://tomlee.co/2012/12/managed-and-owned-boxes-in-the-rust-programming-language/ http://tomlee.co/2012/12/managed-and-owned-boxes-in-the-rust...
- brson 14y agoI'm very curious about better ways to explain not just Rust pointers, but also other features that contribute to Rust's unique feel, like inherited mutability and linear types. These things are all interrelated and there are some emerging best practices, but they are still unfolding as the language evolves and people gain experience with it. I'd recommend reading Tom Lee's post (linked previously) on the subject of pointers. On the subject of libraries, there is a lot of work yet. The plan has been to get the language stabilized then start focusing on libraries and tooling. The core and standard libraries are not very consistent, either in style or quality. The I/O modules (both file and network) are particularly problematic at the moment, so even a simple networking application will be difficult. Some folks have had success though by writing their own bindings to BSD sockets, ZeroMQ, mongrel, etc. (bindings for which are in cargo). Outside of core and standard there have been a lot of graphics- and math-oriented libraries. Multimedia, particularly games, seems to be a very promising domain for Rust. There are a number of useful libraries that are not in cargo because cargo is not yet powerful enough to deal with their build requirements. Some of the easiest, and potentially most useful, code to write when getting started are re-implementations of popular libraries, protocols, etc. in Rust. For example, I really wanted to implement mustache templates in Rust but somebody beat me to it. Where 2012 was the year of stabilizing the language, 2013 will be for cleaning up and redesigning the libraries, and hopefully making all the tooling more usable and featureful.