jcranmer

Joined 12 years ago

Karma
36,173
Submissions
8,515
Member since
Nov 17
View on Hacker News

Recent submissions

Comment · 6 hours ago
Compiler optimizations are a trade-off between compile time, runtime, and code size, mediated by the availability of developer time.

Perfect hashing for switch tables is useful mostly for large, sparse switches, but hot large, sparse switches are rare, and the closest examples I can think of (e.g., parse tables) are themselves likely generated from other tools, which could itself be changed in lieu of the compiler. It really doesn't come across as a useful optimization to try implementing in a compiler.

Comment · 1 day ago
To hammer this point home:

The sender and the receiver both have a copy of the email. The receiver's MTA pretty much has to have a copy of the email for sane antispam to work. Email itself intrinsically leaks the sender, recipient, and time as part of the SMTP message, which means anyone with access to email server logs can recover this information no matter how much security and encryption you try to put on top of it, and that means that whatever three-letter agency you care about probably has access to all the information they want anyways.

The only meaningful difference in security is going to be whether or not the outgoing MTA is going to try to use (or even require) TLS on the MTA-MTA connection, and what level of encryption is applied to the at-rest email.

Personally, I'm not too fussed about a mail system administrator being able to read my email because of the BOFH principle... it's not worth the sysadmin's time to read my email, because it's just not interesting.

Comment · 1 day ago
Yes, people use it in practice. But it's not being used for the thing you're thinking of.

RGB is fine for specifying a color. I mean, there are issues with RGB colorspaces and whatnot, but if you need to pick the background of a page or the color of text, there's no real reason not to use RGB.

The problem with RGB is that it is really bad at color interpolation. You can't take the average of the red, green, and blue components of two colors and expect a usable color in the middle to come out. Instead, you need to move to a perceptual color space. CIELAB is the old perceptual color space of choice; Oklab is the new perceptual color space of choice.

Color interpolation is needed for things like gradients or information visualization, where you need to say things like "20% of the way between color A and color B".

Comment · 3 days ago
I think it's useful to link to a lawyer's take on the utility of a similar tool that was built by somebody else here: https://bsky.app/profile/questauthority.bsky.social/post/3mj...

The tl;dr is that doing git-style change-tracking of the legislation isn't as helpful in practice as you'd think (especially because a lot of the very basic change-tracking is already available in the existing tools that lawyers use!).

Comment · 3 days ago
Nah, it's pretty damn common in any legal system.

If you've got a statute like "no vehicles in the park," the fundamental issue is that you have to interpret "what is meant by 'vehicle'?" and no legal drafting is going to be good enough to actually cover all the possible cases well enough. The main difference between a common law and a civil law system here is that in a common law system, you have to cite the previous similar cases (because precedent is binding) whereas in a civil law system, you're merely using those previous similar cases as persuasive evidence. At the end of the day, it boils down to arguing for your interpretation.

And in my experience working on language standardization (which is closer to a civil law system than a common law system), it's fairly often that I have to resort to looking up not just when a change in the text occurred, but dive deep into the discussions of the paper proposing the change to understand what the committee thought it was doing with the change. The complexity of law is fairly similar--the changes to the law themselves often require understanding the legislative and interpretative history of the law to understand what the intent of the drafter was to be able to rule on how the law is extended to an unanticipated scenario.

Comment · 3 days ago
There is definitely an unanswered question as to what the metric, but no, JavaScript is not 90+% by any useful metric. Most code is not a website, and JavaScript penetration outside of the client-side code on a website and some GUI applications on various operating systems is almost nonexistent.

Remember that all of the code in operation includes code like the microcontroller in your mouse, the hundreds of chips in your car doing things like keeping the engine running or "window goes up when I push the button," the DVD menu (which is actually Java code), not to mention all of the staid systems responsible for things like writing your paycheck every other week.

Comment · 4 days ago
The argument would be that you were elected to the office of Vice President rather than the office of President.
Comment · 4 days ago
I'm not really sold on the idea that nuclear weapons are a salve against conflict. The only real examples are North Korea not getting invaded and maybe tamping down some of the India-Pakistan conflicts (note that India and Pakistan have had armed conflict with each other since both acquired nuclear weapons!). On the contrary, we can see times where nuclear weapons seem to have emboldened leaders--Putin has definitely played the "you can't retaliate against my aggression, I'll nuke you" card, and the Cuban missile crisis had both the American and Soviet militaries stridently arguing for a nuclear first strike because going second would be so calamitous (it was avoided largely because both Kennedy and Khrushchev were reticent to do so).

One of the striking features of the last decade or so of global politics is the willingness of middle powers to arm and fuel regional conflicts, so I think it entirely plausible that a world where middle powers like Saudi Arabia and Iran gain nuclear weapons is one where, say, the Sudanese Civil War involves nukes.

Comment · 4 days ago
The general assessment on Iran has long been that they aim to become a nuclear threshold state (have the ability to make nuclear weapons quickly (~1y timeline or less) should they need to), but not actually acquire nuclear weapons for themselves.
Comment · 5 days ago
In the interests of pedantry, that's not what the writing says. The operative text is quoted here:

> No person shall be elected to the office of the President more than twice, and no person who has held the office of President, or acted as President, for more than two years of a term to which some other person was elected President shall be elected to the office of the President more than once.

The 'obvious loophole' is that the text doesn't constrain the number of terms anyone can serve, but instead constrains the number of times someone can be elected as president, so if you run as vice president for someone who agrees to immediately resign to let you be president, you technically don't run afoul of the rule.

(The more likely loophole, following from Trump v Colorado, is that nobody is actually allowed to declare somebody ineligible for president, so the constitution's strictures are meaningless in practice. It truly is a disgusting SCOTUS decision.)

Comment · 5 days ago
> You got Trump and Biden as a direct result of term limits.

The US only enacted term limits in 1951. Before that time, only two presidents had attempted to seek third terms (another two attempted but failed to secure even a nomination by a political party), and only one was successful.

And, quite frankly, the only president since the 22nd amendment who I could see wanting to run for a third term is Trump, who does seem to be campaigning for one anyways despite being constitutionally barred from it.

Comment · 7 days ago
I think you misread the question I asked.

Nonetheless, even today, the vast majority of countries are not self-sufficient on defense infrastructure, and this has been true for most of the modern era. The most obvious deficiency is in naval terms: the number of countries who have enough of a navy that they can do something about "my shipping is being attacked by pirates" without help from other people is plausibly at most five (US, UK, France, Russia, China), and I have my doubts about half of those.

Comment · 7 days ago
If we're being pedantic, the US is not a nation-state (because the US doesn't really have a coherent "nation"), and I suspect for similar reasons you could claim that Belgium is not a coherent nation either, given the Flemish/Walloon divisions in the state.

That said, a lot of people use nation state as a synonym for sovereign state, and Belgium is as much a sovereign state as the US is.

Comment · 7 days ago
Most countries are roughly the size of a US state. How many US states could be entirely self-sufficient on defense infrastructure?
Comment · 7 days ago
The "... in mice" qualifier is somewhat overdone, but for Alzheimer's in particular, it's actually extremely important: mice do not experience Alzheimer's. We test Alzheimer's drugs in mice by artificially inducing something that produces similar dementia symptoms, and then seeing how the drugs influence that progression. If that model is different from how Alzheimer's works--and there's pretty decent suggestions from the history of failed Alzheimer's drugs in humans that our models of Alzheimer's are in fact wrong--then anything that fixes that model has suspect utility.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton