how are programming languages programmed?

676 views

I tried searching this on google but all answers are wayyy to complicated for me. Like literally how did they create Java for example? Thanks

In: 6

9 Answers

Anonymous 0 Comments

Programming languages are in a sense just *ideas*. You can *invent* a programming language, just by making a list of words and syntax rules and defining exactly how you want them to be interpreted. (The difference between a programming language and a human language is that exactness; everything has to be *perfectly* well-defined.)

The computer itself only speaks a language called “binary machine code”, consisting of a list of 1s and 0s that you can think of as physically flipping switches inside the machine. (If you look at pictures of early computers like [ENIAC](https://en.wikipedia.org/wiki/ENIAC#/media/File:Two_women_operating_ENIAC_(full_resolution).jpg), you can see that they actually had banks of physical switches for the programmers to flip, rather than being controlled digitally.) If you write a program in a programming language rather than in machine code, it has to be translated into machine code before the computer can run it.

Translating your program into machine code is a task that can be done by hand by a human being, but it tends to be long and tedious. So we typically automate it by using a type of computer program called a “compiler” to do the translation for us.

Compilers are just programs like any other, and can be programmed in any language you want. There’s nothing stopping you from using a programming language to write a compiler for that same programming language. (In fact, there are reasons why you might want to do so, if you think you can create a compiler that runs faster, outputs more compact binary code, and/or has better debugging tools than existing compilers do.) The first compiler would have been translated into machine code by hand; later compilers were translated using earlier compilers.

You are viewing 1 out of 9 answers, click here to view all answers.