what is a compiler and what component it is hardware or software | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

what is a compiler and what component it is hardware or software

9th Apr 2017, 8:09 PM
shivajiuser@
shivajiuser@ - avatar
4 Answers
9th Apr 2017, 8:40 PM
Tashi N
Tashi N - avatar
+ 9
@Squidy, it wouldn't just be an awesome feat, it would make computer processing much more efficient and it would most likey save data in the process, not to mention you could directly interface with the CPU or much more.
10th Apr 2017, 12:30 AM
SoraKatadzuma
SoraKatadzuma - avatar
+ 4
More specifically, a compiler translates your code into a set of instructions to be understood and executed by a CPU or a virtual machine. Technically, you can compile anything to anything, but usually it's from a higher level of abstraction to a lower level. For example, you can compile C to assembly or machine code. Transpilers are a specific type of compiler which compile from one programming language to another. Most compilers are implemented in software, but it's theoretically possible to create a hardware compiler (that would actually be a really awesome feat!).
9th Apr 2017, 9:49 PM
Squidy
Squidy - avatar
+ 3
A compiler translates your code into binary code, as your computer speaks in binary, thus for it to understand what you saying, the compiler needs to translate it into the low level language known as binary which is essentially made up of zeros and ones.
9th Apr 2017, 8:55 PM
Mogammad Shameer Losper
Mogammad Shameer Losper - avatar