
Rust gets a faster sort implementation - kzrdude
https://github.com/rust-lang/rust/pull/38192
======
moomin
The code review here is excellent and supportive. I'm very impressed.

~~~
ekidd
I've submitted a couple of small patches and the Rust core team has always
been very helpful and pleasant.

~~~
thegeomaster
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.

------
jeffdavis
The original TimSort had a problem:

[http://envisage-project.eu/proving-android-java-and-
python-s...](http://envisage-project.eu/proving-android-java-and-python-
sorting-algorithm-is-broken-and-how-to-fix-it/)

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

~~~
stjepang
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](https://is.gd/txKd4I)

------
reacharavindh
Enjoyed reading the review process. Thanks for sharing on HN!

------
Panino
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.

~~~
steveklabnik
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](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/...](https://github.com/ryandotsmith/nginx-
buildpack/blob/master/config/nginx.conf.erb) for the default config,
[https://github.com/rust-
lang/crates.io/blob/0f3adf36108dfac6...](https://github.com/rust-
lang/crates.io/blob/0f3adf36108dfac662e3463b4ff97567261f5de9/config/nginx.conf.erb)
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
> 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!

