How Does a Computer Understand Programming languages ?

Computers only understand binary code (0s and 1s). So if we want to tell a computer to do something we have to tell them into 0s and 1s. Now you may think how does a computer understand binary. It’s actually quite simple but was the foundation of modern computing. Everything a computer does comes down to transistors. Computer’ s main memory is made of little micro transistors that either can be low or high voltage levels that interpreted by computer as on\off or 0/1.

So, now we can tell a computer to count and do mathematical tasks but if we only have switches that can be on\off, to represent more than a number we just all have to agree assign the specific number in binary to letters of the alphabet. That’s exactly what happened. ASCII (American Standard Code for Information Interchange) was founded in 1977 by Kazuhiko Nishi and Keiichiro Tsukamoto. ASCII assign the specific binary number to a specific character. eg- A is on the 65th position of ASCII table and 01000001 in binary. Whenever you type ‘A’ somewhere in your computer’s \phone’s microtransistor convert into binary number 01000001.

Facts: A modern smartphone have more than 2 billion transistors.

The history of programming languages actually dates back further than you might think. Early computer codes date back to the early 1800s, and since then, we’ve created nearly 9000 different programming languages.

Of course, many of these languages were specific to particular machines and functions and aren’t used anymore.

You first write a program but computer can’t read. I mean they don’t know c++/java/python etc. They only understand binary. In order to actually run a program you first need to pass it through the special program called complier. Then it outputs a new version of your program that can be read by a computer.

The complier is complex machine that bridges the gap between human-readable code and computer-readable code. Oh you don’t know what I’m talking about. So you probably used IDE(Integrated Development Environment ) eg- vs code, atom etc in which case this whole process was hidden from you.

So, there are two version of your program. The one you wrote in c++/python/java/javascript etc but a computer can’t read is called source code. And the seconde one is an excutable program, the one generated by the complier which is just a list of instructions for the proccessor to follow, written in binary(0s and 1s) is called machine code.

When you program you don’t need to you about the complex machine code. For us programming is about variables, if/else, loops and functions. we build programming languages so that we can easily think and write programs.

So, the source code is the program that we write and the machine code is a list of binary(0s, 1s) that generated by complier when you pass your program through complier.

So basically, complier convert your source code into machine code. And then computer excute your program.



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store