HNHacker News
TopNewBestAskShowJobs

pkasting

760 karma · joined July 3, 2012

[ my public key: https://keybase.io/pkasting; my proof: https://keybase.io/pkasting/sigs/sLo64RRHO3BEoz4IwHQ4Siph2FI6BHWTY0bZHFAGktY ]
submissionscomments
pkasting··on The scourge of x86 emulation
Disclaimer: I work for Valve, but I had nothing to do with Fex or anything related.

There are a lot of other replies here, but one additional consideration is which solution is generally beneficial outside the original problem domain. A Steam-specific bytecode is applicable to games on Steam, whereas x86 emulation on ARM is of general interest to many problem domains today. Working on the latter could be viewed altruistically (it benefits the larger community) or self-interestedly (other developers are more likely to do work for us), but either way, it's an argument for the generalist path.

pkasting··on This Month in Ladybird – August 2026
The distribution opt-outs really bugged me at the time, and I went and talked to the marketing team. Surprisingly, users who got Chrome via one of those opt-out deals used it at rates/in ways statistically indistinguishable from "organic" users (i.e. users who manually downloaded Chrome and installed it). This was a pretty strong counterargument to the idea that we were pushing something unhelpful on people who didn't want it -- they seemed to "want it" as much as the people who'd bothered to go find it manually.

I still didn't (and don't) love the practice, but it called in to question a lot of my assumptions about what people knew about software, why they used what they did, how they found it, etc.

pkasting··on This Month in Ladybird – August 2026
Sure, it could easily take 1%.

Going above 5%, OTOH, I would be shocked to ever see happen, for two reasons. 1) Mass-market adoption requires working well on an enormous long tail, which is difficult without a large team. 2) The primary driver of playing at that size is mass marketing/distribution, which requires $$$. Engineering a great product is necessary, but not sufficient.

My perspective on this is informed by being on Google Chrome from inception to 2025. Chrome from near the beginning was well-engineered and had three compelling-according-to-user-research advantages over the IE of 2008 (speed, security, and not being made by Microsoft), but mass adoption depended on a large number of non-engineering factors, of which marketing/distribution was (to a then-mid-20s software engineer) the most surprising one. I didn't believe that was what made the difference in which browser most people used; I was very wrong. Techies are not the leading-edge trendsetters for the masses we sometimes believe we are.

