compiler1
compiler1
• Refers to the way programming languages and data are structured and interpreted by both humans
and machines.
• 1. Low-Level vs. High-Level Languages
• Low-Level Languages:
o Machine Code: Binary instructions (0s and 1s) directly executed by the CPU.
o Assembly Language: Human-readable mnemonics (e.g., MOV, ADD) that map to machine code.
Requires an assembler to translate.
• High-Level Languages (e.g., Python, Java, C++):
o Abstracted from hardware, focusing on readability and productivity.
o Require compilers or interpreters to convert code into machine-executable form.
• 2. Language Syntax and Semantics
• Syntax: Rules governing code structure (e.g., grammar, punctuation).
• Semantics: Meaning of the code (e.g., how loops or functions behave).
• 3. Compiled vs. Interpreted Languages
• Examples:
o Bytecode (e.g., Java JVM, Python .pyc): Portable intermediate code.
o LLVM IR: A universal IR for optimization across languages.
• 5. Data Representation
• 6. Control Structures
• Virtual Machines (e.g., JVM, CLR): Execute intermediate code across platforms.
• Tailored for specific tasks (e.g., SQL for databases, HTML/CSS for web design).