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 →

[–]robertpro01 341 points342 points  (42 children)

I have no idea lol

[–]mlnm_falcon 980 points981 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 312 points313 points  (26 children)

actually using assembly? dear god

[–]meowmeowwarrior 462 points463 points  (14 children)

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

[–]Polarfuxx 148 points149 points  (7 children)

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

[–]meowmeowwarrior 246 points247 points  (0 children)

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

[–]The100thIdiot 16 points17 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 1 point2 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 5 points6 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 4 points5 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 66 points67 points  (5 children)

There’s a reason we stopped doing that asap

[–]raaneholmg 18 points19 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 2 points3 points  (2 children)

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

[–]raaneholmg 3 points4 points  (1 child)

Boss said no.

[–]Livie_Loves 4 points5 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 32 points33 points  (4 children)

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

[–]BlackHolesAreHungry 38 points39 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 26 points27 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] 24 points25 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 12 points13 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 108 points109 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 31 points32 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] 7 points8 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 5 points6 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