Back to series
· 15 min read

Language Specifications and Version Evolution


I. What Is a Language Specification?

A language specification is a formal technical document describing a programming language, used to define how programs should be written, interpreted, compiled, and executed.

It answers several core questions:

  • Which code is legal?
  • What meaning does each syntactic construct carry?
  • By what rules should expressions be evaluated?
  • How does the type system constrain programs?
  • What behavior should a program exhibit when it executes?
  • What requirements must compilers and runtimes satisfy?

For example, consider the following JavaScript code:

let x = 10;
let y = x + 20;
console.log(y);

A language specification needs to define:

  • The syntax of let and the rules of lexical scoping.
  • How numeric literals are represented.
  • The evaluation semantics of the + operator.
  • The rules for variable declaration and initialization.
  • Whereas console.log is not standard syntax defined by the core ECMAScript language specification, but an API provided by the host environment.

This shows that a language specification describes not only what code looks like, but also what behavior the code should have.

1. Main Components of a Language Specification

Component Main Content
Lexical specification Identifiers, keywords, literals, comments, and whitespace
Syntactic specification Expressions, statements, declarations, and program structure
Semantic specification Operations, control flow, scoping, and execution rules
Type specification Type definitions, type checking, conversion, and compatibility
Memory model Objects, references, memory access, and rules of concurrent visibility
Standard library specification Standard types, functions, containers, and APIs
Runtime specification Exceptions, resource management, module loading, and execution behavior
Implementation requirements Constraints that compilers and runtimes must satisfy

Different languages cover different scopes in their specifications.

For example, the C++ standard specifies not only syntax and the type system, but also object lifetime, the memory model, the standard library, and concurrency behavior; the ECMAScript specification mainly defines the JavaScript language itself and its built-in objects, and does not uniformly specify browser DOM APIs.

2. Language Specifications and Language Implementations

A language specification and a language implementation are not the same concept.

  • Language specification: defines how the language ought to work.
  • Compiler: converts source code into target code, or performs the relevant compilation processing.
  • Interpreter: executes programs according to the language rules.
  • Runtime: provides the environment and foundational capabilities required for program execution.
  • Standard library: provides the general-purpose functionality agreed upon within the language ecosystem.

For example, the Java Language Specification defines the syntax and semantics of Java programs, the JVM Specification defines the behavior of the Java Virtual Machine, and the concrete OpenJDK implementation is responsible for putting these specifications into practice.

flowchart TD
    A["Language Specification"] --> B["Defines Syntax and Semantics"]
    B --> C["Compiler or Interpreter Implementation"]
    C --> D["Runtime Execution"]
    D --> E["Program Exhibits the Specified Behavior"]
    F["Standard Library Specification"] --> G["Standard Library Implementation"]
    G --> D

    style A fill:#E0F0FE,stroke:#93BCE8,color:#1E4976
    style B fill:#E5F4EC,stroke:#A3CBB5,color:#334155
    style C fill:#F3EDFC,stroke:#C4B2E3,color:#334155
    style D fill:#E0F0FE,stroke:#93BCE8,color:#1E4976
    style E fill:#E5F4EC,stroke:#A3CBB5,color:#334155
    style F fill:#FFF5DE,stroke:#E8D29A,color:#334155
    style G fill:#E8EDF2,stroke:#B8C3CE,color:#334155
    linkStyle default stroke:#A3B8AC,stroke-width:1.5px

Specifications usually allow implementers to choose a concrete implementation approach, provided the requirements are met.

For example:

  • The Java Virtual Machine may use interpreted execution or JIT compilation.
  • JavaScript engines may employ different garbage collection algorithms.
  • C++ compilers may adopt different optimization strategies.
  • Different Python implementations may use different internal object representations.

Therefore, a language specification defines externally observable behavior and implementation constraints; it does not necessarily prescribe all underlying implementation details.


II. Why Are Language Specifications Important?

Without a unified specification, different compilers might understand the same program differently, and it would be difficult for developers to ensure that a program runs across platforms.

Language specifications mainly solve the following problems.

1. Ensuring Consistency of Language Behavior

Suppose different compilers applied different evaluation rules to the same expression:

int result = 10 + 20 * 3;

