0xUNDERSTAND
September 27, 2008 11:42 AM 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!
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!
codepad.org lets you type your C and see the output instantly.
posted by MaxK at 12:16 PM on September 27, 2008
posted by MaxK at 12:16 PM on September 27, 2008
I thought it was possible to do that in the Bourne shell.
posted by Class Goat at 12:59 PM on September 27, 2008
posted by Class Goat at 12:59 PM on September 27, 2008
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, 2008
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, 2008
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, 2008
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, 2008
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, 2008
posted by idiopath at 1:58 PM on September 27, 2008
Response by poster: 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, 2008
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, 2008
« Older Names of the locations in these old slides? | The audience chanted, "HECTOR HECTOR HECTOR." Newer »
This thread is closed to new comments.
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, 2008