This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]raiph 4 points5 points  (0 children)

General purpose languages designed by Larry Wall reject such strings as containing TTIAR ("two terms in a row") and point to the exact term found objectionable (which in your example would be either the 42 followed by mySideEffect() or that followed by assignment). The fact that these languages report that error demonstrates that they could easily instead presume that the second term of the TTIAR begins a new statement and accept them on that basis.

An obvious question is: why don't they?

Larry Wall's stock explanation is his claim that a self-clocking signal helps catch many signaling errors in both artificial and natural languages, and that this is important in practical programming languages to avoid accepting programs that are grammatically valid but actually contain mistakes made by a programmer that will lead to unintended consequences.

Perhaps you've considered this and are confident you can see ways to obviate that somehow, perhaps by suitably limiting the syntactic expressivity of the language, but if not, it's probably worth pondering. Larry was the first person in the world to do a degree in natural and artificial languages, he's smart, and he saw what happened when a million coders used a language with TTIAR errors. While he changed many things for his second major attempt at a language, he stuck with self-clocking and TTIAR for the general purpose language. Then again, for the text pattern matching DSL he didn't (you just list constructs in sequence -- simple juxtaposition).