Without a clear operator precedence, compilers might produce different results.

By defining precedence, associativity, and evaluation rules, a language specification reduces behavioral differences between implementations.

2. Supporting Cross-Platform and Cross-Implementation Use

The same program that conforms to the specification can run on different implementations.

For example:

  • Java virtual machines from different vendors.
  • C++ compilers on different platforms.
  • JavaScript engines in different browsers.
  • Python implementations on different operating systems.

However, cross-platform capability also depends on whether the program relies on the operating system, hardware, external libraries and implementation extensions.

Conforming to the language specification does not mean that all behavior depending on the external environment will be exactly the same.

3. Clarifying the Implementer's Responsibilities

A language specification distinguishes between behaviors of different natures:

  • Rules that must be followed.
  • Behavior that implementers are allowed to choose.
  • Behavior defined by the specific implementation.
  • Behavior that the specification does not define or explicitly does not guarantee.

These categories are especially important for compiler development and cross-platform programming.

4. Providing a Foundation for the Tooling Ecosystem

Compilers, static analysis tools, formatters, code editors and debuggers all need to understand the syntax and semantics of the language.

For example:

  • A parser needs to understand the language's syntax.
  • A type checker needs to understand the type rules.
  • A code formatter needs to recognize syntactic structure.
  • A static analysis tool needs to understand variable scope and control flow.
  • An IDE needs to understand modules, symbols and type information.

The language specification provides these tools with a unified basis for behavior.


3. Key Concepts in Language Specifications

The terminology used in the standards of different languages is not entirely the same, but a few important concepts deserve particular attention.

1. Syntax Rules (Syntax)

Syntax specifies how program structure is organized.

For example, a Python function definition:

def add(a, b):
    return a + b

Syntax rules determine:

  • The position of the def keyword.
  • The form of the function name.
  • The structure of the parameter list.
  • The position of the colon.
  • The indentation rules for the function body.
  • How the return statement is used.

A syntax error means the code cannot be parsed according to the structure specified by the language.

2. Semantic Rules (Semantics)

Semantics defines what meaning legal code should express and what behavior it should produce when executed.

For example:

x = 10
y = x + 20

Semantics needs to define the behavior of variable binding, expression evaluation and the addition operation.

Being syntactically correct does not mean the semantics are necessarily correct.

For example:

x = "hello" - 10

This code conforms to the basic syntactic structure, but in Python performing the subtraction raises a TypeError.

3. Type Rules (Type Rules)

Type rules specify the type relationships between values, expressions and variables.

For example, in Java:

int age = 20;
String name = "Alice";

The type system specifies:

  • age is of type int.
  • name is of type String.
  • Assignments between incompatible types must satisfy the corresponding conversion rules; otherwise a compilation error occurs.

Different languages differ considerably in their rules for type checking, type conversion and type inference.

4. Undefined Behavior (Undefined Behavior)

Undefined behavior is an important concept in some language specifications.

Take C and C++, for example: once certain operations occur, the standard no longer requires the program to have any particular behavior.

For example, in C:

int x = 2147483647;
x = x + 1;

If int is a 32-bit signed integer, this kind of signed integer overflow is undefined behavior.

The compiler is not required to guarantee that the program wraps around to a negative number in the way the developer expects.

Note that the integer bit width and the specific range of values are also constrained by the implementation and the version of the standard; the 32-bit assumption in the example should be confirmed against the target platform.

Undefined behavior can have serious consequences:

  • The compiler may optimize based on the assumption that the program does not exhibit undefined behavior.
  • The program may produce unpredictable results.
  • Debug builds and optimized builds may behave differently.
  • Different compilers may behave differently.

5. Implementation-defined Behavior (Implementation-defined Behavior)

Implementation-defined behavior is behavior that the specification allows the implementer to choose, but requires the implementer to document the choice explicitly.

For example, in C the exact width of certain integer types may depend on the implementation.

Different compilers and platforms may make different choices, but they must meet the standard's requirements and document the relevant choices.

6. Unspecified Behavior (Unspecified Behavior)

Unspecified behavior is behavior for which the specification permits several possible outcomes but does not require the implementer to document the specific choice.

For example, in C:

int x = 0;
int result = f() + g();

