|
|
|
|
|
by randrews
1447 days ago
|
|
I'm tempted to email the author answering that question, because it's actually a really good and profound question. Edit: except I can't, there's no way to contact him from the blog. Oh well, in case OP is the author: In addition to programs that read code and do what it says (interpreters, like Python), there's another class of programs called "compilers" that translate code from one language to another. One kind of compiler (an assembler) translates assembly language into the specific numbers (representing instructions) that the computer hardware can understand and run. Some of these are able to do this for a computer other than the one they're running on. So, the bottom of the stack is generally... another computer. When you make a new computer, you write a compiler (or assembler) on your old computer that will generate programs the new computer will run... And those programs include compilers and assemblers for the new computer so it can host its own development after that. The obvious next question is, how did the first computer get programmed? And the answer is, by hand: what an assembler does can be done by hand, by a patient person, so someone did that and then keyed in the numbers manually (old computers had front panels with switches to manually read / write memory, for just this purpose). |
|
Anyway. If I understand you correctly: at the bottom of it all, there is a thing called an assembler, which is a kind of compiler, that makes the code existing "above" the assembler understandable to the actual hardware.
And I'm guessing there's a reason we don't just have people coding in assembly all the time? Probably it is a huge pain to code at the assembly level? If so -- could you redesign the hardware so it is easier just to code directly, I guess, "on" the hardware? Then you wouldn't have to worry about all these languages talking to each other. Plus, I bet the computer would run faster since you don't have to have it doing as much stuff, right?
Potentially dumb question: for computers that are not electric, like mechanical computers or quantum computers, do you essentially have to make a whole new assembly language?