
Rust 0.6 Released - metajack
https://mail.mozilla.org/pipermail/rust-dev/2013-April/003427.html
======
steveklabnik
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...](https://github.com/mozilla/rust/wiki/Doc-detailed-release-
notes#06-april-2013)

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

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

~~~
coldtea
> _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.

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

------
film42
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?

~~~
drbawb
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...](http://pcwalton.github.com/blog/2013/03/18/an-overview-of-memory-
management-in-rust/)

~~~
kibwen
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...](https://github.com/mozilla/rust/wiki/Rust-for-CXX-
programmers)

------
terhechte
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)

~~~
old-gregg
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.

~~~
mindslight
The greatest trick libc ever pulled was convincing the world it didn't exist.

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

~~~
ori_b
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}.

------
wrl
`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?

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

------
shared4you
Previous discussion just 3 days back:
<https://news.ycombinator.com/item?id=5468896>

[This was for RC though]

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

~~~
pcwalton
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 :)

~~~
drbawb
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!

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

~~~
drbawb
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?

~~~
pcwalton
It's a bug. Sorry about that. For now, write the type as `~([int, ..3])`.

~~~
spicyj
I stand corrected -- thanks, didn't realize that you could have a pointer to a
fixed-length vector.

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

------
ksec
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?

~~~
icambron
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".

~~~
chimeracoder
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...](https://blogs.oracle.com/thejavatutorials/entry/why_is_swing_called_swing)

------
charlescearl
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?

~~~
steveklabnik
That discussion is very old.

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

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

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

