|
|
Christopher James Huff wrote:
>
> I've never liked the idea of a language that relied on indentation
> and white space as controlling elements. Some kind of visible block
> delimiter is much better, and "{}" are already used in many
> languages, so people are familiar with them. Explicit begin and end
> keywords are also used in some languages, these take more typing
> and make more cluttered code in my opinion, but are better than
> whitespace.
>
Indeed, I also where rather sceptic, as I lerned haskell some years
ago. I didn't like the idea and thought it would cause problems all
the time. It was a big surprise how good it worked. Of course, the
braces are more of a problem in a functional language with all the
function-style-if-then-else, alternativ clauses and pattern matching
definitions.
Maybee, one reason it works so well there is, that haskell has a
rather elaborated type system and thus the compiler can generate very
specific and precise error messages. Morover the layout rule is an
optional feature and activated on a per-statement-base, when the
opening brace is missing. This, btw, makes implementing the parser
rather a tough job, because there has to be a sort of "talkback"
channel between parser and tokenizer.
Post a reply to this message
|
|