Live data from Hacker News

Announcing Rust 1.0 Alpha

blog.rust-lang.org

251–255 of 255 posts

Re: Announcing Rust 1.0 Alpha

#252

Earlier quoted context omitted.

While I'll readily agree that some parts of the standard library are rotten, that's not sufficient justification to say that there shouldn't be one. I should also clarify my expectations about a standard library; to me, a standard library should have all of the basics covered (interaction with the underlying system, I/O, networking, etc.) and anything that benefits from better integration with the runtime (think data…

The other thing that really needs to be in the standard library is protocols & interfaces that will be implemented by a number of userspace libraries. Go benefits immensely from having standard io.Reader and io.Writer types and most people implementing them instead of defining their own. Similarly, most of its web frameworks use http.ResponseWriter and http.Request instead of defining their own. Python's unittest mod…

... and a sufficiently large C++ application would use 10 different string classes in various parts of it, likely with different text encodings too, with lots of fun converting between them. Even a crappy UTF-16 based String like Java's is better than such a mess.

Re: Announcing Rust 1.0 Alpha

#253
post #170

Earlier quoted context omitted.

Solution: Don't inherit from GameObject. Make GameObject "final" and simply be a container of components. Move all object-specific behaviour into the components.

But, I still need inheritance. DuckComponent would need to inherit from Component in order for my GameObject to add that to the list of components attached. Am I wrong?

You'd use interfaces (or a similar behaviour-indirection mechanism like function pointers). In Rust I suppose you'd use a trait.

Re: Announcing Rust 1.0 Alpha

#254
post #11

> The core libraries are feature-complete for 1.0. Can someone well informed about Rust give some impressions on the standard library? It is as comprehensive as in python or Go for example?

For someone that is new to Rust how do I discover where the libraries are for the things I need to do? In the past year I have needed libraries for HTTP, XML, JSON, CSV, arg parsing, image manipulation, PDF, RDBMS, a trie (and other data structures), async i/o, threads, files, ZIP, and others.

CSV parsing: https://github.com/BurntSushi/rust-csv

Arg parsing: https://github.com/docopt/docopt.rs

Re: Announcing Rust 1.0 Alpha

#255

Earlier quoted context omitted.

Could you post the Scala version as well, for comparison?

Sure: https://github.com/iamdanfox/QwirkleSolver The Rust version has had some algorithm improvements to reach 0.015s, but it was conceptually identical when it was solving in 0.7s.

Taking a quick look, it seems the program starts up, runs once and then quits. I'm wondering if the JIT actually compiled all of the app. Being JVM based Scala is very profile guided, so normally for benchmarks you want to repeat the same operation in a loop until elapsed time stabilises.

That said, if your use case involves running once for a few seconds and then quitting, ahead of time compilers like rustc will always beat a profile guided JITC. So this may be an unfair point.

Post reply on HN