News for hackers. Stuff that matters.
Re:Ask HN: Will Rust ever become a mainstream systems progra... by tomjakubowski on Monday April 10, 2017 @03:32PM (#14081807)
> But the object system (yeah, they're called structures and traits) is too weird.

It's equivalent to writing C++ with:

  * No structural inheritance (i.e. no inheritance of data)
  * Inheritance only from pure virtual interface classes 
  * MyCppPureVirtualClass * pointers in various interfaces
Except that traits are also usable for static dispatch as in templates/concepts.

This isn't the most common style of C++, but it's not uncommon either, and I happen to like it a lot; it's all over Cef's and Chromium's code, for example.

> The enum approach to variant records is too weird.

What's weird about it? It's just the same as e.g. Haskell, ML, but with a different (arguably slightly overloaded) keyword. Swift uses the same terminology.

> The error handling is too weird.

Eh. I certainly like the way that explicit error handling is "forced" on the caller with mechanisms like Result<T,E>::unwrap. But I agree that magical things like the question mark operator are a little too cute.

> There's too much unnecessary originality.

FWIW, I can't think of much real originality in Rust. It just brings together "exotic" features from lesser-known languages.

Re:Ask HN: Will Rust ever become a mainstream systems progra... by Animats on Monday April 10, 2017 @03:56PM (#14081997)
I can't think of much real originality in Rust. It just brings together "exotic" features from lesser-known languages.

I think you're right. Except for the borrow checker, which was a major breakthrough.

Re:Ask HN: Will Rust ever become a mainstream systems progra... by tmccrmck on Monday April 10, 2017 @05:09PM (#14082578)
The borrow checker is Cyclone's region-based memory management combined with linear/affine types.

Edit: As an aside, I found a Reddit post the other day asserting that the Cyclone developers knew that it would never become mainstream but thought it was important because other languages would adopt it's ideas. It's amazing that they predicted that regions would be picked up later on by Rust.

You can find it here: https://twitter.com/tmccrmck/status/850465514807631872

Re:Ask HN: Will Rust ever become a mainstream systems progra... by fasquoika on Tuesday April 11, 2017 @11:06AM (#14088532)
That's the point. IIRC it's called Rust to allude to the fact that there's nothing really new in the language
Re:Ask HN: Will Rust ever become a mainstream systems progra... by parenthephobia on Monday April 10, 2017 @05:56PM (#14082906)
Compile-time checking of owned and borrowed references was in Vala, a C#-inspired language for the GNOME ecosystem, four years earlier.
Re:Ask HN: Will Rust ever become a mainstream systems progra... by steveklabnik on Monday April 10, 2017 @09:12PM (#14084068)
Doesn't Vala use reference counting? [1] I'm not actually sure; do you have some pointers I could read here?

1: http://www.vala-project.org/doc/vala/Overview.html#Memory_ma...

Re:Ask HN: Will Rust ever become a mainstream systems progra... by ssokolow on Tuesday April 11, 2017 @10:52AM (#14088356)
From what I remember, it just uses GLib's system for implementing reference-counted pointers in C and is equivalent to using Rc<T> or Arc<T> everywhere in Rust.
Re:Ask HN: Will Rust ever become a mainstream systems progra... by steveklabnik on Tuesday April 11, 2017 @11:45AM (#14089083)
Yeah, that's what I thought. Which is very different than most Rust code!
Re:Ask HN: Will Rust ever become a mainstream systems progra... by parenthephobia on Tuesday April 11, 2017 @12:29PM (#14089665)
Yes, but so does Rust. Reference counting is orthogonal to, although related to, to borrow checking.

Vala's wiki has a page all about its ownership mechanism: https://wiki.gnome.org/Projects/Vala/Ownership

Re:Ask HN: Will Rust ever become a mainstream systems progra... by steveklabnik on Tuesday April 11, 2017 @12:47PM (#14089866)
Rust does not use reference counting for ownership, or borrow checking. It is true that you can introduce it for your own types though, with Rc/Arc. That's not really "rust using" it though; it's just a library.

Thanks for the link, I'll dig in!