8 ms·
Rust 0.2 released
- MatthewPhillips 15y agoRust definitely seems cool as a no-compromises systems language. Why is Mozilla developing it, though? What is the intended use? Supposedly it will be used by Firefox, but for what? Rendering? JavaScript compilation?
- naner 15y agoI believe it is supposed to be for whatever replaces Firefox/Gecko.
- fusiongyro 15y agoOdd, because their FAQ is quite clear about this: > Are you going to use this to suddenly rewrite the browser and change everything? Is the Mozilla Corporation trying to force the community to use a new language? > No. The Mozilla Corporation's involvement is at the labs level: the group concerned with doing experiments. The point is to explore ideas. There is currently no plan to incorporate any Rust-based technology into Firefox. https://github.com/mozilla/rust/wiki/Doc-project-FAQ https://github.com/mozilla/rust/wiki/Doc-project-FAQ
- naner 15y agoIn a previous post about Rust on HN one of the Mozilla devs claimed that Rust was a result of headaches they've had building Firefox. The language isn't to be used in Firefox, but to (eventually, some day) to be used in whatever supersedes Firefox. They would be starting from scratch. And this is probably very very far in the future. Why else would Mozilla develop a new language if they didn't intend to use it for their products?
- fusiongyro 15y agoI didn't see that post, but every other post I've seen there has been a lot of hand wringing about being forced to use this language or be shut out of Firefox development, which is very clearly not currently even in the long-term plans. They've also been very clear that people should not form indelible opinions about Rust since they expect it to continue evolving at a rapid rate. You're right that it would be idiotic to spend the money and time to develop this if they didn't intend to use it in their products, but they've gone out of their way to make people understand that the Rust they can see today is not going to be shoved down their throats. Whether some eventual successor Rust that may or may not resemble the one we have today is used for some kind of rewrite is probably a foregone conclusion, but they clearly don't want us deciding whether to support or object based on what exists today. I sound like I'm making a big deal out of a minor distinction, but I don't like seeing what I saw on Slashdot, which was essentially, A) Rust devs announce Rust 0.1, B) someone submits story to Slashdot saying Mozilla is forcing everyone to abandon C++ and switch to Rust in the near future, C) everyone on Slashdot complains that Rust isn't going to perform and ought to have language features X, Y, Z. This cycle misinformation/non-information is going to persist as long as we emphasize the foregone conclusion that this might be used in some kind of far-distant rewrite ahead of the actual news, which is just that 0.2 of Rust, an experimental language, came out today.
- kibwen 15y agoIts singular goal is to be an awesome language for writing next-generation browser engines. If it just so happens to also be a really, really exciting systems programming language, that's just a plus. The browser engine in question is called Servo, and initial discussions of its design have only just recently begun. See more here: http://smallcultfollowing.com/babysteps/blog/2012/03/28/servo-design/ http://smallcultfollowing.com/babysteps/blog/2012/03/28/serv...
- sciurus 15y agoThat link is worth its own HN submission.
- neilc 15y agoIts singular goal is to be an awesome language for writing next-generation browser engines. Well, per the FAQ: (https://github.com/mozilla/rust/wiki/Doc-project-FAQ https://github.com/mozilla/rust/wiki/Doc-project-FAQ) What is this project's goal, in one sentence? To design and implement a safe, concurrent, practical, static systems language.
- jk4930 15y agoThen they should use Ada. If it's good enough for high integrity applications in space, transportation, or banking, then it's certainly good enough for browsers. ;)
- heretohelp 15y agoWasn't good enough for the Ariane V launch.
- jk4930 15y agoNice trolling. Ada wasn't the problem, a decision to disable a warning for efficiency reasons was: https://en.wikipedia.org/wiki/Ariane_5_Flight_501 https://en.wikipedia.org/wiki/Ariane_5_Flight_501
- 15y ago
- zobzu 15y agoIt might be interesting to write a sing-like OS with rust (sing#) as well.
- adrusi 15y agoCOME ON!!! I literally JUST finished downloading and reading the docs for rust 0.1 an hour ago. I mean a new version is cool, but could it have come a day earlier?
- gnuvince 15y agoSo many interesting languages, so little time :(
- kibwen 15y agoEr, it was actually five days overdue. :P Fortunately, most of the changes in this version were internal rather than user-facing, and the few user-facing changes (classes, regions) are still somewhat half-baked. Not much new to learn at all. :)
- duaneb 15y agoThis language makes my knees go weak. A system language with a haskell-like type system? Yes please!
- btipling 15y agoSo the garbage collection is optional? That's cool.
- Arelius 15y agoSorta... many types have a more strongly enforced ownership style lifetime scope, but depending on the data you are declaring, the collector may come into action automatically. Basically, Rust makes it easy to avoid the collector by clear ownership rules, but still provides a collector for the cases where that just won't do.
- masklinn 15y agoIn previous threads (can't remember if it was here or on reddit), Rust developers noted that Rust currently needs a GC for many things, but part of the Region works is aimed at removing that need (aka unless the efforts fail, you should be able to use Rust 1.0 sans GC)
- pcwalton 15y agoRust actually doesn't have tracing GC; it instead uses reference counting and cycle collection. The major things that have stopped us from tracing GC so far are LLVM issues; I'm working on those now and we'd like to introduce optional tracing GC soon. My personal thinking is that the standard libraries should avoid the GC and use regions, reference counting should be achievable through a "smart pointer" type in the standard library, and GC should be provided if the programmer wants it.
- akavlie 15y agoRust seems very similar to Go. Anyone looked at/played with both enough to offer some wisdom on the pros/cons of each language?
- heretohelp 15y agoIt makes fewer compromises than Go. It'd be more appropriate for concurrent, high performance systems projects, whereas Go is a way to rapid-dev high(er) performance networked services.
- akavlie 15y agoWhat sorts of compromises does Go make (that Rust does not)?
- MatthewPhillips 15y agoGarbage collection.
- chubot 15y agoThe one that everyone complains about is Go not having generics. I think you have to play around with both languages for long enough to know if it's a real issue; people just seem to look at the spec and decide the lack of generics is a dealbreaker.
- heretohelp 15y agoPertinent to what I said? Garbage collection is the biggie. Utterly unacceptable in systems work.
- willvarfar 15y ago"Systems language" embraces more than kernels and such. Go is a new Erlang; its the Erlang for people who don't like Erlang, perhaps?
- 15y ago
- GFKjunior 15y agoI don't have a lot of experience with systems programming but want to play around with Rust. Would the best route be to learn C then move onto the untread waters of Rust? I'm just looking for some guidance, this seems really cool to learn.
- heretohelp 15y agoJust learn C.
- canop_fr 15y agoIf you want to play, just play with the toy that looks the most fun. Don't plan for the best route, take the most interesting one. There will be enough occasions in your coding life to be serious and not be given a choice...
- Arelius 15y agoI'm not really sure that Rust is quite ready for much usage yet, always worth a try, but some simple things are still pretty hard.
- kibwen 15y agoIt's good to understand the underlying systems concepts in general (such as "what is the difference between heap allocation and stack allocation?"), but you don't necessarily need to know C to grok these concepts. However, C is still a good language to know, or at least be familiar with. As to Rust, there are still a few essential constructs missing from the language, so if you're looking for a gentle introduction you'd probably be better off waiting for 0.3 (scheduled for release in "about a month") or 0.4 (probably due to be released in three months or so).
- msie 15y agoI had trouble trying to just read from stdin. Actually I couldn't do it before I got frustrated and gave up. I hope I can do it this time!!! If not, then I'll wait for 0.3!!!
- lemming 15y agoI love the idea of Rust, but... Shorten 'mutable' to 'mut' Seriously? Are we editing with TextEdit in this day and age?
- sparky 15y agoIs it worse than shorting "integer" to "int" or "begin scope" to "{"?
- Arelius 15y agoI think your first point is valid, but Punctuation has other advantages, the symmetry between {} and the distinctness of the symbols (Taller than most, for instance) provide other advantages for the later.
- willvarfar 15y agoThis irks me to bits. You need to be an ambidextrous octopus to get a { out of my (non-US) keyboard.
- Arelius 15y agoThe problem is many languages are designed on US keyboards. And even engineers who are otherwise mindful of unicode and other internationalization problems, may trivially forget what keys may not be on other keyboards. I suppose your best bet may be to muck a bit with the key bindings of your particular text editor. IMO, I already swap some keys around to make () and {} more usable.
- willvarfar 15y agocontinuing this tangent, I'm not a fan of closing blocks either; I much prefer indentation http://williamedwardscoder.tumblr.com/post/18319031919/programming-language-readability http://williamedwardscoder.tumblr.com/post/18319031919/progr...
- rdtsc 15y ago> Now that we have spawned a child task, it would be nice if we could communicate with it. This is done by creating a port with an associated channel. let port = comm::port::<int>(); let chan = comm::chan::<int>(port); task::spawn {|| let result = some_expensive_computation(); comm::send(chan, result); } some_other_expensive_computation(); let result = comm::recv(port); Why not let the task have a mailbox and send messages to it like in Erlang? Is it because of the desire to have typed channels? I like everything about Rust so far except this choice. I know Go does the same, but I consider Erlang's approach a lot more elegant and less verbose.
- willvarfar 15y agoWell ideally you want both? One can be built on the other, and it being built by the platform rather than the coder would be a big plus. Lets hope mailbox abstraction turn up in the next release.
- rdtsc 15y agoI think there is a semantic difference. Each actor has one mail box. So when sending a message to it, the message is sent to the pid (address) of the actor. So the actor become the central abstraction without the need for channels. To emulate that with channels it is like saying you have one default channel created for each task. Instead of sending a message to the task, it is sent to a channel and instead of just a simple receive, the task has to has a reference to the same channel. Another way of thinking about it, it is like having a graph of components and one model emphasizes the nodes (actors) and the other emphasizes the edge (channels) as the central abstraction.
- Arelius 15y agoMaking a strong association between tasks and message boxes like erlang does makes too many assumptions. That'd be an apt choice for many languages. But for Rust, as a systems languages, that seems like a poor choice.
- 15y ago
- html5iscancer 15y agoGood to see another contender in the C++/D space. Shame they will build another utterly broken browser on top of it.
- digitalzombie 15y agoWhy didn't they do GC per process like Erlang instead of GC per thread? I thought processes and sub processes are cheaper to spawn then threads? That's the reason why Chrome tabs are in per sub processes right? Instead of threads?
- mkup 15y agoGC per lightweight thread does not imply stop-the-world approach as in Go. Also process is heavier entity for OS kernel in comparison to thread (address space, file descriptors are all per-process objects, not per-thread, thread is just a unit of processor time scheduling). Chrome tabs are processes for security reasons. Chrome trades speed for security in this context.
- nimrody 15y agoErlang's style per-process garbage collection requires (or at least favors) passing messages by value between processes. Both Go and Rust - being relatively low level - prefer passing pointers (references) rather than the data itself. This requires a shared GC heap. No free lunch...
- obtu 15y agoRust actually has multiple heaps with their own lifetime characteristics so that they can avoid GC in many cases, and that the only GCed areas are per-thread.
- zokier 15y agoFirstly, while I'm not very familiar with Erlang or its runtime, afaik Erlang processes are not actual OS processes. Secondly threads were originally created as a cheaper alternative because spawning processes was too expensive (on Windows). The original reason for Chrome using processes was that processes gives you memory protection. But I don't know how much it really helped them in the end, because they quickly noticed that using one process per tab doesn't scale. Thus Chrome (at least originally) limited the maximum number of processes to ten.
- obtu 15y ago
- jcla1 15y agoI like the language. But since I have been working with lots of Coffeescript lately it feels really weird using braces!