matterr: How is any programming language encoded into computer chips for a programmer to use?
How is any programming language encoded into computer chips for a programmer to use? I know a little programming (basic c++) but was always wondering, how they embedded these languages into any computer chips or how conversion of binary ( 0101 system) to a more complex language was possible.
Answers and Views:
Answer by Pfo
They have circuits like adders (adds numbers together, also performs subtraction), multiplexors, divider circuits, circuits to do comparisons, and circuits to move memory around. That’s basically all it is…. the binary instructions are encoded in 32 bits, and that’s how all the magic happens.
Characters are stored as numbers, these are used to lookup bitmap images (or vector graphics) that represent characters, but it’s all binary, at every level.
Answer by j0wnerComputer chips know nothing about programming languages. Your modern programming language is an abstraction which your compiler has to convert into instructions (machine code) that your CPU _does_ understand. It’s quite an intricate process.
An analogous example would be that my company’s marketing director passes down instructions in the form of a Microsoft Word document for me to update our web site. A web server doesn’t know anything about Word documents, but I am the intermediary (like a compiler) take takes the user’s instructions and translates them into something that the server can understand, which in this case is HTML and PHP code.
Answer by MeklarThere is only one programming language coded into the chips, and it is called machine code. Well, technically different chip architectures have different versions of machine code, but the principle is the same for all of them. Machine code is read in binary and looks very messy to a human. Programming in it directly is possible, but extremely hard.
In order to make programming easier, other languages were developed. These fall into two basic categories, compiled languages and scripting languages. With a compiled language, like C++, the code that the programmer writes is taken by a program called a compiler and translated into a full program written in machine code, which can then be executed by the chip. With a scripting language like Javascript, the code that the programmer writes is interpreted dynamically by another program (typically written in a compiled language), translated downwards into machine code line by line at runtime. There are also a few languages, like Java, which straddle the border between compiled languages and scripting languages.
Leave a Reply