A compiler is a program that translates source code, written by a programmer in a human-readable language, into a lower-level form that a computer can execute. The output may be native machine code for a processor or bytecode for a virtual machine. Compilers also check code for errors and often optimise it to run faster or use less memory. An interpreter, by contrast, executes code more directly, line by line. Before translating, a compiler checks that the code follows the language's syntax, the rules that define how valid code must be written, and reports any violations.
Compilers are central to smart contracts. Contracts for Ethereum are usually written in Solidity and compiled into bytecode for the Ethereum Virtual Machine, while other platforms compile languages such as Rust to WebAssembly. Since the deployed bytecode is what actually controls funds, a bug in the compiler can create a vulnerability even when the source code looks correct. For this reason a smart contract audit notes the compiler version used, and block explorers let developers verify that published source code matches the deployed bytecode.
Ref 1300000285