I was wondering if it would be doable to not require commas between items when doing multiline imports, exports, lists, and records. Like:
imports [
pf.Task
pf.Stdout
]
Record : {
count : I32
sum : I32
}
I'm in for this
what happens if the record field definition has a super long type, and needs to be multiline?
Backslash for line continuation?
Just assuming definitions that long are rare.
Or assume if 2nd line is indented further then it's a continuation of 1st line?
Jared Cone said:
Or assume if 2nd line is indented further then it's a continuation of 1st line?
CoffeeScript does this. It worked well as I recall, but there was definitely a backlash about how much indentation mattered in that language.
in Roc indentation currently only matters in two places: defs and where branches
https://coffeescript.org/#objects-and-arrays
Admittedly Ive never done significant work in a whitespace significant language, but I've always thought leveraging whitespace in the language syntax would be a benefit, since we tend to require for human readability anyways
If defs and where branches didn't have extra indentation, would that make the syntax ambiguous? (is the extra indentation just conventional, or truly significant)? If truly significant, is it desirable for the language as a whole to have significant indentation just due to those two places? Would something like .. as an "indentation token" serve well to disambiguate?
personally I think it's worth it, yes - but feel free to propose alternative ideas!
I never really understood the arguments against significant indentation.
You can make the compiler accept only multiples of 3 spaces as valid indentation.
Then you won't encounter any copy-paste bugs or tab problems.
It also makes the code correctly formatted, diminishing the need for an external formatter.
I also have a suspicion that it was part of the reason why Python took off.
In the end it always boils down to personal bias. Which makes any discussion on this topic very tiring.
My personal rule of thumb is: Good code* should be easier to write by default.
(*Hopefully the code that is written the most often.)
This applies to immutability over mutability. And it also applies to multiline statements.
fibonacci n =
a = fibonacci (n-1)
b = fibonacci (n-2)
a + b
-- The above should be easier to write than
fibonacci n =
a = fibonacci (n-1); b = fibonacci (n-2)
a + b
It seems to apply to lists too
list = [
123
2
3
]
-- The above should be easier to write than
list = [
123
2,3
]
Those are my 2c
Last updated: Jun 16 2026 at 16:19 UTC