Better HN
topnewbestaskshowjobs
Log inSign up

stephencanon

5,609 karma · joined Dec 21, 2011 (14y ago) · 1,621 submissions

I manage the low-level swift team. Previously I worked on high-performance math libraries.
Submissions

comment 5d ago · link · parent

As is usual for C++, the committee made arbitrary changes from what C had already laid out that made the feature worse. In particular, C++ requires that the fields appear in order, which means you cannot use it to do what the linked page shows.

This isn't usually a huge deal, because C++ gives you other ways to have overloaded functions and default parameters, but it is sometimes mildly annoying.

comment 1w ago · link · parent

Whammy bar is continuous; for the use here you'd want something discrete.

comment 1w ago · link · parent

If you had a mechanism to change the string tension instead of length, then the frets on the neck would still be correct. You'd wear out your strings a whole bunch faster, though, doing this.

comment 2w ago · link · parent

Same. Taught my kids to make it, too, and they are always confused as to why everyone doesn't make them this way at school.

comment 2w ago · link · parent

Yeah. The kids I coach (1st-4th grade) generally call them 'stupidtrucks'.

comment 3w ago · link · parent

Always.

(Hi Ken!)

comment 1mo ago · link · parent

I really don't think I was doing anything especially clever and it was running at 32% for me over 50 samples. That's much worse than chance.

comment 1mo ago · link · parent

> I don't think we're far from every bit of prose online, being at least edited, if not authored, by AI.

Zero chance of that happening anytime soon. I'm sure a lot of people have adopted it, and more will follow, but there are still plenty of us who enjoy writing and have no desire to let AI tools take that away from us.

> I'm not saying I find the prospect thrilling; just that it's inevitable.

I see no reason why this should be the case. All you have to do is keep writing and it's suddenly not inevitable.

comment 2mo ago · link · parent

I've only had a couple weeks in rentals with automatic emergency braking, and was very nearly been rear-ended twice due to false positives. Anecdotal, and I'm sure they'll improve with time, but I would never allow the system I experienced anywhere near a car I owned. It was profoundly unsafe.

comment 2mo ago · link · parent

I would assume that the state law protects parents against a city adding a restriction in their municipal code.

comment 2mo ago · link · parent

Gated communities, by their nature, attract and encourage the sort of busybodies who think that everyone needs to be protected from everything.

comment 2mo ago · link · parent

Our neighborhood in the northeast US does the same (minus the hard prohibition against parents going with them). Our 5 and 9 year old walk to school daily, usually picking up the neighbors' kids (6, 6, 10, 9, 7, 7) along the way. If we happen to be free sometimes an adult will walk with them, sometimes we start walking with them and then stop for coffee with a neighbor while the kids continue on, sometimes they go by themselves.

I can't imagine living somewhere where that was prohibited.

comment 3mo ago · link · parent

That’s exactly the same rule with more words (postfix = right, prefix = left).

comment 3mo ago · link · parent

This comes up every so often, and while it's sort of almost true and attractive, it isn't actually correct.

The correct rule is "follow the C grammar". An easier to remember and also correct rule is "start at the identifier being declared; work outwards from that point, reading right until you hit a closing parenthesis, then left until you hit the corresponding open parenthesis, then resume reading right..." (this is sometimes called the "right-left rule": https://cseweb.ucsd.edu/~gbournou/CSE131/rt_lt.rule.html).

comment 3mo ago · link · parent

It's very cool. Thank you!

comment 5mo ago · link · parent

"Centrist" in practice means "more or less content with the status quo." That is fundamentally a conservative position orthogonal to any notion of "facts".

comment 5mo ago · link · parent

The work discussed in this post shipped in the OS last year (fall 2025), so nothing here is dependent on very recent changes.

comment 5mo ago · link · parent

Field hockey is almost exclusively a girls sport in the US, while boys have (American) football in the fall. Both draw from the potential pool of soccer players in US middle and high schools.

comment 5mo ago · link · parent

“in a real race we have no actual chance of winning” is an absolutely wild thing to say in response to a link to a real race in which the human has won the last few years in a row.

comment 6mo ago · link · parent

What sort of engineering standards are these Cybertrucks built to?

Oh, very rigorous engineering standards. The wheels aren't supposed to fall off for a start.

comment 6mo ago · link · parent

We have a ground-source heat pump for our ADU. We did it because we were curious about just how efficient we could make the house, but I don't expect that it will ever break even financially vs a modern air-source system with resistive backup in our climate (northern New England, typically very few –20˚ nights, –10˚-0˚ more common with daytime highs in the single digits).

It works great, but it's hard to see a way to it making sense for most folks here.

comment 6mo ago · link · parent

Prior to the current generation Intel designs, Apple’s branch predictor tables were a good deal larger than Intel’s IIRC, so depending on benchmarking details it’s plausible that Apple Silicon was predicting every branch perfectly in the benchmark, while Intel had a more real-world mispredict rate. Perf counters would confirm.

comment 6mo ago · link · parent

Must be the water.

comment 7mo ago · link · parent

The CORE-MATH project authors, most of whom are French academics (including the author of the linked paper).

I don’t know of any interesting work in this space that came out of Red Hat, why do you suggest them?

comment 8mo ago · link · parent

"I'd like to thank my mother, Ayn Rand, and God" is the usual example.

Yes, you can reorder the list to remove the ambiguity, but sometimes the order of the list matters. The serial comma should be used when necessary to remove ambiguity, and not used when it introduces ambiguity. Rewrite the sentence when necessary. Worth noting that this is the Oxford University Press's own style rule!

comment 8mo ago · link · parent

That would fall under "more constrained", due to process limits.

comment 8mo ago · link · parent

Enlarging a branch predictor requires area and timing tradeoffs. CPU designers have to balance branch predictor improvements against other improvements they could make with the same area and timing resources. What this tells you is that either Intel is more constrained for one reason or another, or Intel's designers think that they net larger wins by deploying those resources elsewhere in the CPU (which might be because they have identified larger opportunities for improvement, or because they are basing their decision making on a different sample of software, or both).

comment 8mo ago · link · parent

Your students should be able to figure out if a computation is exact or not, because they should understand binary representation of numbers.

comment 8mo ago · link · parent

You can often eke something out for order-four, depending on uArch details. But basically yeah.

comment 8mo ago · link · parent

For throughput-dominated contexts, evaluation via Horner's rule does very well because it minimizes register pressure and the number of operations required. But the latency can be relatively high, as you note.

There are a few good general options to extract more ILP for latency-dominated contexts, though all of them trade additional register pressure and usually some additional operation count; Estrin's scheme is the most commonly used. Factoring medium-order polynomials into quadratics is sometimes a good option (not all such factorizations are well behaved wrt numerical stability, but it also can give you the ability to synthesize selected extra-precise coefficients naturally without doing head-tail arithmetic). Quadratic factorizations are a favorite of mine because (when they work) they yield good performance in _both_ latency- and throughput-dominated contexts, which makes it easier to deliver identical results for scalar and vectorized functions.

There's no general form "best" option for optimizing latency; when I wrote math library functions day-to-day we just built a table of the optimal evaluation sequence for each order of polynomial up to 8 or so and each microarchitecture and grabbed the one we needed unless there were special constraints that required a different choice.

12345
55