
Sorting Algorithms in C - ismdeep
https://github.com/ismdeep/sort-algos-c
======
inciampati
What's amazing to me is that sorting is still an open problem with active
research producing new algorithms. It gets really tricky when you want to use
parallel architectures to speed it up. Case in point: ips4o,
[https://github.com/SaschaWitt/ips4o](https://github.com/SaschaWitt/ips4o)

~~~
thechao
So is printing floating point numbers:
[https://cseweb.ucsd.edu/~lerner/papers/fp-printing-
popl16.pd...](https://cseweb.ucsd.edu/~lerner/papers/fp-printing-popl16.pdf).
That paper was published in _POPL_ \-- one of the most distinguished
conferences in all of CS.

------
thestoicattack
So I was all set to bash include/data-swap.c for allocating on the heap every
time you need to swap memory. Turns out that gcc can optimize out that
temporary, and it ends up the same as std::swap.

But if we use operator new/delete instead of std::malloc the optimization
doesn't take place:
[https://godbolt.org/z/vtxqD2](https://godbolt.org/z/vtxqD2)

~~~
AbacusAvenger
Neat find. Clang seems to be consistent about it in all 3 cases though:
[https://godbolt.org/z/iH7ydo](https://godbolt.org/z/iH7ydo)

------
transitivebs
The irony in these two posts being side-by-side is kind of awesome
[https://twitter.com/transitive_bs/status/1222772644212363267...](https://twitter.com/transitive_bs/status/1222772644212363267?s=20)

~~~
shakna
Hey, CNoEvil should still work with this as well. They're compatible. Insane
to combine, but compatible.

------
ericwood
Tangentially related: what resources would y'all recommend for learning
modern-ish C?

I'm planning out a microcontroller project and reading through avr-libc I'm
realizing my C skills have completely atrophied since college a decade ago.
There seems to be a lot of outdated information out there, and honestly it's
tough for me to judge the quality of what I'm reading. Any advice is greatly
appreciated!

------
gshdg
Gee, this brings me back to second semester computer science class.

