5,609 karma · joined Dec 21, 2011 (14y ago) · 1,621 submissions
comment 5d ago · link · parent
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 1mo ago · link · parent
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
comment 2mo ago · link · parent
I can't imagine living somewhere where that was prohibited.
comment 3mo ago · link · parent
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 6mo ago · link · parent
It works great, but it's hard to see a way to it making sense for most folks here.
comment 6mo ago · link · parent
comment 8mo ago · link · parent
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
comment 8mo ago · link · parent
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.