how are programming languages programmed?

681 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

A computer can understand one thing – machine language. Machine language is a set of simple commands written using 0s and 1s, commands such as “add two values”, “read a value from memory”, “jump to another place in the code”, and so on. The code inside an executable file is usually written in this language.

A programming language is written in a way that is easier for humans to read and to program in. However, the computer can’t understand it “natively”. In order for the computer to run the program, you need to translate it to machine code. This is done using a “compiler”, which is a program written specifically to translate code from one language to machine code.

So in order to create a new language, you essentially need to create two things:

1. A language specification – a set of rules which dictate how the language works, how the code is structured, what kind of keywords and symbols are used, etc.

2. A compiler – the program that uses the aforementioned rules to translate the high level code into machine code.

Java (and some other languages) is a bit more complicated. The Java compiler doesn’t translate code directly into machine code. Instead, the code is translated into some kind of intermediate code. In order to run this code, you need another program called the Java Runtime of Java Virtual Machine that will run the code for you. That’s why you need to install Java on your computer in order to run Java programs, and you can’t run them directly.

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