History Lesson: When Did We Start Missing the Point?

Posted by Daniel Lyons Sat, 11 Sep 2004 13:24:42 GMT

Now that I’ve selected a truly ancient language, I’ve also selected a truly ancient database system to go with it: PROLOG. I think I’m due to give a short history lesson on the why’s involved.

Back in the early days of computer science, there were three models of computation: Turing’s (the Turing Machine), Von Neumann’s (the Von Neumann Architecture) and Church’s (the Lambda Calculus). Big proofs were made that demonstrated that these various models were in fact equivalent. Most of these proofs boiled down to, for example, implementing a limited Turing Machine in the Von Neumann archictecture or demonstrating that it could be done and vice-versa. Two of these three models are widely-referenced, and those are the Turing Machine and the Von Neumann Architecture. People liked the Von Neumann Architecture the best, because either it was a good picture of the hardware or because the hardware could be made to look like it without much difficulty (I’m not actually sure which is the case and I’m too lazy to look it up). People liked (and still like) the Turing Machine because it’s easy to explain and looks good on a white board, especially when you’re taking your Automata class and it’s sitting next to your DFA for matching regular languages or whatever.

Now, back in the early days, they actually made a handful of languages before Backus et. al. came and figured out what a language “is”—they actually implemented compilers of a sort without any of the real technology we think of today as being necessary for the job. As a result, FORTRAN is imminently difficult to parse, far more so than any other language we use today.

FORTRAN is interesting today primarily because of all the mistakes that were made in making it. Students every day take Principles of Programming Languages at their universities and learn all about FORTRAN, and while some of the notions of FORTRAN have survived, most of those notions were present before hand. I’m talking about arrays, functions, and algebraic notation.

At the time, users loved FORTRAN because it was so much more readable than assembly code, and because it was designed more-or-less to map onto the hardware IBM was making at the time, you didn’t lose much by using FORTRAN over assembly. In the years that followed, most of the compiler optimization literature would come to be written about optimizing FORTRAN, so that today it’s not uncommon for a good FORTRAN compiler to have as many as 17 passes, each one optimizing the code. This is also why FORTRAN is still the most-preferred language on supercomputers, though some of that is also because all of the historical code for supercomputers is written in FORTRAN, and nobody wants to have to rewrite any of their code for some kind of short-lived fad like structured programming.

LISP was invented in 1958, just 4 short years after FORTRAN. FORTRANs main idea was basically this: abstract the hardware to the procedure level, and stay close to the hardware for everything. Thus, it was born out of necessity—programmers needed some kind of abstraction in order to be productive. LISP, on the other hand, was created for several purposes: to be an implementation of Church’s Lambda Calculus (or something reasonably close to it), to be a mathematically-speaking high-level abstraction from the hardware, and for list processing. :) LISP is dynamic in truly amazing ways: take this “reader macro” from Successful Lisp :


(set-macro-character #$ 
             #'(lambda (stream char) 
               (declare (ignore char)) 
               (round (* 100 (read stream)))))

Now, whenever you type in, for example, “$14.99,” it will get translated to “1499” by the reader. If you use this convention throughout the code, you can avoid strange rounding errors with money. Quick: name another programming language that lets you modify the syntax on-the-fly.

LISP, as you can guess, ran abysmally slow. This was for many reasons, the most frequently mentioned is of course automatic memory management. In the mathematical land of free-floating functions, there is no such thing as memory, numbers do not occupy physical space, and so forth, so LISP couldn’t be bogged down in ridiculous implementation details like that. Working around those ridiculous implementation details back then meant that the computer spent mind-numbingly long periods of time figuring out which memory was in use and what wasn’t, and freeing what wasn’t. LISP also let you define anonymous functions and pass them around. It has a bevy of fantastically outer-spacey features, because it is meant to provide you with the simplest abstraction that encompasses all other abstractions, by allowing you to create abstraction-creation machines. What I mean by this is that LISP is intended to allow you to factor out anything you see in your code in more than one place, into a single place. Even if that “thing” is recursion, for example, using the commonly-cited-and-highly-dreaded applicative order Y-combinator, which I include below, in Scheme, mostly to fuck with people’s heads:

(define Y
   (lambda (X)
      ((lambda (proc)
          (X (lambda (arg)
            ((proc proc) arg))))
       (lambda (proc)
          (X (lambda (arg)
        ((proc proc) arg)))))))

Is LISP the perfect language? I can hardly answer that question. It does seem to win based on some common criteria: it’s small, it’s extremely powerful, it’s fast (by today’s standards), etc. It also loses on some important points: string mangling is sort of shoddy compared to languages with built-in regular expression facilities, the syntax is “weird,” lack of infix arithmetic is especially strange. (+ (* 3 (* x x)) (- (* 2 x)) 5) doesn’t look much like 3 * x^^2 – 2*x + 5, which is much closer to what I really want to say, which probably won’t look right in the browser anyway, which is 3x2-2x+5.

But let’s look forward a little bit, past the presentation of LISP. About a decade goes by, with lots of *OL languages being invented (in other words, ugly languages designed with some perverted purpose to them). Then, suddenly in 1970 we see a very interesting language appear: PROLOG. In 1971, the curse of my existence is invented, C. I’ll discuss both of these in turn.

