How are computers programmed so that they understand different programming languages?

773 views

How are computers programmed so that they understand different programming languages?

In: 9

11 Answers

Anonymous 0 Comments

They don’t. They speak their own command language called machine code. When you make a program you make it in human readable programming language…you then have to use another program to take your program and “compile” it into the machine code that the cpu can understand.

Anonymous 0 Comments

Computers, at the hardware level, have their own language that is very basic. They understand more advanced languages because those each have their own translator, called a compiler, which translate from the high level language to the low level one.

Anonymous 0 Comments

It’s the other way around. Languages (c c# PHP java JavaScript …) are made to run on specific hardware and / or operating systems like windows or Linux.

Anonymous 0 Comments

They don’t. There is a program called a compiler that converts the specific programming language into machine language that the computer can understand. Basically binary.

Anonymous 0 Comments

A computer chip works by sending it commands (instructions), encoded as ones and zeros. Every chip can understand a certain set of commands (instruction sets).

Before programming language code can be understood by a chip, it has to be converted to ones and zeros (binary code).

The lowest level type of programming code is called “assembly code”. It is the code that is most easily translated to binary. The conversion to binary is called “compiling”. But it is also difficult to write and maintain for humans.

This is why so called “higher level programming languages” were invented. These are easy for humans. They often don’t compile directly to binary, but first to a form of assembly suitable for the target instruction set, and then to binary.

Finally, there’s a class of programming languages that doesn’t compile to binary at all. They require a compiled program to execute the code. That program sends the instructions to the chip, while interpreting the code of the programming language.

In some languages this is not done directly, but uses an intermediate binary format, like that understood by the chip, but instead understood by the program. Which converts it to binary as understood by chip. Such a program is also referred to as a Virtual Machine (not to be confused with full computer emulation).

Anonymous 0 Comments

Computers work by being a massive system of on or off “switches”

They do this by working in something known as binary. 1 indicating on and 0 indicating off.

Programming languages act as a medium between human language and the computer language binary.

For example when you enter the “Print” command your operating system translates that into binary and and the computer is able to “understand” that and act on it.

Anonymous 0 Comments

Yeah you’re thinking about it backward. Every computer only speaks one language. We have to get a translator to talk to them. So every programming language is just a different/”better”/easier translator.

None of that explains C# though so…take my explanation with a grain of salt.

Anonymous 0 Comments

Computers only understand machine code. It’s the Compilers’ job to translate the different programming languages into machine code.

Anonymous 0 Comments

Computers by default only speak one language and that’s called the “architecture” of your machine. There are two types of programming languages.

The first one takes human readable code and interprets it with a program called a compiler which translates it into machine code that your computer understands. This computer friendly code is usually saved as an executable file on Windows for example. The compiler operates based off of a specification. The specification is the programming language.

The other type is a program that is already built for your computer to understand and what it does is it grabs that human readable code and translates it every time you run it.

Either way, the main objective is to act as a translator between the developer and your machine. That’s how computers are able understand code because it has a lot of help from programs that speak that language.

Anonymous 0 Comments

Two ways:

* Either you write a program in a language it already understands, and your program runs programs in the new language
* Or you write a program in a language it already understands, to convert programs that are written in your new language, into a language the computer already understands
* If you do the second one you have the option of writing your converter program so it runs on a different type of computer
* Computers are already wired to understand one language, which is called machine code. Each type of computer understands a different language but we call all of them machine code.