What language do they build other languages with?

后端 未结 8 976
青春惊慌失措
青春惊慌失措 2021-01-31 09:31

What language is used to build low level languages like c++ and java?

How could you build the first language with no language?

相关标签:
8条回答
  • 2021-01-31 10:29

    Typically another machine or another language is used to write the first assembler and the first compiler.

    As long as a working computer and a working language is available, even if rather different, the problem can be solved in two steps.

    1. Write target language x for computer y in language z on computer (urk) a.

    2. Write target language x for computer y in language x. Now a single compile on a will produce a translator that can run on y, and the second compile can then be on y with a fully-bootstrapped system.

    The problem becomes simpler if the languages or machines don't differ.

    Bootstrapping can also be done incrementally, and perhaps this was more common 50 years ago.

    • Write a more powerful virtual machine (perhaps a stack machine or something with strings) in machine code
    • Now, writing in the VM's bytecode, write something closer to the language

    Something like Forth might make a good intermediate step.

    0 讨论(0)
  • 2021-01-31 10:31

    There is no such thing as "no language". The central processing unit operates on a series of signals to which we refer as bits or ones and zeroes (technically, changes in the electrical current flow). In th 50s, coding was done directly in what the CPU could "understand" and the pace at which programming was done was up to around 20 assembler commands per day.

    0 讨论(0)
提交回复
热议问题