> Q: Why are backslashes (\) used as language operators? Isn't that confusing, given they're used in other languages as escape characters?
> A: This is a valid point, but backslashes were chosen for a purely pragmatic reason; on virutally all keyboards, backslashes are very easy to type (requiring only a single keystroke). This is a handy property for backslashes to have because in ANI, you'll be typing them a lot!
> Incomers from other languages might be thrown off a tiny bit, but a programmer that's spent some time with ANI will quickly come to realize that there is actually never any good reason to end a line of ANI code with a syntactual backslash! If one insists on doing so anyway, they are writing ill-formatted code that would be confusing regardless of how backslashes are interpreted by the language. Thus, the backslash conflict is there in theory but irrelevant in practice.
> The usage of \ in the language syntax is a thought-out practical compromise, though the issue may be reconsidered in the future depending on programmer feedback.
To see what the backslash does, see the Pipes section: http://code.google.com/p/anic/wiki/Tutorial
Edit: I'm not defending these arguments, simply pointing out that the developers have put forth some reasons.
That's such a typical US-centric attitude. On (most?) European Apple keyboards, "\" is alt+shift+7 or some similar Vulcan death grip combo. Not exactly "very easy to type".
Going out of your way to produce such small and dubious improvement is always a bad idea imho.
If you really think C syntax is a pain point, the sanest thing to do is to go with textual keywords like in ruby or lua.
Why?
"Hello World" to std.out
That's just an idea I had on the spot, not sure how it would play out. But I
think this stream programming would actually lend itself well to some sort of
literate syntax. \arguments -> body
to Scheme's (lambda (arguments) (body))
because it stands out more. What gives me as the reader an even better hint without getting in the way, is indentation. That's why I prefer that to e.g. curly braces for reading. (Writing, especially in non-programming editors, like a webform, is easier with explicit markers like `end' or } though.)If you were serious about making things easy, you'd look at all the common keyboard layouts (not just American ones) before choosing a "thought-out practical compromise" that is of dubious practicality.
DOS and Win9x were particularly disgusting: C:¥DIR¥SUBDIR¥README.TXT
It's regarded more as a necessary evil than anything else. Any language featuring it prominently will be unlikely to achieve much popularity in Japan.
Also, in C, you can just type ??/ instead of backslash.
amespace ragedy