Fundamentals 10 min read

Can Java Become a More Growable Language? Inside Brian Goetz’s Vision

Brian Goetz, Java language architect, outlines his vision for a more growable Java by introducing the “witness” concept, discussing underlying philosophy, potential new features like numeric types, operator overloading, collection expressions, and how these ideas fit into the Valhalla project and Java’s future roadmap.

21CTO
21CTO
21CTO
Can Java Become a More Growable Language? Inside Brian Goetz’s Vision

Java appears to be seeking transformation, a shift tied to changes within Oracle’s team.

Java architect Brian Goetz shared his long‑term vision for a more “growable” programming language, introducing the notion of “witnesses” to enable stronger new capabilities.

His recent JVM Summit talk did not focus on the Java we have today, but on a hypothetical set of features designed not merely to write better programs but to make the language more extensible and scalable.

Goetz explained that the idea stems from a desire to treat language growth as a core design principle, echoing Guy Steele’s 1998 paper “Developing a Language”. Steele argued that language designers should view growability as central to language design.

Philosophy of a “Growable” Language

At the start of his talk, Goetz emphasized that he was not discussing immediate features but long‑term evolution, aiming for “inspirational examples”. He recalled Steele’s call for language designers to prioritize growability.

Steele noted that while many languages allow extensions via user‑created libraries, extending the language’s primitive set becomes difficult if new primitives differ from the core primitives.

Goetz likened the Valhalla project—an OpenJDK effort started in 2014—to a “starting gun” for such evolution.

Introducing “Witnesses”: A New Java Concept

Goetz proposes redefining method‑defining interfaces as “behavior blueprints”. He suggests that an interface should capture a set of named behaviors, allowing a type or a group of types to conform to that set, with the compiler performing type checks.

This creates a distinction: the Java language design team wants to focus on types rather than instances of types.

精选图片:Java 语言架构师 Brian Goetz 谈 Java 如何发展
精选图片:Java 语言架构师 Brian Goetz 谈 Java 如何发展

He describes “witnesses” as a mechanism to transfer behavior to third‑party objects.

The idea is to introduce a simple keyword—“witness”—and the ability to “summon” a witness simply by naming its type. public static final Comparator COMPARATOR = which would become:

public static final witness Comparator COMPARATOR =

Goetz further explained that adding a relatively small amount of language support could introduce type classes—a mechanism to abstract over type behavior—similar to Haskell’s type classes, and that C# and Kotlin are exploring comparable concepts.

The core challenge is abstracting type behavior without embedding it directly in the type definition.

Growth Opportunities: Potential New Java Features

Goetz identified several possible additions:

New numeric classes with primitive‑like runtime behavior, e.g., 16‑bit floating‑point numbers.

Mathematical operators allowing standard symbols (e.g., “+”) to operate on new types like Float16, while cautioning about the pitfalls of operator overloading.

Collection expressions for building sequence‑like structures, akin to features in C#.

Creation expressions that could indicate valid “null” values via witnesses, enabling validity checks during array initialization.

These ideas build on prior language extensions such as “foreach” loops and “try” with the Iterable interface.

Java’s Future Roadmap

Goetz concluded that the witness concept not only illustrates a new mechanism but also outlines four potential features that have long troubled the language.

He believes witnesses could eventually allow richer libraries and conditional behavior, reducing the need for countless new language constructs.

In the short term, they can provide scalable language features that developers have requested for years.

Audience reaction was enthusiastic, with many recognizing the substantial value of even a modest syntactic change.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Javalanguage designValhallawitnessBrian Goetzgrowable
21CTO
Written by

21CTO

21CTO (21CTO.com) offers developers community, training, and services, making it your go‑to learning and service platform.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.