Live data from Hacker News

Announcing Rust 1.0 Alpha

blog.rust-lang.org

231–240 of 255 posts

Re: Announcing Rust 1.0 Alpha

#231
post #226

Earlier quoted context omitted.

Python is a prime example of a rotten standard library. Take urllib/urllib2 (use requests instead), unittest (use py.test or nose), os (too low-level, hence arcane usage) or time as examples (use pytz for anything serious), and of course Tkinter. Take all of the modules that solve minor/niche tasks that could easily have been put in a seperate library (e.g. wave), that are usually a bad idea to use (e.g. pickle), tha…

In my experience the batteries included is one of the best features of python. The standard library is fine for simple and small scripts, especially in restricted environments without pip or sudo rights. They are a lot of awesome python libs (like requests) but it is awesome to have the stdlib available everywhere and be able to depend on it.

Pip can install without root. Even if pip is not installed, it can bootstrap itself without root.

Re: Announcing Rust 1.0 Alpha

#232

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

Yes, I worked on GC as a summer project. Turned out to be way harder than anyone had thought because LLVM isn't really set up to handle high performance GC. I have a talk on it here:

https://elliottslaughter.com/2012/09/rust-precise-gc/

Re: Announcing Rust 1.0 Alpha

#234
post #152

Earlier quoted context omitted.

I'm sure that developing a large application (Servo) in parallel with the language helped quite a bit.

To be fair, rustc is also a pretty huge application that they (and any self-hosted language) developed in parallel with Rust :D (I'm pretty sure I remember hearing that rustc has more code at this point then servo does, but don't quote me on that)

I should have probably said "non-compiler application" rather than just "application".

Re: Announcing Rust 1.0 Alpha

#235
post #152

Earlier quoted context omitted.

I'm sure that developing a large application (Servo) in parallel with the language helped quite a bit.

To be fair, rustc is also a pretty huge application that they (and any self-hosted language) developed in parallel with Rust :D (I'm pretty sure I remember hearing that rustc has more code at this point then servo does, but don't quote me on that)

[deleted]

Re: Announcing Rust 1.0 Alpha

#236
post #183

Stupid question, but how can a web developer relate to Rust? I had to look up 'systems programming' and Wikipedia basically told me it is writing software for certain hardware components. Will I ever be writing a web application in Rust?

My background is primarily web development, however I've been writing a text editor in rust for a few months now. Prior to that, I had never written any software outside of the web.

Honestly, its not such a big change once you get into it. I'd encourage you to just give it a go, build something just for fun with it. Be it a command line tool, game, whatever. My experience has shown me that just because you've only been involved in web development, by no means limits you from systems/low level development!

Re: Announcing Rust 1.0 Alpha

#237
post #225

Earlier quoted context omitted.

> Forgive me if I'm wrong, but the impression I'm getting here is that you're writing the engine before the game. Your impression is a little wrong, see below. > Never do this. Just don't. What you should do instead, is write a game, and while writing that game, write its engine. I'm not making a game. We have an OpenGL Game Engine class in my Game Programming program at college. I'm creating my game engine with the…

Examples != a game, and given that scenario, I would recommend trying to make a game at this point, but I'll leave it be. And that's fair. I didn't think this way until after working in industry for a while, and my code from when I was at school was very high level and OO. If you're interested, Mike Acton (lead at insomniac, and one of the smartest people in the industry) had a good talk in CPPcon that you can find o…

I guess I should mention... I did write a maze game for a final project in a different class with it. This semester, I was one of the few that actually wanted to work hard on my engine. I just find it really fun because there's so many problems you have to think about when developing an engine, and even more solutions. It's very rewarding for the brain.

This semester, I used an app to keep track of how much time I put into every class.

- game engine: 106 hrs

- AI: 10 hrs

- physics: 10 hrs

- ogre: 12 hrs

As you can tell, my game engine was the thing I worked nearly every day on, mostly late at night. If I took an assumption about my class average on hours put into their game engines, I'd say a safe guess is around 15 hours if we don't include my time and the 2 others who also put an insane amount of time into their engines (it was pretty much a competition between 3 friends to outdo each other).

Back to making my maze game... We had the entire semester to work on either a solar system or a maze game. I pumped out the maze game in 3 hours with my engine on the day it was due. The thing is, I was confident with my engine. I put so much work into it, and I understand how it worked under the hood, that I knew I could produce something very fast and easily with it.

The game itself was simple. Have a first-person camera walk around the maze, pick up a key, and then go to the maze exit and open the door. Even though I did it in 3 hours, I also included the ability to pick up a gun, attach it to the camera like an FPS; added a skybox; added a simple sin wave twirl for objects sitting on the ground; and a few other small details here and there.

Anyways, sorry I went on for a little bit there. I'm just really happy with how much my engine is progressing, but it still needs a lot of work and polish. I'm way more open minded now after this discussion. I feel confident about not needing inhetitance now, especially since I feel like in a couple months I might port everything to Rust.

I also realize that it was very risky leaving that project until the last minute. If I ran into an issue, it could have severely messed up my mark. Making a game at the same time as an engine does indeed help with the engine development, I see the benefits of doing so. When I get a chance to continue working on it, I will probably continue developing the maze game along side it.

Anyways, thanks for those links, I'll be checking them out tonight!

Re: Announcing Rust 1.0 Alpha

#238
post #85
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.

indent(1) has been around for ages. Where does this sudden need for universal style goose stepping come from?

indent(1) is not idempotent, at least not in the configuration I tested, which makes it practically useless as an editor save hook or an SCM pre-commit hook.

Of all the C pretty-printers I tried (about a year ago), clang-format came closest but none were idempotent on the codebase I threw at it.

go fmt is idempotent, which means I use it in an editor save hook. I got used to the convenience, so now I miss an automatic formatter when writing other languages.

Re: Announcing Rust 1.0 Alpha

#239

Earlier quoted context omitted.

Likely around summer, which would be a good time for anyone interested in it to start coding with it.

It is summer right now in half of the world.

Hehe, I also don't understand why people always talk about summer and winter like it is a universal thing. Heck, there isn't such thing as summer or winter in some countries!

Re: Announcing Rust 1.0 Alpha

#240
post #128

Earlier quoted context omitted.

This is a very old post, but you can encode many uses of typestate pretty easily: http://pcwalton.github.io/blog/2012/12/26/typestate-is-dead/ It'd be great for someone to write a more up-to-date version of this post!

Haven't used Rust, but I wonder what you could use in place of the phantom types? Are Traits capable of filling this role? Am I completely misreading what Traits are? Can Rust still do phantom types, and I just can't see them anywhere in the language reference?

Phantom types aren't part of the language because they don't need to be. They're just empty types used as type parameters for structs, where the type parameter isn't actually used as a variable in the struct. It is more of a design pattern than a language feature.
Post reply on HN