Vivek Haldar

The Programming Language Consensus

If you look at features in mainstream programming languages over the last couple of decades, they seem to be converging around a common set of core features, surrounded by fashion, preference and whim. These core features are:

  • first class functions
  • lists and maps are part of the language
  • succinctness

These features first originated in dynamically typed scripting languages like Python. (Well, they originated in Lisp, but then everything originated in Lisp.) Then they gradually found their way into statically typed compiled languages like C++1 and Java. Some of the most anticipated features of Java 8 are lambda expressions and type inference.

There is a subtle distinction between succinctness and expressivity. Expressivity almost always leads to succinct code. My favorite example is list comprehensions. But succinctness is also about omitting unnecessary verbiage. A good example is type inference enabling the omission of spelling out types.

Go had all three from the get-go.

Two things that are not yet part of this common core are objects and concurrency. I almost added “object orientation” to the list above, but then Go’s model of defining structs and interfaces made me think otherwise. It reminds me of Niklaus Wirth’s philosophy of understanding programs by looking at their data structures first. As for concurrency, there are wildly different ways of expressing it, but I have a hunch that the CSP model adopted by Go (and Erlang) will prevail. Maybe in another few years there will be five items on the list of common language features.

This is a good thing, because it looks like we’re gradually finding our way towards abstractions and constructs that are proving to be widely useful and broadly applicable. It is also rendering irrelevant many of the PL community’s fiercest debates. The agitation over static vs dynamic types starts fading when a C++ or Java code snippet with range-based for loops, lambdas and omitted type declarations looks very much like a Python or Ruby one. I was also surprised to see that while Go is very much a systems language, in chatting with other programmers I found Go eating more share from Java and Python than C++.

  1. Yes, lists and maps are not technically part of the core C++ language, but of the STL, which is pretty fundamental to the actual use of C++. I wouldn’t be surprised if a future spec introduced core-language syntax for lists and maps. Same goes for Java. ↩︎