tag:blogger.com,1999:blog-263570512008-07-02T14:04:10.720-04:00Foyledairfoylehttp://www.blogger.com/profile/09522942023186875478noreply@blogger.comBlogger18125tag:blogger.com,1999:blog-26357051.post-91231549835394092722008-06-29T21:24:00.004-04:002008-07-02T14:04:10.823-04:00Warning: Making IceThere are a few people who still use old-fashioned ice-cube trays — including me. I mean the plastic kind that you fill yourself and then twist to get the ice cubes out. (I suppose the even older kind with a complex system of metal levers and partitions are still around.) I think the reason people prefer the hi-tech version connected directly to the plumbing is their nervousness at the prospect of water expanding out of control. When people fill ice-cube trays, they often put little more than a little puddle in each plastic cup. The reason is that they have heard that water, unlike most materials, expands when frozen. I hate to be anticlimactic, but the amount of expansion in volume by about 10%. Two cubes that differ in this volume are impossible to distinguish unless placed side by side, because the linear dimensions of the big one are only 3% larger. However, in a cup of an ice-cube tray, because the sides are almost vertical, except at the bottom and top, the height will in fact increase by about 10%. This still isn't very much, especially considering that there is a bit of space at the top for it to expand sideways into. But as I was watching my daughter refilling an ice-cube tray the other day, moistening the bottom of each cup, it occurred to me that what people visualize, if they haven't done the math, is ice exploding out of control, sort of like the Incredible Hulk. From each little plastic cup in the tray, an iceberg will emerge capable of sinking the freezer as though it were the <span style="font-style: italic;">Titanic.</span> "More," I said to my daughter. She splashed a bit more water in. "More," I said, wrestling it from her and proceeding to fill each cup almost to the rim. Poor child; she grew up in a house with an automatic ice maker, and is ill-equipped for the real world. But it's a parent's duty to train each child to deal with the myriad threats the world poses, and I do not shrink from my duty. There are many things I cannot shelter her from out there, but one of them is a tray full of those dinky ice cubes of every size except "large."airfoylehttp://www.blogger.com/profile/09522942023186875478noreply@blogger.comtag:blogger.com,1999:blog-26357051.post-3927532566852883622008-03-21T21:43:00.004-04:002008-04-05T21:51:57.183-04:00Brain BubblesMy sister-in-law recently sent my spouse and me a pointer to a <a href="http://blog.ted.com/2008/03/jill_bolte_tayl.php#more">a video</a> by a neuroanatomist, referenced in <a href="http://blog.ted.com/">TEDBlog</a>. My beloved played this thing, and I heard the speaker, <a href="http://www.drjilltaylor.com/">Dr. Jill Bolte Taylor</a>, start to describe the brain and its hemispheres, the right one, which "functions like a parallel processor," and the left, which "functions like a serial processor." With growing apprehension, I heard her say, <blockquote> Our right human hemisphere is all about this present moment…. It thinks in pictures …. Information in the form of energy streams in simultaneously through all of our sensory systems, and then explodes into this enormous collage …. I am an energy being connected to the energy all around me through the consciousness of my right hemisphere. We are energy beings connected to one another through the consciousness of our right hemispheres as one human family…. </blockquote> This is the problem with having two computers in the same room; sometimes one spouse starts to run an audio the other really didn't want to hear. (Hey, who knew that the <a href="http://video.voyeurweb.com/index_tcam.php"> Voyeurweb tittie cam</a> even <em>had</em> audio?) As Dr. Taylor waxed more and more ecstatic about the right hemisphere, I tried to stifle a rising urge to shout, "This is utter crap!," but I was not successful. Meanwhile, an essay on one brain hemisphere must be followed, as the night the day, by an essay on the other: <blockquote> Our left hemisphere … thinks linearly and methodically. Our left hemisphere is all about the past and it's all about the future. Our left hemisphere is designed to take that enormous collage of the present moment and start picking out details…. It then categorizes and organizes all that information, associates it with everything in the past we've ever learned, and projects into the future all our possibilities. And our left hemisphere thinks in language. It's that ongoing brain chatter that connects me and my internal world to the external world. It's that little voice that says to me "Hey, you gotta remember to pick up bananas on your way home…." It's that calculating intelligence that … reminds me when I have to do my laundry. But perhaps most important, it's that little voice that says to me, "I am; I <em>am</em>." And as soon as my left hemisphere says to me "I am," I become separate, I become a single, solid individual, separate from the energy flow around me, and separate from you…. </blockquote> At this point I had to leave the room, because I really couldn't interrupt my spouse's session with Dr. Taylor with a spell of badgering about how absurd the good Dr.'s descriptions were. Dr. Taylor is a neuroanatomist, who, according to her website, "specializes in the postmortem investigation of the human brain." Fine; I'm sure she knows her way around dead brains like the back of her hand. But her knowledge of the living variety has apparently been garnered from the same pop-psych books that just about everyone seems to have absorbed and believed unquestioningly. You know the type: They promise to help you unleash the potential of your right brain, which processes information "nonlinearly," and so can help you think outside the box. There is a grain of truth in these theories, and that is that in most people language is mostly processed in the left hemisphere. Damage to certain areas results in linguistic deficits that are by now somewhat predictable, although by no means understood. That's about all we know that is relevant to the issue at hand, regarding differences in processing abilities in the two hemispheres. In particular, spatial reasoning and other sorts of nonverbal abilities do not show any asymmetry; they are, as far as anyone can tell, carried out by tissue distributed across both hemispheres. The mechanisms of consciousness, described in authoritative tones by Dr. Taylor, are still controversial, but all the proposed "neural correlates" of consciousness do not show the sorts of asymmetries she takes for granted. Indeed, the <em>only</em> reason that I have ever been able to glean for the near-universal opinion that the left hemisphere is "serial" and the right "parallel" is the assumption that language is serial in a way that other human capacities are not. This assumption is derived from the obvious fact that words are spoken, and heard, one at a time, and that deciphering the meaning, and intelligibility, of a sentence depends upon assembling the words into sentences that preserve the order in which the words were uttered. At a cocktail party, you may or may not succeed in isolating the words one person is saying, but if you don't you will hear a meaningless babble. Furthermore, many people are insecure about, shall we say, their "debating skills." They may have strong opinions about, for instance, capital punishment, but faced with an argument that conflicts with those opinions they often just get frustrated. I say "they," but I think everyone has been in this position at one time or another. It's comforting for us to think that we have arrived at our opinion "holistically," whereas our opponent is good at thinking "linearly." The opposing argument is, after all, stated in the form of an argument, whereas what we have is a cloud of opinions that we feel <em>must</em> be justified somehow. Wouldn't it be great to think that there are merely two styles of thinking, each valid in its own way, and that the one we use transcends the stifling linearity of argument and arrives at a deeper truth while at same time connecting us to all the other "energy beings" who agree with us? When you add it all up, it's a mighty slim set of reasons to believe some patent absurdities, which I will try to refute: <ul><li>The left hemisphere does not "think in language." The ability to produce and understand language may or may not reside entirely in the left hemisphere, even if much of it does, in most people. But to suppose that the thinking required to understand language is itself transacted in language is a ridiculous case of circular reasoning. </li><li>The brain is a parallel processor, all over. It has billions of neurons that generally find something to do most of the time. This is just as true of the left hemisphere as the right. Think about it: In a sizable fraction of people the language areas are in the <span style="font-style: italic;">right</span> hemisphere; if a child suffers an injury to their left hemisphere, the right one can often adapt. Would that mean the right hemisphere turns serial?</li><li>There is nothing serial about language, or at least what we normally think of as "linguistic thinking." The standard example of "linear" thinking is a mathematical proof. But even if a proof is linear, that doesn't mean the thinking required to find or understand the proof is linear. At the very least there are many blind alleys in searching for a proof, and you can't really understand the proof without reproducing some of that search.</li><li>People who claim that language is "linear" are overlooking poetry and fiction. Texts in these forms are sequences of words just as much as proofs are, but no one would believe that writing or understanding a poem is just a matter of grasping one word after another.</li><li>We do not become "separate...individuals" because an inner voice says "I am." To believe that is to believe that there weren't any separate individuals until the evolution of language. I'm guessing individualhood is as old as the first cell. Of course, consciousness didn't come along until later, but most of us believe that dogs and chimpanzees are conscious, and they don't have inner voices speaking English to them.</li></ul>The truth is, we know remarkably little about how the brain <span style="font-style: italic;">thinks</span>, in spite of much recent progress in neuroscience, and hullabaloo about techniques such as <a href="http://en.wikipedia.org/wiki/Functional_magnetic_resonance_imaging">fMRI</a>. Nonetheless, people like Jill Bolte Taylor love their preconceptions, and it will be a long time before they stop speaking as though there were evidence to back them up.airfoylehttp://www.blogger.com/profile/09522942023186875478noreply@blogger.comtag:blogger.com,1999:blog-26357051.post-14614264009725605112008-03-09T16:14:00.003-04:002008-03-09T17:13:09.322-04:00Windchill Is BaloneyThe temperature (Celsius) today in New Haven is 5, but it "feels like" 1. Why? Because it's windy: Winds are in the range 33 kph to 50 kph, and the gusts are rattling my poor old windows as I type. Now, what good does it do to tell me that it "feels like 1?" It makes the weather more dramatic, and meteorologists usually have little drama to report. Plus, there's some <a href="http://www.weather.gov/os/windchill/index.shtml">scientific basis</a> for the equivalence of 1 degree and no wind with 5 degrees and the wind at hand. The problem is that the equivalence of today's weather with "1 degree and no wind" does me no good unless I have access to a meat locker with a thermostat so I can adjust the temperature, stand inside the meat locker, and see what 1 degree and no wind feels like. If I simply take "feels like 1" at face value, I will imagine what it was like on previous occasions when it has been 1 degree out. Some of them were windy, some less so, but even when it was moderately windy there were some corners, like the notorious corner of Elm and Church, where it was <em>really</em> windy. Boy was that cold! If I took all this seriously I would be left with the impression that it is not "really" 5 degrees; in some scientific sense it's really 1. Hey, it's colder than you thought! Better bring your scarf and earmuffs! Which is absurd. If we know how cold 1 degree is, then we also pretty much know how cold 5 degrees is, and if there's wind gusting to 75 kph and we're planning on walking past the corner of Elm and Church, we know we're in for a blast. Telling us what it "feels like" is pointless. So, weatherpeople, take those windchills away! Be content with the thought that we <em>like</em> you when you're undramatic. You're like Grandma; we love her, but we love her more when she sits quietly in the corner than when she drinks a bit too much and gets her motorbike out. Telling us windchills is like Grandma dressing in a miniskirt; a little bit of nondrama that is at best misleading.airfoylehttp://www.blogger.com/profile/09522942023186875478noreply@blogger.comtag:blogger.com,1999:blog-26357051.post-52866970473577353862008-02-29T01:49:00.002-05:002008-02-29T02:00:21.544-05:00Republicans are Dumb and EvilHave you ever noticed that Republicans, when talking about taxes, claim that every dollar taken from a person's hands and given to the government is a dollar misspent? The person who earned that money has better uses for it than the government, and when he or she spends it it will operate more efficiently as a spur to economic growth than it ever could in the government's hands. Then, when Republicans are talking about immigration, what's their #1 issue? The illegal immigrant's failure to pay taxes! Actually, they should be pinning medals on those brave noncitizens who manage to play such a productive role in society by paying almost no taxes (not zero, of course, because of sales taxes), and thereby creating more jobs than the rest of us Now that the inconsistency has been pointed out, I'm sure the Republicans will rush to fix it, one way or the other — or when they stop fooling most of the people most of the time.airfoylehttp://www.blogger.com/profile/09522942023186875478noreply@blogger.comtag:blogger.com,1999:blog-26357051.post-91458092155934936662008-02-24T18:20:00.002-05:002008-02-24T18:29:33.573-05:00<h3>Top 10 Mistakes Found in "Personal Statements" by Chinese Applicants to Graduate Study in Computer Science </h3> <p>[We're in the midst of graduate-school-application season, so this little guide, which has been making the rounds, may be useful to some applicants — next year.] </p> <p>Anyone who has spent a year or two reading applications to graduate school can attest that many of the "personal statements" found in these applications can be a little weird. The title at the top of this list mentions the Chinese, but these mistakes are made by applicants of every nationality. (It should also be pointed out that many Chinese applicants are excellent students who become academic stars in the U.S.) The only reason to single out applicants from the Middle Kingdom is that there seems to be a best-selling "personal statement style guide" whose influence can be seen in a high percentage of the applications from that country. The writer of this guide should be taken out and … retired peacefully to the countryside. </p> <p>Some of the advice below sounds rather specific to Computer Science, but it's likely it can be adapted to other disciplines. Anyway, without further ado, in no particular order, here are the pitfalls one should avoid when writing the "personal statement": </p><ol> <li>Telling the story of your life, especially talking about how you've loved computers since high school (or the womb) and how much joy and satisfaction you get from CS. </li> <li>Bragging about getting into a top-notch university, winning awards, etc. </li> <li>Failing to talk about your research goals. </li> <li>Listing all the things you've done that were someone else's idea, without mentioning any that were <em>your</em> idea. </li> <li>Mentioning only the successes attained by projects you've participated in. (Most projects fail to accomplish some of their goals, so it sounds weird to have one triumph after another.) </li> <li>Equating research ability with persistence, diligence, perseverance, and similar traits. </li> <li>Emphasizing your abilities as a team player, especially on a team having nothing to do with research (e.g., student government, sports). </li> <li>Talking about what you're <em>willing</em> to do, not what you <em>want</em> to do </li> <li>Listing all the well known algorithms you've implemented, unless you discovered and fixed some significant bugs while doing it. </li> <li>Bragging about all the reading you've done. (Don't list the books; show that you've assimilated them.) </li> </ol> <p></p> <p>It may sound as if the list above is mainly about what <em>not</em> to do, leaving the applicant puzzled about what he or she <em>should</em> do. So, here's some positive advice: First, you should have some research experience as an undergraduate, so if you're thinking of going to graduate school find a faculty member willing to mentor you and give you something to do at least a year <em>before</em> you apply to graduate school. (Obviously, not everybody can follow this advice; if you are applying two years after graduating then you probably can't.) Second, think about what kind of research you would like to do, but don't <em>just</em> think. Read the literature in the area and figure out what's going on and where the interesting issues are. Third, make up some specific research goals. They can be modest or bold, but they should be well informed. </p> <p>Now write about what you've learned, what you've done, and what you'd like to do. Don't give in to wild-eyed speculation. (Promising to prove P=NP or write a program that can pass the Turing Test will make you sound like an ignoramus.) Whatever you write will be made obsolete by your first year's experience in graduate school, but that's okay. You want to sound like as much like a first-year graduate student, and as little like a sophomore, as possible. </p>airfoylehttp://www.blogger.com/profile/09522942023186875478noreply@blogger.comtag:blogger.com,1999:blog-26357051.post-31699826442258895252008-01-04T20:38:00.000-05:002008-01-04T22:00:37.809-05:00Boycott the Iowa Caucuses!<p>The presidential-election process in the United States has reached a point where almost everyone admits it is insane. Theoretically nominees are chosen by conventions in the summer, but since the 1960s the conventions have been rubber-stamp affairs, certifying the candidate who won the most delegates in the primaries. At some point New Hampshire became the state with the earliest primary. In fact, the primaries were scheduled in a more or less east-to-west pattern, with California coming last. California elected a big chunk of delegates, so the issue was often not decided until after its primary, in June.</p> <p>But the exigencies of fund-raising in the TV age drove states to push their primaries earlier. We all know the story: candidates need buckets of money to pay for TV ads, so they must spend as much time raising funds as meeting voters. If you fall behind in the fund-raising race early, you will lose traction in the early primaries, lose more credibility with the money people, and spiral downward to oblivion. Worse, the press seems incapable of covering any aspect of the campaign <span style="font-style: italic;">except</span> the money race. So the set of viable candidates decreases fast, leaving even large states with pointless primaries if they happen to come after, say, the second wave. The inevitable consequence was that states got into an "arms race," moving their primary dates earlier and earlier to stay relevant. New Hampshire insists on being the earliest, which has led to ridiculous squabbles and byzantine intrigues. Now the New Hampshire primary is held in January (January!), followed by a huge gob of them occur in one big wave in early February, including California and New York, and it's hard to hope that there will be much to decide after that. So that means we have a gap from February until late August when the nominees-presumptive will be twiddling their thumbs.</p> <p>What can be done about this mess? Short of a constitutional amendment, it's hard to think what. I don't quite understand how the primary system got through the constitutional filter in the first place. How can a state forbid a party from choosing its nominee any way it wants? If only we could go back to the system that chose Truman, Eisenhower, Roosevelt, and Lincoln as their parties' nominees. It was supposedly less democratic than the contraption that replaced it. Assume it is; is that necessarily a bad thing? The problem with the modern age is that representative democracy has been replaced by direct meddling by the public in the doings of its representatives. We can see what's happening on the House and Senate floor in real time, and we can mobilize our lobbyists electronically to coerce our elected officials to block whatever initiatives our group abhors.</p> <p>The presidential-election calendar got off to its "official" start yesterday, with the Iowa Caucuses, some silly process that, because it isn't a primary, is permitted by New Hampshire to occur a few days earlier than the majestic New Hampshire election. No doubt in 2012 some candidate will find an even sillier non-primary in an earlier state, and, by making a stand there, cause it to become the new "official" start of the Presidential-election calendar.</p> <p>Well, I am boycotting. I refuse to listen to the results of the Iowa Caucuses, and to the analysis by commentators about what the results mean for the presidential race, as if they themselves ere not the ones who <span style="font-style: italic;">determine</span> what they mean. (Never is the passive voice more dishonestly used than when it is used by the media.) Perhaps if we all shut our eyes and ears for a few days every four years, the Iowa Caucuses will just go away, and some earlier event, <span style="font-style: italic;">occurring in the year before the election, </span>will not raise its ugly head.</p> <p>After that, we can set our sights on New Hampshire.</p>airfoylehttp://www.blogger.com/profile/09522942023186875478noreply@blogger.comtag:blogger.com,1999:blog-26357051.post-2879237494411422492007-09-13T12:10:00.002-04:002008-03-08T22:26:44.702-05:00McDermott on Passing the Turing TestI often find the writings of Drew McDermott to be amusing and occasionally insightful. One example is provided by the little blurb you get to by following the link above. The topic is the Turing Test, which you might think had been sucked dry, but he manages to wring out a few novel thoughts (or perhaps just thoughts I haven't seen before). In passing he mentions Hawkins and Blakeslee's much ballyhooed <span style="font-style: italic;">On Intelligence</span>, which it would be nice to see thoroughly trashed, but he manages only to toss in an insulting adjective in his allusion to it. Perhaps someday I'll pick up where he left off.airfoylehttp://www.blogger.com/profile/09522942023186875478noreply@blogger.comtag:blogger.com,1999:blog-26357051.post-53276338659702846872007-07-19T13:40:00.000-04:002007-07-27T19:37:31.878-04:00Tips for Graduate Students Negotiating with Faculty Members<p>I have noticed that when a group of graduate students is meeting with a group of faculty members, the students tend to recede into the background, and become an unheard audience at an impromptu faculty meeting. The effect can be avoided only by making sure only one professor is present, who then cannot help but talk to the students. <!-- It can be disguised if the students include one or two strong personalities who succeed in being heard; the others still sit quietly. --> </p><p>The phenomenon is reminiscent of the way men often (less often than formerly) ignore women, but it stems from somewhat different sources. Faculty are usually rather older than students; they know each other better than they know the students (who are, on their time scale, "just passing through" the college); they share esoteric information that the students would need, in some conversations, to fully grasp the issues under discussion. And, yes, they may look down on students, although just as often they fear that these young, vigorous people, better informed about recent developments in the field, are about to eat their lunch. </p>Of course, the main reason students may feel cowed, especially when a possibly life-changing issue is on the table, is the difference in power between the faculty and the students. The student can't help feeling that if the people on the other side of the table wanted to, they could kick them out on the street and make them work for a living. And, under some circumstances, they could and they have. The power difference is not illusory.</p><p>However, the students must take some of the responsibility for their reticence. Most graduate students have voluntarily postponed their adulthood by staying in school. There is a striking difference in behavior between the typical grad student and one who has returned to school after years in the real world. The latter type seems more <em>grown up</em>; they know better what they want and how to get it. Whereas those who have spent every year since age 18 in the university have gotten into the habit of deferring to faculty members in all things academic. Foreign students (who for some reason it is now politically correct to call "international") are often at a disadvantage because they don't speak the language used in the college as well as the faculty do. And, although I hate to say it, this is usually their fault. Students who invest little effort in learning the local language because they have so many other pressing demands on their time will end up paying for it with a lot more effort and time <a name="lang-BACK"></a>later.<sup><a href="http://airfoyle.blogspot.com/2007/07/tips-for-graduate-students-negotiating.html#lang">lang</a></sup> Some of this effort will be spent in negotiating with the professoriate without being able to communicate clearly. </p><p>Is it important to be able to negotiate? After all, as an undergraduate you didn't have much to do but get high marks, and you must have gotten pretty good at it. But in graduate school things get more complex, more like real life. There is a smaller group of relevant fellow students, who form coalitions that start to want things from the university. But even laying that aside, finding an advisor is a series of negotiations, and so is working with the person you get stuck with. Picking a dissertation topic is perhaps the most important negotiation; if you blow that one, you may pass many sad years. </p>There are two key things to keep in mind: <ol> <li> You are an adult. You have the same right as any other fool to be heard in any discussion you take part in. </li> <li> In almost all cases, students have more power than they think and the faculty less. </li> </ol> </p><p>Point one I've already alluded to. If you act and talk like a grown-up, people will eventually treat you like one. This may take some patience, and the ability to control your temper. If you make a remark, and it is ignored, you may have to make it again, even interrupt the person who began speaking on some random topic after your last deeply insightful remark. Without being a jerk, go ahead and interrupt. Just copy the way they're treating <em>you</em>. I know this may sound scary, but if you're lucky you'll have at least one other grad student, postdoc, or even visiting scholar as a model. Observe what they do.</p><p>The task is made slightly more difficult by the desire of some academics always to be the most flamboyant and outrageous character in the room. Actually, such a person can be found in many human groups, which is okay, in moderation, because they can be entertaining. But they are tiresome to negotiate with. For one thing, they are perfectly willing to stray off the topic at hand in order to make a brilliant observation. When someone does this (for effect, or perhaps because they haven't quite <em>grasped</em> the topic at hand), point out the navigational error and guide them back. </p><p>The flamboyant types can also be tricky because they sometimes get belligerent, or pretend to, just for the hell of it. I don't know how to deal with people like that in a dark alley, but in polite society the best way is to become more polite. The thing about academics is, if you back up your position with an argument, they have to take it seriously. The guy in the dark alley might pull a gun on you, but in academia the argument <em>is</em> the <a name="machismo-BACK"></a>gun.<sup><a href="http://airfoyle.blogspot.com/2007/07/tips-for-graduate-students-negotiating.html#machismo">machismo</a></sup> </p>Point two: Students have more power than they realize. For one thing, they will usually have allies among the faculty. If the person or group you are dealing with is being unreasonable, there are usually other faculty nearby who will appreciate your position, or at least be willing to talk you out of it without foaming at the mouth. But if there aren't, then there are people outside your immediate vicinity. There are deans and provosts and associate and assistant deans and provosts, people whose job is to question every decision the faculty make. There are even shadowy figures beyond that circle, including the dreaded Press. The deans and provosts definitely don't want anything ever ever appearing in the Press, and so they will hasten over to the department in a trice if something suspicious seems to be happening. The faculty are perfectly aware of this, and they want the deans and provosts to hear of some complaint as little as the deans and provosts want the press to hear of <a name="blog-BACK"></a>it.<sup><a href="http://airfoyle.blogspot.com/2007/07/tips-for-graduate-students-negotiating.html#blog">blog</a></sup> And that means that whatever subgroup you are negotiating with, even if it's just one person and that person is your advisor, is vividly aware that they can't just decide to screw you. If someone forgets this in a moment of rashness, they end up causing problems for other members of the department, and losing credibility.</p><p>On the other hand. You <em>can</em> get screwed, although you have to contribute to your own demise. If you contact the press at the first sign of trouble, or air a blogful of complaints on the first day you arrive at school, you are asking for trouble. The problem is that you are kissing your allies goodbye. Even the Administration people who would usually rush over to help would be glad to see you go, because you have already fired your big guns; they have nothing more to fear from you. (Well, you could sue them, but don't count on getting anything for the vast sum you will spend.) </p><p> The surest way to get screwed is to write a bad dissertation for a professor who has left your department. If the advisor were still around, you might have a champion, and might get through. Once he or she is gone, if the faculty decide your work is just too awful, you won't be able to negotiate your way out of it. The moral of that story is to write a good dissertation, or be sure your advisor has tenure and a solid marriage or civil union. </p><p>But I digress. One final observation that may be more on point. Among <i>n</i> faculty members there are famously at least <i>n</i>+1 opinions. This works in your favor if you get a bad deal from a subgroup and want to appeal to the entire faculty. Correspondingly, it works against you if you get a <em>good</em> deal from a subgroup. Anyone who has sat on a committee knows that no matter how carefully it crafts an agreement, no matter how many objections are anticipated, it will be rejected or rewritten when brought to the entire faculty. So don't get too excited after your get two friends together and convince some subcommittee that allowing the graduate students to sell coffee and doughnuts in the front lobby would be a great idea. Your work has just begun. </p> <div name="endnotes"> <p>Note <a name="lang"><strong>lang</strong> </a> Some people learn languages better than others, of course. But usually the younger you are the easier new languages come, another ability the faculty may envy in the students. [<a href="http://airfoyle.blogspot.com/2007/07/tips-for-graduate-students-negotiating.html#lang-BACK">Back</a>] </p> <p>Note <a name="machismo"><strong>machismo</strong> </a> Male faculty may find this a sad commentary on their masculinity; women are fortunately not playing this game. [<a href="http://airfoyle.blogspot.com/2007/07/tips-for-graduate-students-negotiating.html#machismo-BACK">Back</a>] </p> <p>Note <a name="blog"><strong>blog</strong> </a> And now blogs are adding a whole new dimension. What department wants its name to be part of a URL that also includes "<tt>ihate</tt>" before the <tt>ac</tt> or <tt>edu</tt> bit? [<a href="http://airfoyle.blogspot.com/2007/07/tips-for-graduate-students-negotiating.html#blog-BACK">Back</a>] </p> </div>airfoylehttp://www.blogger.com/profile/09522942023186875478noreply@blogger.comtag:blogger.com,1999:blog-26357051.post-1509363200381582612007-07-05T19:31:00.001-04:002008-03-08T22:20:06.154-05:00Unusual Lisp application<span style="font-family:georgia;">Here in New Haven, Connecticut, a single company seems to have a monopoly on parking. What's remarkable are their signs, which point to a clear influence of Lisp technology on operations. Here is a particularly fine example:</span> <a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_DDLwHDNpRtc/Ro2APLAUSGI/AAAAAAAAAAM/DqTcedVx744/s1600-h/parking-prompt.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp3.blogger.com/_DDLwHDNpRtc/Ro2APLAUSGI/AAAAAAAAAAM/DqTcedVx744/s320/parking-prompt.png" alt="" id="BLOGGER_PHOTO_ID_5083860552511670370" border="0" /></a> <span style=";font-family:georgia;font-size:100%;" >Granted, the angle-bracket prompt is out of place, and it is perhaps poor practice to give a name like </span><span style="font-family:courier new;">(p)</span> to such a crucial function, but in all likelihood these are mere tactics to avoid revealing trade secrets to competitors.airfoylehttp://www.blogger.com/profile/09522942023186875478noreply@blogger.comtag:blogger.com,1999:blog-26357051.post-72146383206131928852007-04-28T14:56:00.000-04:002007-04-28T15:16:59.148-04:00tempProgramming peeve of the day: No one should ever use a variable named <tt>temp</tt>. The standard (but by no means only) context for this practice is the idiom for swapping the contents of two settable locations (variables, for instance): <pre> let temp = <span style="font-style: italic;">loc1</span> in (<span style="font-style: italic;">loc1</span> := <i>loc2</i>; <i>loc2</i> := temp) </pre> in some hypothetical imperative language. Why <tt>temp</tt>? Why not <tt>prev_ptr_value</tt>? or <tt>pre_tax_profits</tt>? The usual rationale is that the variable has a short lifespan, so it's "temporary." Or perhaps that its value will be moving on shortly. If that makes any sense, we should adopt the same policy for all variables. We can give them names such as <tt>perm</tt> or <tt>likely_to_last</tt>, or perhaps <tt>valid_for_several_million_clock_cycles</tt>. If you think this is a step in the wrong direction, then the next time <tt>temp</tt> occurs to you as a fine name for a variable, spend a few extra seconds to find one that reminds the reader of your code <em>what information</em> is whizzing through your variable, not its expected flight time.airfoylehttp://www.blogger.com/profile/09522942023186875478noreply@blogger.comtag:blogger.com,1999:blog-26357051.post-41722690652078614162007-03-05T22:29:00.000-05:002007-03-05T22:40:25.757-05:00Adoption vs. abortionA pregnant teenager is confronted with three choices: <ul><li> A Allow the embryo to become human and give it up for adoption.</li><li> B Allow the embryo to become human and keep it.</li><li> C Prevent it from becoming human (i.e., have an abortion).</li></ul>Note that I've avoided any presupposition that a new embryo is human, or that it is separate from the mother in some way, or that destroying it is killing anything. From an ethical standpoint, it is certainly not obvious that C is better than A, or even permissible given the possibility of A. What's odd is that many episodes of popular TV shows hinge on the theme that A is much worse than B. Young mothers who can't separate from their newborn babies are presented as heroic, and those who can are portrayed as monsters. If I were an intellectual, I might speculate that this is an expression of our national guilt over abortion. It's only by making A look really, really evil that those who have chosen C can feel some relief at the choice they made. It's taken for granted that B, while noble, is foolish; rather than get oneself into having to choose between the morally terrible A and the practically terrible B, it's far better to take path C. (By the way --- advice to those who chose A: don't watch any TV show involving a pregnant teenager.)airfoylehttp://www.blogger.com/profile/09522942023186875478noreply@blogger.comtag:blogger.com,1999:blog-26357051.post-1158431679806630982006-09-16T14:08:00.000-04:002006-09-16T14:34:39.896-04:00Yet another annoying thing about telemarketers<p>Ever wonder why, when you pick up the phone, there is sometimes a pause for a second or two before someone comes on, and that someone is always a telemarketer? It's because the marketing companies have automatic dialing machines. These dial numbers at random until they someone picks up, then connect that person to one of their operators. The purpose is to save money. The wages they pay the operators, low as they are, are still their major cost. If they can have a machine do the dialing, instead of a person &mdash; and more important the waiting while the phone rings &mdash; they can save pennies that add up to lots of dollars.</p> <p>Well, that's nice, but it means that <em>you</em> have to wait two seconds for an operator to be found. Sometimes one of them doesn't show up, because the autodialer happens to get too many hits at once. When that happens you wait longer, possibly until the machine hangs up on you. Worse, you start to worry that someone is stalking you. Then there are the times when your voicemail answers the phone. Either the autodialers can detect that or the telemarketer operators are trained not to leave an apologetic message, because the most that happens is a blank message on your voicemail. Which you have to listen to and erase, while thoughts of stalkers flit through your brain. </p> <p>Isn't it nice to know that your angst and wasted time are helping telemarketers save a lot of money? Maybe, if you meditate on the number of them working for charities since the federal "no call" list was created. Then again, those organizations supposedly representing the police, whose administrative costs are 85% of their revenu, are classed as charities. In any case, I feel the need to strike back. And there's a simple way to do this: When the telemarketer calls and asks for you (usually mutilating your name), say "Just a minute," and set the phone down as if you're going to get the person they asked for. Hey, perhaps if they think "Foyle" is pronounced to rhyme with "school," then I really am going off to look for "Mr. Fool." In any case, I don't find him until the phone starts beeping, demanding to be hung up. </p> <p>The beauty of this approach is that it strikes right at the root of the problem: If we can find a way to waste the operators' time, then the goal of saving labor costs will be foiled. The telemarketers will give up on autodialers, and we can all live happily ever after.</p> <p>My wife thinks this is mean to the operators, who are innocent Bengali women just trying to make a decent living. I figure you probably develop a thick skin pretty quick in the telemarketing game, and having to listen to the background noise in my house for 30 seconds is probably one of the more restful ways they get hassled. So, until someone thinks of a better way to retaliate, I'll be asking telemarketers to "Wait just a sec, while I go find him," as often as I hear that little pause. </p>airfoylehttp://www.blogger.com/profile/09522942023186875478noreply@blogger.comtag:blogger.com,1999:blog-26357051.post-1156908726208879122006-08-29T23:28:00.000-04:002006-08-31T20:05:33.386-04:00Europe's True Colors in LebanonIt is, alas, not surprising, but it is sobering, to realize that Europe (and, of course, most of the United Nations) are not that upset at the prospect of Israel's destruction as part of the final solution of the Middle East problem. I don't see how else to interpret the way the Security Council's resolution ending the recent Lebanese war has played out. The <a href="http://www.un.org/News/Press/docs/2006/sc8808.doc.htm">resolution</a> calls for Israel, Hizbollah, the government of Lebanon, and various UN members to do various things. No one is following through. Why? Because everyone responsible for making Hizbollah live up to its promises (including Hizbollah itself) have cheerfully decided to <ul> <li> Not insist on the release of the two Israeli soldiers whose capture ignited the conflict</li> <li> Not disarm Hizbollah </li> <li> Not end Hizbollah's occupation of southern Lebanon</li> </ul> <p>One might say, Oh well, the worst that can happen is that Israel will eventually realize that everyone was kidding about enforcing the UN resolution, and be forced to accept the status quo ante, no worse off than before. The problem is what this suggests about the eventual situation in Israel's neighborhood. A precedent will have been set that when Israel withdraws from an area, it becomes a permanent base for staging attacks on her. The same is true for Gaza. I suppose someone opposed to Israel's policies might argue that when Israel withdraws from the West Bank, then all of this hostile activity will cease. Hizbollah and Hamas will become peace-loving political organizations, and stop shooting rockets into Israel, and launching other offensive operations. But can anyone seriously believe that?</p> <p>The truth is that Europe and much of the rest of the world can easily foresee that eventually Israel will be surrounded by dedicated, well-armed enemies. They can foresee that these enemies will be satisfied only when they have pushed the Israelis into the Mediterranean (the survivors, I mean). They can foresee that, and it doesn't bother them very much. It makes the blood of the average American run cold. The reasons for this difference one can only guess at, but it's hard not to conclude that the history of the Europeans' oppression and genocide against the Jews is relevant.</p> <p>I'm not saying that Americans are saints compared to the Europeans. When it comes to discounting the lives of innocent bystanders, we are champs. Every night the news carries the number of Iraqi civilians killed that day by sectarian conflicts and the number of American soldiers killed. Where is the statistic on the number of Iraqi civilians killed by American soldiers? Apparently these deaths are irrelevant. Even the deaths of innocent civilians killed by Israel in Lebanon get more attention. (Although it is rarely mentioned that many of them were cut to pieces by cluster bombs supplied by us &mdash; and possibly used by the Israelis in violation of rules we imposed when we sold them the weapons.)</p> <p>The Europeans are quite upset about all these civilian casualties among the Arabs, as they should be, but my point is that nobody but us cares much about the Jews. "Big news!" my Jewish friends would say (including my Jewish wife). When in history have the Jews had any friends? Well, they have the U.S. now, and they need to have <em> somebody</em>. It's true that the Israelis have killed too many civilians in Palestine, and mistreated even more. But there's an ultiimate difference between the goals of the Israelis and the goals of the Arabs in Palestine. The Jews don't want to annihilate the Arabs. If the Arabs were to scale down their violence as the Israelis scaled down their occupation, isn't it obvious that peace would eventually come about? If you're skeptical, then isn't it obvious that the Arabs should give it a shot? It's within Hizbollah's power (or Iran's power, if they control Hizbollah) to impose a moratorium on rocket attacks on Israel while the Israelis withdraw from the West Bank. Until the recent war, the idea of trying this hadn't crossed their minds, and it seems clear why: their goal is, and has always been, to destroy Israel. The slightest sign of weakness by the Israelis is taken as encouragement to step up their attacks.</p> <p>The <i>Nation</i> a few days ago carried an interview with a Lebanese who said something like, Of course Hizbollah isn't going to honor its promise to disarm. We can't trust the Lebanese army to defend us against Israel; their units collapsed when the Israelis attacked, while the Hizbollah units fought well. The <i>Nation</i> correspondent saw nothing odd about this statement. But it's absurd. Israel has never had any reason to attack <em>Lebanon</em>; if Hizbollah were disarmed then the border would be peaceful. Their target in the recent conflict was Hizbollah itself. The argument that Hizbollah is good at defending things is circular when the only thing they are defending is themselves. Whoever the <i>Nation</i> talked to was obviously a disingenuous apologist for the militant Shiites. The only argument for not disarming Hizbollah is that annihilating Israel and killing Jews is too important a goal for any commitment to honesty to stand in the way.</p> <p>The Europeans know that the Islamist militants holding the reins in the Middle East feel this way. They just don't particularly care.</p>airfoylehttp://www.blogger.com/profile/09522942023186875478noreply@blogger.comtag:blogger.com,1999:blog-26357051.post-1146936397366321042006-05-06T13:23:00.000-04:002007-08-14T12:13:19.182-04:00Anti-Literacy Program<p><em>Literate programming</em> is a paradigm for writing and documenting programs in which the documentation is primary. The "source" for the program is an essay about how it works, in which all the code is embedded. The code segments are placed in whatever order makes sense for the exposition. A program called the <em>tangler</em> then extracts those segments and puts them in the proper order; you can think of this as the first pass of the compiler. (Why Donald Knuth, the inventor of literate programming, did not choose the term "<em>un</em>tangler" has always been a mystery to me, but perhaps he was deliberately trying to point out that the order compilers want is not necessarily the best. As a Lisp programmer, I've never felt that constrained by the compiler, so the point is lost on me.) </p> <p>Meanwhile, the essay can be written as ordinary text, HTML, or LaTeX. Writing it in a WYSIWYG system such as Word would be more of a challenge for the tangler, but that's not what I want to talk about here. </p> <p>I have flirted with literate programming for the last couple of years, and wrote a Lisp-based system ("LitLisp") to support it. I don't recommend my system, really, but the manual is available in case anyone is interested in looking at it. </p> <p>My conclusion after writing (or at least documenting) several programs using literate programming is that it just doesn't work. Here are my reasons: <ol><li> During program development, I tend to build a partial solution to a problem, then realize it's wrong and discard it or turn it inside out. It's very hard to force yourself to write a bunch of prose during this process; not only is the writing mostly wasted, it slows down your thought processes. </li> <li> It may or may or may not be unnatural for the only copy of a program to be a paper about that program. It is certainly impossible for it to be the only <em>paper</em> about it. For this reason, LitLisp allows two paradigms: the main representation is the essay, from which the program is extracted; or the main representation is the program, from which the essay may quote. If done right, the reader can't tell which paradigm was used. But this seemingly attractive idea requires the code in the paper to be marked up with all possible fragments one later quotes in some paper or other. (Remember, paper #1 is the <em>only</em> stable representation of the code to be quoted in paper #2 or #14.) </li> <li> A paper about a complex algorithm often presents several versions of the algorithm, starting with a sketch, and gradually adding complexity, until something like the final version is reached. How do we express the actual algorithm this way? In some cases the preliminary version of a program can be presented as the final version with some segments postponed to a later section. But there are many cases where some of the program fragments are "fake," in the sense that they appear in the paper as if they were part of the final program, but in fact they aren't. The literate-programming system must incorporate devices for indicating "versioning" information (e.g., that this segment is version 3 of a function, with pointers to versions 2 and 4). I gave up on LitLisp before trying to implement this.</li> <li>Perhaps this objection is due to my being mired in obsolete habits, but here it is anyway: I find it hard to think of the original essay as the "real" program. It's easier to look at the unscrambled version, which appears in the order God meant programs to appear in. Making a change to the program then requires going back to the essay and finding the place in the essay where (e.g.) you put the damned special-variable declarations. If one yields to the temptation to make a little change in the program and fix it in the essay later, one is on the road to perdition. I once forgot for several weeks that I was committing this sin, and had to painstakingly merge lots of little program changes back into my essay. </li> <li>There is a tension between two purposes of one's essay: to enlighten humans or to document the program. If you try for both, then you run into the temptation to hide big boring chunks of the code. LitLisp provides facilities to do that, but using them means departing from the basic literate-programming idea. The hidden parts of the program can be seen in the source for the essay, but not the essay itself. That means you have to work with two documents, one of which (the source) looks suspiciously like the unadorned code one was trying to avoid. </li> <li>One word: CVS! Has anyone ever even attempted to use literate programming in concert with a group of collaborators? I have trouble imagining this scenario, but I would like to hear from anyone who tried it or actually made it work. </li> </ol></p>airfoylehttp://www.blogger.com/profile/09522942023186875478noreply@blogger.comtag:blogger.com,1999:blog-26357051.post-1145743768177521682006-04-22T18:06:00.000-04:002006-05-06T13:53:25.370-04:00Yegging Me OnI just can't stay away from Mr. Yegge's <a href="http://steve-yegge.blogspot.com/2006/04/lisp-is-not-acceptable-lisp.html"> critique of Lisp.</a> What is it about critiques of one's favorite language that makes one feel so righteously indignant? Perhaps it's some primordial fear that our favorite language will be taken away from us. Sort of like the basic fear by aged monolingual English speakers in Miami that as Spanish grows in visibility they will be unable to make themselves understood. As an aging almost-monolingual English speaker, I can easily imagine myself in their position and feel panic. The feeling that Lisp might vanish is very similar. <p> Anyway, putting these feelings aside, let me address one more little Yeggish point — </p> <blockquote> This is a problem. It's not a little teeny one, either. The Lisp communities (yeah, there are a bunch) are going to have to realize that if Lisp is ever going to be massively successful, it needs an overhaul. Or maybe a revolution. Contrary to what some might tell you, it doesn't need a committee, and it doesn't need a bunch of money. Linux proved exactly the opposite. Lisp needs a benevolent dictator. Lisp needs to ditch the name "Lisp", since it scares people. And Lisp needs to learn from the lessons of the 45 years of languages that have followed it. </blockquote> At this point I begin to scratch my head. The point he started to try to argue was that Lisp is not an acceptable Lisp. But an acceptable Lisp would be an "overhaul" of the current language. As the paragraphs before the one quoted show, the overhauled Lisp would not have the "worthless spec" the current one has, it would not have CLOS, it would not have macros, and it would have a different type system. It would have a dictator (its own Guido van Rossum? or Larry Wall?). It would reflect 45 years of history somehow. And it wouldn't be called "Lisp." <p> To which I respond: Would we really <em>want</em> a Lisp that was an acceptable Lisp in this sense?</p> <p>There is a lot I don't like about Common Lisp. None of it has much to do with Yegge's rather general observations. The only specific point he made that I agree with is that case-insensitivity is a big mistake. What were the Common Lisp people thinking? It might have been difficult to convert legacy code then, but it's not getting any easier, and sooner or later Lisp will change. Franz is already agitating for "modern" mode; I've adopted it, and I can't believe that it isn't spreading faster.</p> <p> There are plenty of other flaws in CL. Brooks and Gabriel wrote a <a href="http://www.dreamsongs.com/NewFiles/clcrit.pdf">critique</a> in 1984, when CL was proposed, that hit several nails on the head. I've posted a couple of essays (<a href="http://cs-www.cs.yale.edu/homes/dvm/nil.html">NIL Considered Harmful"</a> and <a href="http://cs-www.cs.yale.edu/homes/dvm/format-stinks.html">FORMAT Considered Ugly</a>) on my website about flaws in CL, and I wrote <a href="http://cs-www.cs.yale.edu/homes/dvm/#software">the Nisp package</a> because I think, contrary to the Lispish conventional wisdom, that static typing is a good idea. </p> <p>But in spite of all that, Lisp embodies several good features that (a) I like, nay, <em>passionately love</em>; and (b) are so essential to the language that removing them would make it not Lisp any more: <ol> <li>S-expressions </li> <li> Programs expressed as S-expressions </li> <li>Macros </li> <li>The read-eval-print loop </li> </ol>Let me elaborate.</p> <p> S-expressions are symbols, strings, and numbers, plus lists of S-expressions and (why not?) arrays of S-expressions. That's their abstract syntax. Their concrete syntax is: <ul> <li> Symbols, strings, and numbers What you would expect. </li> <li>Lists: <code>(<i>e1</i> ... <i>eK</i>)</code> </li> <li>Arrays: <code>#(<i>e1</i> ... <i>eK</i>)</code> (Actually, this is just the 1-dim case, but let's not worry about that.) </li> </ul> The thing to notice is that the abstract syntax and the concrete syntax are essentially the same, so that S-expressions provide the same thing XML that provides: A notion of hierarchy that is representable and parseable before the hierarchy is classified as being an instance of this or that particular syntactic category, data structure, or whatever. (But S-expressions are more concise than XML, at the expense of being less general in some ways.)</p> <p>It's important that programs are S-expressions, but not just <em>Lisp</em> programs. The <a href="http://jscheme.sourceforge.net/jscheme/mainwebpage.html">JScheme system</a>, by Ken Anderson, Tim Hickey, and Peter Norvig, is an implementation of Scheme in Java that allows java to be called from Scheme, using what it inventors call <em>Javadot notation</em>. The expression <i>object.field</i> becomes <code>(.<i>field</i>$ <i>class</i>)</code>. The expression "<code>new <i>class</i>(<i>a</i> <i>b</i>)</code>" becomes <code>(<i>class</i>. <i>a</i> <i>b</i>)</code>. This notation was developed prior to the addition of generic classes and methods to Java (version 1.5). It is now possible in Java to write, for instance, "<code>(new List&lt;String&gt;())</code>" to make an empty list of strings. But it's clear that augmenting the notation in an elegant way is not going to be difficult, because the S-expression notation allows us to capture the hierarchical structure of the Java expression without constraining how we do it. We might write <code>(List&lt; String))</code>, or <code>((&lt;&gt; List. String))</code>. I leave it to the JScheme people to arrive at an extended notation that actually fits their original conception.</p> <p>Another example is the <a href="http://www.ravenbrook.com/doc/2002/09/13/common-sql/">Common SQL</a> notation developed by Lispworks. When sending an expression to the database, the expression might look like <code>(select [Researcher] :from [SampleAreas])</code>. (This notation depends on hacking the syntax of the character <code>'['</code> as well as using S-expression notation.) In other languages you have to send SQL expressions as (brace yourself) <em>strings</em>. To construct what is obviously a hierarchical expression involving data objects, one must discard the hierarchy <em>and</em> the objects, convert both to strings, and send the result to the database, which will then invert the process, recovering the hierarchical structure. S-expressions are an obviously better idea.</p> <p>Now for macros. Let me first observe that macros are not the only useful consequence of the fact that Lisp programs are S-expressions. Another is <code>quote</code>. It's easy to write Lisp as a package or class in Java, until you come to a point when you need to translate, say, <code>(setq x 'foo)</code>. You suddenly have to allocate a new static variable <code>Q_foo</code> somewhere and bind it at static-variable initialization time to the symbol <code>foo</code>. This is a real buzz-kill.</p> <p>But the existence of macros is the really good reason why programs should be S-expressions. The debate about whether this power is a good thing is not important. We are not debating here. We are explaining what Lisp <em>is</em>. Macros are a non-negotiable item. For one thing, if they were repealed, anyone could reintroduce them. (All you need to do is introduce a preprocessor before the compiler; introduce your own version of '<code>defun</code>' that runs the preprocessor.)</p> <p>Even Scheme has macros, although they are of the "hygienic" variety. I don't think I've ever written a hygienic macro; by chance, all the interesting ones seem to be un-hygienic. Nonetheless, I still have all my fingers and toes. The desire to restrict the syntactic transformations a macro can perform is in keeping with the general atmosphere around Scheme, that there is one right way to do any given thing, and until the Central Committee announces what it is, we should avoid doing that thing. Yegge recommends that the Lisp community elect (or suffer the ascension of?) a dictator, but anyone can decide to live under the benevolent rule of the Revised<sup>n</sup> Report on Scheme. I gather this particular dictator is not appealing to him, and I wonder what the odds are that the next one will be either.</p> <p>Finally, the read-eval-print loop. Some languages besides Lisp, or their IDEs, approximate it, but for various reasons they can't quite get to the right idea: a playground where lots of pieces of code are lying around, and you can work on whichever one catches your fancy next. It's like the shell in Unix, except the shell is more of an oil refinery than a playground. But once you're in Lisp, there's no reason to go back to the shell. It's like Emacs; correction: Emacs is like <em>it</em>; correction: Emacs <em>is</em> it, because Emacs is basically a special-purpose Lisp. </p> <p>Obviously, the Lisp idea is not for everyone. But one must acknowledge that there is such a thing as the Lisp idea. John McCarthy once said that Lisp seemed to be a local maximum in the space of programming languages. Most successful languages are. It's a characteristic of local maxima in high-dimensional spaces that small steps in any direction can plunge you into the depths. Mr. Yegge's casual suggestions about Lisp reforms are actually more likely to be high dives into the lower rings of hell.</p>airfoylehttp://www.blogger.com/profile/09522942023186875478noreply@blogger.comtag:blogger.com,1999:blog-26357051.post-1145675389302904582006-04-21T23:07:00.001-04:002008-04-05T21:50:18.307-04:00<p>I just can't stay away from Mr. Yegge's <a href="http://steve-yegge.blogspot.com/2006/04/lisp-is-not-acceptable-lisp.html"> critique of Lisp.</a> What is it about critiques of one's favorite language that makes one feel so righteously indignant? Perhaps it's some primordial fear that our favorite language will be taken away from us. Sort of like the basic fear by aged monolingual English speakers in Miami that as Spanish grows in visibility they will be unable to make themselves understood. As an aging almost-monolingual English speaker, I can easily imagine myself in their position and feel panic. The feeling that Lisp might vanish is very similar. </p> <p>Anyway, putting these feelings aside, let me address one more little Yeggish point -- </p> <blockquote> This is a problem. It's not a little teeny one, either. The Lisp communities (yeah, there are a bunch) are going to have to realize that if Lisp is ever going to be massively successful, it needs an overhaul. Or maybe a revolution. Contrary to what some might tell you, it doesn't need a committee, and it doesn't need a bunch of money. Linux proved exactly the opposite. Lisp needs a benevolent dictator. Lisp needs to ditch the name "Lisp", since it scares people. And Lisp needs to learn from the lessons of the 45 years of languages that have followed it. </blockquote> <p>At this point I begin to scratch my head. The point he started to try to argue was that Lisp is not an acceptable Lisp. But an acceptable Lisp would be an "overhaul" of the current language. As the paragraphs before the one quoted show, the overhauled Lisp would not have the "worthless spec" the current one has, it would not have CLOS, it would not have macros, and it would have a different type system. It would have a dictactor (its own Guido van Rossum? or Larry Wall?). It would reflect 45 years of history somehow. And it wouldn't be called "Lisp." </p> <p>To which I respond: Would we really <em>want</em> a Lisp that was an acceptable Lisp in this sense? </p> <p>There is a lot I don't like about Common Lisp. None of it has much to do with Yegge's rather general observations. The only specific point he made that I agree with is Lisp's case-insensitivity. What were the Common Lisp people thinking? It might have been difficult to convert legacy code then, but it's not getting any easier, and sooner or later Lisp will change. Franz is already agitating for "modern" mode; I've adopted it, and I can't believe that it isn't spreading faster. </p> <p>There are plenty of other flaws in CL. Brooks and Gabriel wrote a <a href="http://www.dreamsongs.com/NewFiles/clcrit.pdf">critique</a> in 1984, when CL was proposed, that hit several nails on the head. I've posted couple of essays( a <a href="http://cs-www.cs.yale.edu/homes/dvm/nil.html">NIL Considered Harmful"</a> and <a href="http://cs-www.cs.yale.edu/homes/dvm/format-stinks.html">FORMAT Considered Ugly</a>) on my website about flaws in CL, and I wrote <a href="http://cs-www.cs.yale.edu/homes/dvm/#software">Nisp</a> because I think, contrary to the Lispish conventional wisdom, that static typing is a good idea. </p> <p>But in spite of all that, Lisp embodies several good features that (a) I like, nay, <em>passionately love</em>; and (b) are so essential to the language that removing them would make it not Lisp any more: </p><ol> <li>S-expressions </li> <li> Programs expressed as S-expressions </li> <li>Macros </li> <li>Read-eval-print loop </li> </ol> Let me elaborate. <p></p> <p>S-expressions are symbols, strings, and numbers, plus lists of S-expressions and (why not?) arrays of S-expressions. That's their abstract syntax. Their concrete syntax is: </p><ul> <li> Symbols, strings, and numbers What you would expect. </li> <li>Lists: <code>(<i>e1</i> ... <i>eK</i>)</code> </li> <li>Arrays: <code>#(<i>e1</i> ... <i>eK</i>)</code> (Actually, this is just the 1-dim case, but let's not worry about that.) </li> </ul> The thing to notice is that the abstract syntax and the concrete syntax are essentially the same, so that S-expressions provide the same thing XML that provides: A notion of hierarchy that is representable and parseable before the hierarchy is classified as being an instance of this or that particular syntactic category, data structure, or whatever. (But S-expressions are more concise than XML, at the expense of being less general in some ways.) <p></p> <p>It's important that programs are S-expressions, but not just <em>Lisp</em> programs. The <a href="http://jscheme.sourceforge.net/jscheme/mainwebpage.html">JScheme system</a>, by Ken Anderson, Tim Hickey, and Peter Norvig, is an implementation of Scheme in Java that allows java to be called from Scheme, using what it inventors call <em>Javadot notation</em>. The expression <i>object.field</i> becomes <code>(.<i>field</i>$ <i>class</i>)</code>. The expression "<code>new <i>class</i>(<i>a</i> <i>b</i>)</code>" becomes <code>(<i>class</i>. <i>a</i> <i>b</i>)</code>. This notation was developed prior to the addition of generic classes and methods to Java (version 1.5). It is now possible to write, for instance, "<code>(new List&lt;String&gt;())</code>" to make an empty list of strings. But it's clear that augmenting the notation in an elegant way is not going to be difficult, because the S-expression notation allows us to capture the hierarchical structure of the Java expression without constraining how we do it. We might write <code>(List. (&lt;&gt; String))</code>, or <code>((&lt;&gt; List String))</code>. I leave it to the JScheme people to arrive at an extended notation that actually fits their original conception. </p> <p>Another example is the <a href="http://www.ravenbrook.com/doc/2002/09/13/common-sql/">Common SQL</a> notation developed by Lispworks. When sending an expression to the database, the expression might look like <code>(select [Researcher] :from [SampleAreas])</code>. (This notation depends on hacking the syntax of the character <code>'['</code> as well as using S-expression notation.) In other languages you have to send SQL expressions as (brace yourself) <em>strings</em>. To construct what is obviously a hierarchical expression involving data objects, one must discard the hierarchy <em>and</em> the objects, convert both to strings, and send the result to the database, which will then invert the process, recovering the hierarchical structure. This expensive and error-prone process is then compensated for by the practice of generating queries in advance and saving them on the server side. S-expressions are an obviously better idea. </p> <p>Now for macros. Let me first observe that macros are not the only useful consequence of the fact that Lisp programs are S-expressions. Another is <code>quote</code>. It's easy to write Lisp as a package or class in Java, until you come to a point when you need to translate, say, <code>(setq x 'foo)</code>. You suddenly have to allocate a new static variable <code>Q_foo</code> somewhere and bind it at static-variable initialization time to the symbol <code>foo</code>. This is a real buzz-kill. </p> <p>But the existence of macros is the really good reason why programs should be S-expressions. The debate about whether this power is a good thing is not important. We are not debating here. We are explaining what Lisp <em>is</em>. Macros are a non-negotiable item. For one thing, if they were repealed, anyone could reintroduce them. (All you need to do is introduce a preprocessor before the compiler; introduce your own version of '<code>defun</code>' that runs the preprocessor.) </p> <p> Even Scheme has macros, although they are of the "hygienic" variety. I don't think I've ever written a hygienic macro; by chance, all the interesting ones seem to be un-hygienic. Nonetheless, I still have all my fingers and toes. The desire to restrict the syntactic transformations a macro can perform is in keeping with the general atmosphere around Scheme, that there is one right way to do any given thing, and until the Central Committee announces what it is, we should avoid doing that thing. Yegge recommends that the Lisp community elect (or suffer the ascension of) a dictator, but anyone can decide to live under the benevolent rule of the Revised<sup>n</sup> Report on Scheme. If that would make Yegge happy, then happiness awaits him any time he wants to reach out and take it. </p> <p>Finally, the read-eval-print loop. Some languages besides Lisp, or their IDEs, approximate it, but for various reasons they can't quite get to the right idea: a playground where lots of pieces of code are lying around, and you can work on whichever one catches your fancy next. It's like the shell in Unix, except the shell is more of an oil refinery than a playground. But once you're in Lisp, there's no reason to go back to the shell. It's like Emacs; correction: Emacs is like <em>it</em>; correction: Emacs <em>is</em> it, because Emacs is basically a special-purpose Lisp. </p>airfoylehttp://www.blogger.com/profile/09522942023186875478noreply@blogger.comtag:blogger.com,1999:blog-26357051.post-1145507670624690152006-04-20T00:30:00.000-04:002006-05-06T13:55:57.206-04:00Good Help is Getting Hard To Find<p>Just so I can say I posted to my blog more than once .... </p> <p>Why is the help facility on Blogger so rudimentary? For instance, it doesn't tell you how to start posting. </p> <p>When you figure that out, you soon encounter a button called "Republish." Why would I want to do that? What does it mean? I haven't figured it out yet, but it may or may not be necessary in order for edits to show up on the actual blog. </p> <p>Maybe there's a book I'm supposed to order from Amazon before I actually get started in my new blogging lifestyle. Now that I'm on the way to becoming a famous blogger, I'm sure plenty of comments will come pouring in letting me know. </p>airfoylehttp://www.blogger.com/profile/09522942023186875478noreply@blogger.comtag:blogger.com,1999:blog-26357051.post-1145419861230521882006-04-18T22:44:00.000-04:002006-05-06T13:59:48.140-04:00Lisp: Paul Graham? Too many Lisps?<p>I didn't mean to create a blog. </p> <p>I read a <a href="http://steve-yegge.blogspot.com/2006/04/lisp-is-not-acceptable-lisp.html">critique of Lisp</a> in another blog, and felt moved to respond. But the space for the comments seemed so cramped. It seemed like a bright idea to create my own blog and defend my favorite programming language at length. (As if I don't have a million better things to do.) </p> <p>The critique was by Steve Yegge. He said several things, but let me mention two: that Lisp's recent increase in popularity is due to Paul Graham; and that there are too many Lisps to choose from. </p> <p>The first seems absurd to me, but I don't know how to evaluate it. I thought Lisp was making a modest (very modest) comeback because Java had made garbage collection respectable; or because of the not unrelated fact that computers have gotten so fast that some of Lisp's inefficiencies (and Java's, and Python's) can be overlooked. Enough intro-CS courses expose students to Scheme that the idea of Lisp keeps rippling through impressionable young minds. John McCarthy once said that Lisp seems to be a lucky discovery of a local maximum in the space of programming languages. Plenty of people are happy finding the top of that particular hill. Others have slightly different objective functions. </p> <p>I've never met Paul Graham or heard him speak. I gather he's exciting to listen to. If he's helped keep fuel in Lisp's tank, that's great. But I think comp.lang.lisp has been a greater source of inspiration for people coming into the Lisp community, as have ALU, Cliki, and other such. </p> <p>Another point Mr. Yegge made was that there are too many Lisps to choose from, making life difficult for the beginner (as compared to the beginning Python programmer). I've noticed that there are too many GNU/Linux versions out there. Sometimes that's just the way it is. </p> <p>However, in the case of Lisp there's a deeper point to be made. It's in the nature of Lisp that it grows in many directions simultaneously outside of central control. I have myself posted a macro package called <a href="http://www.cs.yale.edu/homes/dvm/#software">YTools</a> that transforms Lisp into a streamlined power demon or into an unreadable mess. (People differ on this issue.) I have another called <a href="http://www.cs.yale.edu/homes/dvm/#software">Nisp</a> that adds strong static typing to Lisp. I find I can't get along without these tools. Other people have other tools that they make available, some of which have caught on with a wider community although most have not. </p> <p>The situation is not different with other programming languages, except that in the case of Lisp tool packages make syntactic extensions to the core language. If this whole idea gives you the willies, stay away from Lisp. If it sounds intriguing, you might still want to stay away, because Lisp can be addictive. I never program in any other language if I can help it. (My job involves teaching intro programming, which requires me to write simple Java programs, which I find fun. I've occasionally had to write some C or C++ code to run on a robot. I once had to hack Latex2HTML to fix some bugs, which convinced me that programming in Perl was something I should try to avoid if possible.) </p> <p>There is a portability problem with Lisp, although in my experience it's not quite what one might expect. 90% of the bugs I find when porting from one CL to another are cases where the original implementation was too forgiving of departures from the language standard. A program that's worked fine for years can be ported to a different implementation where you find out it's buggy. I don't know what to say about this except that (a) I've learned that keeping a suite of tests around for any piece of software is a good idea; and (b) YTools and Nisp at this point have been ported and tested on Allegro, CMU Lisp, CLISP, and Open Macintosh CL. Getting them cleaned up was an exercise in anality, but they certainly are superstable as a result of the exercise.</p>airfoylehttp://www.blogger.com/profile/09522942023186875478noreply@blogger.com