Composable Syntax

By Xah Lee. Date: .

twitter extempore! On principle of composable syntax.

in golang, to create a hashtable, syntax is make(map[string]int), key is string, val is int

this syntax is not decomposable. it is just one ad hoc blob.

principle of composable syntax is like functions in functional programing, you combine functions to create variations.

with composable syntax, you only need to understand a handful of patterns, then can understand the syntax, any source code.

example of language with composable syntax includes Wolfram Language, lisp (trivially), APL

sad is that haskell, ocaml uses a ad hoc syntax, similar to the way C syntax, or golang is cooked up

most lang's syntax do not have theory. they tend to be just ad hoc, era habit, evolved. typically borrowed from previous langs

also sad is that clojure mutates lisp's composable syntax into ad hoc complexity, by macro, reader macro, special form, exceptions

Clojure: Magic Characters Clojure Sigils (Magic Characters)

Systematic Grammar