HNHacker News
TopNewBestAskShowJobs

orlp

8,833 karma · joined March 27, 2013

Developer at https://pola.rs/.

Publish a blog at https://orlp.net/blog/.

Other socials:

    http://github.com/orlp/  
    https://stackoverflow.com/users/565635/orlp  
    https://linkedin.com/in/orson-peters/
submissionscomments
orlp··on Major P2P issues in Israel and possibly other Middle East countries
https://en.wikipedia.org/wiki/Conscription_in_Iran

FWIW I don't agree with the comment chain's source, I read "regular people" as "civilians" and don't think there was any nasty connotation meant.

orlp··on Pokemon Emerald Ported to WebAssembly (100k FPS)
Copyright being as long as it is is a theft of our culture. I (and many of our generation) grew up with Pokemon, it's a common experience for many of us. A classic of our culture. Except we're not allowed to use it, remix it, build our own versions, etc. We still do, of course, but it's all illegal.

It didn't used to be this way.

I think 20-30 years of copyright should be plenty to extract whatever profits you deserve from the fruits of your labor. Anything beyond that is just holding culture hostage for the benefit of a few. It doesn't serve society in any meaningful way.

orlp··on Branchless Quicksort faster than std:sort and pdqsort with C and C++ API
It's just a play on words, something lightweight drifts in the wind rather than gliding on a wing. It's really not all that deep.
orlp··on Branchless Quicksort faster than std:sort and pdqsort with C and C++ API
It's called driftsort because it's derived from another sort I made, glidesort: https://github.com/orlp/glidesort. Glidesort is a bit faster still for large inputs, however it was too large and complex for inclusion in the standard library, and suffered from code size penalties on small inputs. So driftsort is a slimmed down version more appropriate for general purpose.
orlp··on Branchless Quicksort faster than std:sort and pdqsort with C and C++ API
Since pdqsort (an older project of mine) was mentioned, I felt it wouldn't be entirely inappropriate to mention that I've since then collaborated with Lukas Bergdoll to provide two high-quality sort implementations for the Rust standard library, ipnsort (unstable) and driftsort (stable).

So if you use Rust, you get these by simply calling [T]::sort(_unstable). Great performance out of the box :)

On my machine (Apple M2), using the benchmarks from the repository on Apple clang 17 and Rust 1.98 nightly:

    Sorting 50 million doubles:
    ipnsort             0.79s
    blqs                0.90s
    driftsort           1.13s   (stable)
    std::sort           1.22s
    std::stable_sort    4.64s   (stable)

    Sorting 50 million (i32, i32) structs:
    ipnsort             0.82s
    blqs                0.89s
    driftsort           1.07s   (stable)
    std::sort           3.09s
    std::stable_sort    3.15s   (stable)

And now for a cool party trick, let's repeat the 50 million doubles experiment again, but have the first 90% already sorted, last 10% random:

    driftsort           0.29s   (stable)
    ipnsort             0.81s
    std::sort           1.15s
    std::stable_sort    1.63s   (stable)
    blqs                1.89s
orlp··on Should you normalize RGB values by 255 or 256?
When going from float to u8 you should add a triangular dither. It makes a world of difference for grayscale gradients, even in 24bit truecolor.
orlp··on Only 17% of all 64-bit Integers are products of two 32-bit integers
The input space is 32 + 32 = 64 bits. The output space is 64 bits. So the best you can do is an 1-to-1 mapping.

However, since a * b = b * a, our input space has a lot of duplicate outputs. So from this alone you can conclude roughly half of the output space must be uncovered by any input pair, simply because there aren't enough input pairs.

orlp··on Everything in C is undefined behavior
There's typically only a performance penalty if the unaligned load spans a cache line on modern hardware.
orlp··on We stopped AI bot spam in our GitHub repo using Git's –author flag
No it doesn't have security implications.

If you are insecure because someone has had one of their otherwise completely innocent PRs merged into your repo... you are insecure, period.

orlp··on eBay Rejects GameStop's $56B Takeover as Not Credible
The person you replied to was talking about selling, not buying.
orlp··on GameStop makes $55.5B takeover offer for eBay
> So you're just outright accusing GameStop of fraud?

I have no idea why you interpret my words that way. I just meant that I didn't want to analyze the cash portion of their offer any further and just wanted to take it at face value.

orlp··on GameStop makes $55.5B takeover offer for eBay
Alright, my company MEME offers to buy Apple then for $1 plus 100% of MEME's stock, which is worth more than Apple then since it will own Apple.

If you word it like this it's just a hostile proposed change of leadership. Weird way to apply to become CEO of eBay, but sure.

