News for hackers. Stuff that matters.
Re:Rust 0.6 Released by steveklabnik on Wednesday April 03, 2013 @01:47PM (#5487684)
From the release notes[1]:

    > While we cannot promise that this is the last time there will be incompatible
    > changes, the great majority of anticipated language-level changes are
    > complete in this version
I'm quite excited about this.

1: https://github.com/mozilla/rust/wiki/Doc-detailed-release-no...

Re:Rust 0.6 Released by PommeDeTerre on Wednesday April 03, 2013 @08:13PM (#5490149)
The most exciting thing about Rust is that we keep seeing something that's already pretty good continually getting better and better.

This is much different than what we're seeing with the evolution of, say, JavaScript or PHP. There, the languages are pretty horrific to begin with. Any "improvements" tend to be yet another hack layered upon one or more earlier hacks. Even in the best cases, these "improvements" are merely bringing JavaScript and PHP to where many other languages were 10 or 20 years ago (if not going back much earlier).

I think the fact that Rust is already so coherent makes these improvements and refinements much more impressive. It's much harder, and requires more real innovation, to improve something that's already great to begin with. Yet that's exactly what we're seeing with Rust.

Re:Rust 0.6 Released by lifthrasiir on Wednesday April 03, 2013 @10:59PM (#5490711)
Much more exciting thing about Rust is that it is actively moving to reduce the language features. At the version 0.1 I was literally shocked about the typestate system ("It is a good idea but I don't know how this feature will end up!") but it is now replaced by other features (owned pointers in this case) more fundamental and more easier to reason. As an wannabe language designer I understand this is very hard to undertake, and I'm appreciate all these works by Rust team and contributors. :)
Re:Rust 0.6 Released by abraininavat on Wednesday April 03, 2013 @11:30PM (#5490806)
I can't help myself. You were literally shocked?
Re:Rust 0.6 Released by coldtea on Thursday April 04, 2013 @09:40AM (#5492554)
Perhaps you are one of those semi-informed people that don't know the definition of "literally" and go around bothering folks with ill-conceived pedantry?

From dictionary.com:

1. in the literal or strict sense: What does the word mean literally? 2. in a literal manner; word for word: to translate literally. 3. actually; without exaggeration or inaccuracy: The city was literally destroyed. 4. in effect; in substance; very nearly; virtually.

Notice definition #4.

Re:Rust 0.6 Released by kemayo on Thursday April 04, 2013 @02:00AM (#5491224)
Since "shocked" is a synonym of "surprised" / "startled", I think literally is fair in this case. I'd believe that he was literally surprised by the news!
Re:Rust 0.6 Released by baddox on Thursday April 04, 2013 @02:52AM (#5491371)
Also, one common usage of "literally" is to describe a figurative or hyperbolic phrase. This usage is well over a century old, and I doubt you can find an English dictionary which does not contain it.
Re:Rust 0.6 Released by lifthrasiir on Wednesday April 03, 2013 @11:58PM (#5490899)
Uhm, no, I exaggerated the fact a bit. But I certainly spewed a drink.
Re:Rust 0.6 Released by andrewflnr on Thursday April 04, 2013 @01:57AM (#5491214)
Maybe if you sprayed onto a badly-insulated keyboard, you could create a short circuit through your fingers, and be both metaphorically and literally shocked, as well as having literally spewed.
Re:Rust 0.6 Released by kaoD on Thursday April 04, 2013 @12:03AM (#5490917)
C'mon guys, it's an oxymoron. He doesn't mean he was literraly shocked, but "metaphorically" is too soft to be used.
Re:Rust 0.6 Released by kaoD on Saturday April 06, 2013 @11:29AM (#5503853)
I've read this comment again. I didn't mean oxymoron, I meant hyperbole (just in case my children read this in 2034, I don't want them to think I'm an idiot).
Re:Rust 0.6 Released by voodoo on Thursday April 04, 2013 @01:24AM (#5491127)
I was theoretically shocked.
Re:Rust 0.6 Released by gcr on Wednesday April 03, 2013 @09:43PM (#5490457)
What "improvements" are you seeing with Javascript? The language is essentially done; all improvements I've seen come in the form of new libraries (jquery et al), environments (v8/nodejs), or revisions (jsnext, asmjs) that IE won't ever adopt.
Re:Rust 0.6 Released by coldtea on Thursday April 04, 2013 @09:50AM (#5492609)
>What "improvements" are you seeing with Javascript?

Harmony (ES6). Isn't it obvious?

>or revisions (jsnext, asmjs) that IE won't ever adopt.

Seeing that MS caught up in the Javascript JIT game, offer Node.js for Azure, and added HTML5 features, SVG, CSS transformations and even WebGL in the latest IE head why would you say they'll never adopt JsNext?

Heck, even them adopting asm.js is not much of a stretch.

Re:Rust 0.6 Released by steveklabnik on Thursday April 04, 2013 @01:18AM (#5491112)
Everyone I know is really excited for ES6.
Re:Rust 0.6 Released by mhartl on Thursday April 04, 2013 @09:50AM (#5492602)
Mozilla and the Rust community are pleased to announce version 0.6 of the Rust compiler and associated tools. Rust is a systems programming language with a focus on safety, performance and concurrency.

This is how you do an announcement right: you include a short description of the product along with the announcement. This way people who don't know WTF Rust is are immediately brought up to speed.

Re:Rust 0.6 Released by film42 on Wednesday April 03, 2013 @11:32AM (#5486703)
Call me a noob, but I have never been properly introduced to Rust. Does anyone know of a good article or walk through with pros, cons, and examples?
Re:Rust 0.6 Released by drbawb on Wednesday April 03, 2013 @04:22PM (#5488782)
This isn't a tutorial, but I found pcwalton's explanation of memory management in rust[0] to be an excellent primer for the different allocation techniques in rust.

Learning the different types of pointers was a real pain point for me; so I'm very thankful for this post. Maybe it will help you out while you're learning!

[0]: http://pcwalton.github.com/blog/2013/03/18/an-overview-of-me...

Re:Rust 0.6 Released by kibwen on Wednesday April 03, 2013 @05:15PM (#5489146)
Anyone who found that post illuminating may also enjoy this general "Rust for C++ programmers" reference: https://github.com/mozilla/rust/wiki/Rust-for-CXX-programmer...
Re:Rust 0.6 Released by kibwen on Wednesday April 03, 2013 @11:46AM (#5486811)
The language is still changing so fast that nearly every resource that you'll find will be outdated. Your best bet is likely the official tutorial,[1] which probably doesn't contain too many references to deprecated features.

[1] http://static.rust-lang.org/doc/tutorial.html

Re:Rust 0.6 Released by ineedtosleep on Wednesday April 03, 2013 @11:56AM (#5486863)
What parts of the language have been changing? And maybe to reduce the scope of that question a bit: are there any specific features that need to be solidified first before someone should bother learning Rust?
Re:Rust 0.6 Released by usea on Wednesday April 03, 2013 @12:05PM (#5486929)
I am no language expert by any means, but I haven't had much trouble picking up Rust. In fact it's been a lot of fun. I've mostly used the official documentation [1](tutorial, manual, core/std reference). Sometimes I will have to look at some unit tests on the rust github source to see how something is used.

[1] http://www.rust-lang.org/

Re:Rust 0.6 Released by dbaupp on Wednesday April 03, 2013 @11:58AM (#5486885)
Recently the biggest breaking changes have been a large amount of syntax removed from the language: https://github.com/mozilla/rust/issues/4707

But, as far as I understand, the goal is to not change the syntax much from now, and actually get it 'frozen' by 0.7.

Re:Rust 0.6 Released by mcguire on Wednesday April 03, 2013 @04:32PM (#5488851)
I started playing with it when 0.5 came out, and the changes that I've seen when I went with a pre-0.6 build are not what I would consider major. There are many of them, but most are either relatively minor syntactic issues or in darker corners of the language that I haven't needed to touch yet.
Re:Rust 0.6 Released by steveklabnik on Wednesday April 03, 2013 @12:45PM (#5487186)
I wrote a 'book' (it's about 50 pages) you can read online called "Rust for Rubyists".

Two things: It's for 0.5 (I'll be updating it to 0.6 later today/tomorrow) and 'for Rubyists' means I assume you don't know anything about systems programming, there's very little that's Ruby-specific.

http://www.rustforrubyists.com/

Re:Rust 0.6 Released by abraininavat on Wednesday April 03, 2013 @01:22PM (#5487466)
'for Rubyists' means I assume you don't know anything about systems programming, there's very little that's Ruby-specific.

Then put out the same book with a new title, "Rust for Pythonistas". Two books for the price of one!

Re:Rust 0.6 Released by steveklabnik on Wednesday April 03, 2013 @01:28PM (#5487519)
I've thought about it. ;)

Primarily, this was an experiment in 'selling your byproducts'.[1] I'm already self-publishing a book on Hypermedia APIs[2], and the older system it was in couldn't handle my new requirements. I also wanted to learn Rust, and so I decided to just write it all down as I went. It also enabled me to get familiar enough with my new tooling that when it came time to port over DHAs, it wasn't bad at all.

So yes, doing the same thing 'for other languages' would be fun, and if Rust continues to take off, I might give it a shot. I'm already planning on writing more content for the book as I go; I've been working on a Rust buildpack for Heroku...

1: http://37signals.com/svn/posts/1620-sell-your-by-products 2: http://www.designinghypermediaapis.com/

Re:Rust 0.6 Released by metajack on Wednesday April 03, 2013 @11:35AM (#5486731)
This is the best talk I've seen on Rust so far.

http://www.infoq.com/presentations/Rust

The tutorial is also pretty good (as are the supplemental tutorials), but they don't yet give you the full picture. For that you'll have to play and experiment and read some code.

You might start here for some code to read:

https://github.com/pcwalton/sprocketnes

Re:Rust 0.6 Released by terhechte on Wednesday April 03, 2013 @12:47PM (#5487202)
It is interesting how many of these newer languages clearly try to improve upon a specific older, established language (at least imho) (take with a grain of salt).

C++ -> Rust

C -> Go

Java -> Scala

Lisp -> Closure

Erlang -> (Go or Scala)

Javascript -> (Too Many; Dart, et al)

(Edit: Formatting)

Re:Rust 0.6 Released by masklinn on Wednesday April 03, 2013 @01:23PM (#5487471)
> C -> Go

Most of C's use cases, Go can't even remotely be used for. It's basically limited to the "network server" use case. It's not portable, it's not a linga franca (via FFI for non-C languages), it's not low-overhead, it's not runtime-less, ...

> Erlang -> (Go or Scala)

Yeah... no, especially not Go. In Erlang's inception, concurrency was first and foremost a tool for reliability (from its telecom roots where 1 = 0, so 1 server means the same as not having a server). Just about none of Erlang's reliability mechanisms are present in Go.

Re:Rust 0.6 Released by burntsushi on Wednesday April 03, 2013 @04:33PM (#5488861)
> It's basically limited to the "network server" use case.

I've been using it to perform research. I also used it to build an X window manager. Neither are remotely close to a "network server" use case. In years past, I would have used C for both projects.

> Just about none of Erlang's reliability mechanisms are present in Go.

I certainly agree that Go shouldn't be viewed as a "better" Erlang, but Go does have green threads with M:N scheduling, which is a significant feature of Erlang. (As argued by Joe Armstrong himself.)

Re:Rust 0.6 Released by masklinn on Wednesday April 03, 2013 @04:41PM (#5488921)
> Go does have green threads with M:N scheduling, which is a significant feature of Erlang.

And Go also has integers, a significant feature of C...

Goroutine's semantics and implementation are nothing like Erlang's processes: the latter are shared-nothing, preempted, monitorable and messageable whereas goroutines are shared-memory cooperative black holes.

Basically, the one and only commonality is that they're mapped M:N on OS threads, which is on par with comparing a wheelie bin and a CAT 797F on grounds that they both have 4 wheels.

Re:Rust 0.6 Released by burntsushi on Wednesday April 03, 2013 @05:54PM (#5489441)
> And Go also has integers, a significant feature of C...

So does every other language. Perhaps I need to be more explicit for you: Go does have green threads with M:N scheduling, which is a powerful feature of Erlang that most other languages do not have.

> Basically, the one and only commonality is that they're mapped M:N on OS threads, which is on par with comparing a wheelie bin and a CAT 797F on grounds that they both have 4 wheels.

I'm more convinced by Armstrong's argument [1] (and my own experience). Green threads enable a concurrent style of programming that is not viable in most other programming languages. (See also: Concurrent ML and Concurrent Haskell, although the former is not parallel.)

> Goroutine's semantics and implementation are nothing like Erlang's processes: the latter are shared-nothing, preempted, monitorable and messageable whereas goroutines are shared-memory cooperative black holes.

I have drawn on an important similarity between goroutines and Erlang processes. I did not dispute their differences, although I think your comparison is overly simplistic.

Also, you ignored my rebuttal to your claim that Go's "basically only use case is network servers." Any particular reason why?

[1] - http://www.guug.de/veranstaltungen/ffg2003/papers/ffg2003-ar...

Re:Rust 0.6 Released by jacques_chester on Wednesday April 03, 2013 @09:08PM (#5490358)
> So does every other language

I dunno. Some obscure languages are float-only. There's one called ECMAscript which I hear gets used in a few places.

Re:Rust 0.6 Released by burntsushi on Wednesday April 03, 2013 @10:43PM (#5490662)
I know you're being sarcastic, but Lua [1] is a good couter-example to my generalization as well.

[1] - http://lua-users.org/wiki/NumbersTutorial

Re:Rust 0.6 Released by jacques_chester on Wednesday April 03, 2013 @10:47PM (#5490674)
I thought about Lua, but figured that javascript would be a more compelling disproof by counterexample (the common wisdom being that "nobody" uses Lua).

edit: yes, I just edited this comment quickly in succession.

Re:Rust 0.6 Released by burntsushi on Wednesday April 03, 2013 @10:57PM (#5490704)
Ironically, I use both quite heavily and still made the generalization :P
Re:Rust 0.6 Released by jacques_chester on Thursday April 04, 2013 @12:00AM (#5490907)
It's a funny old world.

The JavaScript one has stuck with me because it's another good example of the various camouflaged toe-stubbing obstacles left scattered about the design.

Re:Rust 0.6 Released by gcr on Wednesday April 03, 2013 @09:47PM (#5490469)
ECMAscript and Go/C's use cases are almost disjoint.
Re:Rust 0.6 Released by jacques_chester on Wednesday April 03, 2013 @09:53PM (#5490494)
> every other language

Generalisations are excellent sarcasm-bait.

Re:Rust 0.6 Released by sjwright on Wednesday April 03, 2013 @10:08PM (#5490531)
Not always. Sometimes generalisations can be useful.
Re:Rust 0.6 Released by old-gregg on Wednesday April 03, 2013 @01:19PM (#5487438)
As much as I like Golang, it is not a replacement for C. The major reason C is so popular because it's the only portable medium for performant code which can be shared across many languages because it doesn't impose any runtime on you.

Go comes with a VM. It lives in its own world, it cannot live in the worlds of other VMs like C can. It's more like high-performance Python (or simpler+slower C++) optimized for concurrent network services.

I'd say that Rust and probably D are good candidates for replacing C.

Re:Rust 0.6 Released by mindslight on Wednesday April 03, 2013 @01:29PM (#5487525)
The greatest trick libc ever pulled was convincing the world it didn't exist.
Re:Rust 0.6 Released by jpd on Wednesday April 03, 2013 @02:40PM (#5488112)
Isn't libc just a set of libraries and therefore not considered a runtime environment? C does have a small runtime environment, but I'd say it's the existence of the function call stack, as well as the on_exit system that's built into the core language.
Re:Rust 0.6 Released by ori_b on Wednesday April 03, 2013 @02:48PM (#5488180)
As well as things like floating point and large integer emulation, startup code, etc. __divdi3, for example, divides 64 bit integers on i386.

See /usr/lib/x86_64-linux-gnu/{crt1.o,crti.o,crtn.o,gcrt1.o,Mcrt1.o,Srct1.o}.

Re:Rust 0.6 Released by mseepgood on Wednesday April 03, 2013 @02:46PM (#5488167)
On Windows it's even called "Microsoft Visual C Run-Time" (MSVCRT): http://en.wikipedia.org/wiki/Windows_library_files#Msvcrt.dl...
Re:Rust 0.6 Released by sixbrx on Wednesday April 03, 2013 @03:49PM (#5488563)
I think your parent comment means runtimes in the sense of a garbage collector or other services that run concurrently with user code or are scheduled periodically, which will put you in a world of hurt if you touch one of their objects without asking its permissions and/or playing by its rules.
Re:Rust 0.6 Released by coldtea on Wednesday April 03, 2013 @03:28PM (#5488433)
Well, it's so small compared to "real" runtimes, it might as well not exist.
Re:Rust 0.6 Released by epsylon on Thursday April 04, 2013 @10:20AM (#5492793)
You can compile C code without a libc.
Re:Rust 0.6 Released by steveklabnik on Wednesday April 03, 2013 @01:21PM (#5487451)
Currently, Rust cannot go without its runtime either. The plan is that it eventually will be able to.

(EDIT: VM -> runtime)

Re:Rust 0.6 Released by mseepgood on Wednesday April 03, 2013 @02:08PM (#5487849)
Neither Go nor Rust have a VM.
Re:Rust 0.6 Released by steveklabnik on Wednesday April 03, 2013 @02:09PM (#5487862)
Yes, I meant 'runtime.' That's what I get for commenting without coffee... the parent's usage of 'VM' infected my comment.
Re:Rust 0.6 Released by abraininavat on Wednesday April 03, 2013 @01:34PM (#5487575)
The plan is that it eventually will be able to.

To expand upon that point, Rust is designed to allow the programmer to avoid garbage collection altogether, if the programmer chooses. I believe that makes feasible the idea of using a runtime-less subset of Rust in any application where C would have been traditionally used.

Re:Rust 0.6 Released by pcwalton on Wednesday April 03, 2013 @01:40PM (#5487630)
Yes, you can use a freestanding Rust in many domains. Freestanding is still a WIP, but we have examples like embedding Rust in Ruby that work today:

http://brson.github.com/2013/03/10/embedding-rust-in-ruby/

Re:Rust 0.6 Released by kisielk on Wednesday April 03, 2013 @01:34PM (#5487586)
Go doesn't come with a VM, it comes with a runtime. Go code compiles to native machine code.
Re:Rust 0.6 Released by masklinn on Wednesday April 03, 2013 @02:17PM (#5487948)
So does Haskell via GHC, that makes very little difference to the point being made.
Re:Rust 0.6 Released by pjmlp on Wednesday April 03, 2013 @03:02PM (#5488290)
The only language that does not have a runtime is called Assembly.

And even in the case of CISC processors there might be microcode playing the role of a runtime.

Why don't people learn about compiler design nowadays?!

Re:Rust 0.6 Released by gcr on Wednesday April 03, 2013 @09:51PM (#5490487)
In one sense, Assembly does have a runtime, provided by the kernel's system call interface, not to mention all the magic that the loader has to do to make libraries work.

Even the kernel has a runtime, in a less strict sense, provided by the BIOS and whatever CPU interrupts support it.

The only thing that a program can do without any "runtime" at all is warm up your desk.

Re:Rust 0.6 Released by pjmlp on Thursday April 04, 2013 @02:48AM (#5491356)
> The only thing that a program can do without any "runtime" at all is warm up your desk.

+1 Funny

Re:Rust 0.6 Released by coldtea on Wednesday April 03, 2013 @03:36PM (#5488478)
>The only language that does not have a runtime is called Assembly. And even in the case of CISC processors there might be microcode playing the role of a runtime. Why don't people learn about compiler design nowadays?!

Because the C kind of runtime isn't what people regularly mean with the word "runtime" -- much less cpu microcode.

That said, does Forth have a runtime?

Re:Rust 0.6 Released by pjmlp on Wednesday April 03, 2013 @03:50PM (#5488568)
> That said, does Forth have a runtime?

It depends if you mean one of those Forth CPUs there were common in the 80's or the more standard Forth environment, both of which have nontheless runtimes.

Because in the end, you will be using a set of words besides the basic stack manipulation ones, those words are the runtime.

Re:Rust 0.6 Released by dsego on Wednesday April 03, 2013 @08:20PM (#5490170)
Vala?
Re:Rust 0.6 Released by rackman171 on Wednesday April 03, 2013 @08:47PM (#5490268)
I wish the Vala folks would get going. 18 months ago, Vala, Go, and Rust were all possible native language successors to C++. (D was the fourth prospect.) But Vala has advanced so little, it's becoming an afterthought.

The web site is an afterhought that sits like an interloper on the GNOME site. The Windows distros are years old, etc. It's too bad. They had a good idea; they just failed to execute.

Re:Rust 0.6 Released by abraininavat on Wednesday April 03, 2013 @01:30PM (#5487544)
I agree. People mistake the fact "Some C people really like Go, for some of the same reasons they like C" for the falsehood "Go is a good candidate to replace C in the domains C it typically best for".
Re:Rust 0.6 Released by steveklabnik on Wednesday April 03, 2013 @01:20PM (#5487442)
To be fair, with Rust it's more like

    C++ -----
             \
    OCaml ------> Rust
             /
    Erlang --
Re:Rust 0.6 Released by gcr on Wednesday April 03, 2013 @09:52PM (#5490490)
What does the language family tree look like with Go at the root?
Re:Rust 0.6 Released by mseepgood on Thursday April 04, 2013 @01:36AM (#5491166)

    C ---------------
               \     \
    (CSP) --> Limbo ----> Go
                     /
    Modula ----------
Re:Rust 0.6 Released by steveklabnik on Thursday April 04, 2013 @01:20AM (#5491116)
I'm not as familiar with Go, so I can't comment on that, specifically.
Re:Rust 0.6 Released by rdtsc on Wednesday April 03, 2013 @02:31PM (#5488046)
As someone already mentioned, -1 on Erlang-> (Go or Scala)

They didn't try to improve they removed features such as error handling, distribution, all which are very important for building fault tolerant system.

Paradoxically perhaps, I see it inverted:

(Go + Scala) -> Erlang

Temporal sequencing doesn't necessarily imply strict improvement.

Re:Rust 0.6 Released by terhechte on Wednesday April 03, 2013 @03:56PM (#5488617)
I was referring to how Scala copied the actor model (though it is was not invented for Erlang either) and several other Erlang-ideas while adding new features and running on the JVM. In some direction similar with Go; You're right though, it wasn't the best of comparisons.
Re:Rust 0.6 Released by kenko on Wednesday April 03, 2013 @01:13PM (#5487386)
Go or Scala attempt to improve on Erlang? Elixir attempts to improve on Erlang---that I can see.
Re:Rust 0.6 Released by Kototama on Wednesday April 03, 2013 @12:55PM (#5487253)
It's Clojure, not Closure. Google Closure is an optimizing JavaScript to JavaScript compiler.

I'm not sure Go try to replace C. Most (all?) embedded systems need to control memory allocations.

Re:Rust 0.6 Released by mtgx on Wednesday April 03, 2013 @01:14PM (#5487400)
Could we see a brand-new Chrome browser written in Go, though? Or would it better for Google to use Rust, too, for that?
Re:Rust 0.6 Released by fafner on Wednesday April 03, 2013 @08:51PM (#5490286)
The Mozilla/Rust/Servo developers talked about why they continue developing Rust and not considering Go for the job. It has absolutely nothing to do with a turf war because Mozilla is actually using Go for some server side things. But one major reason for not using it to implement Servo (the next-gen browser engine) is the mandatory GC. For a lowlevel performance and memory critical application such as a browser engine you don't want a GC.
Re:Rust 0.6 Released by pjmlp on Wednesday April 03, 2013 @01:13PM (#5487385)
> I'm not sure Go try to replace C. Most (all?) embedded systems need to control memory allocations.

Are you aware that there are embedded systems coded in GC enabled languages?

It is all a matter of the available resources.

Re:Rust 0.6 Released by abraininavat on Wednesday April 03, 2013 @01:35PM (#5487589)
It is all a matter of the available resources.

I'd say, it's all a matter of the guarantees. Guarantees are everything in embedded systems.

Re:Rust 0.6 Released by pjmlp on Wednesday April 03, 2013 @02:08PM (#5487843)
What about ballistic missile tracking?

http://www.militaryaerospace.com/articles/2009/03/thales-cho...

This is just one example from many I can pick up, this one is Java, but there are systems done in other GC languages as well.

But I do agree it is a matter of hardware resources and if hard or soft real time guarantees are to be expected, just that not all embedded systems require real time processing.

Re:Rust 0.6 Released by coldtea on Thursday April 04, 2013 @07:09PM (#5495888)
IIRC, in the "real time java" world though, they don't use Java as is though. They mostly fight with the language, statically allocating all things in advance etc.

In that sense, one could also use Go. But that is a bleak argument.

Re:Rust 0.6 Released by abraininavat on Wednesday April 03, 2013 @02:11PM (#5487874)
What? I never disagreed that Java is used for realtime embedded systems.

I'm aware of the existence of "real time Java". There can be such a thing because of specifications like " areas of memory that are not subject to garbage collection, along with threads that are not preemptable by the garbage collector" [1]. Like I said... guarantees....

[1] http://en.wikipedia.org/wiki/Real_time_Java

Re:Rust 0.6 Released by pjmlp on Wednesday April 03, 2013 @03:00PM (#5488278)
As I mentioned, Java was just the first example that came to my mind.

There are embedded systems being coded in Basic, Oberon, Lisp, Scheme and .NET.

Although those systems are usually 32 bit based. 8 and 16 bit systems are too small for those languages.

Re:Rust 0.6 Released by pkhagah on Thursday April 04, 2013 @01:41AM (#5491181)
Also Ada, my favourite language.
Re:Rust 0.6 Released by jk4930 on Thursday April 04, 2013 @04:20AM (#5491571)
Yes, Ada needs more love here. I think that Rust's main goals are already implemented with Ada (low-level, reliable, strong typing etc.). Plus that Ada is a proven work horse with existing tools and best practices. It just hasn't the C feeling they want in Rust.
Re:Rust 0.6 Released by pjmlp on Thursday April 04, 2013 @04:42AM (#5491618)
My heart has a sweet spot for the Pascal family of languages and their strong typing, in regard to C and C++.

Ada suffered from lack of available cheap compilers back in the 80's, and like Turbo Pascal and Modula-2 it was a victim of UNIX's success, which had the sad side effect of promoting C for systems programming, with all security issues we have nowadays.

Now with the work of GNAT Core, and more security conscious developers, Ada seems to be getting new users, at least here in Europe as more universities adopt it. It is already a constant presence at FOSDEM in the last few years.

http://e.ubmelectronics.com/audience/eetnewsletters/02-19-20...

Re:Rust 0.6 Released by jk4930 on Thursday April 04, 2013 @05:15AM (#5491687)
Yes, I wish that GNAT gets more adoption. Where appropriate I recommend Ada. It would be helpful to have some impressive and successful applications outside the high-integrity/reliability niche.

That's a good time to advertise for http://www.ada-europe2013.org/ in June. :)

Re:Rust 0.6 Released by jff on Wednesday April 03, 2013 @01:04PM (#5487330)
Where does C imply embedded only? The Go authors spent years writing non-embedded programs and operating systems in C, after Ken Thompson laid the groundwork to create C.
Re:Rust 0.6 Released by Kototama on Wednesday April 03, 2013 @01:08PM (#5487360)
I didn't want to imply that. Just that some use of C won't be covered by Go.
Re:Rust 0.6 Released by terhechte on Wednesday April 03, 2013 @03:53PM (#5488590)
Sorry, typo regarding Clojure. Can't edit it anymore though :(
Re:Rust 0.6 Released by epsylon on Thursday April 04, 2013 @10:27AM (#5492840)
> Lisp -> Closure

There is no single "Lisp", but many dialects including Common Lisp, Scheme (and its bazillion variants), Clojure, Emacs Lisp, Arc...

> Java -> Scala

Except for the fact that Scala is based on the JVM and partly reuses the Java standard library (for interoperability reasons), the language is the product of many influences, including ML, Haskell, Java, Scheme, Eiffel... The syntax and the "feel" of the language is actually quite far from Java thanks to its functional side.

Re:Rust 0.6 Released by pjscott on Wednesday April 03, 2013 @08:03PM (#5490113)
That's definitely not a new trend.

http://www.paulgraham.com/fix.html

Re:Rust 0.6 Released by wrl on Wednesday April 03, 2013 @12:16PM (#5486994)
`Static methods no longer require the `static` keyword and instead are distinguished by the lack of a `self` parameter`

Man, am I the only one who really doesn't like implicit things like this?

Re:Rust 0.6 Released by pcwalton on Wednesday April 03, 2013 @12:33PM (#5487097)
This change improves consistency between implementations and modules. `impl MyType { … }` is now just like `mod my_module { … }`, except that you can define methods inside `impl` declarations by including a self parameter.

For example:

    struct MyType { … }
    impl MyType { pub fn foo() { … } }
    mod my_module { pub fn foo() { … } }
    fn main() {
        MyType::foo(); // works
        my_module::foo(); // works too
    }
Re:Rust 0.6 Released by efuquen on Wednesday April 03, 2013 @12:20PM (#5487017)
Well, it does kind of make sense. If you never access anything from self then for all intent and purposes there is no reason the function shouldn't be static. That's just my initial perspective reading your comment, not knowing much about the language, so I might be missing some possible scenario this would actually result in a runtime error.
Re:Rust 0.6 Released by jeremyjh on Wednesday April 03, 2013 @12:23PM (#5487041)
Actually I think its much more explicit that self is ALWAYS passed as a parameter, or it doesn't exist.
Re:Rust 0.6 Released by kzrdude on Wednesday April 03, 2013 @04:24PM (#5488797)
Your comment is funny since the other part of the change you cited is the introduction of explicit self.
Re:Rust 0.6 Released by shared4you on Wednesday April 03, 2013 @11:39AM (#5486761)
Previous discussion just 3 days back: https://news.ycombinator.com/item?id=5468896

[This was for RC though]

Re:Rust 0.6 Released by drbawb on Wednesday April 03, 2013 @01:37PM (#5487612)
Awesome! I'm going to compile `release-0.6` right now, because I've been having some issues w/ trunk these past few days.

Simple things like declaring fixed vectors won't compile for me: `let numbers: ~[int, ..3] = [1,2,3];` fails to compile saying it expected `~[int * 3] and got ~[<VI2>]`. That's an example straight from the tutorial.

I'm getting segfaults when iterating over a non-fixed vector of owned elements casted to a trait. (This works fine if I access the elements directly; or use managed pointers. With owned pointers my `len()` method returns the wrong number of elements, which I suspect is breaking the iterators.)

Re:Rust 0.6 Released by pcwalton on Wednesday April 03, 2013 @01:43PM (#5487654)
The tutorial examples are run as part of the test suite. The tutorial example in question is `let numbers: [int, ..3] = [1, 2, 3];`, which should work.

There are several known compiler bugs with any trait types other than `@Trait`. Please do continue to file any bugs you find, though—all crash bugs are bugs that need to be fixed :)

Re:Rust 0.6 Released by drbawb on Wednesday April 03, 2013 @04:19PM (#5488763)
Whoops, I did botch up the syntax on my listed example.

I compiled release-0.6; and sure enough `let numbers: [int, ..3] = [1,2,3];` compiles.

`let numbers: ~[int, ..3] = ~[1,2,3];` does not compile on my system though. Ditto for the @ sigil.

(Expected `~[int * 3] but found ~[<VI2>]`)

My understanding is that the first example [from the docs] allocates the vector on the stack.

My uncompilable examples should be equivalent except that they use the heap for storage.

Is there a reason this shouldn't compile?

Thanks so much for the reply!

Re:Rust 0.6 Released by spicyj on Wednesday April 03, 2013 @05:52PM (#5489437)
In fact you just want:

    let numbers: ~[int] = ~[1,2,3];
When you allocate a vector on the heap, you don't need to specify the size.
Re:Rust 0.6 Released by drbawb on Wednesday April 03, 2013 @06:21PM (#5489643)
I was thinking you might have a function that operates on some fixed length vector.

For e.g: `fn foo(bar: ~[int, ..3]) { ... }`, and the compiler would enforce that you only pass vectors of length 3 to that function.

But since I can't get `~[int, ..3] = ~[1,2,3]` (etc.) to compile that seems to be impossible w/ vectors on the heap?

Re:Rust 0.6 Released by pcwalton on Wednesday April 03, 2013 @08:37PM (#5490230)
It's a bug. Sorry about that. For now, write the type as `~([int, ..3])`.
Re:Rust 0.6 Released by spicyj on Thursday April 04, 2013 @02:32AM (#5491303)
I stand corrected -- thanks, didn't realize that you could have a pointer to a fixed-length vector.
Re:Rust 0.6 Released by spicyj on Wednesday April 03, 2013 @06:23PM (#5489657)
I believe you can't do that. You can, however, make a function that only operates on 3-tuples:

fn foo(bar: (int, int, int)) { ... }

Re:Rust 0.6 Released by pjmlp on Wednesday April 03, 2013 @11:29AM (#5486688)
Great!

Time to upgrade.

Just as a side note, I am looking forward to the day I won't need to recompile LLVM as well.

Re:Rust 0.6 Released by ksec on Wednesday April 03, 2013 @11:35AM (#5486736)
Slightly Off Topic: Wasn't Rust suppose to be the codename or working name of the languages. Or Has Mozilla decide to simply use Rust as its official name?
Re:Rust 0.6 Released by icambron on Wednesday April 03, 2013 @12:08PM (#5486949)
I don't know the answer to that, but the problem may be that Rust is decent enough name to overcome any proposed name changes. I've always thought you should use implausible codenames for just this reason. It forces you to change it instead of just letting the codename establish itself by momentum. I've always assumed that's why Microsoft uses terrible codenames like "Longhorn".
Re:Rust 0.6 Released by chimeracoder on Wednesday April 03, 2013 @12:23PM (#5487034)
When developing Java, Sun figured out a way around this.... which is how we ended up with the name Swing: https://blogs.oracle.com/thejavatutorials/entry/why_is_swing...
Re:Rust 0.6 Released by ovis on Thursday April 04, 2013 @01:19AM (#5491114)
That must have backfired for the Fedora folks.
Re:Rust 0.6 Released by nnethercote on Wednesday April 03, 2013 @11:48PM (#5490865)
I'm pretty sure Graydon always intended Rust to be the final name.
Re:Rust 0.6 Released by coldtea on Thursday April 04, 2013 @10:16AM (#5492765)
Never heard something about it being just a codename. Why would it be? Rust is quite nice itself and has already 1-2 years of being established.

It even makes sense as an faux-etymology.

Rust: because it's close to the metal and brings some breathing oxygen to the stale system's language arena...

Re:Rust 0.6 Released by charlescearl on Wednesday April 03, 2013 @12:41PM (#5487153)
Just glanced at the discussion on LtU http://lambda-the-ultimate.org/node/4009, I wonder if the C++ hackers have swallowed, and if they are hearding them onto Haskell?
Re:Rust 0.6 Released by steveklabnik on Wednesday April 03, 2013 @01:21PM (#5487458)
That discussion is very old.
Re:Rust 0.6 Released by charlescearl on Wednesday April 03, 2013 @03:05PM (#5488315)
Quite, but I generally use as a way to gauge "language innovation" relevance. It looks like the lag time on getting into innovative programming principles into production languages is ~5 years. The discussion is quite interesting in laying out some of the practical issues with introducing PL research concepts into code that must support large products and large developer bases.
Re:Rust 0.6 Released by steveklabnik on Wednesday April 03, 2013 @03:06PM (#5488323)
Yeah, seems good. I was just excited for a new discussion, then saw that it was from a while back, and given how much Rust has changed in the meantime, wanted to make sure others didn't think it was new.
Re:Rust 0.6 Released by mcguire on Wednesday April 03, 2013 @04:36PM (#5488885)
If you see mention of "typestate" in Rust, the discussion is probably so far out of date as to be useless in learning Rust as it is now.