Roulette

Posted by Daniel Lyons Wed, 07 Nov 2007 07:03:00 GMT

About a week ago I volunteered for the synagogue at Casino Night. I was basically a gopher bringing people coffee, moving ice and plasticware from point A to point B. It felt good though, the antithesis of my work.

I did take two breaks, one to play roulette for a few minutes. I like roulette because it’s very raw. There aren’t a lot of arbitrary rules to remember while you’re trying to compute the probability. In my opinion, one of the best bets in the whole casino can be found there, the color bet: red or black. Of course you can see with your eyes that you’re still a sucker; there are two uncolored slots. You know the odds are close to 50% but just not quite. You’re still a fool if you bet on it, and over time you’re probably going to go broke.

While I was playing and thinking about this I was thinking about what the curriculum for being a casino worker is. They have schools for this stuff; surely they have curricula. I supposed it would include all the rules, plus a bunch of social things like how to suppress your “tells,” how to encourage someone to keep betting, how to be cute or handsome and perhaps even politeness. The dealer (name another industry with this profession, quick) was certainly cute and polite. I lost a couple chips and she said “better luck next time.” I was betting on red, like any wannabe mathematician.

I wonder if they teach any probability? I wonder if they talk about luck. It seems to me if I wanted to hire a bunch of casino workers, I’d like them to know as little about probability as possible. If they know probability, they might admit something they shouldn’t, like discourage a sucker bet. Or they might not be able to pretend to be “fun” if that’s something they’re supposed to do. Do they teach how to spot, say, card counting? If they do, how can they avoid probability? Or is the whole luck thing a charade, false affect to induce irrational behavior by luring customers into safe-feeling but false frames of mind? Or do they even think this far into the game?

My friends think my bets are weird. I like to arrange negative bets, bets against myself, so that if something bad happens, someone will pay me. I recently made a bet that someone on Craigslist wouldn’t write me back after seeing my picture. The wager was that, if she wrote me, I would pay these friends $20; if she did not, they would pay me $1. So I’ve got $2 coming in and the assurance that I’m really good at making predictions. If I had lost, then I would have paid $40 out but presumably had the pleasure of going on a date. I don’t see what’s so hard to understand about using small wagers like these to smooth over the bumps in life. (Normally it would have been a meal for a meal kind of bet, but this was the only way to get Jenny to make a bet with me since she’s broke. Sucker bet!)

I could have wagered $100 against $5 and that probably would have been just as safe. At any rate, I lack the devotion to gambling to learn the correct terminology for these kinds of bets.

Tags , ,  | 3 comments

MacPorts under Leopard

Posted by Daniel Lyons Mon, 05 Nov 2007 01:04:00 GMT

Because I’m an idiot, I uninstalled and reinstalled everything I had in MacPorts thinking for some reason it would be better.

The following ports didn’t reinstall:

  • PostgreSQL (Workaround described below)
  • SBCL (Operational as of Nov. 7th)
  • Bigloo
  • Io
  • teTeX (Build it with +nox11 and you’re golden)
  • ghc (I’ve switched to a 6.8 binary install available here)
  • SWI-Prolog (hangs during configure)
  • Guile

Just a note to anyone thinking about doing this, Leopard doesn’t seem to build everything seamlessly yet.

Update Nov. 7th: sbcl now builds. Awesome! I notice postgresql82-server is different but it still stalls out building postgresql82. None of the other ports get any further.

Update Nov. 10th: There is a nice hack for making PostgreSQL install on the error report page. Do this:


sudo port clean postgresql82
sudo port configure postgresql82
pushd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_databases_postgresql82/work/postgresql-8.2.5
sudo make
popd
sudo port install postgresql82

It seems to have worked for me and a few others.

Update Nov. 24th: Eli, type sudo port install teTeX +noX11 and read the manual or leave an email address next time if you want a faster answer. :P

Tags ,  | 5 comments

Leopard

Posted by Daniel Lyons Tue, 30 Oct 2007 06:14:00 GMT

The upgrade rocks, overall.

It took about an hour to install. My observations:

  • Wow, everything is so translucent and pretty it’s so hard to remember two years ago when we all kissed Steve-o’s feet for removing this feature in Panther.
  • Time Machine is really neat. But did we really need an absurd new button for it?

  • Tell me this is usable, with a straight face:

  • Help now comes with bonus shitlight:

