r/ProgrammingLanguages • u/mc-pride • Mar 05 '26
Are there any books/resources on language design (as opposed to implementation)
A lot of textbooks, guides or articles that get recommended when one is learning about making a programming language focus on either the implementation side of things, like how to write parsers, semantic analysis, SSA form, code generation, etc... or the abstract semantics of languages like category theory, type theory, etc...
Are there any good books that focus on the design of the language itself? i.e. what consequences certain design decisions have, how to do user testing of new language features, how features interact, user experience, etc...
19
u/hanshuttel Mar 05 '26
There is Programming Language Design and Implementation by Torben Ægidius Mogensen (https://link.springer.com/book/10.1007/978-3-031-93299-1). I am probably biased, as I used to teach a course based on this book together with Torben himself.
28
u/Express-Guest-1061 Mar 05 '26
I am not aware of such book. I also feels this quickly become opinionated, people prefer different kind of languages.
The closest book I am aware of is the book ”Masterminds of Programming: Conversations with the Creators of Major Programming Languages”. About 18 language authors are interviewed in the book and you get some insight in how they think about programming.
For me the paper ”GoTo statement considered harmful” and ”Notes on Structured Programming” was influencial. With a structured language, SSA become much easier, e.g. no early returns.
9
u/suhcoR Mar 05 '26
I have "Programming Language Pragmatics" by Michael L. Scott which goes in the direction you're looking for; it discusses the pragmatic consequences of different design decisions.
8
u/Woumpousse Mar 05 '26
I always liked this book. It explores the (rather unknown) language Oz, but does so in a very layered approach: it starts off with a small subset of the language and examines what adding a certain feature would have as consequence.
8
u/tobega Mar 06 '26 edited Mar 06 '26
There is a great talk by Brian Kernighan who has designed a number of successful languages, https://youtu.be/Sg4U4r_AgJU
Kenneth Iverson's ideas on the subject are interesting https://www.eecg.utoronto.ca/~jzhu/csc326/readings/iverson.pdf In APL like languages it has been said that there are adverbs to modify the verbs (-ish), which fascinates me.
The philosophies behind Perl and Raku are also interesting especially since they were designed by a linguist. Perl was based on the idea of "there is more than one way to do it", which was great when writing things quickly, but horrible when trying to maintain a program over time, so successful design in one way, complete failure in another. This follows also in Scala which has too many different ways to do the same thing leading to a lack of maintainability. I have not (yet) any experience with Raku, but I know it has a lot of operators of different classes.
Guy Steeles's talk "Growing a language" is rather meta, but fun. A thing to think about is where does the language end? What about libraries that are built on the language, aren't they a language in themselves, with their own good or bad design? So you have some really simple and consistent languages like Lisp, Smalltalk, Forth, Tcl, Newspeak, Shen, but in the end it's the libraries not the language that determine the experience.
Andreas Stefik and Stefan Hanenberg (and others) have come up with attempts to do empirical research on usability of syntax, and the quorum language is based on some of it. You also have the group behind the Pyret language trying to figure out a good language for learning. Also the Hedy language aims for learnability in a different way.
Ultimately you have to figure out what does "good design" mean? What is the context?
Some languages try to avoid "the turing tarpit" in order to make things provably deterministic, which is useful for some things. For example the bloom programming language can prove consistency of distributed programs, but I couldn't figure out how to sort a list in it.
The Erlang language embraces failure as a fact of life in order to achieve systems that are incredibly reliable and resilient, but maybe they are not that easy to reason about.
IMO, a well-designed programming language would be better at communicating "the theory of the program" as per Peter Naur https://pages.cs.wisc.edu/~remzi/Naur.pdf I wrote a blog post about similar concerns https://tobega.blogspot.com/2023/09/using-programming-structures-to.html
An often used method to determine usability is the Cognitive Dimensions of Notations, which evaluates trade-offs along multiple dimensions. I tried to use it here https://tobega.blogspot.com/2022/12/evaluating-tailspin-language-after.html
After reading "The Essence of Software" by Daniel Jackson I tried to apply the idea of fundamental "concepts" to programming language https://tobega.blogspot.com/2024/01/usability-in-programming-language.html
7
u/MadCervantes Mar 05 '26
Check out quorum. They do actual use testing
7
u/Inconstant_Moo 🧿 Pipefish Mar 06 '26
It's kind of hard to do because how to design the language depends on what the language is for. Good design in Python would be bad design in Rust
There are a lot of design decisions, like every language feature everyone's ever thought of, plus the new ones you'll think of as you go along. The arguments abut any feature can be long and detailed and technical --- look at e.g. how many 1s and 0s have been expended on discussing errors as values versus exceptions; checked exceptions --- god or the devil's snare?; exceptions as effects; should you be able to subtype exceptions; what sorts of things should you be even allowed to recover from ... you could write a chapter on the debates and pros and cons of this one topic. Another chapter on your options for concurrency. A book on type systems ...
And these are all things that you have to fit with the other features of the language and its purpose. E.g. my language has errors-as-exceptions not necessarily because this is good per se but because this is what other more important features require.
First, round up some test users. You will need to use bribery or force.
I don't think anyone would put that in a book because unless you're a multinational corporation this isn't something you're going to be able to do. You eat your own dogfood 'til it tastes nice.
Poorly. Every two orthogonal features meet at a corner case. This is often more of an implementation problem, though, you just have to plug all the corner cases, all the hundreds and hundreds of stupid corner cases ... excuse me (weeps openly). And when it works properly, there may still be implementation trade-offs. E.g. Go's FFI has a large overhead because of their nice simple way of doing concurrency. They pay for good design in one place with slow implementation in another.
From a design view, obviously features fight for the good syntax --- we only have so many kinds of brackets on a standard keyboard, etc.
As to the interaction of their semantics, that's going to be very specific to the features, inevitably. All one can do is look at angry tech bloggers saying "The trouble with X is the way it interacts with Y" .. and then think of a way to fix it, or a way to do without X, or a way to do without Y, or that you'll just have to live with this one because it's important to the purpose of the language to have both.
See above re dogfood. You're the user, you keep using it 'til it makes you happy.
3
u/SnooGoats8463 Mar 06 '26
https://cs.lmu.edu/~ray/notes/languagedesignnotes/
3
u/JeffD000 Squint Mar 10 '26
Here is a list of "great papers" someone put together:
https://www.cis.upenn.edu/~bcpierce/courses/670Fall04/GreatWorksInPL.shtml
I once had a a special SIGPLAN issue that collected all the foundational papers by all the greatest language designers in history. Unfortunately, that was a long time ago, and I have lost the reference.
3
u/SnooCompliments7914 Mar 10 '26
History of programming languages (two volumes).
4
u/eightrx Mar 05 '26
I think most of what you're describing comes at a case by case basis. Every PL dev goes about there design process differently, so my best guidance would be to listen to language designers talk about what your describing and make your own inference.
J blow on language design
Boundaries of language design with Andrew Kelley and Ginger bill
1
u/Material-Discount712 Mar 14 '26
Things I found useful:
Book: "Advanced Programming Language Design" by Raphael Finkel
https://wiki.c2.com/?ThereAreExactlyThreeParadigms followed by https://en.wikipedia.org/wiki/Category:Programming_paradigms
I also second the people mentioning Raku. For those who don't like Perl, Raku is a cleaned-up version. It should especially be considered by anyone interested in language design, if only for the grammar support it has.