Level of Abstraction
About 853 wordsAbout 11 min
2025-08-05
This document explores the evolution of programming languages as tools that create layers of abstraction over computer hardware. The goal is to move from low-level machine operations to high-level, human-understandable programs. Key concepts include the difference between syntax and semantics, various models of computation, and the dominant programming paradigms that shape how we solve problems.
Syntax vs. Semantics
A foundational concept in programming languages is the distinction between what a program looks like and what a program means.
Syntaxstring
The symbols, grammar, and structural rules that define a correctly written program. It's about the form. For example, using {}
versus indentation for code blocks is a syntactic choice.
Semanticsstring
The meaning of a program and the computational processes it follows when executed. It's about the function and meaning. For example, two functions in different languages can be syntactically different but semantically identical if they compute the same result.
Models of Computation
Different programming paradigms are built upon different conceptual models of how a computer works.
Turing Machines
A conceptual model using a tape-reading machine. It forms the basis of the imperative paradigm of sequential instruction execution.
1930s
Lambda Calculus
A mathematical model based on function application and composition. It is the foundation for the functional programming paradigm.
1930s
von Neumann Architecture
A practical hardware model that unifies program instructions and data in memory. This is the basis for most modern computers and follows an imperative model.
1945
The Instruction Execution Cycle
Modern machines based on the von Neumann architecture operate on a simple, continuous cycle.
- Fetch: The CPU fetches the next instruction from memory.
- Decode: The CPU decodes the instruction to determine the operation and any operands.
- Execute: The CPU performs the operation.
- Store: If necessary, the result is stored back in a register or memory.
Dominant Programming Paradigms
Paradigms are different ways to create abstractions, allowing programmers to manage complexity and build robust, scalable code.
Imperative & Procedural
- Imperative programs are a sequence of statements that change a program's state.
- Procedural programming is a type of imperative programming that adds named subroutines (procedures or functions) which can be called from elsewhere in the program. Most modern languages support this.
Object-Oriented (OO) Built around the concept of objects, which bundle data (state) and the behaviors (methods) that operate on that data. It often models the world as a "Kingdom of Nouns".
Declarative Focuses on what a program should accomplish, rather than how it should be done. The underlying engine handles the "how". Examples: SQL, HTML, and Prolog.
Functional (FP) Built around composing pure, stateless functions. It supports higher-order functions (functions that take or return other functions) and treats data as immutable. It can be thought of as a "Kingdom of Verbs".
In-Depth Comparison: Functional vs. Object-Oriented
Functional | Object-Oriented | |
---|---|---|
Unit of Composition | Functions | Objects / Classes |
Programming Style | Declarative | Imperative |
Control Flow | Function calls, recursion, chaining | Loops, conditionals |
Polymorphism | Parametric (Generics) | Sub-Typing (Inheritance) |
Data & Behaviour | Loosely coupled | Tightly coupled in objects |
State Management | Immutable state | Mutates state |
Model of Computation | Lambda Calculus | Imperative (von Neumann/Turing) |
The study of programming languages involves understanding foundational concepts like Syntax , Semantics , and models of computation such as the Turing Machine , the Lambda Calculus , and the von Neumann model . From these models, several programming paradigms have emerged, including Imperative , Procedural , Object-oriented , Declarative , and Functional programming.
Changelog
2aa48
-web-deploy(Auto): Update base URL for web-pages branchon
Copyright
Copyright Ownership:WARREN Y.F. LONG
License under:Attribution-NonCommercial-NoDerivatives 4.0 International (CC-BY-NC-ND-4.0)