Much has been made of the dock. It’s really ugly. I take that back. It’s really pretty. So pretty I keep on staring at it. Distractedly. Did you ever use a mirror for a desk? How about get a bunch of soft blue LED track lighting for it. I suppose I’ll get used to it eventually. It’s not like we get a choice. And the side dock is glitchy, if you can stand having it on the side in the first place.

I have been playing a lot with Emal. The todo function is nice enough I can probably give up on OmniOutliner with the horrendously ugly icon now (and I have been using org-mode with Emacs for everything more sophisticated anyway). The RSS functionality is nice but without folder hierarchies I may be stuck with NetNewsWire. I’m going to try and live without RSS for a few days and see how much I really care about it.

The new Safari is somewhat nicer. Nice enough for me to give it a shot, foregoing Firefox for a few days. The new iChat is a pleasant surprise. The new Terminal is slightly nicer.

Time Machine seems to be a bastion of weird UI considerations. I can’t take a screenshot within it. Clicking the close icon on the window you’re working with closes Time Machine but keeps the window around. Otherwise it seems to be pretty excellent; it has the kind of completely unobtrusive UI that would frighten and confuse developers of a certain obnoxious, intrusive and unreliable backup program. It looks like the best backup program ever.

You’re going to want a Firewire 2 drive. After a few hours of rearranging my files it’s re-backing up 4.6 GB of stuff, and it has to take a complete snapshot when you first get it running. Fortunately, it’s pretty smart about doing it in the background, but of course it slows things down a bit. Disconnected operation is going to be the key concept here, plugging in whenever you want a snapshot taken.

Apart from the usual BS about the usability and looks, it seems to be great. No troubles so far.

Tags , ,  | 2 comments

Programming: The Desperate Losing Battle

Posted by Daniel Lyons Sat, 27 Oct 2007 22:53:00 GMT

Jonathan Edwards refused to participate in the much-vaunted Beautiful Code essay collection, saying on his blog:

“Telling an inspiring story about a beautiful design feels disingenuous. Yes, we all strive for beautiful code. But that is not what a talented young programmer needs to hear. I wish someone had instead warned me that programming is a desperate losing battle against the unconquerable complexity of code, and the treachery of requirements.”

You’ve probably never heard of this guy, but he is responsible for the most interesting development in programming languages in the past thirty years, Subtext. Subtext seems destined to be whispered about for decades before emerging as a powerful yet obscure influence on some future technology.

All good programming languages are based on an interesting principle or theory of computation. The best are those that obliterate an unnecessary barrier, usually between the language and the compiler and the resulting code. In the middle of the second Subtext video, Edwards reveals that Subtext is actually about directly manipulating the run-time structure of the code.

This is quite a departure. In fact, isn’t this the problem most people have with recursion? Visualizing and understanding the run-time structure of the code, namely the call stack?

Of course there are a plethora of other interesting benefits to Subtext; editing a run-time graph enables a lot more code sharing and less duplication. In the second video, you can see incredible simplification of refactoring. I’m also surprised at the excellent details of the GUI and how it all hangs together so well. It has all the hallmarks of being created by a great programmer philosopher. An underground hit.

It will be interesting to see what comes of this in the coming years.

Tags ,  | 4 comments

Lighttpd

Posted by Daniel Lyons Thu, 11 Oct 2007 01:41:00 GMT

I’ve been playing around with lighttpd on another project. This server is seriously fast. With PHP through FastCGI, it’s really astonishingly quick even on a rather bland VPS server.

For more performance I am tinkering around with eAccelerator for PHP bytecode caching. That should eliminate most of the PHP parsing/interpreting cost. Not that I can even notice it now.

But you can go even further with mod_magnet. They don’t yet have a great introduction or explanation of what mod_magnet is, but it seems to be compiled, limited Lua scripting inside the request handling. This apparently beats the socks off talking to PHP, especially since it can reassemble output from its own file caches or memcached. On the wiki above they managed to get a script that was capable of a not-to-shabby 100 requests/second and make the server serve pages at 4200 requests/second. Another script is made to serve 10,000 requests/second.

I have to wonder whether or not this could be used with Voltaire. It would certainly be pretty fast…

Tags , ,  | 1 comment

Sometimes Them Bridges Just Have To Go

Posted by Daniel Lyons Tue, 09 Oct 2007 07:12:00 GMT