If both f() and g() have side effects, this expression alone cannot determine which function executes first.

For different expressions, the specific evaluation order rules must be determined according to the language standard.

7. The Differences Between the Three Kinds of Behavior

Type Does the specification allow multiple outcomes Does it require implementers to document
Undefined Behavior The specification no longer imposes the usual behavioral requirements No
Implementation-defined Implementers are allowed to choose Yes
Unspecified Multiple possible outcomes are allowed Usually not required

These three concepts are especially important in C/C++, and should not be simplistically understood as synonyms for "the outcome is uncertain."


IV. Language Standards and Standards Organizations

Programming language specifications are usually developed and maintained by standards organizations, technical committees, or language governance bodies.

Different languages have different standardization mechanisms.

1. ISO

The International Organization for Standardization (ISO) is responsible for developing international standards.

Some important programming language standards are published by ISO.

For example:

Language Standard series Main purpose
C ISO/IEC 9899 C language standard
C++ ISO/IEC 14882 C++ language standard
Java ISO/IEC 23270 and related standard systems International standards related to the Java language
SQL ISO/IEC 9075 SQL database language standard

Note that Java's main language and platform specifications are also maintained by the Java Community Process and related specification systems such as Oracle's; the ISO standard should not be regarded as their sole source of specification.

2. ECMA International

ECMA International is an organization responsible for developing information and communication technology standards.

The core language specification for JavaScript, ECMAScript, is standardized by ECMA International.

Common standard names:

  • ECMA-262: the ECMAScript language specification.
  • ECMA-402: the ECMAScript Internationalization API specification.

ECMAScript mainly defines the core capabilities of the language, for example:

  • Variables and functions.
  • Objects and properties.
  • Expressions and statements.
  • Classes and modules.
  • Promise.
  • Async functions.
  • Built-in objects.

Capabilities such as the DOM and Web APIs in browsers are defined by other standards organizations and specification systems.

3. W3C and WHATWG

W3C and WHATWG play important roles in Web technology standards.

W3C once developed and maintained a large number of Web-related standards.

WHATWG, in turn, maintains continuously evolving Web standards such as the HTML Living Standard.

For example:

  • HTML: page structure and document semantics.
  • DOM: the Document Object Model.
  • Fetch: the network request interface.
  • URL: URL parsing and processing rules.

These specifications work together with the JavaScript language specification, but they are not part of the ECMAScript core language specification itself.

4. The Java Community Process (JCP)

The Java Community Process (JCP) is an important community governance mechanism for Java technology specifications.

It proposes and advances specifications related to the Java platform through Java Specification Requests (JSRs).

For example:

  • Specifications related to the Java language and virtual machine.
  • Java platform APIs.
  • Enterprise Java technologies.
  • Other standardized capabilities in the Java ecosystem.

The Java Language Specification (JLS) and the Java Virtual Machine Specification (JVMS) are important documents for understanding the Java language and runtime environment.

5. Specification Systems of Different Languages

Language Main specification system Typical specification
C ISO ISO/IEC 9899
C++ ISO ISO/IEC 14882
JavaScript ECMA ECMA-262
Java JCP, Oracle, and other specification systems JLS, JVMS
Python Python core development community Python Language Reference
Go The official Go project Go Language Specification
Rust The Rust project and community Rust Reference

Not all languages adopt the traditional international standardization model of ISO.

For example, Python mainly evolves through the official Python documentation, PEPs, and its core development process; Go's language specification and related toolchain are maintained by the Go project.


V. Version Numbers and Version Evolution of Programming Languages

Programming languages usually use version numbers to indicate the evolution status of language specifications, compilers, runtimes, or toolchains.

For example:

  • C11, C17, C23.
  • C++11, C++14, C++17, C++20, C++23.
  • Java 8, Java 11, Java 17, Java 21, Java 25.
  • ECMAScript 2015, 2016, 2017, etc.
  • Python 3.10, 3.11, 3.12, 3.13, etc.
  • Go 1.20, 1.21, 1.22, etc.

Version numbering schemes are not uniform.

1. Basic Components of a Version Number

Many software projects use Semantic Versioning (SemVer):

MAJOR.MINOR.PATCH

For example:

3.12.2

