proj-plbook-plChListOfLangRemarks

Table of Contents for Programming Languages: a survey

This chapter contains a list of many well-known languages and remarks on what their distinguishing features are, what they value, and/or they're good for. As there is not yet a large body of research objectively measuring which language is better for which sort of task, these remarks are necessarily subjective. I have not used most of these languages, so these remarks are summarizing opinions of other people which I've read -- in other words, this is rumor, not fact. Since many of the remarks are about what is popular or comparatively good in the present day (in contrast to unchanging truths), after each section of remarks I put the year it was last updated.

Most of the best-known high-level languages intended to be written by programmers (in contrast to intermediate or assembly/machine languages) strive to be either general-purpose application languages or systems languages or both, so I won't make a separate section for general-purpose application languages. Although the dividing line between "systems languages" and non-systems languages is defined differently by different people, here I will use the lack of automatic memory management (in the sense of a runtime providing garbage collection or reference counting or similar) as the defining characteristic of a "systems language".

The most popular languages (updated 2022)

The most popular memory-managed (high-level, application) languages

All of these are imperative, object-oriented languages.

Python a dynamically typed, interpreted language that priortizes readability. It is easier to learn than most languages and is moderately small/simple. It is dynamically typed. It is not extremely fast/performant in itself, however Python modules can include code written in a another, faster language, and because Python is so popular, a ton of such modules have been written (including modules for numerical computation and A.I.; Python is in fact widely used in university computer science research). Python is not great for CPU-bound shared memory concurrency, because its architecture includes a Global Interpreter Lock or GIL, which means that many user threads cannot be executing simultaneously in one process. Python is considered enjoyable to use and is a good choice for a 'default' or 'go-to' language that you use unless you have a reason to use another one. (updated 2022)

Java is a statically typed, compiled language that prioritizes throughput performance. It runs on a portable virtual machine, the "JVM", for which much instrumentation is available. One downside is that in its default configuration, it can have noticable and unpredictable pauses due to garbage collection, some startup latency, and high memory usage -- however, alternate implementations and tunings of the JVM are available to ameliorate these. Another downside is that typical Java code has a reputation for being relatively verbose. Many people prefer to use Kotlin, a newer language that interoperates with Java, instead of Java. (updated 2022)

Javascript is the only high-level language natively supported by web browsers for client-side scripting on webpages. Despite the name, it is not actually related to Java. It is interpreted and dynamically typed but has a well-regarded (although somewhat large) extension called TypeScript?. Although its primary use for website client-side scripting, there are implementations such as Node and Deno that allow it to be used as a general-purpose language. Recently the WASM intermediate language has become supported by web browsers so now it is possible to write client-side website code in other languages.

C# (pronounced "Cee sharp") is a statically typed, compiled language. It is made by Microsoft but has been open-sourced and ported to all major operating systems. It was designed to work well with IDEs. One downside is that its syntax and library ecosystem is not great for numerical computation. C# is considered enjoyable to use and is a popular choice for a 'default' or 'go-to' compiled language that you use unless you have a reason to use another one. (updated 2022)

The most popular non-memory-managed (systems / low-level / close-to-the-metal) languages

C is a statically typed, compiled language. C has been described as thin portable layer over assembly language (however this characterization is disputed by some). Unlike the other popular languages, it is not object-oriented. C is often the only high-level language supported by various embedded platforms. C is so popular that it is the language that other languages tend to interoperate with; if a programming language exposes an interface by which it can be call, be called, or pass data to/from a program written in other languages, usually this interface will be specified in terms of compatibility with C. It is relatively simple (at least, compared to other popular high-level systems languages). One downside is that it is easy to make mistakes when writing C code, which lead to crashes, or worse, silent corruption. C is considered enjoyable to use, relative to other languages with manual memory management. (updated 2022)

C++* is a statically typed, compiled, object-oriented language. C++ is roughly a superset of C; C++ interoperates well with C but has many more features, allowing code to be written at a higher level. C++ even has features to (optionally) automate many aspects of memory management. One downside is that it is easy to make mistakes when writing C++ code, which lead to crashes, or worse, silent corruption. Another downside is that C++ is a large and complex language, so large that few people claim to understand all of it, and many teams restrict themselves to writing in a subset of C++ (but different subsets are chosen by different teams). (updated 2022)

Either C and C++ are popular choices for a 'default' or 'go-to' systems language; however, recently a number of new languages have been invented which may better fill this niche. However, you should not use a systems language unless you have a need to, because it is generally faster and easier to write programs in higher-level languages with automatic memory management, and most programmers tend to make mistakes when manually managing memory, causing bugs. Reasons to use a systems language include a need for:

Many years ago, the performance of non-systems language was inadequate for many tasks (with typical speeds 10x slower than C or C++, or worse), but currently, for most tasks, the more performant memory-managed languages such as Java are only about 2x slower than C/C++. This means that in the past, many projects used systems languages out of necessity; whereas if those same projects were started today, a systems language would not be needed. However, many GUI applications (particularly big, important ones with large development teams, such as web browsers) still tend to be written in systems languages, because the difference in performance is still noticable by users in many cases. (updated 2022)

Even if you don't have a use for it, many people recommend that all programmers learn C at some point so as to get better intuition for how computer software works under the hood.

Other popular languages

Other popular imperative, memory-managed, object-oriented languages

This is currently the most popular type of high-level language (as of 2022).

Go is a simple, performant, statically-typed language. It prioritizes being a small/simple language, performance, and developer ergonomics. It is a good choice when you need speed or memory efficiency but not so much so as to justify the use of a non-memory-managed language. It has good support for concurrency via "goroutines" (lightweight threads). Because "Go" is hard to search for, it is often referred to as "Golang". A downside is that due to its straightforwardness (and particularly its explicit error-handing style), it may require many lines of code to express a program (although each of these lines will usually be easy to understand). Go is a good choice for a 'default' or 'go-to' compiled language that you use unless you have a reason to use another one. (updated 2022)

Kotlin is a statically typed language that interoperates with Java and runs on the JVM. It can be interpreted or compiled, although the interpreted form has some startup latency. It interoperates with the vast ecosystem of Java libraries, and, by virtue of running on the JVM, it inherits similar performance characteristics to Java (that is, good throughput, some startup latency, high memory usage, unpredictable garbage-collection pauses). It is less verbose than Java. It is the recommended language for writing Android apps. It is a good choice for writing a performant webserver. Kotlin is a good choice for a 'default' or 'go-to' compiled language that you use unless you have a reason to use another one. (updated 2022)

Other popular non-memory-managed (systems / low-level / close-to-the-metal) languages

Rust is a statically typed, compiled language. Some people would define it as object-oriented and others would not (it has objects with associated methods, and 'traits'/mixins, but not message-passing or classes with inheritance); it also has some features traditionally associated with "functional" languages, such as pattern-matching. Rust is a manual memory management language, but in contrast to both C and C++, it has a system for verifying at compile time that the programmer didn't make any memory-management mistakes (although this system can be opted-out of). One downside is that it is a large and complex language. Another downside is that the system for ensuring memory management correctness is restrictive and complex, making the language difficult to learn. Rust is a good choice when a systems language is needed and a complex language can be tolerated. It is looking like it may replace C++ in this niche, and due to its elimination of memory management bugs it may also replace C in some applications. (updated 2022)

Zig is a statically typed, compiled language. It is relatively small and simple. Although it is manually memory managed, it has some features to make it easier to avoid memory management bugs. Almost all systems languages are interoperable with C, but Zig has especially good developer ergonomics for this. Zig is a good choice when a relatively simple systems language is needed, perhaps a better choice than C. (updated 2022)