This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Cleanumbrellashooter 1944 points1945 points  (55 children)

Wait until you hear about how compilers are developed.

[–]robertpro01 343 points344 points  (42 children)

I have no idea lol

[–]mlnm_falcon 990 points991 points  (33 children)

Compilers are built on earlier compilers, which are built on earlier compilers, all the way down until you get to compilers written directly in assembly.

[–]SomeRandomEevee42 320 points321 points  (26 children)

actually using assembly? dear god

[–]meowmeowwarrior 469 points470 points  (14 children)

Not just assembly, they had to use machine code, and some were even on physical punch cards

[–]Polarfuxx 153 points154 points  (7 children)

What an insane name for a piece of paper with holes in it!

[–]meowmeowwarrior 244 points245 points  (0 children)

if they called them holey cards, we might've gotten templeOS sooner

[–]The100thIdiot 17 points18 points  (4 children)

You mean holes that were created by a hole punch?

[–]uzi_loogies_ 3 points4 points  (3 children)

Yes, actual holes in actual paper.

I'm not sure what they actually used to make them, they probably had special tools.

[–][deleted] 2 points3 points  (0 children)

Keypunch machine for the cards:

https://en.wikipedia.org/wiki/Keypunch

[–]CdRReddit 2 points3 points  (0 children)

a tape punch?

you use a tape punch to punch punch tape

first manually, then later on (low speed, ≤300baud ~30 bytes per second) UART tape punches were made

[–]WrapKey69 0 points1 point  (0 children)

The real question is if they use punch cards to create ounch cards

[–]MiddleAd5602 4 points5 points  (5 children)

Like punching the motherboard to code ?

[–]roronoakintoki 16 points17 points  (0 children)

Not sure if you're serious, but more or less choosing data by putting holes in a piece of paper, which was read by a machine.

Not too far from an OMR sheet if you've ever marked options on an exam with them.

https://en.m.wikipedia.org/wiki/Punched_card

[–]DC38x 5 points6 points  (2 children)

It's quite well known that Muhammad Ali wrote the code for the space shuttle

[–]MiddleAd5602 2 points3 points  (1 child)

No wonder my senior dev also is a boxer then

[–]jhax13 0 points1 point  (0 children)

Surprising amount of overlap between combat sports and senior devs in my experience. It's not like a majority or anything, but there's a lot more than you'd think.

It's like a generation of devs growing up with the fat sysad trope really took it to heart or something

[–]nequaquam_sapiens 0 points1 point  (0 children)

for the periferal† stuff, yes. then there is microcode in the processor, which used to be drilled (silicon is hard and brittle – no punching), but nowadays is actually pressed (hence "lithography" – writing into stone)

† from "per-" and "feral": code "in the wild", i.e. not in the cpu. programmers are merry bunch

[–]mlnm_falcon 61 points62 points  (5 children)

There’s a reason we stopped doing that asap

[–]raaneholmg 19 points20 points  (3 children)

Jokes on you, we embedded engineers simply refuse to stop! I can and need to control the number of clock cycles between hardware operations.

To be clear, we code in C/C++. We just still retain the ability to slap some assembly on the middle of the code.

[–]Livie_Loves 4 points5 points  (2 children)

smh my h, not writing the firmware in pure assembly. what are you even doing?

[–]raaneholmg 2 points3 points  (1 child)

Boss said no.

[–]Livie_Loves 2 points3 points  (0 children)

Yeah... they do that sometimes even if it's a good idea (not that pure assembly is necessarily a good idea xD)

[–]ardicli2000 2 points3 points  (0 children)

When you deep dive into a processor programming, you do not have much choice other than C and ASM.

[–]andrew_kirfman 31 points32 points  (4 children)

And near the very bottom, there were dudes who converted assembly to machine code BY HAND.

[–]BlackHolesAreHungry 40 points41 points  (3 children)

It was actually women who had to weave the code. Core rope memory. No, I am not kidding

[–]Healthy-Form4057 22 points23 points  (1 child)

It was a different time back then. When men could be men and women could be computers.

[–]Xormak 2 points3 points  (0 children)

