5 ms·
Rust gets a faster sort implementation
- moomin 10y agoThe code review here is excellent and supportive. I'm very impressed.
- ekidd 10y agoI've submitted a couple of small patches and the Rust core team has always been very helpful and pleasant.
- kzrdude 10y agoIn this case of the sort improvement, nobody in the literal Rust core team was involved in reviewing the PR.
- thegeomaster 10y agoI 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.
- wyldfire 10y agoIMO 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."
- mastax 10y agoAs 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/ https://reviews.llvm.org/p/Zoxc/
- wyldfire 10y agoIs that just a stack canary? Hasn't gcc had this for years?
- pcwalton 10y agoNo, stack canaries are different. Stack canaries defend against some classes of buffer overflows. Stack probes defend against some classes of stack overflows.
- whitequark_ 10y agoZoxc 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.
- mastax 10y agoAh, 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!
- dbaupp 10y agoLate 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.
- pow_pp_-1_v 10y agoThe PR author's initial write-up and responses to comments were excellent too.
- mathw 10y agoThat struck me, too. I've found the Rust community generally very helpful, but this is really superb feedback and discussion.
- Panino 10y agoI 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.
- steveklabnik 10y agoIt 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 https://github.com/emk/heroku-buildpack-rust in combination with https://github.com/ryandotsmith/nginx-buildpack 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/config/nginx.conf.erb https://github.com/ryandotsmith/nginx-buildpack/blob/master/... for the default config, https://github.com/rust-lang/crates.io/blob/0f3adf36108dfac662e3463b4ff97567261f5de9/config/nginx.conf.erb 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/ https://users.rust-lang.org/ )
- ekidd 10y ago> Crates.io uses https://github.com/emk/heroku-buildpack-rust 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!
- deleted 10y ago[deleted]
- moosingin3space 10y agoAsk this on the #rust-webdev IRC channel, you'll get more help there.
- jeffdavis 10y agoThe original TimSort had a problem: http://envisage-project.eu/proving-android-java-and-python-sorting-algorithm-is-broken-and-how-to-fix-it/ 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.
- stjepang 10y agoAuthor 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 https://is.gd/txKd4I
- deleted 10y ago[deleted]
- reacharavindh 10y agoEnjoyed reading the review process. Thanks for sharing on HN!