# Which other programming languages apart from Python and predecessor are out there using indentation to define code blocks? [closed]

Python quite famously uses indentation to syntactically define blocks of code. (See Compound statements in the Python Language Reference). After years of using Python I'm still intrigued by and very fond of this syntax feature.

But I wonder: Apart from Python and its "predecessor"(*) language ABC which other programming languages are out there using indentation for definition of code blocks? Code blocks means here "multiple statements which in some way are treated as one component".

I'm particularly interested in practical programming languages, but esoteric languages might be worth mentioning as well.

(*): "Predecessor" is my choice of word in default of knowing here a better one. Guido van Rossum, the creator of Python, described the relationship between Python and ABC regarding indentation in an interview like this: "The choice of indentation for grouping was not a novel concept in Python; I inherited this from ABC."

• I don't think "please give me a list of programming languages with feature X" is a computer science question. May 9 '19 at 20:07
• Why, there's the Whitespace language itself that requires proper indentation for it's core method of expression. May 9 '19 at 23:49
• Long-form YAML is probably worth mentioning even though it's not a programming language in the strictest sense, as it's probably one of the next most likely languages with this feature for someone to encounter after Python. May 10 '19 at 0:51
• @penguin359 I also thought of Whitespace. It's not an answer to the question because indentation is, afaict, not used to define blocks; but it's certainly the language in which white space is most significant overall. May 10 '19 at 9:34
• @DavidRicherby Grouping by attribute (i.e. categorization) is definitely a part of science: E.g. an interesting question for a Biology StackExchange could be: "What other animals walk on two legs?" Therefore I consider the above question very appropriate for the Computer Science StackExchange. May 10 '19 at 16:54

Wikipedia has an extensive list of languages that use the off-side rule1:

• ABC
• Boo
• BuddyScript
• Cobra
• CoffeeScript
• Converge
• Curry
• Elixir (, do: blocks)
• Elm
• F# (if #light "off" is not specified)
• Genie
• Haskell (only for where, let, do, or case ... of clauses when braces are omitted)
• Inform 7
• ISWIM, the abstract language that introduced the rule
• LiveScript
• Miranda
• Nemerle
• Nim
• occam
• PROMAL
• Python
• Scheme, when using e.g. SRFI 119
• Spin
• XL

1: I've never heard this term before myself.

• The off-side rule is an exciting find! May 10 '19 at 2:42
• Don't know if it is a language as you or wikipedia understands it, but Makefiles use indentation too. May 10 '19 at 7:22
• @TheWildHealer The wikipedia article also has a section with non-programming languages (including stuff like Make, YAML, RST). I didn't quote that because OP asked about programming languages. May 10 '19 at 10:27
• You are right, next time I'll be sure to open my eyes, thanks. May 10 '19 at 10:31

There are: Elm, Haskell, its predecessor Miranda and its predecessor ISWIM, YAML where spaces are crucial for syntax and tabs are forbidden, OCCAM, Coffee script and Cokescript both are language to language compilers with JavaScript as target and esoteric Whitespaces.

There is also Agda - interactive theorem prover, which is probably not what you had in mind, but its lexer is very sensitive to white-space.
Makefile, which gathers targets with tab-based intends.

• Also Miranda, the language Haskell was based on.
– kne
May 9 '19 at 16:59
• Agda has a very Haskell-like syntax, and is sensitive to both indentation and spaces: (x-y) is not (x - y)) even if it might not be "practical" enough for the OP.
– chi
May 9 '19 at 18:30
• Also, CoffeeScript and the hardly-known CokeScript May 9 '19 at 19:22
• If YAML counts, then I suppose Makefiles must as well May 9 '19 at 19:48
• There is also PureScript. May 9 '19 at 21:35

Make fits your description, even though it probably isn't quite what you have in mind, with its limited syntax and power.

It infamously indicates its code blocks (recipes) with a particular form of whitespace: one tab character. Alternative ways are available (e.g. GNU Make supports using an alternative character), but rarely used in practice.

Another example hovering at the edge is Ansible playbooks. They are specified in YAML, which is heavily indentation dependent. YAML is not a programming language, but Ansible playbooks can be regarded as domain-specific programs.