Generally, this means:

  • MAJOR: major version.
  • MINOR: minor version.
  • PATCH: patch version.

However, note that Semantic Versioning is not a unified version-numbering rule adopted by all programming language standards.

For example, C++ uses year-based numbering, Java uses integer version numbers, and ECMAScript uses years and standard version sequence numbers.

Therefore, when reading a language version, first confirm whether it refers to:

  • the language standard version;
  • the compiler version;
  • the runtime version;
  • the standard library version;
  • the toolchain version.

These versions may not be the same.

2. Main Areas of Language Version Evolution

Language versions typically involve the following changes:

Type of Change Description Example
New syntax Introduction of new syntax constructs Pattern matching
New type capabilities Extensions to the type system Generics, algebraic data types
New runtime capabilities Addition of runtime mechanisms Coroutines, virtual threads
Standard library extensions Addition of new APIs Collections, concurrency utilities
Behavior corrections Clarification or adjustment of existing behavior Exception handling rules
Security improvements Reduction of dangerous operations Stricter type and boundary constraints
Deprecation and removal Phasing out old features Removal of deprecated APIs

Language version evolution does not mean that every update changes the core syntax.

Some versions mainly extend the standard library, some focus on improving the runtime, and others mainly address specification defects and compatibility issues.


VI. How Are Language Versions Formulated?

Different languages have different governance models, but typical specification evolution usually includes stages such as requirement proposal, proposal discussion, specification review, implementation validation, and formal release.

1. Proposing New Feature Requirements

Developers, language maintainers, companies, and communities may propose requirements for new language capabilities.

For example:

  • Simplify asynchronous programming.
  • Strengthen type inference.
  • Improve the expressiveness of generics.
  • Reduce memory safety issues.
  • Improve compilation performance.

When proposing a requirement, it is usually necessary to explain:

  • What problem currently exists.
  • Why existing language capabilities are insufficient.
  • What problem the new feature solves.
  • Whether it will break existing code.
  • What the implementation cost and ecosystem impact are.

2. Submitting a Proposal

Different languages use different proposal mechanisms.

For example:

Language Proposal Mechanism
Python PEP (Python Enhancement Proposal)
Java JEP (JDK Enhancement Proposal), JSR, and other mechanisms
Rust RFC (Request for Comments)
ECMAScript TC39 Proposal Process
Go Go Proposal Process
C++ WG21 proposals and the standards committee process

These proposal mechanisms are not entirely the same.

Some are used to propose language features, while others are used to improve the standard library, toolchain, or development process.

3. Discussion and Review

Proposals usually need to undergo technical discussion and review.

Key concerns include:

  • Whether the design is reasonable.
  • Whether it conflicts with existing syntax.
  • Whether it affects existing programs.
  • Whether it can be supported by different implementations.
  • Whether it introduces complexity that is difficult to maintain.
  • Whether it has sufficient practical value.

For example, adding a new syntax keyword may cause previously valid variable names to become invalid identifiers.

This is the kind of compatibility issue that must be considered in language evolution.

4. Reference Implementation and Experimental Validation

Some languages first implement new features in experimental branches, preview versions, or compiler prototypes.

They validate them through real-world projects:

  • Whether the syntax is easy to use.
  • Whether the compiler implementation is feasible.
  • Whether performance is affected.
  • Whether it is compatible with existing tools.
  • Whether developers can understand it correctly.

A reference implementation helps uncover issues that are not easy to find during the design phase.

5. Formal Acceptance and Release

After review and approval, new features may enter an official language version or standard version.

After release, compilers and runtimes need to implement the relevant capabilities incrementally.

However, the release of a standard does not mean that all compilers immediately support all features.

Different implementations may support them at different paces.

6. Language Evolution Process

