721 karma · joined October 10, 2017
https://www.aarthiandsriram.com/p/our-dream-conversation-and...
``` Turbo Pascal 2 and Hash Tables
Sriram: I think there is some, we're going to talk later about things like GitHub co-pilot, we're dealing with different kinds of code reuse, but I do think there's a little bit of romance in the, for example, I idol you and folks like John Carmack. John Carmack noodling away and trying to make sure every instruction and memory access is aligned on some cash line. The amazing thing is, even today, if you look at AI at the heart of it, you have matrix multiplication and doing things with floating point numbers. Some of these things really tend to matter, which on the theme of optimization, tell us a story of Turbo Pascal 2 and you discovering hash tables because it's legendary.
Anders: [laughs] It is a funny story. You have to remember here that I am self-taught in the art of writing compilers. Now, I have since discovered and read a lot of the literature, but at the time, I was just coding away and doing it the best way I knew how. When you create a compiler, one of the things you have to create is simple tables, or they're not necessarily tables. They could be linked list, they could be whatever, but you have to look up names. When you're trying to compile a code that tries to assign one to X, well, you have to figure out where is X? What memory address have I associated with X? You have to look it up the declaration of X.
In Turbo Pascal 1.0, the first version of Turbo Pascal, all of the variable declarations were just kept on a linked list because that much I knew, but of course, searching linked lists is not particularly efficient when they get large. For really large functions, that would just take an awfully long time. Then, well, maybe you could try first go by first letter, and then have 26 linked lists or whatever, and that could help a little bit. Then I remember reading the literature about these things called hash tables actually in this book by Niklaus Wirth, Algorithms +, what is it? Yes, Algorithms + Data Structures = Programs.
A great book. He explains hash tables and I go, "Oh my God, that's amazing. I got to go try this." I went and implemented it and boom, the compiler went twice as fast. There's Turbo Pascal version 2.0.
[laughter]
Aarthi: Awesome.
Anders: There's a good reason to sell upgrades. ```
Do you really need a proper parser to sell 1.0? A literal compiler project did not fail due to the lack of a "proper" parser (though it can be argued that the lookup table is after the parsing stage; obviously there was not a strong distinction in the Turbo Pascal implementation between tokenization and compilation).
Probably the same for my clothes vs. the washer.
If it takes 10 minutes to boot my computer, log into 10 SSOs with two factor, and install 57 updates, at what point do I start keeping graph paper and a desktop calculator to track my sales instead of using excel?
With buggy ship-it-now software you have a known bounded risk - bugs will occur in some cases but the software will ship and the bugs can be fixed because it’s simple.
With prematurely architected software the risk is unbounded - the project may get bogged down indefinitely in its own complexity without shipping.
The inverse extreme can also be a problem, of course A project that is maintained for a long time on the naive implementation will also become unmaintainable. However, this will be due to _known_ architecture problems encountered during maintenance. These problems can be addressed in a relatively bounded amount of time. They are also quantifiable and thus explainable to management.
https://www.nytimes.com/2021/04/12/nyregion/indian-point-pow...
For context, the South Fork wind farm in this article is slated to produce 130MW
Indian point produced 7GW.
> That would require greater than 50% taxation, which isn’t realistic at all in the United States.
My point is that higher than 50% total taxation on a large single-year income (considering local and corporate taxes) is entirely possible in the United States, though it may be less in some states than other. I’m not saying that the estimate is correct as the Tarn Brothers don’t live in California. But if they took the income to a corporation, paid corporate income tax, and then took the whole income or a large part of it as dividends in a high tax state, then >50% is quite possible. On a pass-through entity, close to 50% is the standard and unavoidable in high tax states.
The upper middle class (i.e most software professionals on this site) and tech billionaires are having a shit year as tech stocks crash and weigh on the market. Don’t discount that you’re in an info bubble. The worst info bubbles are ones that affect the journalism industry and extremely online communities like the ones frequented by software engineers.