0xUNDERSTAND
September 27, 2008 11:42 AM   RSS feed for this thread Subscribe

Are there any scripting / cli-compatible languages which decently provide or at least pretend to provide bit-math?

So, I'm in one of my last CS courses in college, and it involves a whole lot of bit-mangling. Writing, testing C code is all right, but I kind of want to tinker in my free time to get a deeper understanding, and I'd love some language that lets me use something like irb/python/hugs/etc to quickly test bit expressions (your usual ^, |, &, !, etc)

Is there anything? I kind of remember a C++ CLI a while ago, but I can't figure out where it is.

Thanks!
posted by tmcw to computers & internet (7 comments total)
Bitwise operations in Perl.

Bitwise operations in Python.

Google "bit operation 'language'" and you'll find those operators for other scripting languages.
posted by Blazecock Pileon at 11:50 AM on September 27


codepad.org lets you type your C and see the output instantly.
posted by MaxK at 12:16 PM on September 27


I thought it was possible to do that in the Bourne shell.
posted by Class Goat at 12:59 PM on September 27


Erlang has bitwise pattern matching.

Erlang, the language for network programming
Issue 2: binary pattern matching
by José Pablo Ezequiel Pupeno Fernández Silva

posted by gmarceau at 1:31 PM on September 27


Depending on your tolerance for non-algol syntax, forth is interactive, small, self hosting, and designed primarily for low level stuff like bit manipulations.

A quick google found CINT, which is a C interpreter CLI with "bash like command line features" (I am guessing that means they link to lreadline?) available under the MIT license.
posted by idiopath at 1:45 PM on September 27


class goat: looks like you are right, I was surprised! That is probably the easiest way to do a quick bitwise operation, because bash is standard on every major OS but windows, and you can get bash for windows easy enough.
posted by idiopath at 1:58 PM on September 27


epilog: I've been using Ruby, actually, for a lot of testing. You can use bytes with just 0x55, etc.

Still not doing well in the class.

Sigh, take me back to high-level object-oriented meta-programming.
posted by tmcw at 7:56 AM on October 20


« Older Need help identifying some pla...   |   Name that movie filter: What 8... Newer »

You are not logged in, either login or create an account to post comments



Related Questions
If it looks and quacks like a CS Degree, then is... July 23, 2008
Hey, I'm not Trudy! Or Ben! November 12, 2007
Bash, I command thee to always... October 22, 2007
Help me consolidate thousands of pictures January 25, 2007
Linux for a Windows Power User July 7, 2006