You know Cathy, I no longer delight in writing venomous personal diatribes like I used to but for you I’m just going to have to make an exception. I really am tired to death of your commentary on my blog; can you please knock it off? I know you have your own, and if you think carefully you’ll notice that it’s been years and years since I’ve read it or commented on it. I just don’t like talking to a brick wall that much. Imagine my discontent, for a minute, in having brick walls spontaneously appearing in front of me, trying to converse with me.

I know you think you’re doing the right thing, the helpful thing, trying to “reason” me back onto the right path of Marxism and pure materialism and whatnot, but let’s face it, I’m a goner. The sooner we both accept that, the happier we’ll be.

Consider your comment on my blithely indignant essay on the w4m craigslist postings. Without the meet-you-halfway mumbo jumbo it is totally transparent, I hope you realize:

If you’re looking for somebody who’d be OK dating a conservative religious guy, why are you looking through the personals on Craigslist? I don’t see how you can blame “the culture” when you’re the one looking in a place that emphatically does not have the kind of culture you’re looking for. Craigslist personals are not really for dating, they’re for hooking up! Conservative religious people tend to meet and marry through their house of worship, or through religious-appropriate events or dating services. Not through online personal ads.

It’s so charming getting a lecture from you about where religious people meet and marry. Can you say “Donny, you’re out of your element?” Let’s think for a minute about every Jew you’ve ever met. How many of them were religious? Oh yeah, just me. Have you been to a synagogue here? I love it, but it’s definitely a sausage fest. A really old, wrinkly sausage fest.

Just because I didn’t mention looking on JDate and the usual suspects doesn’t mean I don’t look there. I’ve been looking everywhere online. I was driven online by, shock and amazement, them religious folks at my synagogue! I have met and been set up on a total of two dates in the past 1.5 years through the synagogue. One of those was to a girl about as anti-semitic and as you and your Jewish boyfriend—and my friends met her online! The other one didn’t, as they say, work out. When you run out of food, sometimes you have to go to the grocery store, even if they do sell bacon alongside the pastrami.

I don’t know what you’re looking for on Craigslist when you go but there are, in fact, different sections. You’re right, there does seem to be a lot of confusion about the definition of highly contestable words and phrases like “misc romance” and “strictly platonic.” In a perfect world, the women posting hook-up advertisements wouldn’t do it in the w4m section when there is actually a hook-up advertisement section, but hey, I guess they’ve got more important things on their mind than reading (or spelling). But I also see plenty of women looking for Christian guys on there, so I think you’re more-or-less off-base.

Anyway, what you’re really getting at is that you’d like to have all religious people rounded up and thrown into cattle cars, but you’ll settle for merely rounding us all up and segregating us from the rest of society. Well, fuck you. I’m going to look for religious women under every rock I have to because, you know what, there aren’t any! Yay! What a proud day for Darwin’s military liberation front (I’m sure he’d be proud). Somehow, no woman my age wants a stable romantic relationship when she could just have a fuck buddy on the side while she furthers her career. Apparently it’s a documented phenomenon that guys like me are all going for 35 year old women who either missed the boat on this or have finally been burned by it enough to stop wanting it.

By the way, wanting a woman who is OK with a “conservative, religious” guy who isn’t precisely talking marriage yet, but is talking about how he won’t put up with abortion if “they” have sex without a condom (and by “they” you really mean “they and I”, since women do not impregnate themselves, yes?) It should be obvious that all of these things are, taken together, insane.

Oh, you’re so right! Or you would be, if I was looking for one of those hook-ups we were just talking about. Where did I say that, precisely? I think all I said was if I fucked up, I would own up to it. I didn’t, and I still don’t, understand how a woman could find that as bewildering as you do. It’s not like I have any power. Do you see me out there, campaigning against the supreme court? Are you picturing me chaining some woman up in a dungeon until she has my kid? All I have, and all I’m entitled to, is an opinion of zero value. And a whopping boatload of incredulity as to how women would prefer a guy whose first response to hearing “I’m pregnant!” is “Oh shit. I’m not having this! You have to get an abortion. We can go halfers.” That’s your idea of liberation? Doesn’t something seem to be missing from that equation? Like, I dunno, the sanctity of human life? Oh right, everything has a price tag and nothing has a soul in your philosophy. How very secularly humane.

