Live data from Hacker News

Announcing Rust 1.0 Alpha

blog.rust-lang.org

111–120 of 255 posts

Re: Announcing Rust 1.0 Alpha

#111

How can you have an alpha without generics?

We have them.

Like three different kinds, too!

        // Old-style generics; monomorphized 
        // with S as an "input" type of MyTrait
        fn foo>(elem: T) { ... }

        // Where-clause-style generics; monomorphized, 
        // with S as an "output" (associated) type of MyTrait
        fn foo(elem: T) 
        where T: MyTrait { ... }

        // Trait objects; dynamic dispatch
        fn foo(elem: Box) { ... }

Re: Announcing Rust 1.0 Alpha

#112
post #100

Being a game developer, inheritance is a really important language feature. I'm not one to abuse the power. Currently, for school I've been working on an OpenGL game engine in C++. It's a component based system. The only real inheritance situation that's important to me, is to allow the user of the engine to create any object and make it inherit from GameObject (example: Duck would inherit the members and methods fro…

I'm a game developer and I don't use inheritance a lot, and when I do use it it's almost never for virtual dispatch. (I wouldn't mind it being added to Rust, but I don't expect I would use it). Anyway, if you're already doing a component based system, why do you need inheritance? Just do a normal ECS. You don't subclass GameObjects in most implementations of ECS (and this is a good thing).

I guess I should do some more research regarding that. Although, I just liked the idea of inheriting from a base "empty" game object. It makes it easy to have lists of GameObjects. Also, all of my components inherit from a Component class which makes it possible to AddComponent() and GetComponent(). That way, a user of the game engine could create a new type of component and easily add that to any game object. However, I may be over complicating that as well...

Re: Announcing Rust 1.0 Alpha

#113

Wow. Anyone remembers Rust pre-0.1? When it had typestate, ML syntax, garbage collection, etc.? So nice to see how the language slowly evolved and was molded to fit as best as possible the problem they were trying to solve.

Wasn't garbage collection actually always just planned but never realized (other than reference counting)?

Re: Announcing Rust 1.0 Alpha

#114
post #63

How can you have an alpha without generics?

To be fair, there were _some_ languages and frameworks which did not have generics on the 1.0 release. It is a bit strange to assert that a new language should.

It's pretty hard to add them afterwards in a backward-compatible way that is not a great hack

Re: Announcing Rust 1.0 Alpha

#115
post #79
post #69

The one thing that would put rust over the top right now is something along the lines of gofmt - something simple, with zero configuration, that can be run on commit or even save.

gofmt is a huge win for Go. Bye bye bikeshedding. I'd love to see that for Rust too.

I haven’t tried Go yet, but gofmt seems like something that every new language should strongly consider.

Re: Announcing Rust 1.0 Alpha

#116

Earlier quoted context omitted.

You get a Cargo when you install Rust.

Only if you install it as root. I install nightlies in ~/local. It's not stable enough to be installed as root.

The new installers should install Cargo regardless of you installing it as root.

Re: Announcing Rust 1.0 Alpha

#117
post #61

How can you have an alpha without generics?

You can read up here: http://doc.rust-lang.org/book/generics.html , as well about "output" generics here: https://github.com/rust-lang/rfcs/blob/master/text/0195-asso... , and explore usage in collections here: http://doc.rust-lang.org/nightly/std/collections/ .

Are "Traits" basically C++ Concepts?

Re: Announcing Rust 1.0 Alpha

#118
post #100

Earlier quoted context omitted.

I'm a game developer and I don't use inheritance a lot, and when I do use it it's almost never for virtual dispatch. (I wouldn't mind it being added to Rust, but I don't expect I would use it). Anyway, if you're already doing a component based system, why do you need inheritance? Just do a normal ECS. You don't subclass GameObjects in most implementations of ECS (and this is a good thing).

I guess I should do some more research regarding that. Although, I just liked the idea of inheriting from a base "empty" game object. It makes it easy to have lists of GameObjects. Also, all of my components inherit from a Component class which makes it possible to AddComponent() and GetComponent(). That way, a user of the game engine could create a new type of component and easily add that to any game object. Howeve…

I think you're making it way more generic than you want. even if you get that working, you're going to hate coding in that codebase.

Great, a list of objects that could literally be anything in the game. Now what?!

Re: Announcing Rust 1.0 Alpha

#119

Earlier quoted context omitted.

Yes, though you will get fewer tomorrow: https://github.com/rust-lang/rust/pull/20786

That won't get you less warnings, it just won't turn these warnings into errors for doc tests.

Oh right.

Re: Announcing Rust 1.0 Alpha

#120
Pretty nice! I mostly used Rust Nightly till now. The language, the ecosystem, etc. seems really mature now. I've been following language development for a while now. I've never seen something that is really a new language and is that far before 1.0 or in such a short time.

The language developed rapidly, without sacrificing reinventing things, changing opinions a lot. I am not sure how they did that, but it's really impressive. Usually languages lack documentation, stability, performance, etc., have lots of rough edges, no users or libraries, but none of that is true for Rust.

I am really curious about how this was achieved. Maybe someone involved could describe how that was possible. I am sure I'm not the only one interested in this.

A year ago there was an article about using Rust for an undergraduate class on operating system development. Rust was 0.7 back then and very different and way more mature.

https://news.ycombinator.com/item?id=7009414

Post reply on HN