indent-syntax about indent-based notation.
there appear to be two opposing design paradigms: one favoring ornamented complexity, the other favoring functional minimalism. this dichotomy may reflect deeper psychological or cultural dispositions.
this style favors special characters, combinations of special characters, and abbreviations. examples include: apl, mathematical notation, haskell, perl.
such systems seek expressive power through layered meanings, much like mathematical notation or apl, which rely on compact symbols. they feature a dense symbolic vocabulary and require a tediously acquired, shared understanding of esoteric symbols. these systems often use ornate and highly contextualized forms.
this style prioritizes words from natural language, and alphanumeric characters. examples include: coffeescript, scheme, ruby.
these systems employ minimalist, uniform notation, or attempt to approximate spoken language. they seek accessibility and clarity, aiming to reduce the cognitive load on users. this approach often favors streamlined and universal formats.
the same tendencies appear in other domains. in writing, enrichment-oriented authors often favor elaborate typographic conventions, using multiple distinct quotation and apostrophe marks, along with serif typefaces. simplification-oriented writers may restrict themselves to only ' and " for quotations and apostrophes. in more extreme cases, they may write entirely in lowercase, prioritizing content and meaning over form and ornament.
example (vbscript)
if 3 = x then msgbox "test" end if for each a in list: msgbox a: next
benefit: quick to type
example (c)
if (3 == x) { printf("test"); } for (int i=1; iexample (scheme)
(if (= 3 x) (display "test")) (for-each display mylist)
example (coffeescript)
if 3 is x console.log "test" list.forEach (a) -> console.log a
benefit: code written by different authors looks more uniform, as there are fewer structural elements, such as spaces or brackets, that can be freely positioned.
+ 1 2 3 4
1 + 2 + 3 + 4
1 2 3 4 +
comparing coffeescript and wisp highlights interesting differences in how whitespace and other structural characters can be interpreted.
in the examples below, the coffeescript-style syntax uses commas in infix notation to show argument continuation on the same line. in coffeescript, newlines can replace the comma in some cases.
single-line function call
f a b c
continued argument list
f a b . c d . e f
-> "(f a b c d e f)"
nested multiline function calls
f a f2 b c f3 d e
-> "(f a (f2 b c) (f3 d e))"
a space between identifiers marks application position. there is no distinction between the first and remaining elements, and the rule is applied to all following elements to compose function calls.
f a b c
-> "f(a(b(c)))"
comma separates arguments.
f a, b, c
in array and object literals, newlines can replace commas
a = [ b, c d, e ]
-> "a = [b, c, d, e]"
argument list continuation needs one additional comma
f a, b, c, d e, f
-> "f(a, b, c, d, e, f)"
nested multiline function calls
f a, f2 b, c f3 d, e
-> "f(a, f2(b, c), f3(d, e))"
f a, f2 b, f3( c, d ) (e - f)
-> "f(a, f2(b, f3(c, d)), e - f)"
a similar situation as with commas arises with associations.
wisp and scheme handle associations with sub-lists and the syntax of "let", the colon is merely used to open a second nesting on the same line.
let : x a y b z c display x
-> (let ((x a) (y b) (z c)) (display x))
coffeescript uses the colon to identify an association
let x: a y: b z: c, display x