> if AI replaces work wholesale right now billions of people will die before society is reshaped accordingly.
Don't worry, the economists will slap the label "natural readjustment of labour supply levels" on this phenomenon, and it will make everything morally better.
Edit: in fact, we have historic precedents in e.g. Indian famines and how the British administrations talked about them and handled them [0][1]. Ah, malthusianism and undisguised racism, what a mixture. Of course, nobody counts those as part of "the millions of victims of Capitalism".
Reminds me of a review (written somewhere in the early 60s, I believe) by some Soviet sci-fi writer of Hamilton's Star Kings (1949) and the Western sci-fi in general; to paraphrase, "it's astonishing that those writers would set their decorations thousands years in the future, with wildly imaginative technological advances and inventions, yet when they come to the social systems, all they can imagine is either the feudal order of the past, or the modern style of capitalism".
But everything after headers can (almost) be a blob. Just copy buffers while taking care to track CRLF and look if what follows is a space. In fact, you have to do it anyhow, because line-folding is allowed in headers as well! And this "chunking long lines" technique has been around since the 70s, when people started writing parsers on top of hand-crafted buffered I/O.
I am willing to bet the whole xAI/SpaceX merger is simply a ploy by Musk to evade releasing accurate historical information about SpaceX's finances. How much did it actually cost SpaceX to launch a kilogram of payload into space each year? How much is NASA actually donating them, per each year?
I mean, I still remember promises of $1000-per-kg for space launches, and how e.g. Gigafactory will produce half of the world battery supply, and other non-scientific fiction peddled by Musk. Remember when SpaceX suggested in 2019 that the US Army could use its Starship rockets to transport troops and supplies across the planet in minutes? I do. By the way, have they finished testing Starship yet, is it ready?
And having a CPU with "128-by-64" or "64-by-32" division instruction (such as x86/x64) simplifies the algorithm even further.
Inputs: uint[128] N, uint[128] D
Outputs: uint[128] Q, uint[128] R
such that Q ≤ N, R < D, and N = Q * D + R
Uses: (uint[64] quot, uint[64] rem) hw_divmod(uint[128] dividend, uint[64] divisor)
if D.high = 0:
# long division; quotient can be 128-bit wide, but remainder will fit in 64 bits
uint[192] N' := N ≪ lzcnt(D.low)
uint[64] D' := D ≪ lzcnt(D.low)
uint[64] Q', uint[64] R' := hw_divmod(N'.high ≪ 64 + N'.mid, D')
uint[64] Q'', uint[64] R'' := hw_divmod(R' ≪ 64 + N'.low, D')
Q := Q' ≪ 64 + Q''
R := R'' ≫ lzcnt(D.low)
else:
# Quotient will fit in 64 bits, but remainder could be 128-bits wide
uint[192] N' := N ≪ lzcnt(D.high)
uint[128] D' := D ≪ lzcnt(D.high)
uint[64] Q', uint[64] R' := hw_divmod(N'.high ≪ 64 + N'.mid, D'.high)
uint[128] R'' := R' ≪ 64 + N'.low
uint[128] T := Q' * D'.low
if R'' < T:
Q := Q' - 1
R := D' + R'' - T
else:
Q := Q'
R := R'' - T
R := R ≫ lzcnt(D.high)
It's pseudocode. A mix of Python's block structure, C's style of variable introduction, and Pascal's use of ":=" for assignment and "=" for equality. Oh, and assigning to output variables instead of explicit return is from Go, although the tradition is much older, of course.
As for using "'" in variable names, can't recall from the top of my head what language it's from (I don't think it's Lisp), but something does that.
Nice, that's what i noticed; I rather like its clean structure.
But since it was put together by you/not-you, does it have a name and is it used as a Specification/IR/DSL language somewhere (since you gave the algorithm in it) ?
You are right. Not sure how I missed/forgot that. In fact, I think the entire reason I was reminded of the algorithm was because I saw the words "3 multiplications" in the article in the first place. Perhaps I need more coffee...
> On division: There is no neat codegen for division.
Wait, what? I'm fairly certain that you can do a 128-bit by 128-bit division using a x64's 128-bit by 64-bit division instruction that gives you only 64-bit quotient and remainder. The trick is to pre-multiply both dividend and divisor by a large enough power of 2 so that the "partial" quotient and remainders that the hardware instruction would need to produce will fit into 64 bits. On the whole, IIRC you need either 1 or 2 division instructions, depending on how large the divisor is (if it's too small, you need two divisions).
This. Quite a claim to provide insight into an 128bit type implementation, then sparing out the only non-trivial case for division/remainder. Not to mention interface design around C++ type promotion rules which is essential if this is supposed to be a natural extension.
Don't worry, the economists will slap the label "natural readjustment of labour supply levels" on this phenomenon, and it will make everything morally better.
Edit: in fact, we have historic precedents in e.g. Indian famines and how the British administrations talked about them and handled them [0][1]. Ah, malthusianism and undisguised racism, what a mixture. Of course, nobody counts those as part of "the millions of victims of Capitalism".
[0] Rune Møller Stahl, "The Economics of Starvation: Laissez-Faire Ideology and Famine in Colonial India": https://www.researchgate.net/publication/304189843_The_Econo...
[1] Jayant Chandel, "Political Economy of Famines in the British Empire: An Analysis of the Great Famines in India from 1876–1879" (PDF): https://www.journalofpoliticalscience.com/uploads/archives/8...
reply