7 ms·
After using Go for a couple of pet projects in the last couple of months, I came out bored. Many people seem to be quite excited about Rust. I'm setting up my (
by hanlec 11y ago
After using Go for a couple of pet projects in the last couple of months, I came out bored. Many people seem to be quite excited about Rust. I'm setting up my (new) Emacs end for Rust.
Any cool projects I can take a look at?
- malkia 11y agoServo. Seriously that was the first one I took, and compiled, and kept on reading (not that I understand a lot of it)
- andrewchambers 11y agoThe problem with rust is that it has been around for nearly as long as Go, yet is nowhere near stable or production ready in nearly every aspect. Go has been ready for years.
- arthursilva 11y agoWell, once you compare both languages you can see why. Hint: inovation/complexity (not that either is a good or bad thing). Anyway, that's only one possible reason... I think Go is actually 2 years older.
- andrewchambers 11y agoGo hasn't changed much from its initial versions, iirc rust is unrecognizable compared to early versions. Rust didn't know what it wanted to be from the start. I wanted to give rust a crack years ago, but I am glad I didn't because it would have required constant updates for anything serious.
- dbaupp 11y agoGo hasn't changed much from its initial released version, or initial internal version? As I understand it, Go was released in a much more final state, whereas Rust was developed in the open from very very early. Rust has always known what it wanted to be, it has just taken a while to find the best way to actually fill that goal. That isn't really a fundamental problem with the language (in fact, I see the constant iteration and change as a good thing: the language was developed empirically, removing features that didn't work/pull their weight, adding ones that did), although it is definitely a good reason for people to have not used Rust historically. In any case, this discussion seems like a non-sequitur: whether Go is boring to hanlec or not is orthogonal to whether Go is more stable than Rust or not. The fact that a language has been stable for years rather than only just now approaching stability might be something you value highly, but clearly hanlec has a different utility function.
- andrewchambers 11y agoGo hasn't changed much, because it is the natural extension of plan9 C and other languages from the past. If you look at the project layout of the plan9 source tree, it matches the Go project layout now. I think plan9 C even used CSP channels in the form of a C library for most of the servers. They just took what they already knew worked, and tried to polish it and add garbage collection. Rust is trying many things at once then letting things die off as they prove useless.
- dbaupp 11y ago> Rust is trying many things at once then letting things die off as they prove useless. Yes, this is perfectly true. I cannot tell from your phrasing whether you think experimentation, learning from experience and removal of pointless code is good or bad. I personally think all of those are good, but you're perfectly entitled to differ. Go was designed with the lessons learned and experienced gained from plan9, Rust was designed with the lessons learned and experienced gained from iterating on Rust itself. Seems pretty similar. :)
- andrewchambers 11y agoYou are right on all counts. I think experimentation is a good thing, I don't know if I want to be the guinea pig though.
- oldmanjay 11y agoof course, if you're interested in rust's memory safety, performance, low-level control, and expressive type system, then in a very real way, go isn't ready at all. it does have some marquee names behind it, though. I suppose if you squint, that can make up the difference.
- andrewchambers 11y agoGo performance is going to converge on C performance with new optimization's being written after go 1.5. Any gains from rusts expressive type system are lost by all the memory lifetime annotations imo. I still think rust is probably going to be the best language for embedded software like router firmware, as they need to be fast, low overhead and secure.
- seanmcdirmid 11y agoAs an upper performance bound for a GC language, I don't think Go will be able to surpass C# (which has stack allocation in the form of structs, ahead of time compilation, and many other goodies). Rust, on the other hand, has more potential as a non GC language, though at the end of the day it might be hard to tell given equivalent applications.
- andrewchambers 11y agoThe upper performance for garbage collected languages (and rust) is potentially higher than C. The reasons are non aliased pointers allow more aggressive optimization, and batched garbage collection plus memory compaction can perform better than regular mallocs. Rust still has these advantages though, time will tell. Does rust have a way to avoid bounds checks on arrays? I suppose that requires unsafe annotations.
- kibwen 11y agoRust essentially never wastes cycles on bounds checking thanks to the design of its iterators. The Servo team tells me that bounds checking has never shown up in any performance profiles.
- kibwen 11y agoRob Pike has been working on Go's design since Newsqueak in the 90s, and further explored the same space later with Limbo. For reference, Newsqueak is a C-inspired language that features CSP for concurrency (which should sound familiar to Go programmers). Here's some example syntax (which should look familiar to Go programmers): a := mk(array[10] of int) Given this lineage, it seems disingenuous to compare the ages of the two languages. Modern Rust is to early Rust as Go is to Newsqueak.
- andrewchambers 11y agoThis is true, but it does confirm my point about language flux potentially being a problem. It may work out nicely though.
- kibwen 11y agoIndeed, it may ultimately turn out that modern Rust is to early Rust as Limbo (rather than Go) is to Newsqueak. I expect Rust will experience growing pains over the next few years as people begin employing it on an industrial scale and discover where the dark corners of the language lie. But nobody's saying that Rust will be the last systems programming language to ever be written. :)
- tatterdemalion 11y agoThis comment is very strange. Go was made public when it was stable (or maybe shortly before?), Rust was made public long before it was. Rust will be stable in 4 weeks, Go was stable several years ago. So what? If we judged languages by how early they were stable, we would all be writing Fortran 57, Algol 58, and COBOL 60.
- andrewchambers 11y agoI'm not judging the language, I'm just warning people to be careful in choosing to build a product with it. The team still seems to be changing stuff like crazy even after the "stable beta" release.
- dbaupp 11y agoI think you have the wrong impression about the recent changes, e.g. a recent "regression report"[1] found only two regressions between nightly and the original released beta. Furthermore, several changes have been rejected due to being breaking. The team is seriously committed to stability. [1]: http://internals.rust-lang.org/t/regression-report-beta-2015-04-03-vs-nightly-2015-04-10/1860 http://internals.rust-lang.org/t/regression-report-beta-2015...
- andrewchambers 11y agoYou can be sure if more people used rust, there would be many more detected breakages. The undetected ones are more worrying. I get that the language is a beta, but be warned. One example I saw - http://internals.rust-lang.org/t/memcpy-is-backwards/1797 http://internals.rust-lang.org/t/memcpy-is-backwards/1797
- dbaupp 11y agoBreaks during beta that are not detected seem fine to me: people were not using the feature, and the improvement/bug fix could land without issue. That particular change caused heartache, yes, but it was purposely made before the beta release, exactly because it was breaking.
- deleted 11y ago[deleted]
- jmilloy 11y agoIs there a law for this yet? It seems like any time I see discussion about Rust, over half of the discussion is actually about Go.
- kibwen 11y agoLikewise, in any discussion about Go on HN half of the discussion will be about Rust. A truly bewildering phenomenon. Would anyone like to compare Rust to ATS instead? Maybe Erlang? Anybody??
- dorfsmay 11y agoRust: ATS for the rest of us!
- doublec 11y agoI can help with a Rust vs ATS. ATS is more like a safe version of C wrapped in ML syntax vs Rust as a safe version of C++. ATS is lower level. You can do memory safe pointer arithmetic whereas in Rust you'd use unsafe blocks. Some things are implicit in Rust but explicit (and more verbose) in ATS. For example, Rust has destructors for RAII whereas ATS requires manually calling functions to clean up resources. The type checker tells you when you need to do this (via linear types) but programmer still needs to do the call. Borrowing is automatic in Rust. In ATS it requires keeping track of borrows in proof variables and manually giving them back. Again the type checker tells you when you get it wrong but it's more verbosity. ATS has a restricted form of dependent types - Rust is not dependently typed. With current implementations, ATS compiles to C which can be compiled independantly of an ATS install. You can ship the C code to someone to build without them needing ATS. Rust uses LLVM. The two languages feel very differently when programming.
- kibwen 11y agoThis is awesome, I'm so happy to finally hear from somebody with experience in ATS. :) > For example, Rust has destructors for RAII whereas ATS > requires manually calling functions to clean up > resources. This especially intrigues me, as recent events have shaken my faith a little in RAII. Who knows, maybe Rust will one day regret not embracing linear types wholeheartedly...
- aikah 11y agoI wonder why each time there is a news on Rust, people somehow manage to talk about Go in a negative fashion? At that point it's just trolling. Go is mentioned 45 times in that thread about Rust...
- oscargrouch 11y agoAnd Rust are almost-always mentioned in threads about Go :)
- unfamiliar 11y agoThey are the two new systems languages on the block, which take quite different approaches. It makes perfect sense that they would be compared often. There are plenty of people in this thread also complaining about aspects of Rust and its development.
- xiaq 11y agoExcept that go is hardly a "new" system language.
- unfamiliar 11y agoIt's 6 years old as opposed to 43 years old, I would call that new.
- apta 11y agoOr even a "system" language :-)
- thuffy 11y agoBecause there is a battle going on. The lines are being drawn. People who where fighting this battle will see this happening before those who were unaware to start with; however, the lines are now being drawn thanks to Edward Snowden, and this battle is becoming visible to all. Meaning: GO was dead at birth from out of the sphincter of the NSA.