Last time I checked, disapproval didn’t really accomplish much of anything in this country. Women have the right to murder their babies if they want to. I would even say there are a few extremely rare cases where it’s better to have an abortion, namely when the woman’s life is in danger. But Could I be merely suggesting that I think our disregard for responsibility and life is wrong, that this causes more pain for the woman in the long run, that perhaps people should, from time to time, act like the adults they pretend to be by fucking all the time?

Is it so much to ask that people not fuck people they dislike so intently? To suggest that, if you are going to be having sex with someone you at least like them enough to own up to your mistakes if you make them? To at least not have sex with someone you can’t imagine ever committing to? What a monstrous romantic I am! To suggest that human life might actually be an important enough principle to change the way I live! To suggest that love be a precondition to sex! How absurd!

Sorry, but speaking as a woman, I would require a guarantee of support (for example, marriage with a solid pre-nup agreement) before I touched a pro-life man with somebody else’s body, much less mine.

I think we all know that you find the concept of an emotional attachment to someone who is emotionally attached to the concept of life unthinkable. This kind of inhuman behavior is your hallmark. Have you ever loved anything, other than the concept of misanthropic hatred, or your own superiority? Do you ever think to yourself how absurd your life is, that all your beliefs and actions are directly contingent on something shitty that happened to you on a playground when you were a child? Do your pseudo-philosophical extrapolations really reassure you that you’ve made the right irrational decisions when you’re all alone with just your mind?

I suppose there should be nothing surprising about a self-avowed pure materialist bringing up money when everyone else was talking about life, love and sex. What’s Eric paying to be with you? Last time I checked he was somewhere between no tax bracket and the one where they acknowledge you exist but don’t make you send any in. Or are you retaining his services?

Condoms aren’t perfect, and if you’re not willing to commit ahead of time to 18 years of living with a kid, I don’t see why a woman should be expected to.

I think my whole point is that if I’m sleeping with a woman, I am willing to make that commitment. If I’m not, then I shouldn’t be sleeping with her. Is this reasoning so cloudy we should really go around murdering people rather than, I dunno, suggesting that people take responsibility for their own bodies? (I thought personal responsibility was one of those things you were really into.)

Valor is a two-way street, and the valorous way for a conservative, religious man in our culture does not include sex in “long-term relationships” that aren’t marriage, condom or no condom. It seems to me that your requirements are no less contradictory than those you’re complaining about… par for the course with personal ads, I suppose.

You know, you’d be so right, if only you weren’t so completely irrelevant. Do you read my posts before you reply? I thought maybe if I deleted the last one—your inexcusably lame non-contribution to my essay on G-d and reasoning, you would get the hint. I don’t know why you ceaselessly remind me of the useless dialog created by you and the other scumfucks who can’t seem to hit the link at the top of the RSS feed page on LiveJournal. There was a hint in that, but I guess maybe I should be more direct, more reasonable, more logical: I don’t care what you and your friends think about me, my blog, my beliefs, my actions, my words, or my life. I don’t care! I really don’t!

And this blog, believe it or not, isn’t a public forum for the discussion of my ideas, it’s my personal G-ddamn stomping grounds for ideas. I invite commentary pretty much for Justin, Michael, David, Bill and Pi. If they didn’t comment, I’d turn the fucking feature off because so many lice like you seem to take up residence in them. It looks like a big reasoned argument, but really it’s just filler leading up to that last snarky comment. I get it already! You’re an atheist! You like abortion! Well, fucking great! Can you fucking go home now?

Just for good measure, let’s throw in the rubbish you sent me before. The internet’s all about free speech you know.

The question of whether God is a logical being is close to the heart of my own atheism. To me, the Abrahamic view of an omnipotent, judgmental God leaves open two main options: either God is constrained by logic, in which case the literal and philosophical crimes outlined in the Bible and allowed to occur in God’s name in the Universe today suggest (to me) defiant non-compliance with God; or he is not constrained by logic, in which case there is nothing to suggest that compliance will generate a positive result. Taken together, these two scenarios partially explain why compliance with Judeo-Christianity is, for me, not an attractive option.

Blah blah blah… I get it! You’re an atheist! That’s great! You know, you’re in good company, with bright bulbs like Richard Dawkins. Will you leave me alone now? Seriously?