PROLOG, like LISP, was intended to bring humanity to a higher level of abstraction. Instead of saying, “do this,” we say “these are the qualities an answer would have” and PROLOG goes and finds your answer for you. It sparked a whole family of languages (as LISP did), called the declarative or logic-based family. Unlike LISPs family, the functional languages, PROLOG to this day remains the most successful of its family, though some might caution that SQL comes pretty close to doing the same sorts of things. I would say the same thing about LISP, but for a connundrum I’ll address in a few minutes, which makes it very difficult to say what a functional language really is.

PROLOG is almost universally hated. I can think of many reasons for this: it has almost none of the traditional control structures, it has poor data types, backtracking is weird (though exception handling isn’t?), predicates don’t return values in the traditional sense, and often you want to do something and wind up doing something pretty unreadable to achieve it. For example, take the meat of this program I wrote or stole a while back which finds words which overlap:


overlap(NameL, NameR, Overlapped) :-
        name(NameL),
        name(NameR),
        NameL == NameR,
        atom_chars(NameL, LNameL),
        atom_chars(NameR, LNameR),
        append(_, Seg, LNameL),
        append(Seg, RightSeg, LNameR),
        length(Seg, N), N > 1,
        append(LNameL, RightSeg, Appended),
        atom_chars(Overlapped, Appended).

This code works by describing the solution. It says basically this: I have a predicate overlap/3, which is true when the first argument overlaps with the second argument by more than one character, producing the third argument. In point of fact, it’s doubtful that this predicate would work if it were used in any way other than the normal way, which is find two names that overlap and the result of that overlap. The first three lines are pretty simple: give me a NameL and a NameR that aren’t the same (otherwise, you’ll get NameL = NameR = Overlapped). The following two lines deal with the fact that PROLOGs types suck (it should probably be rewritten to work with strings instead). Then, we say something along the lines of: Suppose there is a right portion named Seg, which appended to some value we don’t give a damn about, produces LNameL. Further suppose that Seg can be appended to some RightSeg to produce LNameR. If Seg is longer than 1 character in length, append the left name (LNameL) to the right segment of the right word (RightSeg) giving Appended. Convert it back to an atom and that’s Overlapped, the third argument.

Comparable code, even in a nice language like Ruby, is going to be huge. The reason, of course, is because of all the helpful searching that PROLOG does for you, which would have to be coded in Ruby.

I hope this shows the power of PROLOG. Show me how to do that in SQL!

In the late 70’s and early 80’s, PROLOG compilation became possible, and what with all the AI research going around, PROLOG was also a fairly hot topic. Most of the information about PROLOG today is based on information that was produced in the 80’s, and most of the texts we use today in this field were written in the 80’s. Since then, it’s basically deteriorated into a community that makes the LISP community look vast. But there is PROLOG for every platform, so I guess I’m satisfied.

The bane of my existence, C, was conceived of in 1971, following PROLOG by just one year. But C, unlike LISP and PROLOG, became very successful. Linguistically speaking, C is pretty dull. According to the tree available at the Computer Programming Languages History , we see that C comes from BCPL, which comes from CPL, which comes from Algol 60, which comes from FORTRAN. Thus, C came from a long line of hardware-oriented programming languages. The innovation of C seems basically to be the concept of portability: C is intended to be fairly easy to implement, and abstract from a given platform, but still tightly coupled to the hardware. For example, you have to manage your own memory, you have to worry about the sizes of your integers, you have to worry about whether you’re about to make an invalid memory access, etc. Following along the lines of Worse is Better , C isn’t a massive improvement over BCPL or any other language, it’s just that it’s better enough to spread like wildfire. C++ also sucks, but is everywhere because it rides on the back of C. In a recent interview Bjarne Stroustrup himself admits basically that C++ in built on C because it’s C:

“I think that ‘Algol68 with Classes’ would have been a better language than ‘C with Classes.’ However, it would have been stillborn.”

Such an admission is probably a clue. Look to the current family of worthwhile scripting languages, Ruby , Python , and Io . Each one supports functional programming, in the sense that the Y combinator can be written in it and anonymous functions can be made. What does this mean? It means that programmers find these concepts interesting, and perhaps even useful. In Ruby, for example, it can be difficult to get anything done without a block, and the block is creating (essentially) a lexical closure, or an anonymous function. In Python, if you’re using generator, you’re basically making a closure and re-executing it each time—very cool, but not quite as awesome as what’s going on with Ruby:


100.times { |x| puts x }

And here in Python:


def getN(N):
    i = 0
    while i < N:
        yield i
        i += 1

for i in getN(100):
    print i

The for loop is basically a block, but you can’t make a block in Python and just pass it around to places. The generator/iterator facility is great, but not quite as good as the Ruby method, which lets you do things like this:


myDatabase.execute("SELECT name, age FROM members") do |name, age| 
    puts name + " is " + age + " today!"
end

Ruby is really getting there in terms of functionality. Can I create the reader macro $ in Ruby? Nope. Why are we so limited? Well, if you read Worse is Better up there, the assertion the author makes is that incremental improvement is favored by people for some reason. People don’t want blam, here’s LISP, learn it, love it, it does everything. People want Ruby—“because it’s better than Python!” People wanted Python—“because it’s better than Perl!” People wanted Perl—“because it’s better than Sed & Awk!” People wanted Sed & Awk over C, people wanted C over BCPL, people wanted BCPL over CPL, over Algol, over FORTRAN. Add to this the whole problem of magnetic personalities and programming language choice being (I hate to say it) almost a religious war, and things are even worse than this. We’ve been trying to escape from the wrong paradigm for so long, but all we can do is inch ever closer to where we want to be, adding syntax, built-in abstractions, new concepts, and so forth.

