I really like the significant indentation syntax due to land in the next release, but given how it is impossible to tell what mixture of tabs and spaces there are in a chunk of whitespace, would it be possible to make the presence of tabs a compile error?
I experienced the ability to mix the 2 as confusing in haskell when I was just starting using it (then I dropped tabs altogether), and even if it would be better in Scala 3 (would it?), we can do much simpler than the below if the language is a bit more opinionated about this.
Indentation prefixes can consist of spaces and tabs. Indentation widths are the indentation prefixes themselves, ordered by the string prefix relation. So, so for instance “2 tabs, followed by 4 spaces” is strictly less than “2 tabs, followed by 5 spaces”, but “2 tabs, followed by 4 spaces” is incomparable to “6 tabs” or to “4 spaces, followed by 2 tabs”. It is an error if the indentation width of some line is incomparable with the indentation width of the region that’s current at that point. To avoid such errors, it is a good idea not to mix spaces and tabs in the same source file. (indentation.md)
I dislike how this inevitably opens up a tabs vs. spaces debate, so to try to short-circuit that: I’m with tabs in principle, this is what tabs are for, but spaces won, that’s what modern tools work well with (e.g. soft tabs in editors). Code with tabs looks like a mess in Gitlab for example, sometimes in IntelliJ too. Maybe it’s configurable, but that’s extra effort and friction, especially when talking about e.g. company Gitlab servers.