News for hackers. Stuff that matters.
Re:Poll: How many programmers don't know about bit-wise oper... by sltkr on Sunday April 07, 2013 @07:20AM (#5506833)
There are tons of useful features that aren't supported in C. The basic feature set of C was determined by whatever operations Dennis Ritchie could easily implement on the PDP-11 when he created the earliest C compilers. (Fun fact: the bitwise operators even preceded the Boolean operators like && and ||.)

If the question is "why isn't bit indexing supported" then "because processors didn't (and don't) support it" is the historically correct answer, whether you like it or not.

Re:Poll: How many programmers don't know about bit-wise oper... by jared314 on Sunday April 07, 2013 @07:32AM (#5506858)
arianvanp had the point of my question correct.
Re:Poll: How many programmers don't know about bit-wise oper... by arianvanp on Sunday April 07, 2013 @08:01AM (#5506902)
Now to answer your question:

Yes some languages actually support this:

http://www.erlang.org/documentation/doc-5.6/doc/programming_...

http://hackage.haskell.org/packages/archive/binary-strict/0.... (I have no idea why this isn't a Functor nor an Applicative Functor, so this is a bad example. and I know 'language features' in pure functional programming is cheating, butm eh)

http://en.wikipedia.org/wiki/Bit_field -- BE WARNED. C bitfields might give you access to bits, but they're still aligned to the boundary of your system (DWORD boundary on x86 for example)

e.g.:

    struct a {
       unsigned a: 13;
       unsigned b: 12;
    };

    sizeof(struct a) => 4;
in gcc they've got a flag to force structs to their actual bit size:

   struct a {
      ...
   }__attribute__((packed));