flowchart TD
    A["Identifying language feature needs"] --> B["Proposing an improvement proposal"]
    B --> C["Technical discussion and review"]
    C --> D{"Is the proposal approved?"}
    D -->|"No"| E["Revise or defer the proposal"]
    E --> B
    D -->|"Yes"| F["Design specification and reference implementation"]
    F --> G["Experimental validation and feedback"]
    G --> H{"Are the requirements met?"}
    H -->|"No"| E
    H -->|"Yes"| I["Formally accept the proposal"]
    I --> J["Incorporate into a language version or standard"]
    J --> K["Compiler and runtime implementation"]
    K --> L["Gradual ecosystem adoption"]

    style A fill:#E0F0FE,stroke:#93BCE8,color:#1E4976
    style B fill:#E5F4EC,stroke:#A3CBB5,color:#334155
    style C fill:#F3EDFC,stroke:#C4B2E3,color:#334155
    style D fill:#FFF5DE,stroke:#E8D29A,color:#334155
    style E fill:#FBE9E9,stroke:#D9AAAA,color:#334155
    style F fill:#E0F0FE,stroke:#93BCE8,color:#1E4976
    style G fill:#E5F4EC,stroke:#A3CBB5,color:#334155
    style H fill:#FFF5DE,stroke:#E8D29A,color:#334155
    style I fill:#E5F4EC,stroke:#A3CBB5,color:#334155
    style J fill:#F3EDFC,stroke:#C4B2E3,color:#334155
    style K fill:#E0F0FE,stroke:#93BCE8,color:#1E4976
    style L fill:#E5F4EC,stroke:#A3CBB5,color:#334155
    linkStyle default stroke:#A3B8AC,stroke-width:1.5px

This is a conceptual process; it does not mean that every language releases versions strictly according to the same stages and order.


Seven, Version Evolution Case Studies of Mainstream Languages

The best way to understand language version evolution is to observe how real languages have developed.

1. C: From a Procedural Language to a Modern Standard

The development of the C language is closely tied to the Unix operating system.

Early C spread mainly through different compilers and implementations, and only later gradually took shape as a formal standard.

Version Main changes
C89 / C90 Established the early standardized specification
C99 Introduced variable-length arrays, compound literals, inline functions, and other capabilities
C11 Introduced thread support, atomic operations, generic selection expressions, and other capabilities
C17 Mainly defect fixes
C23 Introduced a number of language and standard library improvements

C89 / C90

C89 is the C language standard established by ANSI, which later became ISO C90.

It laid the foundation for C compatibility across different compilers.

C99

C99 brought a large number of improvements, for example:

for (int i = 0; i < 10; i++) {
    printf("%d\n", i);
}

It allowed variables to be declared in the initialization part of a for loop.

Other important changes included:

  • The long long integer type.
  • Variable-length arrays.
  • Compound literals.
  • inline functions.
  • // single-line comments.
  • Enhancements to variadic macros.

C11

C11 introduced language-level support for concurrency and atomic operations.

For example:

#include <stdatomic.h>

atomic_int counter = 0;

void increment(void) {
    atomic_fetch_add(&counter, 1);
}

This enables C programs to use standard-defined atomic types and atomic operations.

C23

C23 continued to improve the C language's type system, syntax, and standard library.

For example:

  • Introduced the nullptr keyword.
  • Introduced language support for bool, true, false, and related items.
  • Improved integer constants and the attribute mechanism.
  • Enhanced the standard library and type support.

One characteristic of C's evolution is that, while maintaining long-term compatibility, it gradually refines modern programming capabilities.

2. C++: From Object-Oriented to a Modern Multi-Paradigm Language

C++ developed on the basis of C and gradually grew into a complex language system supporting multiple programming paradigms.

Version Key features
C++98 / C++03 Early standardization and corrections
C++11 Move semantics, lambdas, smart pointers, concurrency library
C++14 Generic lambdas, make_unique, etc.
C++17 optional, variant, structured bindings
C++20 Concepts, Ranges, coroutines, modules
C++23 std::expected, std::print, and other capabilities

C++11: A major turning point for modern C++

C++11 introduced many far-reaching features.

Move semantics:

std::vector<int> source = {1, 2, 3};
std::vector<int> target = std::move(source);

Lambda:

auto add = [](int a, int b) {
    return a + b;
};

Smart pointers:

auto ptr = std::make_unique<int>(100);

These capabilities improved resource management, functional programming expressiveness, and object lifetime control.

C++17: Enhanced standard library and language expressiveness

For example:

#include <optional>

std::optional<int> find_value(bool found) {
    if (found) {
        return 100;
    }

    return std::nullopt;
}

std::optional is used to represent a value that may or may not exist.

