DEV Community

Tao Wen
Tao Wen

Posted on • Originally published at Medium on

3 Roles of Programming Languages

3 Roles of Programming Languages

One programming language plays 3 different roles: it connects the machines, the developer and the team. There are serious flaws in existing programming languages for these roles. If we can solve the 3 problems listed blew, it does not only make the developer experience superb, it will certainly have substantial return financially.

Problem of Accountability

The biggest crisis of the software development is the lack of accountability. Ideally, there will be one team to be accountable for the whole thing, then they can delegate responsibilities to lower level teams like what was promised by structured programming. Instead, what we are facing in the micro-service world is the responsibilities are relayed from one to many other in a fragmented way, causing great communication overhead for the business owner. And more importantly, this leaves no one can be accountable for the end result.

Why this is related to programming language? Because every function, every class we write is about breaking down the problem. Language is not just about describing the logic, it also shapes our worldview on how to break the big thing down to small things, and how to put them back together.

Problem of Readability

It is often we need to read a lot of code to find out what we want. The information density is low. It is often twisted to follow the causality in the code. Code reuse inevitably will hurt the readability, as you need to skip the code irrelevant to your use case. Non-functional requirements entangled with already complex functional logic. Error handling is a common problem to make the code unreadable.

Making code readable is more than naming your variable properly. The programming language needs to provide construct like co-routine, AOP, multi-dispatch to allow certain kind of coding style.

Problem of Heterogeneous Computing

Parallel or distributed execution in the mainstream programming language is implemented as compiler vectorization hint or library. Mainstream programming language largely resembles the worldview of PDP-11 with just one sequential CPU. Nowadays, It is very common to have a different kind of execution engines (SIMD, GPU) in the same machine, and it is more and more common to utilize more of them in one piece of software. And the memory model is no longer just one big heap, there could be multiple stages of heap for multiple executors. The programming language should provide a more faithful abstraction of the actual execution device, instead of constraining the thinking and expression in an out-dated computation model.

The Vision

The ideal programming language should provide these properties

  • Responsibility is broken down from very top to very bottom, there is always a team be accountable for the whole.
  • Good logic locality, do not need to jump over multiple places to find out what is going on
  • The same language can be used to describe SIMD/GPU/MicroServices and interop between them

In the end, it is all about readability for humankind. You can inspect the code from different conceptual levels, and reason about its correctness (compliance with your mental models) without hurting your eyes and brain.

Discussion (0)