Tuesday, January 17, 2006


Ever closer to Greenspun's Tenth

Anyone who's glanced at LML's should find Markup for Ruby familiar:

html do
head do
title action_name
stylesheet_link_tag 'scaffold'

body do
p flash[:notice], :style => "color: green"
self << @content_for_layout

So the code for a domain specific language for HTML code generation in Ruby looks similar to a Lisp version, and both look kinda similar to the HTML they are representing. Why is this surprising or interesting?

Greenspun's Tenth Rule says that a sufficiently complex program must implement code to accomplish what Common Lisp does out of the box. It doesn't at all relate to similar libraries being written in two separate languages. If anything, the fact that the Ruby version looks so similar to the Lisp version indicates how close in power Ruby is to Lisp (though it obviously isn't as powerful, since it lacks macros).
Surprising, no. Amusing, perhaps. Just as the smugness was starting to wear off, something like this comes along as a great new thing, and it's another example of something Lisp's had for a decade or two.
I read over your blog, and i found it inquisitive, you may find My Blog interesting. So please Click Here To Read My Blog

Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?