How was the first compiler written?










148














I heard about the chicken and the egg and bootstrapping. I have a few questions.



What wrote the first compiler that converted something into binary instructions?



Is assembly compiled or translated into binary instructions?



...I'd find it hard to believe they wrote a compiler in binary.










share|improve this question























  • possible duplicate of When someone writes a new programming language, what do they write it IN?
    – nawfal
    Jul 21 '14 at 11:31















148














I heard about the chicken and the egg and bootstrapping. I have a few questions.



What wrote the first compiler that converted something into binary instructions?



Is assembly compiled or translated into binary instructions?



...I'd find it hard to believe they wrote a compiler in binary.










share|improve this question























  • possible duplicate of When someone writes a new programming language, what do they write it IN?
    – nawfal
    Jul 21 '14 at 11:31













148












148








148


78





I heard about the chicken and the egg and bootstrapping. I have a few questions.



What wrote the first compiler that converted something into binary instructions?



Is assembly compiled or translated into binary instructions?



...I'd find it hard to believe they wrote a compiler in binary.










share|improve this question















I heard about the chicken and the egg and bootstrapping. I have a few questions.



What wrote the first compiler that converted something into binary instructions?



Is assembly compiled or translated into binary instructions?



...I'd find it hard to believe they wrote a compiler in binary.







compiler-construction compiler-design machine-instruction






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jun 25 '14 at 19:11









Kara

3,936104152




3,936104152










asked Oct 31 '09 at 6:58









Shawn Mclean

28.5k79251383




28.5k79251383











  • possible duplicate of When someone writes a new programming language, what do they write it IN?
    – nawfal
    Jul 21 '14 at 11:31
















  • possible duplicate of When someone writes a new programming language, what do they write it IN?
    – nawfal
    Jul 21 '14 at 11:31















possible duplicate of When someone writes a new programming language, what do they write it IN?
– nawfal
Jul 21 '14 at 11:31




possible duplicate of When someone writes a new programming language, what do they write it IN?
– nawfal
Jul 21 '14 at 11:31












6 Answers
6






active

oldest

votes


















123














Assembly instructions are (generally) a direct mapping to opcodes, which are (multi-)byte values of machine code that can be directly interpreted by the processor. It is quite possible to write a program in opcodes directly by looking them up from a table (such as this one for the 6039 microprocessor, for example) that lists them with the matching assembly instructions, and hand-determining memory addresses/offsets for things like jumps.



The first programs were done in exactly this fashion - hand-written opcodes.



However, most of the time it's simpler to use an assembler to "compile" assembly code, which automatically does these opcode lookups, as well as being helpful in computing addresses/offsets for named jump labels, et cetera.



The first assemblers were written by hand. Those assemblers could then be used to assemble more complicated assemblers, which could then be use to assemble compilers written for higher-level languages, and so on. This process of iteratively writing the tools to simplify the creation of the next set of tools is called (as mentioned by David Rabinowitz in his answer) bootstrapping.






share|improve this answer
















  • 17




    My first computer was a Z80-based machine in whose ROM monitor I had to hand-assemble a bootstrap loader to bring up the basics of an operating system (CP/M) so I could assemble the rest of said operating system into a working system, complete with a disk-based bootstrap loader. Fun times. So yeah, you can hand-assemble just fine. It's slow and painful and error-prone (which is why we automated things) but it's possible.
    – JUST MY correct OPINION
    Apr 22 '10 at 11:09










  • The first link is broken.
    – Luke Fisk-Lennon
    Sep 16 '18 at 0:18


















41














Please read about compiler bootstrapping and the history of compiler writing



The idea is to write a very simple compiler directly in machine code, use it to write a more sophisticated compiler, use the second one to build a third one and so on until you can have a full featured compiler.






