When Designing a Programming Language, Should You Choose Complexity or Simplification?

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 在设计编程语言时,选择复杂还是简化?

| username: 非凸科技

The design of most modern programming languages leans more towards maximalism, with the rapid addition of new features helping to enhance competitive advantage. Some believe that adding more features is a way to demonstrate progress. However, this mindset is overly simplistic and overlooks many other critical aspects necessary for a programming language to achieve success and progress, such as ease of learning, stability, tool support, and performance.

For a programming language to succeed, it must have good tool support. If the language and its features are constantly changing, the related tools need to be continuously updated. For example, C++ has many issues, one of which is that its syntax is difficult to parse.

Rust’s core features are very satisfying, and compared to C/C++, Rust has made significant improvements in many areas. However, it also has drawbacks, such as being overly complex. Some say that its syntax is verbose, there is a lot of knowledge to master, many rules and subtleties, and Rust has a steep learning curve with high cognitive load.

Some argue that programming languages should remain simple, with as few concepts as possible, and only choose primitives that can be well integrated together, making them easier to learn.

Others say that minimizing the complexity and number of features in a programming language is a better way to respect programmers. Reducing complexity is also a way to lessen cognitive burden and respect human limitations.

In response, some suggest:

  1. The initial design of a programming language should not be too large. A programming language is a user interface, an API for people to interact with machines. The smaller the scope of the API, the lower the risk of introducing unintended complexity and subtle design errors.
  2. Programming languages should be kept as simple as possible. The fewer features, the less likely redundancy will occur, and it also means you can select the features that provide the most expressiveness and value to programmers.
  3. Language design is an art that reflects a delicate balance between many different constraints, much like user interface design.