News for hackers. Stuff that matters.
Re:Rust gets a faster sort implementation by moomin on Wednesday December 14, 2016 @10:11AM (#13176466)
The code review here is excellent and supportive. I'm very impressed.
Re:Rust gets a faster sort implementation by wyldfire on Wednesday December 14, 2016 @11:15AM (#13177088)
IMO the LLVM community could learn a few things from the Rust team. I know that the activity level is not the same but it's really encouraging to new folks that reviews get engagement and disposition: "this is good, but fix that" instead of wilting without any clear indication of whether it could be merged.

Also, the fact that the CI triggers and lets you know whether your change causes any collateral damage before you merge takes away a lot of the fear factor of contributing. This is also in stark contrast to LLVM's "merge it if it LGTM, revert it soon after when we find out what it broke."

Re:Rust gets a faster sort implementation by mastax on Wednesday December 14, 2016 @12:56PM (#13178066)
As an example of this, Zoxc has been trying to get stack probe support into LLVM for two years to no avail [0]. This is important to make sure that stack overflow or buffer overrun actually trigger the guard page and cause termination.

I admit it's not really fair to LLVM to pick on one patch like this but it's frustrating to me even as an outsider.

[0]: https://reviews.llvm.org/p/Zoxc/

Re:Rust gets a faster sort implementation by whitequark_ on Wednesday December 14, 2016 @03:33PM (#13179399)
Zoxc has repeatedly refused reasonable requests to alter the patch to fit the standards of upstream. Because of this (and because I am rather tired of not having stack probes, with my embedded system not having functional guard pages), I'll make a hostile fork of their patch soon and get it through the pipeline. Stay tuned.
Re:Rust gets a faster sort implementation by dbaupp on Tuesday December 20, 2016 @01:47PM (#13222681)
Late comment, but aren't stack probes entirely predicated on having working guard pages? I.e. they only exist to guarantee that the guard page is accessed before anything else, when a frame is larger than the page.
Re:Rust gets a faster sort implementation by mastax on Wednesday December 14, 2016 @06:17PM (#13180689)
Ah, interesting. I hadn't gleamed that from the threads. It's great to hear that there's a chance that this will be supported though!
Re:Rust gets a faster sort implementation by wyldfire on Wednesday December 14, 2016 @01:05PM (#13178157)
Is that just a stack canary? Hasn't gcc had this for years?
Re:Rust gets a faster sort implementation by pcwalton on Wednesday December 14, 2016 @01:27PM (#13178340)
No, stack canaries are different. Stack canaries defend against some classes of buffer overflows. Stack probes defend against some classes of stack overflows.
Re:Rust gets a faster sort implementation by ekidd on Wednesday December 14, 2016 @10:41AM (#13176755)
I've submitted a couple of small patches and the Rust core team has always been very helpful and pleasant.
Re:Rust gets a faster sort implementation by thegeomaster on Wednesday December 14, 2016 @11:13AM (#13177071)
I once submitted a patch to Cargo. Despite being uninformed and violating code style rules which I should have read and known about, they patiently guided me, I resolved the issues, and it ended up being merged. They're great folks.
Re:Rust gets a faster sort implementation by kzrdude on Wednesday December 14, 2016 @10:54AM (#13176869)
In this case of the sort improvement, nobody in the literal Rust core team was involved in reviewing the PR.
Re:Rust gets a faster sort implementation by pow_pp_-1_v on Wednesday December 14, 2016 @11:55AM (#13177426)
The PR author's initial write-up and responses to comments were excellent too.
Re:Rust gets a faster sort implementation by mathw on Wednesday December 14, 2016 @12:30PM (#13177801)
That struck me, too. I've found the Rust community generally very helpful, but this is really superb feedback and discussion.
Re:Rust gets a faster sort implementation by jeffdavis on Wednesday December 14, 2016 @12:01PM (#13177476)
The original TimSort had a problem:

http://envisage-project.eu/proving-android-java-and-python-s...

I assume the author knows about that and/or it does not apply to this modified version.

Re:Rust gets a faster sort implementation by stjepang on Wednesday December 14, 2016 @12:26PM (#13177750)
Author here. Yes, this is an interesting problem TimSort used to have. A counterexample to incorrect TimSort is sequence "120, 80, 25, 20, 30". This simple sequence could have been easily discovered by generating sequences randomly and verifying that the TimSort invariants hold on it. The fact that it took 13 years to discover the bug (using formal verification!) is just silly :)

Fortunately, the problem is easy to fix and there's a brief mention of it in the comments: https://is.gd/txKd4I

Re:Rust gets a faster sort implementation by reacharavindh on Wednesday December 14, 2016 @10:02PM (#13182038)
Enjoyed reading the review process. Thanks for sharing on HN!
Re:Rust gets a faster sort implementation by Panino on Wednesday December 14, 2016 @11:15AM (#13177089)
I don't mean to be off-topic (sorry!), but what's the best CGI/FastCGI library for Rust? My impression is that it's not ideal for webapps at the moment, and I'm comfortable with that. Putting all of Python into a webserver chroot isn't exactly ideal either. I specifically ask about Rust because when I looked at it a while back, it just felt so right to me.
Re:Rust gets a faster sort implementation by steveklabnik on Wednesday December 14, 2016 @11:27AM (#13177194)
It looks like there are a few CGI crates on crates.io, but they're not super popular. Crates.io uses https://github.com/emk/heroku-buildpack-rust in combination with https://github.com/ryandotsmith/nginx-buildpack, which puts nginx in front of a Rust application server, communicating over a socket. See here: https://github.com/ryandotsmith/nginx-buildpack/blob/master/... for the default config, https://github.com/rust-lang/crates.io/blob/0f3adf36108dfac6... for the one we actually use.

(Given this is offtopic, I'll leave it at that. Happy to answer questions over at https://users.rust-lang.org/ )

Re:Rust gets a faster sort implementation by ekidd on Wednesday December 14, 2016 @11:43AM (#13177331)
> Crates.io uses https://github.com/emk/heroku-buildpack-rust

Oh, wow, maintainer here. I had no idea. :-) Thanks for making my morning, and never hesitate to send PRs!

Re:Rust gets a faster sort implementation by moosingin3space on Wednesday December 14, 2016 @11:44AM (#13177333)
Ask this on the #rust-webdev IRC channel, you'll get more help there.