What is the primary role of a compiler in the context of programming languages?
A. Interpret code line by line
B. Convert source code to machine code
C. Debug code in real-time
D. Manage system resources
A compiler translates high-level programming languages into machine code before execution.