orlp··on GameStop makes $55.5B takeover offer for eBay
Yes, that goes into the '50% cash' part of the offer. With a 20B credit line and 7.5B cash from their own coffers (which they claim to have, so let's believe them on their word there), you cover the cash portion.

The issue is the non-cash portion of the offer. They claim that the remaining 27.5B is covered by GameStop stock. But that's more than double the market cap of GameStop.

orlp··on GameStop makes $55.5B takeover offer for eBay
GameStop doesn't have (even close to) $55.5B. Their offer from the letter is literally impossible:

> Our offer is $125.00 per share, comprising 50% cash and 50% GameStop common stock

Even if you magically included all existing GameStop stock in the offer, it still would not comprise 50% of $55.5B.

EDIT: looks like it's not impossible and I misunderstood. It's a proposed change of leadership with a $25B injection of cash to sweeten the deal. GameStop would issue shares which would capture the original eBay value (since GameStop would own eBay after the trade), making that part a wash. At least assuming people owning eBay stock currently would value the combined company at at least the sum of their parts, which is a big if.

orlp··on Copy Fail
What is your Python version? Splice was added in 3.10.

https://docs.python.org/3/library/os.html#os.splice

orlp··on Bugs Rust won't catch
Vec::set_len is by no means deprecated. The lint you linked only covers a very specific unsound pattern using set_len.
orlp··on MiniMax M2.7 Is Now Open Source
I've flagged the post, the title is editorialized, the title on the blog post is "MiniMax M2.7: The Agentic Model That Helped Build Itself" (at least at the time of writing this).
orlp··on Defer available in gcc and clang
In university? No, absolutely not straight away.

The point of a CS degree is to know the fundamentals of computing, not the latest best practices in programming that abstract the fundamentals.

orlp··on A Pokémon of a Different Color
Why do you find it in interesting that someone chose something mainstream? Isn't that the definition of mainstream, that it's a common choice?
orlp··on Why is the sky blue?
In modern usage (e.g. in gaming communities) "carries" has become not only ambitransitive but also a noun.

If something "carries" or is "a carry", it means it is so strong it metaphorically carries the rest of the setup with it. For example:

> This card carries.

> These two are the carries of the team.

orlp··on Attention at Constant Cost per Token via Symmetry-Aware Taylor Approximation
> N tokens looking at N tokens is quadratic

Convolving two arrays can be done perfectly accurately in O(n log n), despite every element being combined with every other element.

Or consider the even more basic sum of products a[i] * b[j] for all possible i, j:

    total = 0
    for i in range(len(a)):
        for j in range(len(b)):
            total += a[i] * b[j]
This can be computed in linear time as sum(a) * sum(b).

Your logic that 'the result contains terms of all pairs, therefore the algorithm must be quadratic' simply doesn't hold.

orlp··on The largest number representable in 64 bits
An interesting follow-up question is, what is the smallest number unable to be encoded in 64 bits of binary lambda calculus?
orlp··on Binary fuse filters: Fast and smaller than xor filters (2022)
Bloom filters also become full.

As it fills up the false probability rate goes up. Once the false probability rate reaches the threshold of unacceptability, the bloom filter is full, and you can no longer insert into it.

That most interfaces still let you do something that looks like an insert is an interface failure, not a bloom filter feature.

If you find this controversial and want to reply "I don't have a threshold of unacceptability", I'll counter that a false probability rate of 100% will be reached eventually. And if you still find that acceptable, you can trivially modify any probabilistic filter to "never become full" by replacing the "is full" error condition with setting a flag that all future queries should return a false positive.

orlp··on Binary fuse filters: Fast and smaller than xor filters (2022)
Same author.
orlp··on Scaling long-running autonomous coding
> Long-running projects that converge on high-quality, complex projects

In my experience agents don't converge on anything. They diverge into low-quality monstrosities which at some point become entirely unusable.

orlp··on Rue: Higher level than Rust, lower level than Go
I work in a 400k+ LOC codebase in Rust for my day job. Besides compile times being suboptimal, Rust makes working in a large codebase a breeze with good tooling and strong typechecking.

I almost never even think about the borrow checker. If you have a long-lived shared reference you just Arc it. If it's a circular ownership structure like a graph you use a SlotMap. It by no means is any harder for this codebase than for small ones.

orlp··on Ireland’s Diarmuid Early wins world Microsoft Excel title
The person you replied to stated:

> how productive power users in different [fields] can be with their tools

There are a lot more tools in programming than your text editor. Linters, debuggers, AI assistants, version control, continuous integration, etc.

I personally know I'm terrible at using debuggers. Is this a shortcoming of mine? Probably. But I also feel debuggers could be a lot, lot better than they are right now.

I think for a lot of us reflecting at our workflow and seeing things we do that could be done more efficiently with better (usage of) tooling could pay off.

orlp··on Slowness is a virtue
When "everybody is better", you can still increase your relative rank to other people if you benefit even more.

For example if I were to give $1 to every person on earth, but $100 million to you, everyone would be richer but you would be a lot richer still.

orlp··on Two recently found works of J.S. Bach presented in Leipzig [video]
> Do you have any particular pieces in mind when you wrote this?

(not me, but...)

Bach - Passacaglia & Fugue in C minor, BWV 582

> But one wonders what he could have made without those constraints.

Bach-Busoni - Chaconne from Partita No. 2 in D minor, BWV 1004

orlp··on John Carmack on mutable variables
Rust works this way, yes. There are escape hatches though, which allow interior mutability.
← PreviousPage 2 of 23Next →