Am I bitter? I guess I am, to some extent, that I’ve invested all this time and energy into things which just aren’t as good, to such a point where I actually feel fear for what it’s going to be like to do Project SOULTRAIN in these other technologies. The accepted Right Answer these days would definitely be Python or Ruby + an SQL-based database. But then I would be facing the deliciously maddening inability to marry relational and object-oriented paradigms. I lose sleep over that problem almost every night. Well, going this route, I just don’t have to think about it. I hope it will be liberating, but I know that the liberation just lets me get back to the problem at hand, which I don’t know how to go about fixing. People don’t want to be liberated to work on real problems, they want to be liberated to worry about how to format this line of code, or how to get the database to give us the data we want in a timely manner. People aren’t interested in actually doing anything. We want to make it easier to do things, but we don’t really want to do things. Above all, I guess I feel bitter because I’m scared again, like I felt when I was trying to learn Python for the first time and I didn’t know anything else. Scared of LISP… damn, I hope Allan isn’t reading this.

I guess I’m proposing an extension to Worse is Better: Inefficient is Better. Mac owners trying to convince people to buy Apple, Linux users trying to convince Windows users to convert, widespread use of C++ and Java all point to a fundamental desire to not get things done. If we really wanted to get things done, we’d all be sitting in the console cranking out LISP. But we’re not. The Linux people are sitting in Fluxbox (whose “killer” features can be implemented from within FVWM2, Sawfish, and SCWM) staring at each other’s blogs, wondering how much better things would be if we had XML-RPC on our servers. Did we start missing the point at FORTRAN? If LISP came out today, would everyone start using it? I bet we probably would, and it would probably have a better regex library. Now, moving to LISP is an evolutionary step: get rid of the syntax. Back in the FORTRAN days, LISP was a revolution: functions as first-class citizens, garbage collection, recursion, machine-independence. These are all commonplace now, except for the syntax. Maybe Arc will make it happen, Paul Graham seems to have a lot of interesting wacky ideas.

no comments | no trackbacks

Implementation Language Selected: Lisp

Posted by Daniel Lyons Thu, 09 Sep 2004 12:00:11 GMT

Today I decided to use LISP as the implemenation language for Project SOULTRAIN. I discovered that there was a PostgreSQL package for CMU Common LISP, and that partly directed the selection.

Frankly, I’m tired of using programming languages that are intentionally under-powered. Nobody has made anything as strong as LISP since. It gets right to the point and is more powerful and flexible than anything else. Granted, I can do many similar things in other languages, but I haven’t done them in LISP yet, and I bet after I learn how to do it, I’ll be amazed at how powerful it is yet again. I’m ready for a mind-expanding experience, and neither Ruby nor Io nor Python are going to give me one (though I love them all).

Part of this was prompted by Alex pointing out that I hold LISP in higher regard than any other programming language. Well, fuck it—I’m ready to take the plunge.

The Spider

At work, a huge (1-2” in diameter) spider wandered in. It looks like it’s in the recluse family, but it’s not a brown recluse. I held him for questioning for about four hours, and then when Michael made it in, he took the spider out to the field.

My Favorite Design Pattern

For a long time now, I’ve said that Visitor is my favorite design pattern. And it probably is, overall, the most cool, though I hope not to have to use it again for some time. At work today, I got to enact the adapter pattern, and it was really quite fun. We have a shitty credit card authentication system from <a href=”http://www.goemerchant.com”>Go E-Merchant.com that works in a rather perverse way. You create a form and submit it via POST to their CGI, along with a redirection URL. They get your data and fire a Location-style header redirection off to your URL, with the results encoded in the URL as GET parameters. Not very wrappable, in point of fact, rather nasty.

We are going to be upgrading from this butt-nasty system to a proper system with a poor name called Advanced Integration Method or AIM. This system is more sane: you pass them your info via a POST and they give you back comma-separated values with every piece of information you could dream of (the old method only gave you whether it worked or not, and what the message was if it didn’t).

The adapter came into play because we need to drop something into the old purchase page that’s going to work with the new system. Hence, adapter: it looks like the old butt-nasty, but it works using the new magic. Plus, it affirms that library driving the new system works. All this makes me quite happy.

Lllama’s Heat

During the past 6 days, Lllama went into and came out of heat. We need to get her to the vet.

Tomorrow

Apparently, tomorrow is the day of Zozobra, or “let’s get drunk and set shit on fire” day. I will not be participating. Alex, Hillary, and Krishna probably will, though, at least in the fire. I think it’s a waste of time, but more power to ‘em; I can just skulk around here or program or something. Hopefully, Faust will come up and hang out with me and I’ll initiate him into the dark theories of flow-oriented programming. Not sure if I can remember it well enough now, but if anyone is around who can help me get worked up and offended about the state of computer science these days, it’s him. Maybe I’ll even get to show him BeOS.

