Live data from Hacker News

Rust 0.5 released

mail.mozilla.org

11–20 of 54 posts

Re: Rust 0.5 released

#11

Do you still need to compile all of LLVM? I tried to install Rust a few days ago and came back to my computer using gigabytes of swap space, which I assume is due to LLVM.

Yeah, for the moment it still uses a custom LLVM, so the first compile is still a pain (though LLVM does build in parallel really well with -j8). I really hope that the Rust devs make it a priority to upstream their LLVM customizations, especially if they hope to be pegged to a stable LLVM release by Rust 1.0.

Re: Rust 0.5 released

#13

How is rust compared to Go?

Rust and Go may be superficially similar, but they are night and day semantically. They're also aimed at different niches and have wildly different goals. So though it may be tempting to compare the two, it's not an especially productive exercise. :) This town is more than big enough for the two of them.

Re: Rust 0.5 released

#16

How is rust compared to Go?

At least for me: the major difference between the two [implementation wise] is currently the core and standard libraries.

Go may not have the most efficient stdlib, but it covers _such a wide breadth_ of features, and the code is all very readable, well documented, and idiomatic. This is my current pain point in Rust, however I'm confident it will get better with time, and the language itself is _really_ exciting to me.

The two can certainly coexist, they're not exactly sharing the same space IMO. Most importantly, Rust seems to have a much more complex type system, in addition to some very interesting concepts on memory management. Go on the other hand is pretty tightly coupled to its garbage collector, and while it is slowly improving, the current collector leaves a lot to be desired.

Go is great for writing "programs in the large", things like highly scalable servers; it also has a huge focus on concurrency with goroutines [functions multiplexed onto threads by the runtime for concurrent execution] and channels [ability to share data amongst routines in a typesafe way]. In a lot of ways its like a statically typed, compiled Python, rather than a C/C++/"systems" language. The language feels very "light" and it's a very readable language.

Rust seems to be a much more modern, more orthogonal, more comprehensible "C/C++"/systems programming alternative.

While there is definitely some overlap, I don't think the two languages are really targeting the same niche, and there is certainly room for both of them to continue evolving.

Re: Rust 0.5 released

#18
post #5

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 re…

> 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.

Re: Rust 0.5 released

#19
post #6

Really glad to see the REPL!

I wonder whether anyone here knows how it is meant to work.

All my inputs fail with the following message:

> rust: task failed at 'no mode for lval', /home/tyl/files/cloud/rust/rust-0.5/src/librustc/middle/liveness.rs:1573

Re: Rust 0.5 released

#20

How is rust compared to Go?

I love both. If you are writing a production app today, I would strongly recommend Go. However, if you want to write an app that you want to take over the world with in a year or so, I would strongly recommend coding it in Rust.

Go is a beautifully minimal language and very easy to learn. Rust isn't quite as productive, but it won't be too foreign for most coders either — unlike the Erlangs and Haskells of this world. And whilst I've never missed generics in Go, I've already found them useful in Rust.

Rust's memory model takes a bit of time to understand, but it provides a lot more power and flexibility than Go is ever likely to. To get the same kind of fine-grained memory management in Go, you have to manually allocate and manage []byte slices. Not only does this get tedious, but you end up losing most of the benefits of static typing as well.

Rust is also exciting due to the lower-level nature of tasks (the unit of concurrency in Rust). Goroutines are awesome, but you are at the mercy of Go's runtime/scheduler. In Rust, the potential is there to even do interesting things like dynamically load new tasks at runtime — opening up possibilities like Erlang's hot swapping so that code can be changed without ever stopping the system.

However, despite the awesomeness of the language, Rust suffers from a terrible standard library at the moment. Even when Go was first released in 2009, it had a really impressive standard library. And, today, thanks to having superstar hackers like agl and bradfitz on its team, Go has some of the highest quality libraries around — especially in crypto, networking, http, etc. In comparison, Rust's standard library is rather poor with little attention having been paid to API design.

Rust also suffers in comparison to Go with regards tooling support. The 'go' command-line tool is awesome. I've not had a single dispute over style guides due to 'go fmt' and 'go doc'. The 'go fix' command really helped in auto-updating my Go code as the language evolved. The 'go build' tool saves me from having to write build scripts and Makefiles. And Go's (non-existent) package management system is absolutely brilliant — just 'go get github.com/user/repo'!

But, neither problems — quality of the standard library or tooling — are intractable in Rust. In fact, now that the language is starting to stabilise, I am highly confident that a lot of love and attention will be given to both of those issues. This is also an area where we, the community, can also help out a lot. Myself, I've slowly started working on a port of the 'go' tool called rusty:

* https://github.com/tav/rusty

And, having found the Rust developer community to be extremely friendly on #rust on irc.mozilla.org, I'm pretty sure they would be happy to have other interesting hackers join in too!

Post reply on HN