Archive for August, 2006

Quiet A.I. I think this will be the way A.I. ultimately sneaks in to everyday life. It’s already happening on the web. But this response on kuro5hin is a fair warning. Choose carefully what you feed your digital “children”!

Comments No Comments »

To clarify for some respondants to Voted Off the Planet: As far as I know, the decision to remove my blog from Planet Lisp was not made collectively by readers but solely by the site’s maintainer. As is apparent from comments on the announcement, some people approved of the decision and some did not, but those comments came after it had already been done. The emailed responses I’ve gotten have been uniformly positive — thank you to those people, and to anyone who is still reading.

I was never actually notified either when my blog was added or when it was dropped. I think that’s revealing: I was not being invited into the community, I was being tested. According to one person’s standards, I failed. That in itself does not surprise me. I was not ready for such a large and demanding audience. I only started this blog a few months ago, and I am definitely still feeling my way towards a writing style.

What did surprise me was the viciousness of the criticism, some of it from people who were clearly only skimming my posts anyway. E.g., I was “hassling” Planet Lisp by announcing “UFFI bindings to a C library.” Well, 1) It was CFFI, not UFFI; 2) only half of it is bindings, the rest re-implements bits of the Perl API in Lisp and translates data between the two; and 3) I said it was just for fun.

Or was the idea of embedding Perl code in Common Lisp just too heretical? ;)

But the lesson I can take from all this is that I still have a long way to go. So bear with me, gentle readers, as this page (hopefully) evolves into an interesting and enjoyable discussion.

Comments 1 Comment »

This is just an random idea that popped into my head. Tell me if I’m crazy.

Is there enough distinction between literals in code and values generated at runtime? In other words, what should be the difference between this:

x = "Hello, World!"

and this (syntax made up):

x = new String("Hello, World!")

In general, I understand literal values in code to be immutable, or at least it’s undefined what happens if you modify them. So should two identical literals be pointers to the same block of memory? Does this C code:

char x[] = "Hello!";
char y[] = "Hello!";
if (x == y) printf("True");
else printf("False");

print True? (I tried it, and the answer is no, it doesn’t.)

This gets more confusing when you can have object literals as in JavaScript:

myFriend = {
  name : "Bob",
  age : 32,
  friends : ["Jack", "Jill", "Joe"],
  talk : function(){alert("Hi, I'm "+myFriend.name)}
};

Is myFriend mutable? As it turns out, in JavaScript, the answer is yes. For an interpreted language embedded in web pages that makes sense. But what about a compiled language — is efficiency lost when values could be compiled in but aren’t because the compiler doesn’t know the value never changes? I suppose that’s the reason for all those annoying const declarations in C++, but is that a complete solution?

So my question is this: would it be worthwhile to have specific syntax for compile-time contants? C has preprocessor constants, but they’re text-based and don’t carry type information.

Comments No Comments »

Consider the following simple bit of mathematical notation:

Fourth Root

the TeX code that draws it:

\sqrt[4]{\frac{x^2+1}{x-1}}

and the same thing in an S-expresion syntax like Common Lisp:

(exp (/ (+ (exp x 2) 1)) (- x 1)) (/ 1 4))

and in a typical function-call notation like Python:

pow((x**2+1)/(x-1), 1/4)

I know which one I’d prefer for doing my math homework. For a while I thought S-expressions were superior to conventional mathematical notation because they are more consistent, but that consistency is what makes it harder to read complex nested expressions like the one above. Splitting it up into multiple lines with more whitespace would help, but it wouldn’t solve the fundamental problem: linear code doesn’t have enough shape. I can look at the math and immediately, without thinking about it, say “that’s a fraction inside a radical.” Determining the same thing from S-expressions, function calls, or TeX requires me to mentally parse the code and build up the expression in my head. Maybe if I spent a lot more time reading code than I presently do I would achieve the same ease with code, but I can’t really believe that any programming language would ever be as easy to read as the math. As long as it’s linear (in some respect) code doesn’t provide enough visual information to engage the image-processing functions our brains excel at.

Comments 2 Comments »