Live data from Hacker News

Bithacks.h - bit hack macros

catonmat.net

1–10 of 20 posts

Re: Bithacks.h - bit hack macros

#4
Another great resource for tidbits like this is _Hacker's Delight_, by Henry S. Warren, Jr. It covers a number of other tricks outside of bit twiddling, as well. Worth checking out for anyone who finds this sort of stuff fascinating.

Link: http://www.amazon.com/Hackers-Delight-Henry-S-Warren/dp/0201...

Re: Bithacks.h - bit hack macros

#5
Whenever I need to do bit manipulations, I always check the Linux kernel source. I figure that any bit manipulation I'd ever want to do is also done in the kernel, and I'm usually right:

http://miller.cs.wm.edu/lxr3.linux/http/source/include/linux...

http://miller.cs.wm.edu/lxr3.linux/http/source/include/linux...

http://miller.cs.wm.edu/lxr3.linux/http/source/lib/bitmap.c?...

Re: Bithacks.h - bit hack macros

#6
Catonmat never fails in fascinating me, regardless of how stupid this may sound, the more unpopular the language he implements his tutorial/illustration in, the more I realize how unimportant the language actually is. As long as we can/are reuse/reusing what we write, we can rest in the idea that what we do/did now/before actually matters for what we can/are do/doing in the future/present.

Re: Bithacks.h - bit hack macros

#7
post #6

Catonmat never fails in fascinating me, regardless of how stupid this may sound, the more unpopular the language he implements his tutorial/illustration in, the more I realize how unimportant the language actually is. As long as we can/are reuse/reusing what we write, we can rest in the idea that what we do/did now/before actually matters for what we can/are do/doing in the future/present.

As languages go C may be a lot of things but I don't think you can call it "unpopular".

Re: Bithacks.h - bit hack macros

#8
For this sort of thing, it would seem helpful to release it under "any license viewed as free by the FSF" or similar. Is that sort of statement likely to cause problems? Or at least license it MIT/BSD/whatever. For such a small piece, it would be nice if projects can just import it without having to move from "all code is BSD" to "all code is BSD except bithacks.h which is MIT, but we also comply with that license".

Re: Bithacks.h - bit hack macros

#9
post #7
post #6

Catonmat never fails in fascinating me, regardless of how stupid this may sound, the more unpopular the language he implements his tutorial/illustration in, the more I realize how unimportant the language actually is. As long as we can/are reuse/reusing what we write, we can rest in the idea that what we do/did now/before actually matters for what we can/are do/doing in the future/present.

As languages go C may be a lot of things but I don't think you can call it "unpopular".

How about passé or gauche or some other fashion term, with perhaps, all the implied connotation?

Re: Bithacks.h - bit hack macros

#10
post #7
post #6

Catonmat never fails in fascinating me, regardless of how stupid this may sound, the more unpopular the language he implements his tutorial/illustration in, the more I realize how unimportant the language actually is. As long as we can/are reuse/reusing what we write, we can rest in the idea that what we do/did now/before actually matters for what we can/are do/doing in the future/present.

As languages go C may be a lot of things but I don't think you can call it "unpopular".

Indeed. I'm always surprised at the number of people I meet (and, distressingly, the number of posters on this site) that honestly believe that "most" software is written by web geeks or IT droids in scripting languages or Java or .NET.

That, and the fact that this belief persists as they turn off their digital televisions, click their garage door remotes, text a friend on their phone, fire up the engine in their personal vehicle, and drive to work stopping carefully at all the carefully automated traffic lights, swipe their ID card and sit at their desk where they can finally get to see some software.

Post reply on HN