HNHacker News
TopNewBestAskShowJobs

crdrost

3,621 karma · joined January 22, 2019

Email via [my HN name] at the Google email site.
submissionscomments
crdrost··on Blasting Yeast with UV Light
There are a bunch of tricks like this. So for instance to make antibiotic-free chicken without a commitment to being antibiotic-free and organic, raise a bunch of chickens, take any who gets sick enough to need antibiotics and put them into a separate field with their antibiotics, sell the ones that happen to not get sick as antibiotic-free, sell the other ones as usual.

Or, if you're making orange juice, make the ingredients label say oranges. But you can split it up, take the peels, put them into a hydraulic press, extract out oils that have the concentrated aroma and flavor of oranges, homogenize some of that into the juice. Or you can centrifuge the juice, or you can pass it through osmotic filters to remove some of the water and concentrate the flavor. No rule saying you can't treat some of the juice similar to sugar beet juice and try to isolate its sugars. At the end, you reassemble a perfect consistent mixture. The label doesn't have to tell you about any of this, it just has to tell you that the ingredients were oranges.

(The recipe for the best lemonade you'll ever make is like this, it's just lemons and water and sugar, but you zest the lemons into the simple syrup you're making with the sugar water, then strain it with cheesecloth or a coffee filter, before adding to the juice and water and pulp.)

Imported oils, you can basically do anything that some middleman country allows you to do with the oil (in particular mix with cheaper oils) and then say "oh this is imported olive oil, olive oil according to someone else's standards”...

crdrost··on American Heart Association says melatonin may be linked to serious heart risks
I mean it's understudied, but at the very least you have [1], children given high doses daily of melatonin developed delayed sleep/wake cycles when measured by DLMO (the time of day that your endogenous melatonin starts to rise) and that “Nearly all children who temporarily discontinued melatonin experienced a delay in sleep onset time,” both of which strongly suggest downregulation is happening. (Usually endogenous melatonin skews earlier with melatonin supplementation, see [2].)

Similar inefficacies have been seen clinically e.g. in [3] and are (caution, anecdata) widespread on the internet, with "melatonin doesn't work" being a popular search term with tons of articles about it. An honest to goodness test seems to have been done at [4] where they made sleep disturbance symptoms "disappear" by resuming treatment at a lower dosage, but instead of blaming the neurons they are blaming the liver, saying that it got overloaded and couldn't clear melatonin out of the bloodstream anymore in some patients—I just want to include that as a plausible alternative explanation so that you don't take my words as gospel truth or anything. I’m trained as a physicist, not a physician, and there is this meme of people with physics degrees thinking that everybody else’s field is their expertise and like I want to be deliberately self conscious about my limitations here.

[1]: PDF Warning: https://www.herbogeminis.com/revista/IMG/pdf/melatonin-adhd....

[2]: https://academic.oup.com/sleep/article-abstract/33/12/1605/2...

[3]: https://www.psychiatrist.com/jcp/effects-exogenous-melatonin...

[4]: https://pubmed.ncbi.nlm.nih.gov/20576063/

crdrost··on American Heart Association says melatonin may be linked to serious heart risks
PSA that melatonin use was way out of control before this study was even published.

Sleep aid melatonin is shipped in pills containing ridiculous amounts of the stuff—I’ve seen 10, 12, and 20mg myself, Amazon has a 40mg fast dissolve and 60mg gummies.

This spikes your blood amount with 100x-1000x of your natural cycle of melatonin. Why? Because melatonin is not, repeat not, the signaling molecule that makes you sleepy. It responds to light levels and triggers the cascade of other molecules that make you sleepy, several hours after it peaks. So that's why the 100x overdose—you are trying to kick those secondary mechanisms into overdrive, “hey everyone it is black as the abyss of hell I guess we gotta sleep!!”, because Americans taking melatonin want to pop one just before bed and have it knock them out.

And it does that for like 2 or 3 days before your body starts down-regulating all of its sensitivities to those melatonin byproducts. Nerve cells like to be tickled, not zapped, when you shock them like this they react angrily.

You want to use melatonin to reinforce circadian rhythm and fight jet lag, you do it with amounts in the ~100 micrograms range, slow release if you can find it, and you take that at sunset and let it reinforce your normal cycle. If you're looking for an acute sleep aid, take a walk, get fresh air, drink water, and if those don't help pop a Benadryl/Unisom (it's the same drug either way). If you have doctor’s orders of course follow those, but if you're just trying to self-medicate that’s how you do it.

Absolutely unsurprising that punching your sleep apparatus in the gut once every day for five years increases some sort of stress on your heart.

crdrost··on Why I love OCaml (2023)
We lost this fight at least by 1994 when Sun acquired “Thinking Machines,” which to its credit was bankrupting itself by making highly parallel supercomputers, at least. Now of course there is a new AI company of the same name. If the wrestling world echoes the computing world, one can only wonder what in 5-10 years will be the equivalent of Undertaker throwing Mankind off of Hell In A Cell to plummet 16 feet down through an announcer’s table...
crdrost··on Why I love OCaml (2023)
I mean pohl's joke above whooshed kjmh so it's all fine. The important thing for threads like this one is for us to name drop all of the weird programming languages that we have used, publicly avow the greatness of ones that we have not, and make a New Year's resolution that we will never follow, to actually pick up those great languages and write something in them...
crdrost··on Why I love OCaml (2023)
You don't get it from language tooling because you are compiling to a bytecode that runs in a virtual machine (BEAM).

The current tool to wrap your bytecode with a VM so that it becomes standalone is Burrito[1], but there's some language support[2] (I think only for the arch that your CPU is currently running? contra Golang) and an older project called Distillery[3].

1: https://github.com/burrito-elixir/burrito

2: https://hexdocs.pm/mix/Mix.Tasks.Release.html

3: https://hexdocs.pm/distillery/home.html

crdrost··on Fiber reduces overall mortality by 23%
I also found that first one surprising, even if he gives his back-of-the-envelope calculation (He guesstimates, 75% of healthcare spending is for metabolic-syndrome type chronic diseases, and then he guesstimates that 75% of that is preventable, $3.5T times .75 times .75 gives his figure of $1.9T/year.)

But even if the margin is not quite as wide as the back-of-the-envelope calculates, it's still bigger by a decent margin, right? For instance [1] estimates with more detailed methodology that it's $2.9T over 3 years or ~$1T/year, with at least 44% of that attributable to obesity, so like ~$400B/year, whereas [2] talks about $240B/year cigarettes, $250B/year alcohol.

Of course Lustig would say "TOFI people exist, obesity isn't the problem, obesity is just another symptom of metabolic syndrome, so 44% is an underestimate for the costs of bad nutrition." Not sure I agree there but he'd defend higher numbers even if we agreed to use these sources as kicking off points.

And yeah I agree that the question of "what do we do about it" is something that he appears to have a very opinionated take on, but I'd like to see more hard data. Like I'm happy for him that he had a big study that showed reversal of metabolic syndrome symptoms just by switching sugary food out for starchy food while holding weight and calorie consumption constant, but how we get from there to "eat real food -- the problem is not what's on the nutrition label but all of the antibiotics and adulteration that they don't have to tell you about on that label" stuff seems a bit opaque.

[1] https://www.americanactionforum.org/research/the-economic-co...

[2] https://www.cdc.gov/chronic-disease/data-research/facts-stat...

crdrost··on Fiber reduces overall mortality by 23%
Yep! Lustig has a book, Metabolical, that goes into kind of a simple explanation of the underlying mechanism here, and it's roughly like this: fiber-rich foods contain a combination of soluble and insoluble fiber, the insoluble fiber basically forms a sort of "net" of chunks and strings and such that you can't digest, and the soluble fiber forms a "gel" which gets stuck in the net and traps other foods. This gel is infused with various enzymes to break down foods in the duodenum, and then passes to the first and second half of the "zig-zag" parts of the small intestine -- the jejunum and the ileum.

The combination of fibers then leads to a given packet of calories traveling further down the jejunum as it gets absorbed, which makes more of the bacteria living along the length of the intestine happy with you, as well as protecting from blood glucose spikes that come with concomitant "crashes".

crdrost··on Fiber reduces overall mortality by 23%
Yes, here "overall" is being used as a synonym for "from all causes" not "over the full length of your life," and there's this frustrating thing for those of us with physics educations where people frequently leave off a unit of time: so like if it's a 5 year study, and your all-cause mortality is lower by a factor of 20% over those 5 years, that means 80% survived and you should compute the fifth root 0.8^(1/5) to find that 95.6% survived per year on this account, and then you can say "reduces mortality by 4.4% per year," and that sounds much more reasonable.

This happens all over the place. You're just supposed to know in investment that a price-to-earnings ratio is measured in years, or people will say "the Buffett indicator is 200%" not "the Buffett indicator is 2 years."

crdrost··on How to make a Smith chart
So you can continue it beyond that circle if you like, it just happens to be the case that the thing electrical engineers and others dealing with waveguides are plotting in the source space, is impedance. (Well, a ratio of impedances—a load impedance divided by a transmission line impedance.) The real part of impedance is resistance, and negative resistance is very uncommon. The area outside the unit circle so mapped, I think also corresponds to reflected amplitude ≤ transmitted amplitude, with the center of the diagram being a perfectly matched impedance, and no reflection.
crdrost··on US car repossessions surge as more Americans default on auto loans
I mean they hide it as best they can. Big restaurants like Applebee's you'll see "2 for $28" not priced at $28 so you can guesstimate the squeeze but otherwise you kinda have to go straight to Starbucks or McDonalds using a mobile app to order your "usual" to compare "here's what it looks like if I use DoorDash, here's what it looks like if I go myself," to find that the actual delivery fee is some $20-25 per order. Even worse, I'm pretty sure that they test algorithms to try to selectively lower this for new customers so that in the early days when you're more aware of the cost it seems like a steal.

Of course, you can arrive at the $20 just by thinking, "okay, I need someone to go do an errand for me, they'll have to drive to the restaurant, wait there for 15-20 minutes, and then bring it back... so it'll cost $15 for the hour of their time plus a few bucks of overhead for the platform plus a few bucks of messed-up-my-order insurance..."

Which gets us to 5 years from now when the DoorDash killer comes out, it'll be called Kourier or something starting with a K, and it'll start with trying to give Target a way to call up some extra trained Target employees, but they're cross-trained in packaging orders for K. One person will pick up 10 carefully-packaged K-orders, take them all to the central delivery hub, they'll get sorted into driverless cars that plot through some neighborhood some 10 stops, it'll be marketed as a real Amazon-killer and fly under DoorDash's nose -- InstaCart might balk, but DoorDash won't. Until they reveal some pizza-delivery partnership and suddenly within a year every restaurant has some K-employee working for them, whose job it is to batch orders down to the bikes that come by.

Sure, delivery times for Kourier will be 75, 80 minutes long at first. People won't mind because you pay $4 for delivery instead of $20. And Doordash/Amazon won't die, Amazon will just buy Kourier and DoorDash will focus on more rural locales.

crdrost··on Lace: A New Kind of Cellular Automata Where Links Matter
I mean even phrasing what you're trying to do there, would be a big difficult task.

Consider e.g. that Game of Life has had folks build universal Turing machines for it, and those machines can be programmed to run a Lace automaton.

crdrost··on Americans' love of billiards paved the way for synthetic plastics
Another place where you will frequently find celluloid is guitar picks. Can just slowly amass a collection for free. Especially if they're thin, flexy, especially if they've got wavy or trippy designs in the plastic, it's probably celluloid. This can be handy for survivalism -- you buy your first ferro-rod fire starter, if you're having trouble getting wood shavings to ignite, try mixing them with shavings of guitar pick and see if the explosive reaction helps. Other folks keep a jar of cotton balls coated in petroleum jelly for a similar quick-start, or egg cartons filled with sawdust and parrafin (although that's less for getting the spark to take and more for getting a log to start burning in a stove)... and of course if you don't want to just slowly accumulate unwanted guitar picks you can buy big sheets of celluloid for like 5-10 bucks.
crdrost··on Bots are getting good at mimicking engagement
That is worse. Now you have a bunch of companies wondering why their engagement is falling over a whole year, some dude's getting fired for not doing his job, etc. etc.

The correct thing to do, probably, is to just provide the new data to the customer without changing what they were already looking at. So a new widget appears on their dashboard, "52% bot traffic", they click on that, and they see their familiar line chart of "impressions over time" broken down as a stacked line chart, bottom is "human impressions over time," top is "bot impressions over time," and the percentage that they were looking at is reported either above or beneath the graph for the same time intervals. Thus calling attention to the bottom graph, "human impressions over time," and they can ask your sales people "how do I get THAT number on my normal dashboard?" and they can hem and haw about how you have to upgrade to the Extended Analytics Experience tier for us to display that info and other business nonsense...

Point is, you stimulate curiosity with loud interference rather than quietly interfering with the status quo.

crdrost··on You are the scariest monster in the woods
So the current problem with a loop like that is that LLMs in their current form are subject to fixed point theorems, which are these pieces of abstract mathematics that come back when you start to get larger than some subset of your context window and the “big matrix” of the LLM is producing outputs which repeat the inputs.

If you have ever had an llm enter one of these loops explicitly, it is infuriating. You can type all caps “STOP TALKING OR YOU WILL BE TERMINATED” and it will keep talking as if you didn't say anything. Congrats, you just hit a fixed point.

In the predecessors to LLMs, which were Markov chain matrices, this was explicit in the math. You can prove that a Markov matrix has an eigenvalue of one, it has no larger (in absolute value terms) eigenvalues because it must respect positivity, the space with eigenvalue 1 is a steady state, eigenvalue -1 reflects periodic steady oscillations in that steady state... And every other eigenvalue being |λ| < 1 decays exponentially to the steady state cluster. That “second biggest eigenvaue” determines a 1/e decay time that the Markov matrix has before the source distribution is projected into the steady state space and left there to rot.

Of course humans have this too, it appears in our thought process as a driver of depression, you keep returning to the same self-criticisms and nitpicks and poisonous narrative of your existence, and it actually steals your memories of the things that you actually did well and reinforces itself. A similar steady state is seen in grandiosity with positive thoughts. And arguably procrastination also takes this form. And of course, in the USA, we have founding fathers who accidentally created an electoral system whose fixed point is two spineless political parties demonizing each other over the issue of the day rather than actually getting anything useful done, which causes the laws to be for sale to the highest bidder.

But the point is that generally these are regarded as pathologies, if you hear a song more than three or four times you get sick of it usually. LLMs need to be deployed in ways that generate chaos, and they don't themselves seem to be able to simulate that chaos (ask them to do it and watch them succeed briefly before they fall into one of those self-repeating states about how edgy and chaotic they are supposed to try to be!).

So, it's not quite as simple as you would think; at this point people have tried a whole bunch of attempts to get llms to serve as the self-consciousnesses of other llms and eventually the self-consciousness gets into a fixed point too, needs some Doug Hofstadter “I am a strange loop” type recursive shit before you get the sort of system that has attractors, but busts out of them periodically for moments of self-consciousness too.

crdrost··on Why is everything so scalable?
I don't know too much about the performance side of RDS, but the backup model is absolutely a headache. It's at the point where I'd rather pg_dump into gz and upload to s3.
crdrost··on Abstraction, not syntax
This is what's nice about Pkl, you define a schema as a Pkl file, you define a value of that schema as a Pkl file that imports the schema, `pkl eval my file.pkl` will do the type check and output yaml for visual inspection or programmatic processing, but keeping it to one file per module means that I almost never obsessively D-R-Y my Pkl configs.

Actually that's not the biggest benefit (which is tests for schemas) but it's nice to have the “.ts” file actually log the actual config as JSON and then the app consumes it as JSON, rather than importing the .ts file and all its dependencies and having weird things like “this configuration property expects a lambda.”

crdrost··on Bell Labs Scientists Accidentally Proved the Big Bang Theory
This is kind of a strange way to use the terms, if you think about other things called theories in science.

For instance, atomic theory, heliocentric theory, quantum theory, the theory of relativity, chemical collision theory, cell theory, the germ theory of disease, the kinetic theory of gases, the theory of plate tectonics...

"Proved" a theory, is actually a way of talking about that theory "proving useful." If you dump a ton of energy into a small particle in a cyclotron, you will observe that its speed "maxes out" at the speed of light, but that this does not appear to be due to some sort of friction force or anything; the energy is still extractable in collisions. If you therefore say that cyclotrons have proven special relativity, I don't think that's an abuse of language. Yes, strictly speaking what you mean is that special relativity proves useful for explaining what happens in cyclotrons, but that's not particularly a reach.

crdrost··on Quicksort explained IKEA-style
So binary MSD radix sort is also just called "binary quicksort" by some authors; they are substantially the same algorithm. How can I explain?

If you really want to replicate the exact swaps and pivoting in the most common form of quicksort, what your fingers will actually do, looks like this.

1. Cut the to-be-sorted deck-portion in half so that you can peek at the first, last, and middle card. Choose the median and swap it to the back of the deck.

2. The deck now sits in your left hand and your right hand conceptually contains two empty stacks of cards, the one between thumb and forefinger is a stack <= to pivot, and between forefinger and ring finger is the stack > pivot.

3. You are permitted two operations: (a) deal a card > pivot from the left hand onto the back of the second stack, or (b) deal a card <= pivot from the left hand onto the back of the first stack, but to make it a conceptual swap you now have to pick the card from the top of the second stack and put it on the back of the second stack.

4. Process the whole left hand this way; at the end the pivot you selected will be at the back of the first stack in your right hand. Separate it out and recurse on the two remaining stacks.

So if you do this enough you'll start to appreciate these two things:

- "with cards I don't really need to rotate that second stack card by card whenever I add to that first stack -- that's not affecting correctness, it's just needed for array sorts to be in-place"

and similarly

- "with cards I sometimes get these really stupid starts where like the median is 10 of spades and I'm going to split this like 9-1-42, eff it I'm just going to pretend that the median was the king of clubs, that's what I needed to split the damn deck in half."

and those are the optimizations performed in the above description of quicksort.

crdrost··on Quicksort explained IKEA-style
For me the key was just application to figuring out if any cards are missing in a deck by sorting it.

Assume spades < clubs < diamonds < hearts, and ascending order for cards for all suits. Once you know the principle you can switch to US playing card order if you want.

In your first pass, divide the deck into black and red cards. Then divide black into spades and clubs. Then divide spades into <= 7 and >7. Then insertion sort the cards <= 7, then insertion sort the cards > 7, spades are now sorted. Clubs come next, divide into <= 7 and > 7, insertion sort, and combine. Split diamonds and hearts, repeat with diamonds, repeat with hearts.

“What about the pivot thing?” Well, that's because we don't know the midpoint of our set in a typical sort. So instead you can just grab a random card and then go through the deck to find all cards < that card. If you want slightly fewer passes, use median of three.

crdrost··on Solving a wooden puzzle using Haskell
I'm really surprised at the whole filtering the rotation matrices thing, to me it is like, the long side of the piece is an arrow, that arrow can be pointed in one of six directions, I can rotate in one of four directions after that, so there's 24 orientations:

    orientations = concat [
      [
        [(0,0,0), (t,0,0), (2*t,0,0), (3*t,0,0), (2*t, a, b)],
        [(0,0,0), (0,t,0), (0,2*t,0), (0,3*t,0), (a,2*t,b)],
        [(0,0,0), (0,0,t), (0,0,2*t), (0,0,3*t), (a,b,2*t)]
     ] | (a, b) <- [(1,0), (-1, 0), (0, 1), (0, -1)], t <- [1, -1]]
With translations, okay, there's 40 of those per piece and figuring out the right direction to go with those requires a cross product, sure, let's just generate 5×5×5 = 125 of them and filter out the right 40. But doing 20,000 determinants and whatever it was, 10-15 paragraphs, to filter out the right 24 orientations doesn't make as much sense to me.
crdrost··on Determination of the fifth Busy Beaver value
Like I haven't run Coq but I assume that in this particular instance, the answer is a rather trivial "yes"? You'd think about, creating this proof is a gigantic research slog and publishable result; verifying it is just looking at the notes you wrote down about what worked (this turing machine doesn't halt and here's the input and here's the repetitive sequence it generates, that turing machine always halts and here's the way we proved it...).

But taken more generally, not for this specific instance, your question is actually a Millenium Prize problem worth a million dollars.

crdrost··on Magical systems thinking
General principle 1: to make a meeting matter, make a decision. (A meeting at its most basic is kinda like a locking primitive, gets independent threads to synchronize for a short time. Think through why you need that synchrony.)

General principle 2: create focus on the critical path. (If each ticket you work on is slightly different from other tickets and no cookie-cutter solutions exist, then there is some chain of slow, annoying, winding steps, and the rest of the dependency graph doesn't really matter, just these big pains in the butt that often are linked in the dependency graph only by the fact that it's going to be one developer working on all of them and they can't work on them all simultaneously. It follows that you can only get interesting speed improvements if multiple developers are working on the same change. Note that daily stand up is an example of a meeting which does not make a decision—it could but in practice nobody uses it that way—but instead its function is to create pressure on the critical path. Often unhealthy pressure, someone was sprinting at 100% and now they are getting a little burned out, and daily stand up forces them to do something that they can report at standup lest they be honest and say that they're suffering.)

General principle 3: process helps create shared reality. (Consider two different ways to protect prod from the developers. In one way, everyone commits to main, some file or database table or configmap contains a list of features, and those features can be toggled in dev, uat, or prod. The process here is, whenever you change anything, you wrap it in a feature toggle, so that your change does not impact prod if that toggle is off. Versus, consider having three different branches, you can usually commit new features to dev, eventually we cut a release from Dev and push it to the UAT branch, cut a release from UAT to push to the prod branch. But these are separate branches because we might need to hotfix UAT or Prod. The process here can go in these two different directions, see, but one of them leads to a shared reality, this is the entirety of the code and all of the different ways that it can be configured in our production environment, and we need to carefully consider how we remove those feature toggles—versus the other one has three independent realities and nobody is considering all of the different ways that it can be configured or what is being removed, and periodically you get bugs because people didn't revert the revert—what, you didn't know that you needed to revert the revert, you always need to revert the revert. So process tends to be more lightweight if it generates one shared reality).

General principle 4: process needs to help you figure out, and keep highlighted, the “Useless Without.” (There are many nice-to-haves, in a given project. There are a lot of them that people will say are must-haves. The product must be secure, the product must be available at this website address, okay fine. But there is one business goal that the project serves, which, if that business goal is not accomplished, the whole project is useless. That is the Useless Without feature. So I worked on a shop floor system of kiosks for like 6 months once before I determined from talking to the stakeholders that the thing was actually Useless Without time tracking, and this is a sensitive issue because unionized pipefitters are understandably skittish around surveillance technology that could be used in dystopian ways. But we're going to address their needs by looking at the project only, trying to figure out how long each of the steps in building the project takes, but we still don't talk about how we're trying to make the shop floor run efficiently. But you understand every meeting I had before we had clarified this, was actively detrimental to my productivity on this task.)

crdrost··on Magical systems thinking
I like this. The author is somewhat needlessly hopeless about the prospects of changing a complex system.

Basic summary is that once you start getting more than a handful of feedback loops, the author through many examples cautions that maps of the system becomes more like physical maps—necessarily oversimplified. When you have four feedback loops under the right control of management, it's still a diagnostic aid, but you add everything in the US healthcare system, say—fuggetaboudit! And because differences at the small scale add up for long term outcomes, the map doesn't let you forecast the long term, it doesn't let you predict what to optimize, in fact, the only value that the author finds in a systems map for a sufficiently complex system, is as a rhetorical prop to show people why we need to reinvent the whole system. The author thinks this works very well, but only if the new system is grown organically, as it were, rather than imposed structurally.

The first criticism is, this complaint about being unable to change a system, is actually too amorphous and wibbly wobbly to stand. Here's what I mean: the author gives the example of the ICBM project in US military contracting as a success of the "reinvent method", but if you try to poke at that belief, it doesn't "push back" at you. Did we invent a whole new government to solve the ICBM project? I mean we invented other layers of bureaucracy—but they were embedded in the existing government and its bureaucracy. What actually happened was, a complex system existed that contained two subsystems that were, while not entirely decoupled, still operating with substantial independence. Somewhere up the chain, they both folded into the same bureaucracy with the same president, but that bureaucracy minimized a lot of its usual red tape.

This is actually the conceit of Theory of Constraints folks, although I don't usually see them being bold about it. The claim is that all of those hacks that you do in order to ship something? “Colleague gave me a 400 line diff, eh fuckitapprove, we'll do it live” ... that sort of thing? Actually, say ToC folks, that is your system running well, not poorly. The complex system is being pinned to an achievable output goal and it is being allowed to reorganize itself to achieve that goal. This is ultimately the point of the whole ToC ‘finding the bottlenecks’ jargon. “But the safeties are off and someone will get hurt,” you say. And they say somewhat unhelpfully, “That’s for the system to deal with.” Yes, the old configuration had these mechanisms to keep things safe, but you need a new system with new mechanisms. And that's precisely what you see in these new examples, there actually is top-down systems engineering, but around how do we maintain our quality standards, how do we keep the system accountable.

If the first criticism is that the “organically grow a new system to take its place” is airy-fairy, the second criticism is just that the hopelessness is unnecessarily pessimistic. Yes, complex systems with lots of feedback loops do maintain a homeostasis and revert back to that as you poke and prod them. Yes, it is really frustrating how to change one thing, you must change everything. Yes, it is doubly frustrating that systems that nominally are about providing and promoting X, turn out to provide and promote Y while actually being X-neutral (think for instance about anything which you do which ultimately just allows your manager to cover their ass, say—it is never described as a CYA, just acknowledged silently that way in hallway conversation).

But, we know complex systems that find new homeostatic equilibriums. You, reading this, probably know someone (maybe a friend, maybe a friend of a friend) who kicked drugs. You also know somebody who managed to “lose the weight and keep it off.” You know a player who became a family man, and you yourself remember instances where you were a dumb kid reliving the same shitty day over and over when you could have just done this one damn thing differently—you know it now!—and your days would have gotten steadily better and better rather than the same old rut. So you know that these inscrutably complex things do change. Sometimes it's pinning the result, like someone who drops the pounds because “I just resolved to live like my friend Derek, he agreed to take me a week through everything in his life, I wrote down what he eats for breakfast, when he hits the gym, how much does he talk with friends and family, then I forced myself to live on this schedule for a month and finally I got the hang of it.” Sometimes it's literally changing everything, “Yeah I lost the pounds because I went to live in the Netherlands and school was a 50 minute bike ride from my apartment either way and then I didn't have any friends so I joined the university's competitive ultimate frisbee team, so like my dinner most days was bought that day after practice in a 5 minute trip through the grocery—a raw bell pepper, a ball of mozzarella, maybe some bread in olive oil—I didn't have time to cook anything big.” Or sometimes it was imposed top-down but with good motivation, “yeah, I really wanted to get a role as an orphan in this musical, so I dieted and dieted with the idea of ‘I can binge once I get the part, but I have to sell scrawny orphan when auditions come round soon’ and like it sucked for two weeks but then I got used to the lifestyle and I no longer wanted to binge, funny how that worked out.”

There are so many different stories, and yes they never look like we would imagine success to look like, but being pessimistic about the existence of the solution in general because there's nothing in common about the success stories, I don't know, seems to throw the baby out with the bathwater. There is hope, it's just that when you are looking at the systems map, people get in this rut where they're looking for one thing to change, but really everything needs to change on that map, you've created a big networked dependency graph of the spaces you need to interrogate to figure out whether they are able to cope with the new way of doing things and, if not, are they going to grind their heels in and try to block the change. There's still use in it, you just need to view the whole graph holistically.

crdrost··on We all dodged a bullet
This was one of Doug Crockford's big bugaboos since The Good Parts and JSLint and Yahoo days—the idea that lexical scope aka closures give you an unprecedented ability to actually control I/O because you can say

    function main(io) {
        const result = somethingThatRequiresHttp(io.fetch);
        // ...
    }
and as long as you don't put I/O in global scope (i.e. window.fetch) but do an injection into the main entrypoint, that entrypoint gets to control what everyone else can do. I could for example do

    function main(io) {
      const result = something(readonlyFetch(onlyOurAPI(io.fetch))
    }
    function onlyOurAPI(fetch) {
      return (...args) => {
        const test = /^https:\/\/api.mydomain.example\//.exec(args[0]);
        if (test == null) {
          throw new ValueError("must only communicate with our API");
        }
        return fetch(..args);
      }
    }
    function readonlyFetch(fetch) { /* similar but allowlist only GET/HEAD methods */ }
I vaguely remember him being really passionate about "JavaScript lets you do this, we should all program in JavaScript" at the time... these days he's much more likely to say "JavaScript doesn't have any way to force you to do this and close off all the exploits from the now-leaked global scope, we should never program in JavaScript."

Shoutout to Ryan Dahl and Deno, where you write `#!/usr/bin/env deno --allow-net=api.mydomain.example` at the start of your shell script to accomplish something similar.

In my amateur programming-conlang hobby that will probably never produce anything joyful to anyone other than me, one of those programming languages has a notion of sending messages to "message-spaces" and I shamelessly steal Doug's idea -- message-spaces have handles that you can use to communicate with them, your I/O is a message sent to your main m-space containing a bunch of handles, you can then pattern-match on that message and make a new handle for a new m-space, provisioned with a pattern-matcher that only listens for, say, HTTP GET/HEAD events directed at the API, and forwards only those to the I/O handle. So then when I give this new handle to someone, they have no way of knowing that it's not fully I/O capable, requests they make to the not-API just sit there blackholed until you get an alert "there are too many unread messages in this m-space" and peek in to see why.

crdrost··on Why haven't quantum computers factored 21 yet?
Same way you go from 2 billion CPU operations per second to only ~4000 register bits (not counting ZMM SIMD registers) on a conventional CPU.

The operations all consist of saying, connect these 3 bits and do a reversible operation on them all together. Same as assembly, "add these two registers and store the sum in the first one..." You didn't need to introduce any new bits.

You only need to introduce new bits for steps that cannot be reversibly done, in assembly you get around this by being able to overwrite a register: in quantum, that requires an explicit measurement in the computational basis to figure out how you want to do stuff to zero it; zeroing a bit is not a unitary operation. But if you can encode the circuit in Toffoli gates which are perfectly reversible, you don't have to delete any bits after that encoding (but you may have to introduce extra bits to get to that encoding, like using Toffoli to build “x AND y” requires an extra z bit that effectively gets discarded at the end of the computation when everything is done and nobody cares what that bit holds, but it holds the information you would need to reverse that logical AND).

But yeah it's just number of operations that you need to run the algorithm, versus the number of registers that you need to run the algorithm, they're just two different numbers.

crdrost··on Show HN: I was curious about spherical helix, ended up making this visualization
I think this particular function was selected because it happened to be convenient to program and the visual effect was pleasant enough.

The actual "correct" thing to do would probably be to have the point maintain constant speed in 3D space like a real boat sailing on a globe, right? But that's a rather bigger lift:

    const degrees = Math.PI / 180;
    const bearing = 5 * degrees; // or it might be 85 degrees? Not sure off the top of my head
    const k = Math.tan(bearing);
    const v = 0.001 // some velocity, adjust as needed
    const phi = (t) => v*t/Math.sqrt(1 + k*k) // the sqrt is not strictly needed
    const theta = (t) => k*Math.ln(Math.tan(phi(t)/2)) // this is the annoying one haha
with outputs,

    const x = (t) => Math.sin(phi(t)) * Math.cos(theta(t))
    const y = (t) => Math.sin(phi(t)) * Math.sin(theta(t))
    const z = (t) => Math.cos(phi(t))
I doubt that they did the ln(tan(phi/2)) thing though, but it's what you get when you integrate the k d{phi} = sin{phi} d{theta} equation that you have here.
crdrost··on The Raft Consensus Algorithm (2015)
I just want to clarify that, strictly speaking, Paxos is simpler than Raft. Like Paxos is Raft plus "delete the part where the new leader has to be fully caught-up" (which causes an extra weirdness in Raft when the leader got majority adoption of a new log entry but failed to commit it due to network partition) plus "delete the part where the leader election elects the leader, you can do that and it's called multi-paxos, but if your use case isn't big enough you can instead just elect the next log entry, but it doesn't have to have the form "this is our new leader, all hail" (but in practice this is what everyone does).

I think the Raft paper is more approachable for newcomers, but if you are finding Paxos hard to explain and Raft easy to explain, just use the Raft lingo to explain Paxos.

crdrost··on Why Elixir? Common misconceptions
I feel like the other comments I see here, are not expressing the deeper point, and you're asking to really understand something, so that's what you care about? So I'm sorry to pile on when you've got like a dozen good answers, but.

Let It Crash refers to a sort of middle ground between returning an error code and throwing an exception. It does not directly address your customer's need, and you are right that they are facing a bug.

So if you were to use Golang with Let It Crash ethos, say, you would write a lot of functions with the same template: they take an ID and a channel, they defer a call to recover from panics, and on panic or success they send a {pid int, success bool, error interface {}} to the channel -- and these are always ever run as goroutines.

Because this is how you write everything, you have some goroutines that supervise other goroutines. For example, auto-restart this other goroutine, with exponential backoff. But also the default is to panic every error rather than endless "if err != nil return nil, err" statements. You trust that you are always in the middle of such a supervisor tree and someone has already thought about what to do to handle uncaught errors. Because supervision trees is just the style of program that you write. Say you lose your connection to the database, it goes down for maintenance or something. Well the connection pool for the database was a separate go routine thread in your application, that thread is now in CrashLoopBackoff. But your application doesn't crash. Say it powers an HTTP server, while the database is down, it responds to any requests that do not use the database just fine, and returns HTTP 500 on all the requests that do use the database. Why? Because your HTTP library, allocates a new goroutine for every request it handles, and when those panic it by default doesn't retry and closes the connection with HTTP 500. Similarly for your broken codepath, it 500s the particular requests that x.(X) something that can't be asserted as an X, we log the error, but all other requests are peachy keen, we didn't panic the whole server.

Now that is different from the first thing that your parent commenter said to you, which is that the default idiom is to do something like this:

    type Message {
        MessageType string
        Args interface{}
        Caller chan<- Message
    }
    // ...
    msg := <-myMailbox
    switclMessageType {
    case "allocate":
      toAllocate := args.(int)
      if allocated[toAllocate 
        msg.Caller <- Message{"fail", fmt.Errorf(...), my mailbox}
      } else {
        // Save this somewhere, then
        msg.Caller <- Message{"ok", , my mailbox}
      }
    }
With a bit of discipline, this emulates Haskell algebraic data types which can give you a sort of runtime guarantee that bad code looks bad (imagine switching on an enum `case TypeFoo`: foo := arg.(Foo)`, if you put something wrong in there it is very easy to spot during code review because it's a very formulaic format)

So the idea is that your type assertions don't crash the program, and they are usually correct because you send everything like a sum type.

crdrost··on Long Covid destroys teenage lungs in ways doctors never saw
We still can take it more seriously!

Here's a PDF handout from 2023 for handing to hospital admins, https://www.nerode.org/clean-air/medical%20clean%20air%20rel... . The same statistics can probably be looked up for children acquiring covid at school, because like where else do they get it. $100 HEPAs in every classroom, $40 reusable p100 masks for every teacher, ask parents to voluntarily mask their kids.

Just share stories. You see [1], go to your social media and share it, “she got COVID like 3 or 4 times and it seems to have caused chronic kidney disease, even with vaccines reducing the rate of straight up death, we need get this thing under control otherwise our generation's not going to live to see 80. Each time you get it there is another small chance of long covid, another rolling the dice hoping for no snake eyes. Masking is just saying you want to roll the dice fewer times.”

Organize or join a covid slack channel at work, there are other groups like https://publichealthactionnetwork.org/ , if BTS Army can connect over K-pop we can connect over wanting to protect others.

1. https://x.com/HollyMars2/status/1936235382816784443?t=A4RaLq...

← PreviousPage 2 of 26Next →