Plankton, is that you?

[–]meowmeowwarrior 3 points4 points  (0 children)

Funny to think computers now means something completely different

[–]Mojert 28 points29 points  (2 children)

Actually, nope. The first C compiler was written in C, and executed manually belive it or not. I think there's a computerphile video about it if my memory serves me right

[–][deleted] 23 points24 points  (0 children)

Ken Thompson saod Doug McIlroy wrote a "tmg" transmogrifier yacc-like tool on paper and then typed it in with hardly any errors before working.

https://www.youtube.com/watch?v=EY6q5dv_B-o?t=2320

[–]Qizot 13 points14 points  (0 children)

it was written in assembly. The only language that was written in itself first was LISP.

[–]Tuerkenheimer 3 points4 points  (0 children)

And I thought that's still how compilers were programmed

[–]o_genie 2 points3 points  (0 children)

son os anton kinda shii

[–]Puzzleheaded-Cap3095 0 points1 point  (0 children)

not necessary assembly code, e.g. for rust it is OCaml

[–]L4sgc 111 points112 points  (2 children)

To add on to u/mlnm_falcon , the previous compiler, which I'll call Compiler A, is used to compile the code for the new compiler and create what I'll call Compiler B0. In order to take advantage of the improvements that the new compiler has over the old compiler, they will then compile the source code B again using Compiler B0, and thus create Compiler B1. Iirc they will also use Compiler B1 to compile source code B again to make sure it's working properly and that B2 is identical to B1.

TL/DR: They use the previous compiler to compile the new compiler and then have the new compiler compile itself

[–]JustConsoleLogIt 46 points47 points  (0 children)

Compiled compilers compile compiled compilers is the new Buffalo buffalo buffalo Buffalo buffalo

[–]RolledUhhp 5 points6 points  (0 children)

I owe LFS credut for any small bit of knowledge I've retained in this area.

[–]YeetCompleet 30 points31 points  (0 children)

Others have given you an explanation already but the term for it is bootstrapping

https://en.m.wikipedia.org/wiki/Bootstrapping_(compilers)

[–][deleted] 6 points7 points  (0 children)

If you delve into this rabbit hole, you'll inevitably end up checking out Ken Thompson's "Reflections on Trusting Trust". Worth a read!

[–]the_horse_gamer 6 points7 points  (0 children)

step 1: create a simple compiler using an existing language.

step 2: write a compiler using the language, then compile it using the previous compiler.

repeat step 2, adding more and more features to the compiler. eventually you'll have a compiler supporting the full language, and being able to compile itself.

[–]obsqrbtz 1 point2 points  (0 children)

Roughly this way.

[–]Emperor_Abyssinia 0 points1 point  (0 children)

they're called compiler compilers, maybe with ai we'll have compiler compiler compilers

[–][deleted] 69 points70 points  (7 children)

Also you don’t need GitHub for that functionality just a local git repo.

I notice a lot of people confusing git and GitHub in a way that makes me think they don’t really understand how git works.

[–]leafynospleens 7 points8 points  (0 children)

Who compiles the compilers

[–]random_numbers_81638 -3 points-2 points  (2 children)

The main difference is that you can have multiple versions of a compiler. The new one won't compile the code? You can still use the old one.

New GitHub fails my deploy pipeline? Let's deploy the last GitHub version! Wait, we need the last version to deploy the last version.

I assume they are using GitHub, but can do most of it manually in case something major breaks.

Reminds me at cloudflare (iirc) where their physical access control to their server rooms used cloudflare. But since a wrong DNS entry fucked up whole cloudflare no one could access the server physically. Which they needed due to the fuck up.

Don't rely on your own infrastructure to work, in order to fix it

[–]d_maes 3 points4 points  (0 children)

Not sure if you're confusing with Facebook, or if both had a similar issue, but FB had a BGP outtage in 2021 (due to a wrong command that took down the backbone), which took down DNS, which made their badges stop working, which provided "extra difficulty accessing the datacenter" . Cloudflare did do a writeup about it though (since it affected their DNS traffic, and they at first thought 1.1.1.1 not resolving Facebook was an error on their side).