What is a programming language? A six-layer model
March 2016 (perspective of an assistant professor)
This article is adapted from a 15-minute talk I gave at the University of Rochester's annual hackathon in April 2016:
To watch a longer lecture on this topic, see What is a programming language? (45-minute lecture)
What is a programming language?
When someone says that a language is good or bad, useful or impractical, elegant or messy, what are they referring to?
I want to walk through what a programming language means to me. To me, a programming language consists of six layers:
Imagine a burrito with six layers, with specification as the base layer of beans and community as the outer tortilla wrapping.
Layer 1: Specification
A specification describes both the syntax and semantics of a programming language. If someone gives you a piece of code, you can, in theory, refer to the language's specification to determine exactly what that code is supposed to do. But that process would be unbearably slow, so that's why we have ...
Layer 2: Implementation
Engineers spend bazillions of hours creating implementations that run code as fast as possible. You might have heard the terms interpreter, compiler, or just-in-time compiler. Those are techniques for creating implementations, which usually trade off simplicity for speed.
Layer 3: Run-time environment
Layer 4: Standard library
In contrast, a language such as Python is known for having a well-designed and feature-rich standard library so that many practical programs can be written without installing third-party libraries.
Layer 5: Third-party libraries
Who writes these libraries? This question brings us to the final layer ...
Layer 6: Community
The outermost layer (burrito wrapping) of a programming language is the community of programmers who write code in that language.
Since programming languages are ultimately written by and for people, a language succeeds or fails based on the people who use it. Is your community vibrant and inclusive? Or stagnant and off-putting? Are people helpful and encouraging to beginners? Or scary and intimidating? Both in-person and online communities shape people's impressions of a language and are vital for that language's long-term sustainability.
In sum, if you want to create a new language from scratch and see it get adopted in the real world, then you need to take all six layers into account. Simply writing a mathematically-elegant specification or a lightning-fast implementation isn't enough. Think about the people. Think about the entire burrito. Happy hacking!
Keep this website up and running by making a small donation.
Last modified: 2016-03-28