The Hacker's Calculator, aka hc(1)


posted 7/24/2000
last updated 9/16/2000

So one day in 1998 I picked up my (currently missing) copy of Kernighan and Pike (The Unix Programming Environment, for those of you who don't know one white computer book with an AT&T copyright from another) with the thought that there didn't seem to be a whole lot of calculator programs out there that specialized in hacker-type calculations, i.e. things like hex and octal bases and bitwise operations. So I took the book's hoc(1) code and hacked it up here and there, stripped out unnecessary features, and hc(1) was born.

Maybe it should be yahc(1), since I'm sure it wasn't the first, and others have been surely written since. But it's mine, I like it, and even though I realize it's somewhat more of a specialized piece of code than it would have been twenty years ago, someone should find it interesting.

Requirements

hc(1) is available only as a source tarball at this point, and should compile unchanged on anything that can handle a Unix makefile. (For the record, the development platform was an IBM PS/2 model 55 running Slackware 3.6; I don't have that computer anymore but there should be no problem compiling on any other Unix out there. Including MacOS X.) The only thing you need is a working copy of byacc or bison (I prefer byacc for political reasons).

Future Plans

I have a Mac version all compiled up and ready to go (complete with Macified docs and original source), but the CodeWarrior standard library it's based on is very old and probably not Carbonized. I'd upload it anyway but I don't think GeoCities accepts .sit.hqx files. Let me know if it's something you'd like to see and I'll see what I can do with it; right now snailmail would probably be the best way.

I encourage people to try and get hc(1) running on as many platforms as possible; IMHO it would be most useful on development-level platforms such as Darwin or AtheOS where a lot of low-level work might still be needed. A Palm implementation would be nice as well.

In the future, I may go back and rewrite the whole thing as a superset of the full implementation of hoc(1); I think it would be overkill, but if there's demand I'll do it.

Versions

Legal Stuff

hc(1) is released under the GNU Public License; I ask only that if you use hc(1) in a commercial product (such as a Linux distro, for example) that you make me a full registered user of any product that you include it in. Future versions (should I have the time to rewrite it from the ground up) will be released under the Mozilla Public License instead, with the same stipulation.

If you use hc(1), I'd like to hear about how you use it and what you're doing with it.


Click here to download hc(1) in source form.

As stated above, the MacOS Classic version is not yet available; contact me if you're interested.


Click here to return to my home page. 1