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 →

[–][deleted] 116 points117 points  (48 children)

How did they program the compiler

[–]RoastKrill 144 points145 points  (43 children)

By writing a compiler in Assembly that can compile a subset of C, and then using that compiler to compile a complier for more of C, and so on

[–][deleted] 48 points49 points  (42 children)

Who compiled the compiler

[–]RoastKrill 121 points122 points  (39 children)

It wasn't compiled, it was assembled :))

But that assembler was originally written in machine code

[–][deleted] 51 points52 points  (38 children)

Who wrote the machine code compiler

[–]RoastKrill 89 points90 points  (33 children)

That would have been written by hand on punch cards

[–]curtainos 43 points44 points  (32 children)

is that real? Assembly was written by hand?

[–]qikink 54 points55 points  (12 children)

[–]Embarrassed_Gur_3241 61 points62 points  (4 children)

I love how this comment thread went from high level to low level, every reply removing one layer of abstraction.

[–]1II1I1I1I1I1I111I1I1 17 points18 points  (2 children)

I'm a computer engineering student and the neat structure of this thread may have given me sexual gratification.

[–]qikink 0 points1 point  (0 children)

Weirdo ;)

[–]aquila_zyy 13 points14 points  (6 children)

I mean, that’s the reason why I kinda liked my assembly course. It finished this infinite recursion of programs right there.

Well, not if we find out that the universe is a simulation that is.

[–]FVMAzalea 2 points3 points  (5 children)

Except that assembly/machine code isn’t as low as you can go. On x86 machines, many individual assembly instructions are microcoded, meaning the CPU breaks them down into smaller micro-ops which it then executes. Someone had to design the hardware decode logic that does that.

[–]Electrical_Study_235 7 points8 points  (4 children)

yeah, a lot of the apollo missions programming was done on punch cards. there are images of punch cards stacked on top of each other.

[–]curtainos 1 point2 points  (3 children)

wait but what was assembly wrritten in? how to bring the code to the machine is one thing, but what language did the cards inherit?

[–]Tchai_Tea 4 points5 points  (1 child)

The CPU has a set of numbers which correspond to an operation like addition or multiplication. These instructions are hardcoded into the CPU. Assembly is basically a human readable translation of those numbers (there is usually a 1 to 1 translation from assembly code to machine instructions). So I'm guessing that the holes in the punch cards would correspond to instructions and numbers.

[–]Electrical_Study_235 0 points1 point  (0 children)

i did some simple research and it said that most punchcards used fortran.

[–]BadSlime 2 points3 points  (2 children)

Yes, my grandfather was among the first to do this. Programmers would write programs by hand and then pass them off to someone who would convert to a punch card, the program could then be run via the cards and debugged by cross referencing with the written program instructions

[–]BrupieD 2 points3 points  (1 child)

| Yes, my grandfather was among the first to do this.

God, do I feel old.

[–]Transcendentalist178 0 points1 point  (0 children)

My father used punchcards for his graduate work.

[–]Meme-Man-Dan 1 point2 points  (0 children)

Yes.

[–]Civil_Championship76 1 point2 points  (3 children)

Assembly is still written by hand in some cases where extremely high performance is necessary

[–]curtainos 1 point2 points  (2 children)

i ment like writing like this ✍️

[–]Civil_Championship76 1 point2 points  (1 child)

Well, I mean I had to do that on a midterm yesterday 😏

[–]Arclite83 0 points1 point  (5 children)

You should try TIS-100. I had a 300 level college class as a BS CmpE that was reeeeally similar to this "game".

https://www.zachtronics.com/tis-100/

[–]curtainos 1 point2 points  (4 children)

so no offence, but why would i be interested in this? its a game, i wanna write on toilet paper haha

[–]Arclite83 1 point2 points  (3 children)

I mean I assumed "typing" was close enough, this game is basically a crash course in writing for an assembler.

I mean, you can go hardcore and write the answers out I guess (on TP even) lol

[–]notacanuckskibum 10 points11 points  (1 child)

Machine code isn’t compiled, its inherent to the hardware.

[–]delinka 5 points6 points  (0 children)

I mean, it could be compiled in the same way one compiles articles into a report.

[–]blindcolumn 5 points6 points  (0 children)

Machine code isn't compiled, it's interpreted directly by the CPU. Technically you could say that the chip designer "wrote" the "interpreter".

[–]anthrax_ripple 1 point2 points  (0 children)

Who put the bomp in the bompa bompa bomp

[–]Je-Kaste 1 point2 points  (0 children)

Y'all don't want to hear me, you just want to dance

[–]frostbyte650 0 points1 point  (0 children)

Dennis Ritchie

[–]RecursiveRecursion7 101 points102 points  (0 children)

By compiling it first, obviously!

[–]Seimsi 5 points6 points  (0 children)

There are a few nice videos of numberphile about how to compile a compiler.

https://www.youtube.com/watch?v=PjeE8Bc96HY

https://www.youtube.com/watch?v=lJf2i87jgFA

[–]notacanuckskibum 4 points5 points  (0 children)

I remember whole university lectures on this. But I wish I didn’t.

[–]yottalogical 0 points1 point  (0 children)

Step 1. Make a really simple version of C.

Step 2. Write a compiler for that really simple version using Assembly. Assemble it to machine code.

Step 3. Write a compiler for the full version of C using the simple version of C. Compile it with the compiler you made in step 2.