Small programs are interesting. But I’m also interested in small programming languages. Generally speaking, the smaller the language, the less expressive it is. One of the most well-known, least expressive languages is assembly. Assembly languages are very syntactically and conceptually simple. There’s not much language at all: it’s mostly a rigid sequence of opcode mnemonics. Even with macros, writing in assembly is mostly about understanding the puzzle of a particular CPU’s instruction set architecture, or ISA. (You can prove this by comparing the syntax of assembly for CISC and RISC processors. The puzzle is totally different, while the language remains practically unchanged.) An honorable mention must be made here for SNOBOL, which is kind of like assembly language both for the rigid syntactic reasons listed above and also because it presents a similar control flow challenge. Like a CPU, it only understands jumps and call/return. (In every other way, SNOBOL is wildly different, being a string matching and replacing language. It’s weird and fun and highly effective.) Moving on to syntactically tiny "high-level" languages, these three are brilliant: Forths win just about any "smallness" contest. The only syntactical construct is the space character. Forths are mind-bendingly flexible and powerful in a way that is downright disturbing. Lisps, (especially Scheme?), have small core languages with very simple syntax and enormous expressive power and flexibility. Tcl deserves to be mentioned with Forth and Lisp. Tcl is wild because everything is a string in a way that is hard to appreciate at first. You can construct your own language in Tcl just as you can with Forth or Lisp. Forth, Lisp, and Tcl only require you to understand a few core ideas and give you limitless power in return. You could fit the syntactic core of these languages on an index card or less. And yet, to wield these tools effectively requires a massive shift in thinking if you’re used to "normal" Algo...
First seen: 2025-06-06 14:07
Last seen: 2025-06-06 21:08