Here’s a bucket of possible explanations:

  1. Perhaps G-d voluntarily constrains himself to reason as part of his gift of reason to mankind, even though he doesn’t, strictly-speaking, have to? Maybe this evolved since the Biblical era?
  2. Maybe the atrocities documented in the Bible are actually part of a historical narrative rather than a how-to manual on things to do when you’re in power?
  3. Perhaps people were actually bad and G-d actually knew enough about them that when he ordered they be destroyed, it was for the best (Him being omniscient and all)?
  4. Perhaps there is a moral ulterior motive to the story, that, I dunno, atrocities are bad and this is what has been taught about the Biblical narrative for thousands of years by both Judaism and Christianity?
  5. Perhaps some cases of abject destruction are meant to illustrate that you shouldn’t profit from war?
  6. Perhaps in the Talmud there are a few thousand much better interpretations of the things that have turned all our stomachs for thousands of years?
  7. Maybe (your favorite possibility) there’s no scientific evidence that anything mentioned in the Tanach ever happened and it’s all a big metaphor?
  8. I’m sure with your startling command of the Bible you’ve noticed by now that G-d is angry a lot more often at the Jews in Tanach, not the Gentiles who are better at repenting (see Jonah, for example)? (Or, alternatively, is the Cliff’s Notes Exodus really the extent of your literacy?)

I could have responded so at the beginning, but I don’t like to get that worked up over marketing, so I just deleted your comment like the advertisement it is. Let me invite you to get worked up over that: no, wait, it’s my house, I can delete whatever I want. You have our own blog. Now go blog how small-minded and horrible I am. I’m sure all your rabid atheist friends and your hired boyfriend will all rush to burn me in effigy along with all other religious people. Have a real party! By the way, have you noticed I’m completely alone out here? You assholes have won! The religious right doesn’t exist, I’m the only religious Jew my age in the southwest. You’ve swallowed a bunch of propaganda engineered to keep the two-party machine going a little bit longer so your party and the party you hate can be just a bit more profitable, together!

Hope you’re all having a blast! Please never return! Thank you! Goodnight!

P.S.: Your taste in metal sucks.

P.P.S.: It sickens me that this is going to be the top thing on my blog for weeks, and it sickens me that this is undoubtedly the nail in the coffin of my friendship with Eric, which I really did treasure and whom I really do miss.

Tags , , ,

The Greatest Blog Entries Ever

Posted by Daniel Lyons Sun, 07 Oct 2007 23:42:00 GMT

There are several mediums of artistic expression which are sorely underdeveloped. Blogging may be ubiquitous but really artistic blog entries are extremely rare. These two I think deserve special attention as an artistic expression:

I read a lot of blog entries and somehow, these two had the right combination of news, humor, and good writing. We should all aspire to write like that.

Tags ,  | no comments

A Woman of Valor, Who Can Find?

Posted by Daniel Lyons Fri, 05 Oct 2007 08:31:00 GMT

I find it amusing that most women writing personals on Craigslist want a “decent” guy, but would never dream of dating a conservative religious person. They want a decent guy who is OK with getting an abortion if they have sex without a condom. They want a decent guy, but aren’t looking for a long-term relationship. They want a decent guy who will put up with all of their quirks and hangups without having any of their own. On top of all this, they want a guy without an ulterior motive. It should be obvious that all of these things are, taken together, insane.

I’d like to say this reflects poorly on women, but we all know that in reality it’s just economics. Women on any personals service can make arbitrary or insane demands because they will get a ton of responses either way. Though I find it hard to understand why the world’s most completely generic personals ads get a bunch of responders, I’m sure that they do. As an ex of mine once observed, every woman has three guys who are dying to sleep with her.

And then there is the attractiveness of the blank slate. Kate’s character in Dodgeball is a perfect example: very attractive, apart from the scene when you see inside her house and everything is covered in cheesy unicorn art. A pretty girl loses some luster when she reveals her passion for orthodontics. In Free Enterprise, Claire is completely detached from our experience in reality through her complete detachment from other people. In reality, getting to know a person involves getting to know their parents, their best friends, their siblings, their roommates, their coworkers. In the movie, Claire has none of those complicating aspects. We want to fall in love with someone simple, a free radical bouncing around the universe unattached to anything, ready to bond into our molecule without any entanglement with foreign substances.

Online personals really represent a hilariously horrible dilemma. We are becoming more isolated like these atoms, bouncing around unattached. We wind up trying to be explicit about what we’re looking for, but we lack any kind of network that might produce what we really need. The eye cannot see itself, yet we are expected to write to the world what we are with the hopes that another eye which cannot see itself can perceive in this note that we are what it needs to complete itself. Wouldn’t our family and friends do a better job if they had a chance?