I spent a good chunk of time this past week looking back on BeOS and what I had hoped would come of it. Major mailed me a link to a store selling BeOS for $22.50 and I think I’m going to have to sink a little money into it one last time. The UI is starting to look a bit dated, but I miss everything being so fast, and the promise. I recall the semester I spent with an OpenBSD gateway and a BeOS-based computer; I think it was named Euryalus back then. Let’s see if I can recall all the stupid names I’ve given my computer: Euryalus, Monolith, Murdock, Evolution. And the laptop is iDan. And the folk’s computer is Polaris, and Nathan’s computer is Godzilla or Parker. I still believe in the power of a pretentious name. I think I’m going to name the RAID server of Project SOULTRAIN Heorot, after the legendary hall of Beowulf. I need something pretentious that implies bigness, but isn’t common enough to have been used by a bunch of teeny bitches. I liked Evolution a lot. It was short for Evolution is Inevitable or Obvious or something else, just to offend the creationists. It seems clear to me that God is clever enough to invent evolution, and kick back and let it do the work. I guess that’s one reason why I’m interested in LISP so much, I expect it will provide the same kind of laziness to an ordinary human like me.

Bah

no comments | no trackbacks

Good Weekend

Posted by Daniel Lyons Mon, 30 Aug 2004 13:17:42 GMT

I had meant to work on the Io DBI interface this weekend, but never got around to it because I spent so much time being pissed off at Emacs and not knowing how to make it work like it should. It would up being the difference between (require ‘ruby-mode) and (auto-load ‘ruby-mode “ruby-mode”). Sigh… I love Emacs now, but sometimes I’m really befuddled at the amount of work that one can put into it before getting to where they want to get. In case I forgot to mention it, I’m supposed to be writing the database abstraction layer for Io. But I’m not sure when I’ll be doing that. I don’t exactly have hours and hours to put into coding these days.

I saw a couple good movies this weekend, Pushing Tin, which I had avoided for no reason I can put into words, which turned out to be quite good. It’s got all the awesome of a John Cusack movie and it also makes one respect air traffic controllers to some extent. We also got Aguirre—Wrath of God based on a recommendation on Plastic. I liked it a lot, Alex didn’t, what else is new. :) The visuals were really good, and the lead actor had some incredibly chilling moments. We also re-watched The Butterfly Effect and it wasn’t as good the second time around. It was like taking all the gut-wrenching moments of your standard drama, and then playing them over and over again, while having a Llama fuck you in the ear. Or something else distasteful. I don’t know…I love time travel as a theme, and I liked that movie in particular because the time travel was by will rather than technology or magic or whatever, but it was just too heavy I guess.

Eric told me to start reading his LiveJournal account, and to get in on the action between Major and Paul and so forth. I told him I think LiveJournal is the trailer park of the internet, he liked that. I don’t want to say I’m all high-and-mighty with my Bloxsom-based blog out here on a real server somewhere that I maintain, but, hey! Look at that, I am. So fuck off. Nobody reads my blog, and that’s really something wonderful about blogs that aren’t on LiveJournal. I’m not really doing this because I don’t have enough drama in my life, and though I enjoyed Jerry Springer, I didn’t really want to participate in it. 90% of blogging is drivel about what a blog is about. The other 10% is drama. I have enough of both I think.

That said, I guess I’ve been feeling a little lonely for my gang. I’m sure they’ve moved on for the most part, because even when I chat with Bill he wanders off and doesn’t respond so much, I figure everyone (as usual) has enough to do without me. This must be how Nick felt, and probably why he hasn’t contacted me since I emailed him about going down to Tech. An outsider can’t really take another outsider somewhere. So I think I’m going to email him with a different proposal. I dunno. I miss the guys. People ask me, “dontcha feel weird not going back to school?” Yes—I feel very weird, thank you very much. But it was killing me. I couldn’t take another year of it, let alone two. At Matterform I’m learning lots of things that aren’t really teachable, either because they change too fast or because it wouldn’t make for an interesting research area. GUI design is fascinating, but coding them is tedious. Making a brilliant GUI is to make a GUI that’s effortless to use. A lot of coding goes into that.

This morning, I was feeling ill, and Lllama came and sat on me, and was affectionate with me. I hope it was a glimmer of what’s to come. She hasn’t been a very friendly cat, but I always make sure to torment her. She also clawed me in the foot today when we were playing.

I am (once again) rewriting the random 5 bot for Alex’s LiveJournal community. She wants me to help her make some “memes” which is apparently what they call the trite little quizes that all the LJ people take. She thinks it’s a burden to me, but I love to code and I love to do little simple projects. it’s always interesting to me to see how complex even a little program can be. Picasso once said something about, whenever you feel you can’t paint anymore, stop what you’re working on and paint a flower. Put all of your love into that flower. When you’re done, your powers will return. I think this is very true.

I convinced Pablo that IRV was a bad idea, and brought him over to the right-thinking people who like approval voting. If only we could do this in the real world, too.

Life is truly good now. I seldom miss my old life, but it does come up from time to time. But I am very happy where I am now, who I am now, and who I am with. Everything feels very, very genuine and good. I’ve also had Andrew WK’s “Really In Love” stuck in my head for about a week, and that can’t be helping. :)

no comments | no trackbacks

AppleScript, ECPG, and QuickTime

Posted by Daniel Lyons Thu, 26 Aug 2004 13:03:09 GMT

It is certainly a varied life, working for <a href=”http://www.matterform.com”>Matterform Media. Today, when I showed up, I figured I would be presenting my case for why we need to migrate away from REALbasic to this cool system called ECPG or Embedded SQL. ECPG is a way of putting your damn SQL into C directly. I think it looks pretty cool, it looks like this:

