full circle to lisp

My programming experience has been thus: perl, c, lisp (clisp), python, scheme (mzscheme/drscheme), php, java (grudgingly), ruby. I’m now trying to find time to dabble with clojure.

Every time I came across a bit of lisp code that I could understand, I was drooling with envy. What interests me is the ability to interpolate data and code. I’m not aware of any other language besides the lisp family of languages that do away with that line entirely and meld them.. data = code = data.

I don’t program at my day job and haven’t done so for a long time. I program personal projects. I’ve tried to use lisp as much as I can for some of them. I’m a lazy programmer (I got that from perl – laziness, impatience, hubris). I like to think of a programming language as a tool to get me to the results I want as quickly and as efficiently as possible. If I have to write every piece of code, including a library or wrapper to talk to the file system or to internet data sources, it’s an immediate turn-off. Perl has a ton of libraries, including third party ones that lets you do almost anything.. but I can’t read my own code after a year. I don’t want to have to remember to do things a certain way. Python took that and came up with a much prescriptive way of programming, it even includes a lot of libraries as standard libraries, but tabs? Besides, it doesn’t do code as data very well. Ruby takes it a bit further making it a lot easier to do code as data. It has a lot of the good parts from a lot of other languages (perl, ruby, python, java, even lisp). I use it every time I would opt for perl or python.

I’ve tried different lisps, clisp, sbcl, allegro cl, drscheme etc. The problem for me with standard lisps has been that each of those lisps are a platform on their own and interfacing with the outside world is (for me) a case of acrobatics. The commercial lisps obviously have wonderful ways of doing that (with their own proprietary libraries). But, they’re commercial.

I’m neither a languge purist nor an academic. I want something that comes with batteries (like python), is lispy (code as data), has easy access to tons of third party libraries (like perl), is possibly cross platform (at least linux, windows and mac os x), is easy to ship (like jar files or scripts), has decent ide/editor support (emacs is not what I have in mind, even textmate is more useable for me) and is also fast.

Drscheme/mzscheme comes pretty close and is pretty darn good (except for the third party libraries thing besides native calls). Java has tons of libraries but I hate the verbosity and the 100 lines to do anything heritage. I waited for arc but was disappointed when it finally got here. It will evolve over time and I will definitely have to take a look at it once in a while.

Clojure, however, is here and is pretty close to what I want. It’s getting netbeans support soon, already has an inferior lisp mode for emacs, works wherever a JVM works, has access to anything that a JVM has access to, does lispy things really well (real macros, reader etc), and even has lazy evauators (sequences actually)..

So, I’m game. Some lisp or language purists will probably have things to say about this, but that’s ok.


mathematics as a basis for music

or .. mathematics as a basis for art (part 2)
I’m a little late to the party.

I was researching natural number sequences to create number generators when I came across the OEIS (online encyclopedia of integer sequences). It has a whole bunch of sequences, and I had only created a few (fibonacci, padovan, perrin, lucas and feigenbaum). Not only that, it lets you listen to the sequences by deriving pitch and duration from the sequences via midi files.
It uses another site to generate the midi files, the Musical Algorithms site.

Man, that site is loaded. Besides number sequences, the site lets you input all kinds of algorithms and sequences including DNA sequences (ATGC), constants, powers etc.. and listen to them by tweaking pitch and duration (derived by scaling or mapping).

Oh well..
So, I’m gonna have to take a slightly different tack, probably filtering sequences based on criteria (such as some described in the book “This is your brain on music“), transforming them (like adding syncopations) and combining them..

Stay tuned…

bugs, glitches and malfunctions didn’t originate in the computer industry

Quoting from Bob Cringley’s post:

— the origin of the term “bug,” referring to a problem with computer hardware or software. The story I originally heard directly from the late Grace Hopper, the mother of COBOL, was that a malfunction in the Mark II computer at Harvard in 1947 was traced to a dead moth that in its last living act had shorted out a circuit card. They taped the moth carcass in the computer logbook and history was made. Only it wasn’t, as I realized this week while reading the 1932 Flying and Glider Manual published back then by Modern Mechanics magazine.

“Once you have built your sportplane,” wrote the editor, identified only as Andy, “it must be test flown. If you have already taken flying lessons, you can hop it yourself — if not, entrust the job to a competent pilot. He’ll put it through its paces and find out if there are any ‘bugs’ that need correcting before the plane goes into active service.”

So much for Grace Hopper’s version of the story.

It turns out that “bug” was a common term for hardware glitches and dates back to the 19th century and possibly before. Edison used the term in a letter he wrote in 1878. This is no earthshaking news, of course, but simply reminds me how self-centered we are as an industry and there really isn’t much that’s truly new.

He’s referring to the computer industry (and by reference to the software industry) in the last sentence. Hilarious, but true. We really are self-centered. We also think we can solve most problems using software.

Tags: , ,

yeti in popular culture

I must confess, this looks like I have a lot of time on my hands. I really don’t but I had to speak my mind about this.

As can be seen from this post, most of what has been reported about the yeti has been through western media, with it’s own lens. That includes pictures/drawings/paintings of yeti. I would also assume that some of that imagery is probably influenced a lot by “bigfoot” images.

What strikes me as odd is that most of these images cannot be traced back to anyone from Nepal or Tibet, which is where the Yeti is supposed to be making his home. Maybe it’s because people there have been busy with sustaining their livelihood rather than painting images of Yeti for mass consumption. Maybe, there wasn’t enough of an artist pool, or maybe the artists there don’t think the Yeti is worthy of having art created around it.. whatever the reasons, I think it’s time to change that. I personally am not an artist, I can barely draw a straight line.

Maybe someone with an interest in mythical creatures imagery would actually want to talk to folks in nepal / Tibet about this and set the record straight, at least in terms of how people think the Yeti looks like.

Or then again, maybe I do have a lot of time on my hands.
related links:

update march 17, 2008:
Gama-go sells yeti stuff