Lexical Scoping

/ˈlɛksɪkəl ˈskoʊpɪŋ/

noun … “Scope determined by code structure, not runtime calls.”

Lexical Scoping is a scoping rule in which the visibility of variables is determined by their position within the source code. In languages with lexical scoping, a function or block can access variables defined in the scope in which it was written, regardless of where it is called at runtime. This is fundamental to closures and scope management.

Scope

/skoʊp/

noun … “Where a variable is visible and accessible.”

Scope is the region of a program in which a variable, function, or object is accessible and can be referenced. Scope determines visibility, lifetime, and the rules for resolving identifiers, and it is a fundamental concept in programming languages. Understanding scope is essential for managing state, avoiding naming collisions, and enabling features like closures and modular code.

Key characteristics of scope include:

Closure

/ˈkloʊʒər/

noun … “A function bundled with its environment.”

Closure is a programming concept in which a function retains access to variables from its lexical scope, even after that scope has exited. In other words, a closure “closes over” its surrounding environment, allowing the function to reference and modify those variables whenever it is invoked. Closures are widely used in Functional Programming, callbacks, and asynchronous operations.

Key characteristics of closures include:

Replication

/ˌrɛplɪˈkeɪʃən/

noun … “Copy data across nodes to ensure reliability.”

Replication is the process of creating and maintaining multiple copies of data across different nodes in a Distributed System. Its purpose is to enhance Availability, fault tolerance, and performance by allowing data to remain accessible even if some nodes fail. Replication is fundamental to distributed databases, file systems, and cloud storage platforms.

Paxos

/ˈpæk.sɒs/

noun … “Consensus algorithm for unreliable networks.”

Paxos is a fault-tolerant Consensus algorithm designed to achieve agreement among nodes in a Distributed System, even when some nodes fail or messages are delayed or lost. It ensures that a single value is chosen and consistently replicated across all non-faulty nodes, providing a foundation for reliable state machines, replicated databases, and coordination services.

Consensus

/kənˈsɛnsəs/

noun … “Agreement among distributed nodes.”

Consensus is the process by which multiple nodes in a Distributed System agree on a single value or state despite failures, message delays, or node crashes. Consensus ensures that all non-faulty nodes make consistent decisions, which is crucial for maintaining data integrity, coordinating actions, and implementing replicated state machines. It underpins critical operations in databases, blockchain networks, and fault-tolerant services.