We have, really, no chance of communicating what is essential about ourselves in one paragraph of text written specifically to woo someone we haven’t met. Our friends and family have an image of ourselves in their minds. They can talk about our qualities generally. We can only mime it based on what we have heard from them about ourselves. A human can hold an image of another human within, and it is mostly valid. It can be off by a tone or two, and certainly lack some of the details, but this image is almost completely inaccessible to ourselves. If you have the slightest clue what you’re all about, it’s only because you’ve had someone tell you or a guess you’ve made based on looking at your bookshelf or your CD collection.

This leads us back to the number one thing people talk about in personals, their likes and dislikes. What could be less relevant? Yet it’s the only thing we can talk about that differentiates us from each other spiritually. Our souls all crave the exact same things, but our minds naturally appreciate different things to different degrees. And of course tribal affiliations are handy for weeding people out. But when we are trying to create relationships for ourselves, it’s always a process of weeding people out, disqualification. If we actually were being treated as people, as images within the minds of those who know and love us, then the process is completely different. I don’t have much first-hand knowledge of it except that every time I ever entered an intense relationship, we both suddenly felt like experts on all matters of the heart and tried to set up our friends, and it never worked. But we weren’t working from a basis of lists of mutually exclusive qualifications, but more like from the thought of finding two colors that complement each other. (There is a joke that a Jewish matchmaker calls any two Jews who are about the same height as one another a match.)

I don’t really know where I’m going with all this, except to say that dating is miserable and I think I can blame the country and the culture.

Tags ,

Functional/Object Oriented Evolution

Posted by Daniel Lyons Thu, 04 Oct 2007 02:27:00 GMT

I noticed something interesting the other day about the functional and object-oriented languages.

Consider Python, where you can write functions like:

def foo(first, second=0, *rest, **kwargs):
  return first + second / len(rest) * kwargs['multiple']

Compare to a functional language like Haskell, where you can’t do that, but you can create types like:

data MyThing = YourThing Integer 
             | AnotherThing (Int, Char, Float)
             | NoThing

Weird that in Haskell, a functional language, you don’t get keyword arguments or arbitrary numbers of arguments, but you do in Python, whereas in Python, you’re confined to a rather small set of built-in types or full-on objects.

Of course in Lisp, you get really ornate functions and the ability to make new types through OOP. But you don’t get strong typing. ;)

Tags , , ,  | 2 comments

One More on Haskell

Posted by Daniel Lyons Fri, 28 Sep 2007 09:11:00 GMT

My faith in Haskell has wavered somewhat lately, and all because of Reddit. Essentially, three things:

  1. Haskell’s fixed-point combinator, y f = f (y f).
  2. The ramifications of Haskell’s purity on abstraction.
  3. Haskell’s epidemic academia.

The first is really two problems. One is that the usual definition of the Y-combinator is not itself recursive. Obnoxious. The second problem is that, though it’s beautiful, there are a number of problems that you can’t express in Haskell using the above combinator which you could in an untyped language. This isn’t, apparently, news to anyone but me. I can’t see how to use the above Y-combinator. This is an incredibly academic problem, like most Haskell problems, but it bugs me a little.

The second was elucidated by Peter Van Roy on Lambda the Ultimate’s forum:

“True state lets information pass “underground” between two interfaces, i.e., the information passes without any apparent connection between them. This is because the connection is the shared state, which is shared by the two interfaces yet hidden from the outside. The shared state is a kind of covert information channel: it lets a module pass information to other modules (or to itself in the future) without anybody else seeing it.”

His point has to do with the fact that Haskell’s purity means that in order to get data from some point A to some point B through a number of other modules, each of the intermediate modules will have to carry the information around, even if it doesn’t do anything with it.

I would like to hate that, really, I would. But I can’t, because I programmed Voltaire in a very functional and abstract way in PHP partly because I could count on a handful of global variables passing some state around “underground” between modules that were loosely connected. In particular, Voltaire creates a region context and a template context in which each script is evaluated. The database connection is also shared clandestinely like this. If I were using Haskell, every function in the system would have to take an extra four parameters to get the current region, template, path and database connection, even if it wasn’t going to use it or pass it directly to a child.