void show_people()
{
  EXEC SQL BEGIN DECLARE SECTION;
  VARCHAR name[255];
  int age;
  int name_ind, age_ind;
  EXEC SQL END DECLARE SECTION;

  // get the people
  EXEC SQL DECLARE show_people_people_cursor CURSOR FOR
    SELECT name, age FROM people ORDER BY name;

  EXEC SQL WHENEVER NOT FOUND DO BREAK;
  EXEC SQL OPEN show_people_people_cursor;

  while(1)
    {
      EXEC SQL FETCH NEXT FROM show_people_people_cursor 
    INTO :name:name_ind, :age:age_ind;
      printf("found %s (age %d)
", 
         (name_ind ? "(null)" : name.arr), 
         (age_ind ? 0 : age));
    }
}

So, natually, Michael hates it (and he should: it’s C, after all) and I want to write our massive spam crime analyzer bot in it. The existing implementation takes about 2 days per 2/3rds of a percent (0.66%) for dealing with the spamspace, and that’s not including the spam from the past two weeks which has been reflected to our other database. So, I’m looking at C and thinking it’s the ticket, and Michael wants to poke at our RB until it’s sorta fast.

I don’t think we’re going to get there.

Anyway, what I wound up working on today instead was an AppleScript evaluation library for the first half, until we hit the weird irresolvable problems, and then a little QuickTime-based sound recorder demo app which will be used in iAnswer. Neither of them work very well, but they both seem to sort of do some stuff in a way kind of from time to time when they feel like it. But at least it wasn’t scanning more damned beads, so I’m happy.

Since I got home, I’ve been reading <a href=”http://www.nmt.edu/~jarrod/journal”>Jarrod’s excellent journal. I told him I would read it and I haven’t had time until now that he’s finally back home.

In reference to yesterday’s post, I’m downloading the CIA World Factbook and I’m going to see how bad parsing it is, and I’m going to make a little database here to hold the stats for each country so I can generate my little table in it’s entirety, and then perhaps graph it. But then again we know that Sealand is going to have the best representation ratio, and it’s a kingdom… :)

It’s only midnight and I’m already tired. It’s like I graduated into a goddamn retirement home. I have an airport extreme, which is connected to the internet over a modem. A few things around here seem, at times, to be somewhat weird.

no comments | no trackbacks

Alex and Io

Posted by Daniel Lyons Thu, 26 Aug 2004 10:02:00 GMT

So, today we discovered Alex has mono. I am a carrier so I guess it’s no surprise. I guess it’s better that it happened now than once she got into college, but she’s probably not going to be very energetic for a few months.

I asked Steve Dekorte about the DBI module for Io, and apparently it is incomplete due to inability to test on Steve’s part. So I’ve been asked to take up the slack and make it happen. We’ll see.

In a related note, the next release of Io is going to feature some pretty high-powered syntactic sugar. {}’s, ()’s and []’s will be recast into function calls with names like “brackets” and “parens.” Of course, due to Io’s fantastically awesome scoping system, you can overload these methods in some object and put that object in your object’s parent or proto slot, and presto! different syntax is available down a particular inheritance tree! I think this shit is pretty wild…

For my birthday, I got a quantity of CDs. One of the ones I hadn’t heard yet, Saxon’s “Wheels of Steel” is just awesome. On a scale from AC/DC to Sikth in terms of complexity, they’re hovering about an inch above AC/DC, but it’s impossible not to speed while listening to it. Alex said “It was like dog crapping on lawn,” and though I couldn’t agree more, I absolutely love it. :)

We’re going to go watch Aqua Teen Hunger Force Season 1, which my brother kindly gave to me for my birthday. I’ll bring it down to Tech next time I visit, too.

no comments | no trackbacks

Implementation Thoughts for SOULTRAIN

Posted by Daniel Lyons Tue, 24 Aug 2004 10:22:40 GMT

Last week I posted my ERD for Project SOULTRAIN (Sound Of Unreasonably Lossless Truly Ridiculous Audio (Array) In a Network). The original goal of Project SOULTRAIN few recall, so I’ll reproduce it here.

I hate RIAA. I hate record labels. I hate promoters. On the other hand, I love music. I want to have a single copy of whatever CD I want to own, and I want to use that copy exactly once. That one time that I use it, the following need to take place:

  1. A perfect disc image must be made.

    By this I mean, I want an image which is indistinguishable from the original when burned to CD. Near as I can tell, there is a way to do this with the command cdrdao read-cd.

  2. An Ogg/Vorbis or Mp3 cached copy of each track is made.

    This is because morons seem to like lossy music, because that way they can cram more of it on their cheap iPod ripoff.

  3. All metadata is stored in my massive and friendly database.

    I want to be able to search the database against any criteria I can imagine. Former band members, instruments used, “double-axe attack,” anything. Cover art, liner notes and lyrics count.

Then I want to have two other little bits laying around: a CD regenerator, and a plugin for whatever music player I’m using.

So today my thoughts drifted back to this. I want to pick my implementation language and answer a few other questions. Namely, whether or not I should couple tightly to PostgreSQL (I think I probably should) and whether or not I should make use of triggers and stored procedures. I have mixed feelings about triggers and stored procedures, because I don’t want to use Pl/PgSQL, and using anything else would make it even more unlikely that this software will be reused. I’m looking at putting many man-months into this (not to mention my own specific database) and I think other people may wish to use it, so it’s probably in my best interest not to couple it too tightly to any “weird” technology. But I also don’t want to do this if it’s going to be a drag.

Here’s the language break-down:

