Short answer: the first programs were carefully written in the source machine code, and everything was created from there.
This idea is called bootstrapping . Suppose you have a bare computer with a processor, flash memory and hard drive. Typically, the processor is configured at power-up to boot a simple operating system, called the bootloader, from a fixed location in non-volatile memory (such as CMOS or flash). This OS is unusually simple and has enough functionality to point the computer to the place on the disk where the real OS lives. This OS can then turn on more and more devices and load more and more complex programs until the entire OS is ultimately launched and launched.
But what is this bootloader? They were originally written in raw machine codes and hardcoded into a machine. The programs that he ran were also written in machine code, which would be incredibly slow and tedious to work with. In the end, someone wrote the first simple assembler into machine code. When you have this assembler, you can start writing programs in the assembly, including the assembler itself. In fact, once you have a simple assembler, you no longer need to write machine code. You can just write the assembler in the assembly!
From now on, you can create more complex programming languages ββby first writing to the compiler using existing tools (such as assembler) to get enough functionality available so that the compiler can do basic programming. Then you use this compiler to write a compiler for the programming language itself and use the same trick to build your previous work to get something bigger and cooler. This method is still used today - most compilers are written in the language they compile.
So, everything had to be done manually at some terrible moment in the past, but thanks to the hard work of the people who did this, we can build on what is already there.
templatetypedef
source share