IMO, taking mass market share in the future will require either a compelling-to-users product coupled with at least a couple hundred million dollars in marketing and distribution budget, or else something that is completely unlike web browsers of the past (maybe there's something that replaces the web entirely). No one has done the former since Chrome launched; the closest people have come to the latter thus far is things like Dia/Atlas that try to reimagine workflows in an AI context, and I think the market has not found those to be sufficiently different+compelling.

pkasting··on Getting silly with C, part and((int*)-8)[3]
The common theme of this whole series of articles is basically "GCC extensions allow abominations".
pkasting··on There Will Come Soft Rains (1950) [pdf]
Ray Bradbury is the best horror writer to have worked in a sci-fi milieu.

This story is one of only a couple sci-fi short stories to creep me out enough that I still remember them vividly decades later. (John Varley's "PRESS ENTER ■" is another.)

pkasting··on How old is Ann?
The closing problem is more fun.

> A man is twice the age his wife was when he was the age she is now. When she reaches his present age, their combined years will be 100. Find the age of each.

This seemed initially like something amenable to guessing and checking a few ratios. <narrator voice>It was not.</narrator voice>

My answer: The man is 44 4/9 years old, the wife 33 1/3 years.

pkasting··on The Voice of Google
I was there 06-25, and this matches my recollection. Honestly, it's a very restrained document.
pkasting··on Lore – Open source version control system designed for scalability
The idea sounds good, even if Epic's recent track record of tools is not inspiring. But the commit messages etc. are very clearly products of vibe-coding. And version control is not the situation where "works 97% of the time" is a good-enough bar.

Passing for now.

pkasting··on Forking the Web
XHTML was never all the rage. Your premise is false.

Hard errors up front are great when you control the full content pipeline. It's very rare that that's the case, and was rare even in 2004. As soon as including someone else's broken content in your page prevents users from seeing your content, and that someone else can break the content at any time and you can't control it... few people will want hard errors.

pkasting··on Forking the Web
On the contrary, image decoders all run complex processes that try and guess what to do in erroneous cases. I used to maintain Chrome's image decoders, and every single image format has "what the spec says" and then "what people actually do in practice"; you must handle the latter, and it is often very difficult to figure out how to do so. For BMPs, for example, determining whether the author intended 24-bit RGB or 32-bit RGBA sometimes requires decoding the full image and scanning to see whether any pixels' alpha bytes differ from the others, since "all 00" and "all FF" might both be "no alpha".

I also used to work on a production C compiler. Compilers can and do "guess what you meant" in various cases, notably for producing actual human-readable errors or proceeding past various warnings, but if I recall correctly even in more obscure non-error cases.

Hyrum's Law is a real jerk sometimes.

pkasting··on Laws of Software Engineering
(Tangent: What a pleasure to see your username again; will always think of your readability help fondly!)
pkasting··on Laws of Software Engineering
This list is missing my personal law, Kasting's Law:

Asking "who wrote this stupid code?" will retroactively travel back in time and cause it to have been you.

pkasting··on Gonon: Building a Clock with No Numerals
Crowing over omitting Arabic numerals in the name of avoiding any kind of cultural influence or bias seems silly when everything is still going to be expressed in decimal.
pkasting··on Banned C++ features in Chromium
C++ module implementation is a story with a lot of drama, if you ever want to read up on it.

The short summary, though, is that no toolchain yet has a bulletproof implementation, though everybody at least has enough to let people kick the tires a bit.

pkasting··on Banned C++ features in Chromium
Yeah, maintainers would certainly +1 a CL that added a note about the parts of //base to use instead. Trivial oversight.
pkasting··on Banned C++ features in Chromium
FWIW, I still think the Google Style Guide banning UDLs entirely is too harsh. I think they should be used sparingly, but there are cases where they make sense.

In Chromium's UI code, we have a lot of APIs that deal with coordinates, which may be in either px or dp. And we have a lot of code that needs to hardcode various constants, e.g. layout values for different dialogs. IMO, it's sane to have UDL support here, e.g. `20_px` (at least if we had separate types to represent these two things, which we don't... don't get me started).

pkasting··on Banned C++ features in Chromium
A cursory Chromium code search does not find anything outside third_party/ forcing either signed or unsigned char.

I suspect if I dug into the archives, I'd find a discussion on cxx@ with some comments about how doing this would result in some esoteric risk. If I was still on the Chrome team I'd go looking and see if it made sense to reraise the issue now; I know we had at least one stable branch security bug this caused.

pkasting··on Banned C++ features in Chromium
Dunno! My last project there was to add support for one of the TI DSPs, but as I said, that's decades past now.

Anyway, I think there are two takeaways:

1. There probably do exist non-8-bit-byte architectures targeted by compilers that provide support for at-least-somewhat-recent C++ versions

2. Such cases are certainly rare

Where that leaves things, in terms of what the C++ standard should specify, I don't know. IIRC JF Bastien or one of the other Apple folks that's driven things like "twos complement is the only integer representation C++ supports" tried to push for "bytes are 8 bits" and got shot down?

pkasting··on Banned C++ features in Chromium
Yes, reading the actual data would still be UB. Hopefully will be fixed in C++29: https://github.com/cplusplus/papers/issues/592
pkasting··on Banned C++ features in Chromium
At least in Chromium that wouldn't help us, because we disable strict aliasing (and have to, as there are at least a few core places where we violate it and porting to an alternative looks challenging; some of our core string-handling APIs that presume that wchar_t* and char16_t* are actually interconvertible on Windows, for example, would have to begin memcpying, which rules out certain API shapes and adds a perf cost to the rest).
pkasting··on Banned C++ features in Chromium
When I led C++ style/modernization for Chromium, I made this argument frequently: we should prefer the stdlib version of something unless we have reason not to, because incoming engineers will know it, you can find advice on the internet about it, clang-tidy passes will be written for it, and it will receive optimizations and maintenance your team doesn't have to pay for.

There are cases, however, when the migration costs are significant enough that even those benefits aren't really enough. Migrating our date/time stuff to <chrono> seemed like one of those.

pkasting··on Banned C++ features in Chromium
It's weird to me, as the former lead maintainer of this page for ten years or so, that this got submitted to both r/c++ and HN on the same day. Like... what's so exciting about it? Was there something on the page that caught someone's eye?
pkasting··on Banned C++ features in Chromium
The majority of things Chromium bans would still get banned in green-field use.

Some notable exceptions: we'd have allowed std::shared_ptr<T> and <chrono>. We might also have allowed <thread> and friends.

pkasting··on Banned C++ features in Chromium
This bit us in Chromium. We at least discussed forcing the compiler to use unsigned char on all platforms; I don't recall if that actually happened.
pkasting··on Banned C++ features in Chromium
Green Hills Software's compiler supports more recent versions of C++ (it uses the EDG frontend) and targets some DSPs.

Back when I worked in the embedded space, chips like ZSP were around that used 16-bit bytes. I am twenty years out of date on that space though.

pkasting··on Banned C++ features in Chromium
I don't think that's an accurate representation. There are a few features like that, but the majority of things banned in the Google style guide are banned for safety, clarity, or performance concerns. Usually in such cases Google and/or Chromium have in-house replacements that choose different tradeoffs.

That's different from an inability to refactor.

pkasting··on Banned C++ features in Chromium
Both parts of your sentence refer to the Google style guide. This doc isn't the Google style guide. It's the Chromium modern c++ features doc. We don't talk about exceptions or platform-specific stuff (save a note on [[no_unique_address]]) in this doc.
pkasting··on Banned C++ features in Chromium
We have base::Callback for when you'd reach for std::function, which provides superior safety.
pkasting··on Banned C++ features in Chromium
Sure; you can roll your own, or you can use one of the many other libraries that provide alternatives. There are obvious downsides to the former, and the latter is basically equivalent to using the Abseil ones in terms of practical tradeoffs.

Chromium uses hundreds of other open source libraries. Is there something about Abseil specifically that sticks in your craw?

pkasting··on Banned C++ features in Chromium
We have a linter that checks for most of them as a pre-upload hook.
Page 1 of 4Next →