LanguageProCon
RubyMost fun, probably, second-best glue coding language, C extensions are probably easiestTendancy for sloppiness, low possibility of 0D, PostgreSQL module sucks
IoSecond most fun, worst glue coding language, C extensions are impossible but a fork of the code or embedding Io in a greater system with primitives for dealing with everything else is possible and might be easySeals the casket with respect to reuse, would wind up writing a lot of C ultimately, language is far from stable
PythonBest libraries, great portability, likelihood of reuse very good, probability of 0D very highLeast fun (now that I want to try other languages), probably slowest (if it matters)

My urge is toward the first two, because they’re more fun. If you can use a fun language in your own projects, when can you use one? But the other concerns may wind up weighing it down.

The other possibility is to build different portions of it in different languages. This is probably the most compelling. I wrote a demo in ECPG the other day, just to see how bad it was, and it wasn’t that bad (though it looks like handling large objects is quite a chore). So there is the possibility of writing some sort of “Objecty-C” wrapper for the database in ECPG and then building on that for both Ruby and Io support, and doing the actual work there. I might even bother to learn about extending Python at that point, assuming I have a fleshed-out and fully tested C library to drive the thing. But then we lose on the flexibility angle with respect to homebrew queries. Perhaps the best thing to do is to do that and then provide a way of speaking directly to the database. I have serious doubts about object-relational interfacing, because it seems to miss out on the flexibility of the database which is it’s fundamental merit. But maintainability being the other concern, one doesn’t want to expose the database to too much fiddling.

What a quandry…

Update: I’ve discovered that Io includes something called libdbi, a C-based database abstraction layer, which comes with PostgreSQL support. Making it happen in the build automatically may be quite a trick, but it seems like it’s definitely doable. Additionally, I worked on Ruby’s PostgreSQL module and I can get it to compile in Linux but not on the Mac. Further investigations are necessary as to the reason why this is, but I suspect very strongly that I’ll be able to get it to work too.

no comments | no trackbacks

The Real Red vs. Blue

Posted by Daniel Lyons Fri, 20 Aug 2004 12:13:00 GMT

I’ve made up my mind: this year I’m going to vote my conscience. I’m voting Socialist. I’ve had it with the red/blue bullshit conspiracy. “If you don’t help Kerry, you’re helping Bush!” they scream. If you can’t see through the thin veneer that is Kerry, you deserve him. He’s as bad as Bush, he’s probably worse.

Politics here have been fucked up for a long time. If it makes you feel better, I don’t think I can change things. Nor do I think that my vote is going to make a difference. But you know what? That’s not the fucking point— voting is sharing your voice and nobody is hearing the Socialist voice, or the Libertarian voice, or whatever because Americans do not vote the way they feel. We vote the way that we think will “matter.” Well, that’s bullshit, because it makes us give up on our ideals when we shouldn’t, and would reduce us to a the current shat two-party system regardless of how many parties we started with. Fuck it!!

Now, because I believe it is fraudulent to call America a representative system, let’s see some pretty charts. The “representation ratio” is the percentage of the population of the country who are representatives in the federal government. Observe:

CountryPopulationRepsRepresentation Ratio
USA293,027,571536 (house + senate + pres)1.82e-6 or 0.000001829
United Kingdom60,270,70812772.11e-5 or 0.00002119
Spain40,280,7806091.51e-5 or 0.00001512
New Zealand3,993,8171203.00e-5 or 0.00003005
Vanuatu202,609520.0002567

Look at this! America’s representation ratio is an order of magnitude worse than that of the New Standard Democracy. European nations, it seems, maintain about an order of magnitude more representatives per their own population. New Zealand is doing better than average for a European nation. And then look at Vanuatu, with a paltry 52 seats, yet it beats all the rest hands down. All of my raw numbers are from our very own <a href=”http://www.cia.gov/cia/publications/factbook/”>CIA factbook, so you can just go fuck yourself if you don’t like my numbers.

The reason why I like this examination is because it points out our own hypocrisy so effectively. We claim to be bringing democracy to all of these nations—and most of them are sitting next to nations that looked at our model and said, “This would be good if only it had more representation in it.”

Nor should I be taken as saying that our system can’t work. It can work, but it needs to be calibrated. The formula we work from, 2 senators per state and 1 legislator per N people, works great until states are populated the way California is. Hell, New Mexico is a po-dunk little back-water state (or so it is thought) and our population is far, far greater than what was anticipated by the authors of the Constitution. Fairness in goverment is only achievable at a certain scale, and adjustments must be made or a better formula created.

Why I Hate Red and Blue

I hate Red and Blue both, for various reasons. I hate that Red tries to guilt me away from the platform I truly want to vote for. I hate that Blue insinuates that monogamy is an important characteristic of a politician. Blue voters would vote for a sociopathic serial killer (and some would say they have) over a Red with a divorce in his past, when this issue is both irrelevent and far less of a sin than destroying the environment for personal gain and warring for no better reason than to plunder and take revenge. But I hate that Red says “Our statistics say you’ll vote for this rotting piece of meat if we stamp it non-Blue. plop Here you go. Vote. Good boy.” The Blues are at least deluded into believing they have some kind of cause. The Reds are a deeper kind of self-loathing scum; they know they have nothing to offer except an alternative and they always find the loser of the losers to push. “Oh, we can’t have Dean!” they scoff, ”he has been known to occassionally get excited, even going so far as to vocalize his emotions!” He’s not stiff enough, we need a staler one.

