Overview
This lecture explains the main categories of programming languages—interpreted, compiled, query, and assembly languages—comparing their features, purposes, advantages, and limitations with examples.
Programming Languages Basics
- Programming languages let humans give instructions to computers.
- High-level languages are easier for humans to read; low-level languages are closer to machine code.
Interpreted Languages
- Code is executed line by line at runtime by an interpreter, not compiled ahead of time.
- Scripting languages automate tasks and include JavaScript, Python, Ruby, and PHP.
- JavaScript adds dynamic behavior to websites.
- Python is known for simplicity and versatility.
- Ruby is used for web applications.
- PHP is used for server-side web development.
- Advantages: easy to learn, platform independent, flexible for rapid development.
- Disadvantages: slower performance, limited access to system resources.
Markup Languages
- Used to define structure and presentation of text, especially in web development.
- Examples: HTML (structures web pages), XML (stores and transports data), CSS (controls webpage appearance).
- Advantages: good for structuring and separating content and presentation.
- Disadvantages: not meant for complex computations or logic.
Compiled Languages
- Source code is translated into machine code by a compiler before execution, producing an executable file.
- Examples: C (low-level access), C++ (adds object-oriented features), Java (compiles to bytecode), Go (efficient system programming).
- Advantages: fast execution, code optimization, full access to system resources.
- Disadvantages: slower development/testing due to compilation, platform-dependent code.
Query Languages
- Specialized for retrieving and managing data in databases.
- Examples: SQL (manages relational databases), GraphQL (flexible API queries), XPath/XQuery (queries XML data).
- Advantages: efficient for database tasks, simplifies complex data queries.
- Disadvantages: limited to database operations, not for general-purpose programming.
Assembly Languages
- Low-level language closely aligned with machine code, specific to hardware architectures.
- Examples: x86 assembly (Intel processors), ARM assembly (mobile/embedded devices).
- Advantages: high performance, direct hardware control.
- Disadvantages: complex to write, not portable between systems.
Key Terms & Definitions
- Interpreter — Software that executes code line by line at runtime.
- Compiler — A tool that translates source code into machine code before execution.
- Scripting Language — Language used for automating tasks, interpreted at runtime.
- Markup Language — Language for structuring and formatting text.
- Query Language — Language for retrieving or manipulating database data.
- Assembly Language — Low-level language for hardware-level programming.
Action Items / Next Steps
- Review the characteristics and examples of each language category.
- Prepare for exam questions comparing interpreted, compiled, query, and assembly languages.