Overview of Programming Language Concepts

Concepts and terminology help us organize our knowledge in such a way that we can better describe the world, talk about the world, and be open to creating new things in the world.

The Main Topics

Perhaps none of us will agree on the set of main topics in the study of programming languages, but I’ll take a shot. Here I’ve organized the field into eight topic areas:

① Names, Binding, and Scope (Declarations)
How do we give names to entities? And when we encounter a name, how do we know which entity it refers to?
② Evaluation (Expressions)
How do we express computations, using values and operators?
③ Execution (Control Flow)
How to we organize computation in time? What actions or effects can we produce?
④ Types
How do we classify values so that they may behave in certain, predictable ways?
⑤ Functional Abstraction (Subroutines and Coroutines)
How can we abstract computations into chunks so that we can invoke them whenever we need them?
⑥ Data Abstraction (Objects and Modules)
How do we make little bundles of data together with behavior?
⑦ Concurrency
How do we arrange to do different computations at the “same” time (safely)?
⑧ Metaprogramming
How can our programs know about themselves? How can we answer questions about the code itself?
Are there others?

What about things like performance? readability? maintainability? security?

These are higher-level, qualitative concepts that are all important to be sure, but they are more cross-cutting concerns that apply to a language as a whole. The list above is focused on more technical, academic concerns of what can be expressed and how.

But that said, read on to the end, because there’s something interesting at the end of these notes.

Details

Let’s look a little deeper into each of these areas.

Names

We have to be able to name things. Naming is indispensible even in human languages.

Expression Evaluation

An expression is either a value, or one or more expressions joined by operators. Expressions are evaluated to produce a value.

Control Flow

Computations often are required to occur in time. Some constructs produce actions, or effects. Some are triggered by events. Many languages feature statements (a.k.a. commands) that are executed.

Types

A value’s type constrains the way it may be used in a program. Types impose constraints on what we can and cannot say.

Subroutines

Subroutines, a.k.a. routines, subprograms, procedures, or functions, may just be the most important building block of good code. They are the most basic kind of code abstraction.

Modules

“Bob Barton, the main designer of the B5000 and a professor at Utah had said in one of his talks a few days earlier: "The basic principle of recursive design is to make the parts have the same power as the whole." For the first time I thought of the whole as the entire computer and wondered why anyone would want to divide it up into weaker things called data structures and procedures. Why not divide it up into little computers, as time sharing was starting to? But not in dozens. Why not thousands of them, each simulating a useful structure?” — Alan Kay

Concurrency

In the real world, things don’t happen in a single sequence. Things can happen at anytime. Different things can happen at the same time. What is time, anyway?

Metaprogramming

You might write a HR program that can answer questions like “What is the average salaray of employees in the marketing department?” But can you also ask it ”How many local variables are you made up of, and what are their types?” Metaprogramming is writing programs that manipulate programs (including themselves).

Going Beyond Concepts

A lot of these concepts feel technical, dry, and even somewhat language-independent. But you can’t really know a language without knowing its history (who created it and why? When? What problems were being solved? Was it built as a reaction to something?), and its vision.

A good vision helps to make a language learnable, usable, and maybe even successful. Here’s a fantastic talk in which vision is mentioned a couple times:

Summary

We’ve covered:

  • Eight major concepts in the study of programming languages
  • Higher-level ideas