0058: borrow-checking surprises, books, links

Published 2026-04-07

borrow-checking surprises

I'm working on a post that starts:

This is a demo of a dynamically-typed toy language with inline values, stack allocation, interior pointers, single ownership, and a limited form of borrowing - less expressive than rust, but much more expressive than second-class references (eg we can express external iterators).

Since there is no static typing all the borrows are checked dynamically. The interesting part of the demo is that we can do that fairly cheaply and with useful error messages.

(If you want to help beat up on the draft version, let me know and I'll send you a link.)

In the process of working on this I often turned to rust as a reference and repeatedly ran into confusing edge cases in rust. I wrote them up some of them here.

books

Feed-zone portables. A cookbook by a chef whoe caters for professional cyclists. I read this because clif bars went way up in price and I needed a replacement food for big climbing days. I liked the authors rationale for preferring whole foods (even before I read the book below). But I also tried a bunch of the recipes and didn't like any of them that much. Some of them were tasty out of the oven but turned to rubber after a night in the fridge. I do have way fewer constraints though, since I'm not trying to eat thousands of calories one-handed while winning a bike race. I ended up preferring rice/quinoa pudding (easy to make in a rice cooker, keeps well overnight, easy to vary flavours), or bread-and-butter pudding if I have more time (go heavy on the eggs to make it a well balanced meal).

Ultra-Processed People. I still don't like this narrative/anecdote driven style of book, but the author makes a decent argument that we're in an analogue of the long period with smoking (or trans fats) where there was uncertainty and debate back-and-forth as to whether smoking caused any harm, but in hindsight all the forth was from research funded by tobacco companies. The literature survey he references is particularly compelling:

We identified 60 studies (28 trials and 32 systematic reviews/meta-analyses of trials) that examined the effects of SSB consumption on obesity- and diabetes-related outcomes... Studies funded by the SSB industry were significantly more likely to be negative [than] independently funded ones: 25 of 26 studies (96.2%) had funding ties to this industry, whereas only 1 of 34 positive studies (2.9%) had such ties (relative risk, 32.70 [95% CI, 4.70 to 225.8]; P < 0.001).

I also didn't know that the FDA has near zero oversight over food additives. Companies can apparently self-certify their novel ingredients as safe, and don't even have to report to the FDA that they did so. There are no standards for what tests they have to do to self-certify either.

Since 2000 there have been only 10 applications to the FDA for full approval for a new substance. There have been 766 new food chemicals added to the food supply since then...

There's strong epidemiological evidence associating ultra-processed foods with a range of negative health outcomes, at least on par with the evidence we had for smoking. There are also natural experiments in regions which are only just getting access to ultra-processed foods.

Despite that, government advice in the UK is very mild. The author notes that all the bodies that advise government policy on nutrition are funded by companies that make ultra-processed foods.

The author wants the UK to:

The whole thing has the same kind of shape as the 2008 crash. Libertarians always want to let industries regulate themselves, arguing that if they do harmful things then the market will respond. But the market will only notice immediate, severe harm. If a food additive raises your risk of heart attacks or eventually causes irritable bowel syndrome, it takes a huge amount of work for anyone to figure out which additive is responsible.

Trans fats became popular in the 40s, it took until the 90s to get consensus they were harmful, and until 2018 for the FDA to ban them. Any of the '766 new food chemicals' added since 2000 could be equally harmful without being detected yet.

I was pretty persuaded by this argument! I don't know if the risk of eating novel food additives is that high, but the cost of avoiding them turned out to be very low for us in practice. Eg a lot of bread contains unfamiliar ingredients, but we found some brands in our local store that don't, and those brands don't cost more or taste worse.

The land trap. I wanted to find this interesting, but for whatever reason I just couldn't slog my way through it. I ended up skimming the last third.

Bits In, Bits Out. I agree that AI writing is terrible, but I thnk this underestimates the impact on math. I expect AI to increase productivity of top mathematicians much more than that of top writers, because formalization is a kind of translation task, it doesn't require much judgement, and as long as it compiles noone needs to read the result.

Measuring Agents in Production is a review of paper that surveys agent use in production and finds that open-ended agent use is pretty rare. There's a big hype incentive for companies to claim otherwise though.

Remember 2018? IBM published a whitepaper stating that "7 in 10 consumer industry executives expect to have a blockchain production network in 3 years".

Some linux devs have autonomous code review running against the linux patch list. They claim a pretty low false positive rate, but other comments disagree. Interesting to see progress on this front though.