I’ve previously looked at some programming language websites and found that they often failed to actually communicate what is the raison d’etre of the language, or even say much of anything about what distinguishes it from other languages. But new, hobby, and experimental programming languages are often pretty upfront about why the effort exists. In this post I’d like to look at some of popular categories of reasons for creating a new programming language. This is not intended to be an exhaustive list, in particular I’m mostly looking for reasons for the language to exist, rather than reasons for the author to engage in such a project, many do this mostly as a learning exercise even if the project turns out more successful than they expected.
AI coding agents has made the construction of your own programming language pretty accessible. I think this was always relatively accessible for a programmer anyway but AI does take care of a lot of the drudgery, such as documentation and building a passable website for your language. This has also meant that more exploratory, and educational attempts have a greater chance of becoming something at least usable.
Anyway here are the categories I often see and some thoughts I have on such languages.
X but with Y
As we will see a bunch of the later categories could be considered a sub-category of this one. For this category I usually think of examples where the author has some pet-peeve of a language that they otherwise like. That pet-peeve is often syntax related. In my experience, I can pretty much get used to any syntax as long as I spend enough time with it. On many occassions I have suggested that I didn’t like some particular syntax only to later find myself happily using it without issue. Early in my career I was dead set against the idea of significant whitespace, for reasons I can no longer recall, but I was forced into use Haskell at work and within days I realised I had been pretty wrong about significant whitespace.
Alamagam
There’s a long-running joke, which turns up with different languages and properties swapped in and out. Here’s a recent version from Ngnghm:
Heaven is where the compile speed is from Go, the safety from Rust, the performance from C++, the libraries from Python, the macros from Lisp, the stability from Java, the types from Haskell, the ubiquity from JavaScript, and the error handling from Elm.
Hell is where the compile speed is from Rust, the safety from C++, the performance from Python, the libraries from Lisp, the macros from Java, the stability from Haskell, the types from JavaScript, the ubiquity from Elm, and the error handling from Go.
This category of languages is where someone attempts to create the Heaven part of the joke. Usually they are a bit less ambitious than that.
Experimental
My favourite recent one in this category is Goose “A memory-safe systems language with no heap allocator, garbage collector, or lifetime annotations.”
Arguably Elm is a great example, the language was written as part of the author’s thesis. These are languages where the focus is on exploring an idea with some kind of workable compiler. Rather than producing an actual production usable eco-system, even if after time it may evolve into that after the idea is validated, as was the case with Elm. Such languages tend to, and should be, fairly small and frugal in features outside those of the core expermental idea. Part of the reason for this is that you do not want a plethora of other features to cloud evaluation of the main experimental idea. So for example if Goose adopted a 2D grammar people would necessarily be distracted by that when evaluating the efficacy of the memory management model.
Modernise
These tend to accept that an old language cannot really be brought up to date for various often including backwards compatibility. The C language is a common targer for this kind of new language. Since the C language was designed, and even since it has been updated, there have been many new and old ideas surrounding programming languages that have been tested and evaluated. So it is a common goal to take the best parts of C and add in the author’s favourite modern ideas. Common things to add include, memory safety, garbage collection, concurrency, and a more modern type system often including generics.
Remove the cruft
Forks
Successor with migration path
Guest on a platform
Domain specific
Deliberately stable - Some other guarantee
Other categories
There are other categories that I’m not going to discuss here. Mostly because these languages typically fulfill their goals. Two obvious categories here are educational and joke/parody languages. Mostly these languages are indeed a decent joke or can be used well to teach programming. If I’m 100% honest I mostly think the educational category is unnecessary. I think it’s quite possible to teach, for example, a subset of Python.