C++20: A major upgrade in language capabilities

C++20 introduced important features such as Concepts, Ranges, coroutines, and modules.

Concepts example:

#include <concepts>

template <typename T>
requires std::integral<T>
T add(T a, T b) {
    return a + b;
}

It allows explicit type constraints to be added to template parameters.

The evolution of C++ reflects how a large language continuously expands its abstraction capabilities and engineering expressiveness while maintaining compatibility.

3. Java: From a virtual machine platform to a modern language

Java achieves cross-platform execution through the JVM and continuously enhances its language and runtime capabilities.

Version Key changes
Java 8 Lambdas, Stream API, default methods
Java 9 Module system
Java 10 Local variable type inference
Java 11 HTTP Client standard API, etc.
Java 14 Switch expressions officially released
Java 16 Records officially released
Java 17 Sealed Classes officially released
Java 21 Virtual threads, pattern matching, and other official features
Java 25 A new LTS release and subsequent language and platform improvements

Java 8 lambda expressions:

List<String> names = List.of("Alice", "Bob", "Tom");

names.forEach(name -> System.out.println(name));

Java 10 local variable type inference:

var message = "Hello Java";

Here, var does not mean Java has become a dynamically typed language.

Variable types are still determined at compile time.

Java 21 virtual threads:

Thread.startVirtualThread(() -> {
    System.out.println("Hello from virtual thread");
});

Virtual threads are an important concurrency capability of the Java runtime, aimed at reducing the thread management cost of large numbers of blocking tasks.

It is important to distinguish: Java language features, JDK APIs, and JVM capabilities are not exactly the same. A feature added in a given version may belong to different layers: the language, the standard library, or the runtime.

4. JavaScript: From a scripting language to a modern application language

The standardized name of JavaScript is ECMAScript.

Early JavaScript was mainly used for browser interaction. As web applications grew more complex, the language continued to introduce new abstraction capabilities.

Version Key Features
ES5 Strict mode, array methods, JSON support
ES2015 (ES6) let, const, arrow functions, classes, modules, Promise
ES2016 Exponentiation operator, Array.includes
ES2017 async/await
ES2018 Async iterators, object spread
ES2019 flat, flatMap, etc.
ES2020 BigInt, optional chaining, nullish coalescing
ES2022 Class fields, private fields, top-level await

Arrow functions introduced in ES2015:

const add = (a, b) => a + b;

Async functions introduced in ES2017:

async function getUser() {
    const response = await fetch("/api/user");
    return response.json();
}

Optional chaining in ES2020:

const city = user?.address?.city;

The evolution of JavaScript versions reflects its development from a simple scripting language into a language for large-scale application development.

5. Python: From Concise Syntax to Modern Typing and Concurrency Capabilities

Python is known for its concise syntax and rich ecosystem, and its language and runtime continue to evolve.

Version Main Changes
Python 2.7 The last major release in the Python 2 series
Python 3.0 A major version upgrade with significant incompatibilities
Python 3.5 Introduced async/await syntax
Python 3.6 Introduced variable annotations and formatted string literals
Python 3.7 dataclasses, context variables, etc.
Python 3.8 Walrus operator
Python 3.10 Structural pattern matching, enhanced union type syntax
Python 3.11 Performance improvements, exception groups
Python 3.12 Type parameter syntax and other improvements
Python 3.13 Experimental free-threaded build and other capabilities

Formatted string literals in Python 3.6:

name = "Alice"
message = f"Hello, {name}"

Pattern matching in Python 3.10:

def handle(value):
    match value:
        case 0:
            return "zero"
        case 1:
            return "one"
        case _:
            return "other"

Type parameter syntax in Python 3.12:

def first[T](items: list[T]) -> T:
    return items[0]

Note that Python type annotations are mainly used for static analysis and developer tooling support, and generally do not automatically perform full static type checking at runtime.

The free-threaded build in Python 3.13 also needs to be understood in the context of specific build options and runtime environments; one cannot simply assume that all Python 3.13 programs are GIL-free by default.


VIII. Compatibility Issues with New Language Features

A language version upgrade is not just about adding new syntax; it also requires considering whether old code can continue to run.

Compatibility is one of the most important engineering concerns in the long-term evolution of a language.