So I’m going to vote green, or purple, or red-and-black. Not because I have no regard for your suffering, but because I think we have to put this system out of its misery. I can’t vote my mind because it doesn’t work with our numbers. I can’t vote my mind because my platform is “extreme” (read: not tepid or scripted). Then fine, I’m doing it, and I’m doing it to say “fuck you” to Red and Blue, and all their weak-spined supporters. They think I can’t live without them, well, they’re in for a surprise. I’m onto their little game, and I know I have nothing to lose by not voting for them, so I’m going to tell them “do your worst, fucksack, I can take it.”

How to Make a Difference

Now, this is how we could use this line of thinking to actually make a difference. Granted, that’s not why I’m doing this—I’m doing this because I hate our system and I hate the morons on TV and I hate not speaking and voting my mind. But you could think about it this way, and if it gets your ass to the voting parlor, that would be nice too.

Right now, we get what, 25% voter turn-out? Not much, at any rate, and it’s the 18 to 26 age bracket (us, mostly) who are not voting. Jarrod and I are the only people I know who are my age and who make it a point to vote. Anyway, most of us aren’t voting, and there’s a fuckload of us out there.

What if we all went in there and voted randomly? If you and I go and vote, say, Constitution Party and Socialist Party, instead of Red or Blue, what happens? Well, firstly, we feel gratified, because we’ve voted how we feel and we’ve said “fuck you” to Red and Blue. That’s all we wanted to get out of it anyway, so we can’t really be disappointed (plus, we don’t have to stay up late to see the election results on TV). But suppose an extra 20% of us turned out and did this? Some Red or Blue fuck would still win, but this time it wouldn’t be Red winning 52% of the vote, it would be Red winning 23% of the vote. Suddenly, the fact that most Americans don’t fundamentally agree with the platform of Red or Blue more than anyone else, becomes very, very clear. It would demonstrate what a complete fallacy it is to say that half of us prefer Red and the other half prefer Blue. Plus, in the next election, you can bet your ass Red and Blue are going to be shopping for those Constitution and Socialist votes. You’ll be able to chart the transition of Red to socialist and Blue to libertarian on an egg timer. Of course, at that point, we just hold out on them because we’re cocks and we want them to beg for it. We like the look on Blue’s face when they get all pouty and say “Please come back to me libertarian lover! Living without your minimalism is a lie!”

So, to sum up: fuck Red and Blue. Let’s move to Vanuatu. :)

no comments | no trackbacks

Back Online at Home

Posted by Daniel Lyons Thu, 19 Aug 2004 10:58:45 GMT

It’s been what, six weeks?

Today at work we found a really awesome program: TeleCrapper 2000. The intent of the program is to behave sort of like Eliza for your phone: you record a bunch of waves of you talking to nothing and it plays them back for telemarketers over the phone whenever they pause for input. The example stacks are pretty hilarious.

The Yahoo! transport was down on Jabber for a few weeks there. I am apologetic to those who use the Clan Spum Jabber server. They rotated back to sms.msg.yahoo.com from sms.msg.yahoo.com (or whatever).

Dialup is true pain. I love having internet access again, but at what cost? It seems like a lot to put up with. At least I’ll have a chance to perfect my synchronized Clan Spum Sites folder AppleScript magic. I’ll post it after I get it to work.

For my birthday, Alex got me a couple of CDs yesterday: the new Evergrey album, “The Inner Circle” and the second Avantasia album. Unfortunately, I don’t have much to say about the second Avantasia album. It just isn’t as good as the prior one (“Metal Opera Part 1”). The new Evergrey, on the other hand, kicks all kinds of ass. :) They are starting to sound like themselves in places, but they still turn it up to eleven; it has some of the most beautiful passages I’ve heard in metal, while retaining all class and not falling to cheese. It also has some really fast, hard, heavy stuff. Everyone who liked their older stuff should get it, definitely.

SpamCrime Analysis

At work, we’ve been doing a lot of Spam Crime Analysis lately. We picked one domain semi-randomly from the top 30 spamming domains for our analysis, cutprice12.com. We traced the IP and and bubbled back up to find other domains of theirs we had seen. We had seen, in total, about 12 different domains of these assholes. Then we did a WHOIS query and found 68 other domains of theirs, of which 67 were aliases for their internet pharmacy. The other was for an online casino, bay-casino.com, or Phoenician Casino as they like to think of themselves. I thought this was pretty amusing.

I did a bit more digging and found that they were using casino software written by a particular company (I can’t recall the name, BogCasino or something). Looked up that company and found links to about 50 online casinos. One of them even looked somewhat legitimate, based in Canada. Apparently, Canadian law dictates that gambling is illegal, but leaves prosecution up to the provinces. Some provinces choose not to enforce the law, and these guys were apparently based out of one of those. I called their 800 number, it was very open and professional sounding.

Other Languages

I have found that I miss Ruby and Python. My boss asked me to write a little script for him the other day, just to take a file that looks like this:

2398238   foo    bar
other fields here

9838388   other foo    other bar
other fields here

.
.
.
  

