The Little Language That Could

Make everything as simple as possible, but not simpler — Einstein

Are you quite sure that all those bells and whistles, all those wonderful facilities of your so-called "powerful" programming languages belong to the solution set rather than to the problem set? Dijkstra

qdbp is small. Really, really small. The language has just 1 keyword and a small handful core constructs(along with full type inference and a little bit of syntax sugar to sweeten the deal). In fact, the below program, clocking in at just 15 lines of code, demonstrates every single primitive of the language:


int := 0

float := 0.0

string := "hello world"

object := {

  Method1[arg1 arg2 | arg1 + arg2.]

  Method2[arg1 arg2 | $foreign_fn_bool(arg1 arg2)]

}

extended_object := { object

  Method3[arg1 arg2 | (arg1 * arg2)]

}

six := extended_object Method3 arg1: 3 arg2: (@math Factorial 2).

tagged_object := #Ok string

tagged_object

  Ok? [that| that Print.]

  Error? [ {} ].


As a comparison, Go 1.20 has 25 keywords, Python 3.10 has 38, C++14 has 84, and Lua 5.4 has 22. Neither keyword nor feature count are sufficient to judge language simplicity, but they are good approximations, and the magnitude of the difference between qdbp and its closest competitor is striking. Though the snippet above may seem unfamiliar, understanding those 15 lines, along with learning a little bit of syntax sugar, is all that is required to understand the entire language.

Of course, just being small and simple is not sufficient. If it were, the world would run on Brainfuck. qdbp's beauty comes from its ability to compose its small set of primitives to express complex abstractions. Here is a list and demonstration of common language features that qdbp can emulate. The list includes

That qdbp's core feature set can be so naturally wielded to express complex abstractions is testament to the elegance of the language. The goal of qdbp is to be the distillation of programming into only its necessary components, and in doing so, become greater than the sum of its parts. If this sounds like something you want from a language, clone the repo and checkout the rest of this website. Happy qdbping!