News for hackers. Stuff that matters.
Re:Anic - Faster than C, Safer than Java, Simpler than *sh by terhechte on Tuesday August 14, 2012 @12:02PM (#4381580)
This specific one is just bad though. I mean "\" is really difficult to type on almost all non-us keyboards. It's not even really easy on US keyboards (the pinky has to go a long way). See how often it's in there. Even standard C syntax is a pain on some non-us keyboards. I.e. on a German keyboard, the [, [, {, }, are rather difficult to type. That's why I (being German) switched to an English layout around two years ago. Now I have trouble typing umlaut and thus writing good German, but at least my coding speed improved by probably 50% and my Hand hurts far less.
Re:Anic - Faster than C, Safer than Java, Simpler than *sh by GregBuchholz on Tuesday August 14, 2012 @05:58PM (#4383270)
Now I'm interested to know which languages exist that don't rely heavily on backslashes. I guess I can't think of a language that doesn't use blackslashes for string escapes. Some other uses off the top of my head:

    * C -- line-continuations (important for macros).
    * Perl -- regex back-references.
    * Haskell -- anonymous functions.
    * Python -- line continuation.
    * Tcl -- line continuation.
    * Icon -- non-null test (unary), generator limitation (binary).
    * Prolog -- \+ for not provable.
    * J -- the prefix adverb and the grade-down verb (\:).
    * TeX -- Yes.
Re:Anic - Faster than C, Safer than Java, Simpler than *sh by runn1ng on Tuesday August 14, 2012 @10:06PM (#4384080)
During my perl experience, I learned that any special character next to $ is usually some magic variable that does something. So I would bet that $\ also does something.

edit: oh yeah.

$\ - The output record separator for the print operator. If defined, this value is printed after the last of print's arguments. Default is undef.

Re:Anic - Faster than C, Safer than Java, Simpler than *sh by rfurmani on Tuesday August 14, 2012 @07:04PM (#4383521)
Technically, for Perl you can use $ for regex backreferences. I don't remember which one is preferred, but I remember it frowning upon one of them.
Re:Anic - Faster than C, Safer than Java, Simpler than *sh by btilly on Tuesday August 14, 2012 @07:32PM (#4383615)
What you use depends on where you use it. Inside of a match, \1 refers to what was matched by the first parens. After the match $1 refers to what was matched. In a substitution, \1 is special cased to mean $1, but that is frowned on.

Thus: /\b(\w+)\W+\1\b/ means "match repeated word".

And: /\b(\w+)\W+$1\b/ means "match word preceeded by the word matched on your last match.

Moving on: s/Hello (\w+)/Goodbye $!/ means "Replace Hello followed by a word with Goodbye followed by the same word."

And finally: s/Hello (\w+)/Goodbye \1/ is special cased to mean the same thing, but is frowned upon.

Re:Anic - Faster than C, Safer than Java, Simpler than *sh by rdtsc on Tuesday August 14, 2012 @07:31PM (#4383610)
> Now I'm interested to know which languages exist that don't rely heavily on backslashes.

I posit that line continuations don't count, at least not in the "rely heavily" category.

Then I am not sure how popular J and Icon are. So let' keep those away. Is the backlash really used that often in Prolog? I wouldn't say "heavily". So that leaves us with:

    * Perl
    * Haskell
    * Tex
I think that's a more realistic "rely heavily" category.
Re:Anic - Faster than C, Safer than Java, Simpler than *sh by GregBuchholz on Tuesday August 14, 2012 @08:12PM (#4383749)
"\tDon't forget the \"main\" uses.\u263A\n"
Re:Anic - Faster than C, Safer than Java, Simpler than *sh by threedaymonk on Tuesday August 14, 2012 @03:55PM (#4382787)
There are various keyboard layouts that are superficially English but which allow various diacritics via dead keys, such that, for example, you can type AltGr+" followed by u to get ü. (I just did exactly that.) I know of us altgr-intl on Linux (that is, xkb), but there are similar layouts on OS X and Windows.
Re:Anic - Faster than C, Safer than Java, Simpler than *sh by eru on Tuesday August 14, 2012 @12:09PM (#4381618)
You might want to try the Neo layout. It's a modern layout that includes international characters, like German Umlauts.

(I'm also German and switched to American Dvorak earlier. I only heard about Neo later, and am too lazy to switch now.)

Re:Anic - Faster than C, Safer than Java, Simpler than *sh by dkersten on Tuesday August 14, 2012 @01:08PM (#4381942)
I guess if LCtrl and their LMod3 were swapped (ie so that capslock is used as Ctrl for shortcut keys), I could see this being an interesting layout. It has all the common keys either on the home row or easily reached from the home row. I can't ever see myself switching from Colemak though, I like how the fingers roll across adjacent keys too much.

(Plus since I don't type much German, I don't need quick access to üöäß, though an English-centric variant of Neo would be.. interesting, maybe using those keys for the most common programming symbols?)

Re:Anic - Faster than C, Safer than Java, Simpler than *sh by luchs on Tuesday August 14, 2012 @06:55PM (#4383494)
I solved that problem by binding capslock to Alt Gr and using a custom US layout with Alt Gr plus e-[;' bound to €ßüöä. This basically allows me to quickly switch to the German layout when necessary without losing much speed.
Re:Anic - Faster than C, Safer than Java, Simpler than *sh by jlgreco on Tuesday August 14, 2012 @12:06PM (#4381603)
Yes, without doubt this specific one is bad.