It’s easy to denounce. At the same time I feel blameless for having done it, because while the state is “available” to anything beneath, nothing should be changing these variables outside the core. It’s available in a read-only way. Later on I wrote a plugin for rendering templates programmatically, and that involved understanding the inner state, and another plugin for producing lists which also involved understanding the inner state. But languages like Lisp provide interesting semantics for those times when you would want to change the behavior of a global variable safely.

Which brings me back around to Lisp, the language I have paid the least attention to of the four or so that I decided were “safe” so long ago when I started to force myself to use functional programming. And, truly, there are things about Lisp which are hard to love. The principle advantage of Lisp is that it permits you syntactic innovation. It’s certainly the only language that provides it meaningfully (let us not quibble about Lisp/Scheme differences or bizarre languages like Pliant). But doesn’t this seem like the fundamental abstraction of programming languages?

Aren’t we always starting with some problem and selecting a language based on its syntactic abstraction of some part of the problem domain? I mean, I pick Lisp because I want the ability to create my own structures. That comes in handy against every problem domain. But if I want to write a blog, well, Rails makes it a lot easier up front. Maybe I don’t get linguistic abstraction, but the starting abstraction is quite close. Michael chooses REALbasic for application development, I choose Cocoa. Both of us are making certain sacrifices in the name of abstraction. I lose defmacro. He loses the most recent Cocoa innovations. If I pick Lisp for my blog, then I’m sacrificing the fast start. The laziness of later syntactic abstraction had better pay off. The up-front cost is higher. For any given reasonable language, there is going to be a situation in which its abstraction is an up-front benefit that beats the up-front cost of using Lisp.

You see, these languages are compression algorithms. They compress your explanation of how to solve a problem. Like any compression algorithm, there are problems for each language that compress so badly you wind up writing a different language inside the language. This is Greenspun’s law all over again. Lisp wins frequently because it makes it easy to create a sublanguage for a subproblem that compresses it better. Ruby wins frequently because it encompasses most problem domains.

And Haskell wins frequently in academia because academia is interested in representative subproblems rather than complete problems. My experience on the ICFP this past year was that when you give Haskell a pure math problem, it will beat nearly anything else hands-down for both readability and speed. Now sprinkle some I/O on the problem. How about a non-local return? Perhaps a bit of, dare I say it, destructive state? Suddenly you find yourself looking up “monad transformer,” wondering what the hell you got yourself into.

And Justin, G-d bless him, is a Haskell wizard. I can sort of read the code he wrote. My contribution to that code was negligible. I wasn’t much help debugging it. But at the end, we had a performant Haskell version using prominent Haskell performance themes. But it was also 300 lines of code. I remain convinced against any of that pesky proof stuff that an OCaml implementation would have been half the length, more understandable, maintainable and debuggable. I believe Justin came away from the contest with the opposite conclusion: proof, solid proof, that Haskell can be made to attack the kinds of domains that other languages are generally selected for. In other words, his success with Haskell encourages him to use it more, whereas it filled me with doubt.

And today I see on Reddit a link to the paper introducing Haskell Server Pages. Not to the code itself, or the documentation talking about it, or to a page talking about it or some examples, but to an academic paper about it. I write on Reddit that “I have to admit I’m getting a bit tired of seeing things that should be cool Haskell libraries show up as academic papers. It’s as though the whole industry has turned its gaze to Haskell, exasperatedly asking to see something practical, and instead of turning out practical things, the Haskell world turns out academic papers about practical things. “Proof” that Haskell can be used practically is not the same as people using Haskell practically, nor the same as people practically deciding to use Haskell.”

Let’s face it. I really enjoy Haskell in part because of its snobbery, but that’s really a part of what it is. And the posturing about how mind-expanding it is. Haskell is addicted to academia. You’re much more likely to see a paper about some neat library than a neat library. When you go look at the code, it’s untested, only works on one platform, is broken or partially implemented. Academics are not rewarded for having good, useful code. They’re rewarded for writing papers.

Look at the Wash page and tell me who’s going to use this framework. Look at the first four links. Notice these PDFs and PS files are all LaTeX output. What kind of web people would do this? Academic web people.

So here we are. I suppose every language has its vices. I’m particularly drawn to languages that do a lot of posturing, apparently. Beyond that I’m not sure what to conclude. Every language that isn’t pure offal (Java) seems to have a place in the world. It would be better not to get too worked up about it, but it’s probably impossible.

Tags , , , ,  | 1 comment

Older posts: 1 2 3 4 5 ... 43