I figured that articles like folklore are like an amusing movie file (say someone chopping a skin of a watermelon) that's repeatedly being passed around reddit.
How long would a quicksort (say, of integers) be in 68000 assembly? Maybe 20 lines? My 68000 isn't very good. The real advantage of writing it in Haskell is that it's automatically applicable to anything that's Ord, that is, ordered.
This is great, thanks! I was thinking it could be much simpler, but it looks like I was mistaken.
I'm trying to code up a version in ARM assembly to compare, and it looks like it'll be about 30 lines; when I get that working I can compare to see why the difference. In some ways the 68000 is more expressive than ARM, like being able to reference memory directly, even twice in one instruction.
(Am I misunderstanding this, or is this the source code to Apple System 7.1? There seems to have been a mailing list about this codebase from 02018 to 02021: https://lists.ucc.gu.uwa.edu.au/pipermail/cdg5/)
Here's a quicksort in 20 lines of ARM assembly, sorting an array of integers in memory starting at [r0] and ending at [r1] (i.e., inclusive bounds):
quirks: push {r4, r5, r6, lr}
4: subs r2, r0, r1
bhs 3f @ Exit if carry set (no borrow).
mov r5, r1 @ This frees up r1 as a temp.
mov r6, r0
ldr r3, [r5]
1: ldr r4, [r5, r2]
cmp r4, r3 @ Is element at r2 ≤ pivot?
bgt 2f @ If so, swap elements at r2 and r6,
ldr r1, [r6] @ Load previously first element in > side,
str r4, [r6], #4 @ and postincrement r6,
str r1, [r5, r2] @ and save previous element at end of > side.
2: adds r2, #4 @ Increment offset. Reached the end (>0)?
ble 1b @ Loop if ≤ 0 (either N && !V && !C, or !N && V && C)
subs r1, r6, #8
bl quirks @ Recursively sort left partition.
mov r0, r6
mov r1, r5
b 4b @ Tail-recursively sort right partition.
3: pop {r4, r5, r6, pc}
> Am I misunderstanding this, or is this the source code to Apple System 7.1?
More or less, yes. It only encompasses the system (i.e. not applications like the Finder) and isn't entirely complete, but it's still a great window into the world of Apple pre-OS X.
This mailing list was for a set of projects which focused on taking this code dump (among other things) and making it compile, ideally to reproduce released binaries.
"Seems like a waste of effort" in a vacuum yes, but
1 - GNU utilities is ancient crufty #IFDEF'd C that's been in maintenance mode for decades. You want code to handle quirks of Tru64 and Ultrix? You got it.
2 - Waving your hands around 'the community will take care of it' is magical thinking. C developers don't grow on trees. C tooling is kinda weird and doesn't resemble anything modern - good luck finding enough VOLUNTEER C developers to make your goals happen.
you're just an end user, you don't have to maintain the suite.
In OSS every hour of volunteer time is precious Manna from heaven, flavored with unicorn tears. So any way to remove Toil and introduce automation is gold.
Rust's strict compiler and an appropriate test suite guarantees a level of correctness far beyond C. There's less onus on the reviewer to ensure everything still works as expected when reviewing a pull request.
The President who ordered the Kent State National Guard deployment won his re-election campaign in a massive landslide - 49 out of 50 states went for Nixon. I suspect that people that lived through it remembered Kent State very differently at the time than we do (or maybe than they do now).
The thing about Kent State wasn't that four people were killed. The thing about Kent State was that the US military killed four people - four US civilians.
The people of the US may be inured to violence. They aren't inured to violence from their own military, though.
Kent State is a classic case of historical revision. The majority of Americans supported the National Guard’s actions, in part because they were in valid fear for their lives after the rioters started throwing bricks at their heads.
Revisionism you say? Most accounts say that before the National Guard was involved, most of what was thrown was beer bottles at police cars.
The Wikipedia article on the shootings doesn't mention the word "brick" once. It also says:
"While on the practice field, the guardsmen generally faced the parking lot, about 100 yards (91 m) away. At one point, the guardsmen formed a loose huddle and appeared to be talking to one another. They had cleared the protesters from the Commons area, and many students had left.
Some students who had retreated beyond the practice field fence obtained rocks and possibly other objects with which they again began pelting the guardsmen. The number of rock throwers is unknown, with estimates of 10–50 throwers. According to an FBI assessment, rock-throwing peaked at this point. Tear gas was again fired at crowds at multiple locations."
So there were rocks being thrown at National Guard members who were ALREADY teargassing the boxed in group AND had knelt and aimed weapons.
Somehow you extrapolate that to average people going about their day and randomly taking a brick to the head... huh.
So even by your account, the rioting students were attacking the guardsmen by pelting them with rocks, and the guardsmen opened fire to defend themselves from this attack. That's a clear instance of justifiable force.
there were crematoriums falling apart because of constant use. Morgues overflowing with coffins.
Three of my direct coworkers died from covid. One guy didn't get his sense of taste back for a year.
People just gasping to death in their bedrooms waiting for things to improve and only going to the overloaded ER when it's too late.
I'm an asthmatic, I've been close to that feeling where sub 90% oxygen saturation made me feel like death. Anything like 80% your lungs start to fail. You're dead in a hurry.
I'm kind of surprised that after all these years TF2 and Source are still separate entities. Like, is there any TF2-only code in Source that only runs if TF2 is the current mod?
The Source engine powers more than just Team Fortress 2 so of course they'd be separate.
There might be some Team Fortress 2-specific stuff in the engine (certainly the GoldSource engine tweaks a couple of things based on which game is running) but I doubt it - the Source engine relies a lot more on expecting game code to implement a bunch of interfaces.
```
> cargo clean && time cargo build
cargo build 713.80s user 91.57s system 706% cpu 1:53.97 total
> cargo clean && time cargo build --release
cargo build --release 1619.53s user 142.65s system 354% cpu 8:17.05 total
```
this is without incremental compilation. And it's not like you have to babysit a release build if you have a CI/CD system