My shoddy ASCII art about writing data to disk was surprisingly popular, so I finished off an old set of notes talking more comprehensively about durably writing data to disk and added a better version of the diagram.
https://t.co/yc2cBScfHZ
Does anyone have a really respectable list of books leaders in tech (eng, product; managers and high level ICs) should read?
e.g. Peopleware, Manager's Path, My Years with General Motors, Mythical Man Month, Invisible Women, Toyota Production System, etc.
I would love to hear stories from senior+ engineers who pushed fuck ups to prod to know I’m not crazy for feeling some type of way to be told my code quality is poor due to code pushed to prod that I quickly fixed when I found the issues . Just wanna know if this is something common . Also PR requires 2 approvals.
I've worked with superconductors for the better part of a decade now in different contexts, from STM condensed matter labs, to particle accelerators, and now fusion.
Time for a deep dive on what exactly this miracle-technology unlocks for us a species: 🧵
LK-99 Endgame: What Happens Next & Market Size
If LK-99 is a room-temperature ambient-pressure superconductor, there are three distinct possibilities depending on its eventual engineering properties.
Here is a straightforward explanation of each scenario and estimated total market sizes in ARR:
The two limits on superconductor performance are:
- How much current it can carry
- How much magnetic field it can withstand
If either of these limits are exceeded, superconductors stop working. The scenarios are high/low field and high/low current, but you can't really get high-field without high-current, so only three scenarios
Scenario 1: Low-field, low-current ~$1.5 trn:
LK-99 saturates at relatively low fields, like 0.3T, and relatively low current densities, of ~1 amp / mm^2. It works in delicate electronics, small packages, at high efficiencies, with extremely high sensitivity.
It revolutionizes the following industries:
- Telecom hardware $650 bn; Cellphones $450 bn; Electronic Sensors $200bn; Satellites $70bn; GPUs $40bn; CPUs $20bn; Antennas $20bn.
Scenario 2: Low-field, high-current ~ $2 trn:
LK-99 can carry large current densities, on the order of >1000 amps / mm^2, but can't stand strong magnetic fields. It gains relevance in power transmission, switches, relays, and larger electrical equipment.
It revolutionizes the following industries:
Power transmission $320 bn; Wires + cables $200bn; Switches & Relays ~$ 25 bn and many others.
Scenario 3: High-field, high-current ~ $4.5 trn:
LK-99 can operate in high fields of several Tesla and high currents of >1000 amps / mm^2. It revolutionizes fundamental industries by replacing motors, generators, transportation equipment, and unlocks new energy sources like fusion.
It revolutionizes the following industries:
Power generation $1.8 trn; Electric Motors $300 bn; Rail freight $250 bn; Energy Storage $200 bn
~~~~
Some important considerations:
- "The totals don't add up" - If something works at high field, it works at low-field, and same for current. Therefore Scenario 1 is the base-case and adds to the bottom line of both other scenarios; it places the least engineering requirements on the material. All numbers for total market sizes are estimates found online in popular market reports for ~2022.
- To incorporate this material into micro-electronics means re-thinking the extremely-mature CMOS 300mm silicon wafer fabrication process, a process that would take a decade if not more to get right.
- A final consideration is the mechanical strain the material can withstand, which also affects the current and field tolerances of existing superconductors. Bulk deformations of the crystal lattice can disrupt superconducting properties - this issue has over-time been improved upon in modern high-temperature superconductors but is still present, and may limit applications in the long-run.
- Our current generation of YCBO-based high-temperature superconductors started out as low-field, low-current, highly strain-sensitive, and over 30+ years of engineering development, these now carry >1000 amps/mm^2 in fields as high as 10T (although these numbers trade off against each other). What this means is, with time, engineering, patience, and concerted effort, if TK-99 is a superconductor then Scenario #3 is highly likely within 10-20 years.
~~~~
Conservative estimate:
Current conservative estimates by an MIT professor put the probability of LK-99 being "it" at 5%.
Assuming a long-term achievement of Scenario 3, this gives an expectation value of a $225 billion annual market.
~~~~
Caveat: LK-99 is not yet confirmed to be a superconductor but has several suggestive corroborations from other experimentalists and simulations. I am reserving judgement until results are confirmed by a Department of Energy National Lab in the USA or a similarly regarded institution.
As a functional programmer interested in performance, I've long been troubled by the amount of garbage that functional programming generates.
Every time we want to apply a modification to a structure, we have to copy the structure (sharing as much substructure as possible), and apply the modification to the part we are changing.
Yet, the supermajority of times we copy a structure (for purposes of applying a modification), we do not utilize the old structure. We throw it away immediately, which results in garbage collection working overtime.
Why does functional programming insist on applying modifications through copying?
Well, partly, that's just because what it means to do "functional programming": functions always produce the same output from the same input, which implies no mutation.
More practically speaking, however, immutable data makes code maintenance easier. Like many techniques in FP, immutable data "inverts control".
In ordinary procedural programming, if you hand off some `Person` object to another function, it can choose to modify that, or not. As a result, callees have control. The caller loses control.
In functional programming, if you hand off a `Person` object to another function, it cannot do anything, except read its contents, and use its contents to produce a (deterministic) output.
Inversion of control supports local reasoning and local testing, which help improve code quality and provide developers confidence that changes are correct (because their impact is limited and the code is better understood). Moreover, immutable data is really a great fit for concurrent programming, because it works well with atomics and you don't have to worry (nearly as much) about races and clobbering.
Is there a way to have our cake and eat it, too? A way to achieve the effect of immutable data, but without the performance penalty?
In essence, what you want is something like this:
person.withAge(32).withName("John")
where you would execute these changes mutably, knowing that the previous 2 instances of Person would never be used.
As you can imagine, it's really hard to do this in practice in languages like Scala. Though there are places where you can make it happen.
In ZIO Chunk, there is a clever optimization that pre-allocates a mutable array and stores it inside a chunk. If you append, then the mutable array is filled with new values. From the outside, however, everything is purely functional: if you try to reuse an old chunk, and append a value to that, then the conflict will be detected, and a new mutable array allocated.
This is possible to do with appending an element (with some effort), because when you append an element, the old elements are still there, which allows the structure sharing necessary to maintain referential transparency.
More generally, can we use a sufficiently powerful static type system to "cheat" and reuse "old memory" for a copy, when we know the old version of the structure will never be used again?
The answer is a resounding yes, and it turns out, that Rust's support for affine types is exactly what you need to implement this optimization!
In Rust, you can have methods like `withAge` or `withName` consume the original value, preventing it from being used again:
fn withName(mut self, newName: String) -> Person {
https://t.co/NT9B7R8Vmq = newName;
self
}
This allows you to expose what is, for all intent and purposes, a purely functional API, but with zero copying: the old structure is reused for the modification, but with the type system guaranteeing it is impossible to reuse the old value (which is something that almost never happens anyway, in practice).
Now, it turns out that, immutable data is not the only way to obtain benefits of inversion of control. I'll talk more about that in a future post. For now, it's just really interesting to see that affine types let you do things which are impossible in functional programming languages!
One of the most common mistakes I see from subscription apps?
Making the free product ~too~ good.
Many founders say they'll change the paywall to optimize conversion later on, but that’s hard to do. Here’s why ⬇️
My mind is blown 🤯
In a Dockerfile you can copy things from an image in the registry
It totally makes sense considering in multi-stage build you reference local layers but I never imaged using it this way
For copying executables etc is fantastic