And make a bunch of files with names like “2398238” with all that record’s data in it. I found myself taking a little longer than I should have, because I missed dicking around in these other, more expressive languages. You never write something like “x = [x.strip().split(”,”)[1:] for x in stdin if x.split(”,”)[0] = “keep” ” in REALbasic. You also never see anything like “bar = (files.each {|f| file.read.split(” “).collect(”,”) }).strip.” After a while you come to see why these languages are so popular in the hacker community and so reviled in the business world. Yet I have to wonder how Perl got to be so popular when it’s much worse than Ruby or Python could ever be. These are the things I worry about…

Project SOULTRAIN

I am working on an ERD for Project SOULTRAIN. I have decided I want to store as much data as possible. I don’t care if entering the data for a CD takes 30 minutes and ripping and encoding it only takes 5. I want to be able to do bad-ass queries like these:

  • Give me all the songs performed by this artist (regardless of band).
  • Give me all guitar music without synths.
  • Give me all additional tracks off remastered albums.
  • Give me all tracks performed exclusively by musicians older than 40 at the time of the performance.
  • Give me all bands that this musician was in.
  • Give me all bands who have had more than three genres on one album.

It’s incomplete, and I know where most of the bugs are, but here’s the image:

ERD image”/>

Here are the problems I’ve noted:

  • Every release is the same album exactly, just on either a different medium or with differing release-specific information. This is wrong. Maybe tracks should be associated with the release rather than the album? Or maybe there should be some kind of track diff thing with releases.
  • What to do about lyrical/melodic/timing differences between compositions and tracks?
  • Is it possible that other artists will re-release the same album as another artist? If so, we will need to permit more than one artist to release the same album. Perhaps this should be a three-way relationship?
  • Should we differentiate between brands of instrument? Personalized instrument? What about keeping track of which instrument is used on a per-track basis? Maybe that should be considered a player in the track/composition/musician relationship?
  • How should we account for lineup changes?
  • What constitutes a genre? Should genre modifiers be just genres or do we need a heirarchical tree type deal?
  • Should genres be done at the artist, album, and track levels? At which level should we stop? Should compositions have a genre? Should upper levels simply aggregate the genre of lower-level items or should they have their own, separate genre?
  • Where should lyrics and artwork be stored?

These sorts of things always work out better when there’s a second pair of eyes looking at them.

New Mac Software

Most of this stuff is butt, incomplete, and poorly-documented. Nevertheless, I am working on it and I intend to see this shit through 1.0 at least. Anyway, here it is:

Password Generator

It generates secure passwords using /dev/random or /dev/urandom, your choice. Actually you can put whatever you want in for the device, but you probably shouldn’t put in /dev/zero or it’ll probably lock up your machine.

The algorithm is deceptively simple: I read blocks out of the device and keep all the typeable characters. Look at that! Anyway, SSH Options

Right now, it pretty much works as long as you don’t want to do one of those ulta-obscure things with more than one local-to-remote or remote-to-local or application port forward, though all of the drop boxes don’t work yet because I don’t see how to do them with Cocoa Bindings. I’ll be making that work pretty soon. Also, my AppleScript needs a little work since it seems to open more than one window when you click on Connect. Otherwise, it’s my most-complete app and I had a lot of fun writing it (it was also basically my first app). Let me know what you think, and download it here.

I still have lots of other dormant software which I intend to release as soon as I’m good and ready. It is, however, almost ten and I have lots of housework type chores I need to do. Uploading all this shit is probably going to take forever and goddamn software update is wanting to download something like 30 MB of software, which will probably take two or three hours at this rate.

Here’s hoping the posting keeps going this time. :)

no comments | no trackbacks

Random 5 Bot Rewritten

Posted by Daniel Lyons Sat, 24 Jul 2004 14:27:00 GMT

Most of you are unaware of my little <a href=”http://www.livejournal.com”>LiveJournal account, <a class=”ljuser” href=”http://www.livejournal.com/users/fusiongyro”>fusiongyro, which is a good thing because there’s nothing there. However, I do use it in order to be a member of a certain LiveJournal community, <a class=”ljcommunity” href=”http://www.livejournal.com/community/musical_elitist/”>musical_elitist. I’m sure you are all blindingly aware of what a good name that is.

At any rate, I had a piece of software called “Random 5 Email” which worked for about a month and then died mysteriously. I wrote it using a Ruby implementation of Prevayler, called Madeleine. Well, one day it just sort of stopped doing its thing, probably due to an upgrade of either Ruby or Prevayler. This is actually a pretty good case being careful with Prevayler, since you need to be sure that you are always using the right version of whatever you’re using. If the dump format or object layout changes at all, you’re fucked. There should be a solution to this problem.

Today I rewrote that piece of software. It works for me but I wouldn’t call it production ready, so I’m going to hold off on releasing it until it’s a little more stable.

Earlier on we went to Alex’s old place and picked up some supplies, including a nuker, so we now have proper reheating action.

The cats have basically made up; they play together somewhat, sleep together, and eat from the same bowl. Lllama likes to hide underneath one of the chairs Faust is lending us, and Ebony found somewhere new to hide today that was so effective we were worried we had lost him. We don’t know where that place is yet, either.

Tomorrow I am looking forward to writing some CORBA code just to get a feel for it. I would take suggestions if anyone were actually reading this blog. I think I will aim for some kind of networked jukebox, because we can never have enough of those. It might give me a chance to brush up on my Pthreads, too.

no comments | no trackbacks

Victor, the Moron-ator

Posted by Daniel Lyons Thu, 08 Jul 2004 08:31:29 GMT

I got this email from a moron named Victor “The Liberator.” Apparently, that wonderful used car salesman slash pothead Ed Berndt got high with this guy, and now I have to deal with the consequences. I’m not really willing to give this guy webspace, but since yesterday was a slow day, I’ll give you guys the email instead of real content.

2 comments | no trackbacks

Older posts: 1 ... 39 40 41 42 43 ... 45