share|improve this answer




























    31














    Eggs long preceded chickens. The answer to most "chicken and the egg" problems is the same: evolution. Some people have trouble believing in biological evolution too, but disbelief is not an argument (google argumentum ad ignorantiam).



    To directly answer your question: the first compiler was written (by a human) in an assembly language -- a program called an assembler would translate assembly language into binary; this is a much simpler process than compilation because assembly language is just a symbolic form of machine language that uses opcode names instead of numbers, represents addresses with symbols, and so on. Many subsequent compilers were written in an assembly language as well. But the first C compiler was a modified B compiler, which was written in B. The first B compiler was written in TMG. The TMG compiler used to compile that B compiler was written in PDP-7 assembly language.






    share|improve this answer


















    • 19




      Downvote, eh? Probably a Creationist.
      – Jim Balter
      May 26 '15 at 4:15










    • Or maybe jealousy? :)
      – Mikayil Abdullayev
      Aug 15 '17 at 7:42


















    23














    Woz said in one of his public talks that when he started, he couldn't afford a compiler so he compiled to binary by hand on paper. If you want to see something even more wild, read about the conditions under which Bill Gates and Paul Allen wrote the BASIC for the Altair 8800.



    Regarding "writing a computer in binary" -- take a step back from being a programmer and think about what the early computers were. High level stuff didn't yet exist -- you thought about everything in the low level because that's all it was. You had hardware that could do basic logic and arithmetic that you manipulate via machine code (which is just compiled assembly -- Amber explains why this part isn't hard to do by hand) and you wanted this hardware to perform certain mathematical feats. You didn't worry about the non-existent operating system, you just told the hardware (in assembly) how to manipulate the numbers you feed it. It was a just big calculator. The computer of today was built one abstraction at a time.



    If you want to break down the barrier that keeps computers feeling like magic, I HIGHLY recommend reading CODE by Charles Petzold and/or The Elements of Computing Systems. With just a basic knowledge of programming, these wonderfully accessible books will have you understanding computers from top to bottom. Obviously, one can't get a comp. sci. or EE degree after just 2 books, but I can say as a self-taught programmer who missed out on the formal training: these books rocked my world!






    share|improve this answer
















    • 2




      Writing the Altair BASIC interpreter after making the sales pitch? Coding the bootstrapper on the plane ride to Albuquerque? That sounds kind of ridiculous. And fun.
      – Ehtesh Choudhury
      Aug 1 '11 at 2:17







    • 2




      @Shurane: ha! Those point are relevant too but to me the nitty-gritty of how they made the BASIC interpreter and how the group crammed it into the tiny space is a thing of beauty and astounding programming ability/hackery.
      – Dinah
      Aug 2 '11 at 0:55


















    9















    What wrote the first compiler that converted something into binary instructions?




    A human did. Read about the A-0 system:




    In 1952, Grace Hopper completed her first compiler for Sperry, known as the A-0. The A-0 System was a set of instructions that could translate symbolic mathematical code into machine language. In producing A-0, she took all the subroutines she had been collecting over the years and put them on tape. Each routine was given a call number, so that it the machine could find it on the tape. "All I had to do was to write down a set of call numbers, let the computer find them on the tape, bring them over and do the additions. This was the first compiler," as described by Grace.







    share|improve this answer


















    • 1




      The link seems to be 404 right now, in any case, "Grace" above is Grace Hopper.
      – ShiDoiSi
      Sep 20 '10 at 16:50






    • 1




      I've heard that Hopper wrote the first compiler, but the description above it makes it sound more like a linker than a compiler. Still, good story. It's amazing to think there was a time when computer scientists were skeptical about the idea of compilers...
      – Mark E. Haase
      Dec 21 '12 at 20:32






    • 1




      @mehaase this is why it is called "compiler". it makes a compilation of routines, each of which is (potentially) written in machine language directly.
      – Elazar
      Jun 4 '13 at 21:37










    • @MarkE.Haase The people Hopper referred to here were applications engineers and scientists using computers to for specific calculation tasks; they were not "computer scientists". There was a handful of cyberneticists around in 1952, but I doubt that she spoke to any of those.
      – Jim Balter
      Oct 10 '18 at 4:26


















    8














    The first programs were written in machine code (not assembly language) - actual numbers plugged into the computer memory using switches. We've come a long way...



    Sometimes this still happens to a small extent - to patch small bits of code or create thunks. I recall punching in numbers into Basic strings that were then executed as small, fast subroutines on early micros. I also remember toggling switches on a PDP-11's front panel to enter a bootloader program into its memory for a university course.



    These programs would sometimes be used to process text files to create other programs, and voila programming languages were created.






    share|improve this answer






















    • The question is about the first compiler, not the first programs in general, despite programs sometimes being compilers; the history of the two is not the same. (An analogy: the answer to the question of when the first animals appeared on the Earth is not the answer to the question of when the first cats appeared on the Earth, despite cats being animals.)
      – Jim Balter
      Jan 6 '17 at 14:55









    protected by Ry- Jun 25 '13 at 2:39



    Thank you for your interest in this question.
    Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).



    Would you like to answer one of these unanswered questions instead?














    6 Answers
    6






    active

    oldest

    votes








    6 Answers
    6






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    123














    Assembly instructions are (generally) a direct mapping to opcodes, which are (multi-)byte values of machine code that can be directly interpreted by the processor. It is quite possible to write a program in opcodes directly by looking them up from a table (such as this one for the 6039 microprocessor, for example) that lists them with the matching assembly instructions, and hand-determining memory addresses/offsets for things like jumps.



    The first programs were done in exactly this fashion - hand-written opcodes.



    However, most of the time it's simpler to use an assembler to "compile" assembly code, which automatically does these opcode lookups, as well as being helpful in computing addresses/offsets for named jump labels, et cetera.



    The first assemblers were written by hand. Those assemblers could then be used to assemble more complicated assemblers, which could then be use to assemble compilers written for higher-level languages, and so on. This process of iteratively writing the tools to simplify the creation of the next set of tools is called (as mentioned by David Rabinowitz in his answer) bootstrapping.






    share|improve this answer
















    • 17




      My first computer was a Z80-based machine in whose ROM monitor I had to hand-assemble a bootstrap loader to bring up the basics of an operating system (CP/M) so I could assemble the rest of said operating system into a working system, complete with a disk-based bootstrap loader. Fun times. So yeah, you can hand-assemble just fine. It's slow and painful and error-prone (which is why we automated things) but it's possible.
      – JUST MY correct OPINION
      Apr 22 '10 at 11:09










    • The first link is broken.
      – Luke Fisk-Lennon
      Sep 16 '18 at 0:18















    123














    Assembly instructions are (generally) a direct mapping to opcodes, which are (multi-)byte values of machine code that can be directly interpreted by the processor. It is quite possible to write a program in opcodes directly by looking them up from a table (such as this one for the 6039 microprocessor, for example) that lists them with the matching assembly instructions, and hand-determining memory addresses/offsets for things like jumps.



    The first programs were done in exactly this fashion - hand-written opcodes.



    However, most of the time it's simpler to use an assembler to "compile" assembly code, which automatically does these opcode lookups, as well as being helpful in computing addresses/offsets for named jump labels, et cetera.



    The first assemblers were written by hand. Those assemblers could then be used to assemble more complicated assemblers, which could then be use to assemble compilers written for higher-level languages, and so on. This process of iteratively writing the tools to simplify the creation of the next set of tools is called (as mentioned by David Rabinowitz in his answer) bootstrapping.






    share|improve this answer
















    • 17




      My first computer was a Z80-based machine in whose ROM monitor I had to hand-assemble a bootstrap loader to bring up the basics of an operating system (CP/M) so I could assemble the rest of said operating system into a working system, complete with a disk-based bootstrap loader. Fun times. So yeah, you can hand-assemble just fine. It's slow and painful and error-prone (which is why we automated things) but it's possible.
      – JUST MY correct OPINION
      Apr 22 '10 at 11:09










    • The first link is broken.
      – Luke Fisk-Lennon
      Sep 16 '18 at 0:18













    123












    123








    123






    Assembly instructions are (generally) a direct mapping to opcodes, which are (multi-)byte values of machine code that can be directly interpreted by the processor. It is quite possible to write a program in opcodes directly by looking them up from a table (such as this one for the 6039 microprocessor, for example) that lists them with the matching assembly instructions, and hand-determining memory addresses/offsets for things like jumps.



    The first programs were done in exactly this fashion - hand-written opcodes.



    However, most of the time it's simpler to use an assembler to "compile" assembly code, which automatically does these opcode lookups, as well as being helpful in computing addresses/offsets for named jump labels, et cetera.



    The first assemblers were written by hand. Those assemblers could then be used to assemble more complicated assemblers, which could then be use to assemble compilers written for higher-level languages, and so on. This process of iteratively writing the tools to simplify the creation of the next set of tools is called (as mentioned by David Rabinowitz in his answer) bootstrapping.






    share|improve this answer












    Assembly instructions are (generally) a direct mapping to opcodes, which are (multi-)byte values of machine code that can be directly interpreted by the processor. It is quite possible to write a program in opcodes directly by looking them up from a table (such as this one for the 6039 microprocessor, for example) that lists them with the matching assembly instructions, and hand-determining memory addresses/offsets for things like jumps.



    The first programs were done in exactly this fashion - hand-written opcodes.



    However, most of the time it's simpler to use an assembler to "compile" assembly code, which automatically does these opcode lookups, as well as being helpful in computing addresses/offsets for named jump labels, et cetera.



    The first assemblers were written by hand. Those assemblers could then be used to assemble more complicated assemblers, which could then be use to assemble compilers written for higher-level languages, and so on. This process of iteratively writing the tools to simplify the creation of the next set of tools is called (as mentioned by David Rabinowitz in his answer) bootstrapping.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Oct 31 '09 at 7:02









    Amber

    348k60521483




    348k60521483







    • 17




      My first computer was a Z80-based machine in whose ROM monitor I had to hand-assemble a bootstrap loader to bring up the basics of an operating system (CP/M) so I could assemble the rest of said operating system into a working system, complete with a disk-based bootstrap loader. Fun times. So yeah, you can hand-assemble just fine. It's slow and painful and error-prone (which is why we automated things) but it's possible.
      – JUST MY correct OPINION
      Apr 22 '10 at 11:09










    • The first link is broken.
      – Luke Fisk-Lennon
      Sep 16 '18 at 0:18












    • 17




      My first computer was a Z80-based machine in whose ROM monitor I had to hand-assemble a bootstrap loader to bring up the basics of an operating system (CP/M) so I could assemble the rest of said operating system into a working system, complete with a disk-based bootstrap loader. Fun times. So yeah, you can hand-assemble just fine. It's slow and painful and error-prone (which is why we automated things) but it's possible.
      – JUST MY correct OPINION
      Apr 22 '10 at 11:09










    • The first link is broken.
      – Luke Fisk-Lennon
      Sep 16 '18 at 0:18







    17




    17




    My first computer was a Z80-based machine in whose ROM monitor I had to hand-assemble a bootstrap loader to bring up the basics of an operating system (CP/M) so I could assemble the rest of said operating system into a working system, complete with a disk-based bootstrap loader. Fun times. So yeah, you can hand-assemble just fine. It's slow and painful and error-prone (which is why we automated things) but it's possible.
    – JUST MY correct OPINION
    Apr 22 '10 at 11:09




    My first computer was a Z80-based machine in whose ROM monitor I had to hand-assemble a bootstrap loader to bring up the basics of an operating system (CP/M) so I could assemble the rest of said operating system into a working system, complete with a disk-based bootstrap loader. Fun times. So yeah, you can hand-assemble just fine. It's slow and painful and error-prone (which is why we automated things) but it's possible.
    – JUST MY correct OPINION
    Apr 22 '10 at 11:09












    The first link is broken.
    – Luke Fisk-Lennon
    Sep 16 '18 at 0:18




    The first link is broken.
    – Luke Fisk-Lennon
    Sep 16 '18 at 0:18













    41














    Please read about compiler bootstrapping and the history of compiler writing



    The idea is to write a very simple compiler directly in machine code, use it to write a more sophisticated compiler, use the second one to build a third one and so on until you can have a full featured compiler.






    share|improve this answer

























      41














      Please read about compiler bootstrapping and the history of compiler writing



      The idea is to write a very simple compiler directly in machine code, use it to write a more sophisticated compiler, use the second one to build a third one and so on until you can have a full featured compiler.






      share|improve this answer























        41












        41








        41






        Please read about compiler bootstrapping and the history of compiler writing



        The idea is to write a very simple compiler directly in machine code, use it to write a more sophisticated compiler, use the second one to build a third one and so on until you can have a full featured compiler.






        share|improve this answer












        Please read about compiler bootstrapping and the history of compiler writing



        The idea is to write a very simple compiler directly in machine code, use it to write a more sophisticated compiler, use the second one to build a third one and so on until you can have a full featured compiler.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Oct 31 '09 at 7:02









        David Rabinowitz

        22.5k1278114




        22.5k1278114





















            31














            Eggs long preceded chickens. The answer to most "chicken and the egg" problems is the same: evolution. Some people have trouble believing in biological evolution too, but disbelief is not an argument (google argumentum ad ignorantiam).



            To directly answer your question: the first compiler was written (by a human) in an assembly language -- a program called an assembler would translate assembly language into binary; this is a much simpler process than compilation because assembly language is just a symbolic form of machine language that uses opcode names instead of numbers, represents addresses with symbols, and so on. Many subsequent compilers were written in an assembly language as well. But the first C compiler was a modified B compiler, which was written in B. The first B compiler was written in TMG. The TMG compiler used to compile that B compiler was written in PDP-7 assembly language.






            share|improve this answer


















            • 19




              Downvote, eh? Probably a Creationist.
              – Jim Balter
              May 26 '15 at 4:15










            • Or maybe jealousy? :)
              – Mikayil Abdullayev
              Aug 15 '17 at 7:42















            31














            Eggs long preceded chickens. The answer to most "chicken and the egg" problems is the same: evolution. Some people have trouble believing in biological evolution too, but disbelief is not an argument (google argumentum ad ignorantiam).



            To directly answer your question: the first compiler was written (by a human) in an assembly language -- a program called an assembler would translate assembly language into binary; this is a much simpler process than compilation because assembly language is just a symbolic form of machine language that uses opcode names instead of numbers, represents addresses with symbols, and so on. Many subsequent compilers were written in an assembly language as well. But the first C compiler was a modified B compiler, which was written in B. The first B compiler was written in TMG. The TMG compiler used to compile that B compiler was written in PDP-7 assembly language.






            share|improve this answer


















            • 19




              Downvote, eh? Probably a Creationist.
              – Jim Balter
              May 26 '15 at 4:15










            • Or maybe jealousy? :)
              – Mikayil Abdullayev
              Aug 15 '17 at 7:42













            31












            31








            31






            Eggs long preceded chickens. The answer to most "chicken and the egg" problems is the same: evolution. Some people have trouble believing in biological evolution too, but disbelief is not an argument (google argumentum ad ignorantiam).



            To directly answer your question: the first compiler was written (by a human) in an assembly language -- a program called an assembler would translate assembly language into binary; this is a much simpler process than compilation because assembly language is just a symbolic form of machine language that uses opcode names instead of numbers, represents addresses with symbols, and so on. Many subsequent compilers were written in an assembly language as well. But the first C compiler was a modified B compiler, which was written in B. The first B compiler was written in TMG. The TMG compiler used to compile that B compiler was written in PDP-7 assembly language.






            share|improve this answer














            Eggs long preceded chickens. The answer to most "chicken and the egg" problems is the same: evolution. Some people have trouble believing in biological evolution too, but disbelief is not an argument (google argumentum ad ignorantiam).



            To directly answer your question: the first compiler was written (by a human) in an assembly language -- a program called an assembler would translate assembly language into binary; this is a much simpler process than compilation because assembly language is just a symbolic form of machine language that uses opcode names instead of numbers, represents addresses with symbols, and so on. Many subsequent compilers were written in an assembly language as well. But the first C compiler was a modified B compiler, which was written in B. The first B compiler was written in TMG. The TMG compiler used to compile that B compiler was written in PDP-7 assembly language.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Jun 17 '15 at 11:41

























            answered Feb 7 '11 at 22:21









            Jim Balter

            13.3k12853




            13.3k12853







            • 19




              Downvote, eh? Probably a Creationist.
              – Jim Balter
              May 26 '15 at 4:15










            • Or maybe jealousy? :)
              – Mikayil Abdullayev
              Aug 15 '17 at 7:42












            • 19




              Downvote, eh? Probably a Creationist.
              – Jim Balter
              May 26 '15 at 4:15










            • Or maybe jealousy? :)
              – Mikayil Abdullayev
              Aug 15 '17 at 7:42







            19




            19




            Downvote, eh? Probably a Creationist.
            – Jim Balter
            May 26 '15 at 4:15




            Downvote, eh? Probably a Creationist.
            – Jim Balter
            May 26 '15 at 4:15












            Or maybe jealousy? :)
            – Mikayil Abdullayev
            Aug 15 '17 at 7:42




            Or maybe jealousy? :)
            – Mikayil Abdullayev
            Aug 15 '17 at 7:42











            23














            Woz said in one of his public talks that when he started, he couldn't afford a compiler so he compiled to binary by hand on paper. If you want to see something even more wild, read about the conditions under which Bill Gates and Paul Allen wrote the BASIC for the Altair 8800.



            Regarding "writing a computer in binary" -- take a step back from being a programmer and think about what the early computers were. High level stuff didn't yet exist -- you thought about everything in the low level because that's all it was. You had hardware that could do basic logic and arithmetic that you manipulate via machine code (which is just compiled assembly -- Amber explains why this part isn't hard to do by hand) and you wanted this hardware to perform certain mathematical feats. You didn't worry about the non-existent operating system, you just told the hardware (in assembly) how to manipulate the numbers you feed it. It was a just big calculator. The computer of today was built one abstraction at a time.



            If you want to break down the barrier that keeps computers feeling like magic, I HIGHLY recommend reading CODE by Charles Petzold and/or The Elements of Computing Systems. With just a basic knowledge of programming, these wonderfully accessible books will have you understanding computers from top to bottom. Obviously, one can't get a comp. sci. or EE degree after just 2 books, but I can say as a self-taught programmer who missed out on the formal training: these books rocked my world!






            share|improve this answer
















            • 2




              Writing the Altair BASIC interpreter after making the sales pitch? Coding the bootstrapper on the plane ride to Albuquerque? That sounds kind of ridiculous. And fun.
              – Ehtesh Choudhury
              Aug 1 '11 at 2:17







            • 2




              @Shurane: ha! Those point are relevant too but to me the nitty-gritty of how they made the BASIC interpreter and how the group crammed it into the tiny space is a thing of beauty and astounding programming ability/hackery.
              – Dinah
              Aug 2 '11 at 0:55















            23














            Woz said in one of his public talks that when he started, he couldn't afford a compiler so he compiled to binary by hand on paper. If you want to see something even more wild, read about the conditions under which Bill Gates and Paul Allen wrote the BASIC for the Altair 8800.



            Regarding "writing a computer in binary" -- take a step back from being a programmer and think about what the early computers were. High level stuff didn't yet exist -- you thought about everything in the low level because that's all it was. You had hardware that could do basic logic and arithmetic that you manipulate via machine code (which is just compiled assembly -- Amber explains why this part isn't hard to do by hand) and you wanted this hardware to perform certain mathematical feats. You didn't worry about the non-existent operating system, you just told the hardware (in assembly) how to manipulate the numbers you feed it. It was a just big calculator. The computer of today was built one abstraction at a time.



            If you want to break down the barrier that keeps computers feeling like magic, I HIGHLY recommend reading CODE by Charles Petzold and/or The Elements of Computing Systems. With just a basic knowledge of programming, these wonderfully accessible books will have you understanding computers from top to bottom. Obviously, one can't get a comp. sci. or EE degree after just 2 books, but I can say as a self-taught programmer who missed out on the formal training: these books rocked my world!






            share|improve this answer
















            • 2




              Writing the Altair BASIC interpreter after making the sales pitch? Coding the bootstrapper on the plane ride to Albuquerque? That sounds kind of ridiculous. And fun.
              – Ehtesh Choudhury
              Aug 1 '11 at 2:17







            • 2




              @Shurane: ha! Those point are relevant too but to me the nitty-gritty of how they made the BASIC interpreter and how the group crammed it into the tiny space is a thing of beauty and astounding programming ability/hackery.
              – Dinah
              Aug 2 '11 at 0:55













            23












            23








            23






            Woz said in one of his public talks that when he started, he couldn't afford a compiler so he compiled to binary by hand on paper. If you want to see something even more wild, read about the conditions under which Bill Gates and Paul Allen wrote the BASIC for the Altair 8800.



            Regarding "writing a computer in binary" -- take a step back from being a programmer and think about what the early computers were. High level stuff didn't yet exist -- you thought about everything in the low level because that's all it was. You had hardware that could do basic logic and arithmetic that you manipulate via machine code (which is just compiled assembly -- Amber explains why this part isn't hard to do by hand) and you wanted this hardware to perform certain mathematical feats. You didn't worry about the non-existent operating system, you just told the hardware (in assembly) how to manipulate the numbers you feed it. It was a just big calculator. The computer of today was built one abstraction at a time.



            If you want to break down the barrier that keeps computers feeling like magic, I HIGHLY recommend reading CODE by Charles Petzold and/or The Elements of Computing Systems. With just a basic knowledge of programming, these wonderfully accessible books will have you understanding computers from top to bottom. Obviously, one can't get a comp. sci. or EE degree after just 2 books, but I can say as a self-taught programmer who missed out on the formal training: these books rocked my world!






            share|improve this answer












            Woz said in one of his public talks that when he started, he couldn't afford a compiler so he compiled to binary by hand on paper. If you want to see something even more wild, read about the conditions under which Bill Gates and Paul Allen wrote the BASIC for the Altair 8800.



            Regarding "writing a computer in binary" -- take a step back from being a programmer and think about what the early computers were. High level stuff didn't yet exist -- you thought about everything in the low level because that's all it was. You had hardware that could do basic logic and arithmetic that you manipulate via machine code (which is just compiled assembly -- Amber explains why this part isn't hard to do by hand) and you wanted this hardware to perform certain mathematical feats. You didn't worry about the non-existent operating system, you just told the hardware (in assembly) how to manipulate the numbers you feed it. It was a just big calculator. The computer of today was built one abstraction at a time.



            If you want to break down the barrier that keeps computers feeling like magic, I HIGHLY recommend reading CODE by Charles Petzold and/or The Elements of Computing Systems. With just a basic knowledge of programming, these wonderfully accessible books will have you understanding computers from top to bottom. Obviously, one can't get a comp. sci. or EE degree after just 2 books, but I can say as a self-taught programmer who missed out on the formal training: these books rocked my world!







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Sep 20 '10 at 16:45









            Dinah

            25.6k28118139




            25.6k28118139







            • 2




              Writing the Altair BASIC interpreter after making the sales pitch? Coding the bootstrapper on the plane ride to Albuquerque? That sounds kind of ridiculous. And fun.
              – Ehtesh Choudhury
              Aug 1 '11 at 2:17







            • 2




              @Shurane: ha! Those point are relevant too but to me the nitty-gritty of how they made the BASIC interpreter and how the group crammed it into the tiny space is a thing of beauty and astounding programming ability/hackery.
              – Dinah
              Aug 2 '11 at 0:55












            • 2




              Writing the Altair BASIC interpreter after making the sales pitch? Coding the bootstrapper on the plane ride to Albuquerque? That sounds kind of ridiculous. And fun.
              – Ehtesh Choudhury
              Aug 1 '11 at 2:17







            • 2




              @Shurane: ha! Those point are relevant too but to me the nitty-gritty of how they made the BASIC interpreter and how the group crammed it into the tiny space is a thing of beauty and astounding programming ability/hackery.
              – Dinah
              Aug 2 '11 at 0:55







            2




            2




            Writing the Altair BASIC interpreter after making the sales pitch? Coding the bootstrapper on the plane ride to Albuquerque? That sounds kind of ridiculous. And fun.
            – Ehtesh Choudhury
            Aug 1 '11 at 2:17





            Writing the Altair BASIC interpreter after making the sales pitch? Coding the bootstrapper on the plane ride to Albuquerque? That sounds kind of ridiculous. And fun.
            – Ehtesh Choudhury
            Aug 1 '11 at 2:17





            2




            2




            @Shurane: ha! Those point are relevant too but to me the nitty-gritty of how they made the BASIC interpreter and how the group crammed it into the tiny space is a thing of beauty and astounding programming ability/hackery.
            – Dinah
            Aug 2 '11 at 0:55




            @Shurane: ha! Those point are relevant too but to me the nitty-gritty of how they made the BASIC interpreter and how the group crammed it into the tiny space is a thing of beauty and astounding programming ability/hackery.
            – Dinah
            Aug 2 '11 at 0:55











            9















            What wrote the first compiler that converted something into binary instructions?




            A human did. Read about the A-0 system:




            In 1952, Grace Hopper completed her first compiler for Sperry, known as the A-0. The A-0 System was a set of instructions that could translate symbolic mathematical code into machine language. In producing A-0, she took all the subroutines she had been collecting over the years and put them on tape. Each routine was given a call number, so that it the machine could find it on the tape. "All I had to do was to write down a set of call numbers, let the computer find them on the tape, bring them over and do the additions. This was the first compiler," as described by Grace.







            share|improve this answer


















            • 1




              The link seems to be 404 right now, in any case, "Grace" above is Grace Hopper.
              – ShiDoiSi
              Sep 20 '10 at 16:50






            • 1




              I've heard that Hopper wrote the first compiler, but the description above it makes it sound more like a linker than a compiler. Still, good story. It's amazing to think there was a time when computer scientists were skeptical about the idea of compilers...
              – Mark E. Haase
              Dec 21 '12 at 20:32






            • 1




              @mehaase this is why it is called "compiler". it makes a compilation of routines, each of which is (potentially) written in machine language directly.
              – Elazar
              Jun 4 '13 at 21:37










            • @MarkE.Haase The people Hopper referred to here were applications engineers and scientists using computers to for specific calculation tasks; they were not "computer scientists". There was a handful of cyberneticists around in 1952, but I doubt that she spoke to any of those.
              – Jim Balter
              Oct 10 '18 at 4:26















            9















            What wrote the first compiler that converted something into binary instructions?




            A human did. Read about the A-0 system:




            In 1952, Grace Hopper completed her first compiler for Sperry, known as the A-0. The A-0 System was a set of instructions that could translate symbolic mathematical code into machine language. In producing A-0, she took all the subroutines she had been collecting over the years and put them on tape. Each routine was given a call number, so that it the machine could find it on the tape. "All I had to do was to write down a set of call numbers, let the computer find them on the tape, bring them over and do the additions. This was the first compiler," as described by Grace.







            share|improve this answer


















            • 1




              The link seems to be 404 right now, in any case, "Grace" above is Grace Hopper.
              – ShiDoiSi
              Sep 20 '10 at 16:50






            • 1




              I've heard that Hopper wrote the first compiler, but the description above it makes it sound more like a linker than a compiler. Still, good story. It's amazing to think there was a time when computer scientists were skeptical about the idea of compilers...
              – Mark E. Haase
              Dec 21 '12 at 20:32






            • 1




              @mehaase this is why it is called "compiler". it makes a compilation of routines, each of which is (potentially) written in machine language directly.
              – Elazar
              Jun 4 '13 at 21:37










            • @MarkE.Haase The people Hopper referred to here were applications engineers and scientists using computers to for specific calculation tasks; they were not "computer scientists". There was a handful of cyberneticists around in 1952, but I doubt that she spoke to any of those.
              – Jim Balter
              Oct 10 '18 at 4:26













            9












            9








            9







            What wrote the first compiler that converted something into binary instructions?




            A human did. Read about the A-0 system:




            In 1952, Grace Hopper completed her first compiler for Sperry, known as the A-0. The A-0 System was a set of instructions that could translate symbolic mathematical code into machine language. In producing A-0, she took all the subroutines she had been collecting over the years and put them on tape. Each routine was given a call number, so that it the machine could find it on the tape. "All I had to do was to write down a set of call numbers, let the computer find them on the tape, bring them over and do the additions. This was the first compiler," as described by Grace.







            share|improve this answer















            What wrote the first compiler that converted something into binary instructions?




            A human did. Read about the A-0 system:




            In 1952, Grace Hopper completed her first compiler for Sperry, known as the A-0. The A-0 System was a set of instructions that could translate symbolic mathematical code into machine language. In producing A-0, she took all the subroutines she had been collecting over the years and put them on tape. Each routine was given a call number, so that it the machine could find it on the tape. "All I had to do was to write down a set of call numbers, let the computer find them on the tape, bring them over and do the additions. This was the first compiler," as described by Grace.








            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Oct 10 '18 at 4:16









            Jim Balter

            13.3k12853




            13.3k12853










            answered Oct 31 '09 at 7:06









            Sinan Ünür

            107k15174310




            107k15174310







            • 1




              The link seems to be 404 right now, in any case, "Grace" above is Grace Hopper.
              – ShiDoiSi
              Sep 20 '10 at 16:50






            • 1




              I've heard that Hopper wrote the first compiler, but the description above it makes it sound more like a linker than a compiler. Still, good story. It's amazing to think there was a time when computer scientists were skeptical about the idea of compilers...
              – Mark E. Haase
              Dec 21 '12 at 20:32






            • 1




              @mehaase this is why it is called "compiler". it makes a compilation of routines, each of which is (potentially) written in machine language directly.
              – Elazar
              Jun 4 '13 at 21:37










            • @MarkE.Haase The people Hopper referred to here were applications engineers and scientists using computers to for specific calculation tasks; they were not "computer scientists". There was a handful of cyberneticists around in 1952, but I doubt that she spoke to any of those.
              – Jim Balter
              Oct 10 '18 at 4:26












            • 1




              The link seems to be 404 right now, in any case, "Grace" above is Grace Hopper.
              – ShiDoiSi
              Sep 20 '10 at 16:50






            • 1




              I've heard that Hopper wrote the first compiler, but the description above it makes it sound more like a linker than a compiler. Still, good story. It's amazing to think there was a time when computer scientists were skeptical about the idea of compilers...
              – Mark E. Haase
              Dec 21 '12 at 20:32






            • 1




              @mehaase this is why it is called "compiler". it makes a compilation of routines, each of which is (potentially) written in machine language directly.
              – Elazar
              Jun 4 '13 at 21:37










            • @MarkE.Haase The people Hopper referred to here were applications engineers and scientists using computers to for specific calculation tasks; they were not "computer scientists". There was a handful of cyberneticists around in 1952, but I doubt that she spoke to any of those.
              – Jim Balter
              Oct 10 '18 at 4:26







            1




            1




            The link seems to be 404 right now, in any case, "Grace" above is Grace Hopper.
            – ShiDoiSi
            Sep 20 '10 at 16:50




            The link seems to be 404 right now, in any case, "Grace" above is Grace Hopper.
            – ShiDoiSi
            Sep 20 '10 at 16:50




            1




            1




            I've heard that Hopper wrote the first compiler, but the description above it makes it sound more like a linker than a compiler. Still, good story. It's amazing to think there was a time when computer scientists were skeptical about the idea of compilers...
            – Mark E. Haase
            Dec 21 '12 at 20:32




            I've heard that Hopper wrote the first compiler, but the description above it makes it sound more like a linker than a compiler. Still, good story. It's amazing to think there was a time when computer scientists were skeptical about the idea of compilers...
            – Mark E. Haase
            Dec 21 '12 at 20:32




            1




            1




            @mehaase this is why it is called "compiler". it makes a compilation of routines, each of which is (potentially) written in machine language directly.
            – Elazar
            Jun 4 '13 at 21:37




            @mehaase this is why it is called "compiler". it makes a compilation of routines, each of which is (potentially) written in machine language directly.
            – Elazar
            Jun 4 '13 at 21:37












            @MarkE.Haase The people Hopper referred to here were applications engineers and scientists using computers to for specific calculation tasks; they were not "computer scientists". There was a handful of cyberneticists around in 1952, but I doubt that she spoke to any of those.
            – Jim Balter
            Oct 10 '18 at 4:26




            @MarkE.Haase The people Hopper referred to here were applications engineers and scientists using computers to for specific calculation tasks; they were not "computer scientists". There was a handful of cyberneticists around in 1952, but I doubt that she spoke to any of those.
            – Jim Balter
            Oct 10 '18 at 4:26











            8














            The first programs were written in machine code (not assembly language) - actual numbers plugged into the computer memory using switches. We've come a long way...



            Sometimes this still happens to a small extent - to patch small bits of code or create thunks. I recall punching in numbers into Basic strings that were then executed as small, fast subroutines on early micros. I also remember toggling switches on a PDP-11's front panel to enter a bootloader program into its memory for a university course.



            These programs would sometimes be used to process text files to create other programs, and voila programming languages were created.






            share|improve this answer






















            • The question is about the first compiler, not the first programs in general, despite programs sometimes being compilers; the history of the two is not the same. (An analogy: the answer to the question of when the first animals appeared on the Earth is not the answer to the question of when the first cats appeared on the Earth, despite cats being animals.)
              – Jim Balter
              Jan 6 '17 at 14:55















            8














            The first programs were written in machine code (not assembly language) - actual numbers plugged into the computer memory using switches. We've come a long way...



            Sometimes this still happens to a small extent - to patch small bits of code or create thunks. I recall punching in numbers into Basic strings that were then executed as small, fast subroutines on early micros. I also remember toggling switches on a PDP-11's front panel to enter a bootloader program into its memory for a university course.



            These programs would sometimes be used to process text files to create other programs, and voila programming languages were created.






            share|improve this answer






















            • The question is about the first compiler, not the first programs in general, despite programs sometimes being compilers; the history of the two is not the same. (An analogy: the answer to the question of when the first animals appeared on the Earth is not the answer to the question of when the first cats appeared on the Earth, despite cats being animals.)
              – Jim Balter
              Jan 6 '17 at 14:55













            8












            8








            8






            The first programs were written in machine code (not assembly language) - actual numbers plugged into the computer memory using switches. We've come a long way...



            Sometimes this still happens to a small extent - to patch small bits of code or create thunks. I recall punching in numbers into Basic strings that were then executed as small, fast subroutines on early micros. I also remember toggling switches on a PDP-11's front panel to enter a bootloader program into its memory for a university course.



            These programs would sometimes be used to process text files to create other programs, and voila programming languages were created.






            share|improve this answer














            The first programs were written in machine code (not assembly language) - actual numbers plugged into the computer memory using switches. We've come a long way...



            Sometimes this still happens to a small extent - to patch small bits of code or create thunks. I recall punching in numbers into Basic strings that were then executed as small, fast subroutines on early micros. I also remember toggling switches on a PDP-11's front panel to enter a bootloader program into its memory for a university course.



            These programs would sometimes be used to process text files to create other programs, and voila programming languages were created.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Oct 31 '09 at 7:07

























            answered Oct 31 '09 at 7:01









            Michael Burr

            281k40427666




            281k40427666











            • The question is about the first compiler, not the first programs in general, despite programs sometimes being compilers; the history of the two is not the same. (An analogy: the answer to the question of when the first animals appeared on the Earth is not the answer to the question of when the first cats appeared on the Earth, despite cats being animals.)
              – Jim Balter
              Jan 6 '17 at 14:55
















            • The question is about the first compiler, not the first programs in general, despite programs sometimes being compilers; the history of the two is not the same. (An analogy: the answer to the question of when the first animals appeared on the Earth is not the answer to the question of when the first cats appeared on the Earth, despite cats being animals.)
              – Jim Balter
              Jan 6 '17 at 14:55















            The question is about the first compiler, not the first programs in general, despite programs sometimes being compilers; the history of the two is not the same. (An analogy: the answer to the question of when the first animals appeared on the Earth is not the answer to the question of when the first cats appeared on the Earth, despite cats being animals.)
            – Jim Balter
            Jan 6 '17 at 14:55




            The question is about the first compiler, not the first programs in general, despite programs sometimes being compilers; the history of the two is not the same. (An analogy: the answer to the question of when the first animals appeared on the Earth is not the answer to the question of when the first cats appeared on the Earth, despite cats being animals.)
            – Jim Balter
            Jan 6 '17 at 14:55





            protected by Ry- Jun 25 '13 at 2:39



            Thank you for your interest in this question.
            Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).



            Would you like to answer one of these unanswered questions instead?



            這個網誌中的熱門文章

            How to read a connectionString WITH PROVIDER in .NET Core?

            Node.js Script on GitHub Pages or Amazon S3

            Museum of Modern and Contemporary Art of Trento and Rovereto