Tuesday, November 4, 2008

Clojure: a LISP that has a chance

Clojure is an interesting new language. Here's the executive summary:

Clojure is a dynamic programming language that targets the Java Virtual Machine. It is designed to be a general-purpose language, combining the approachability and interactive development of a scripting language with an efficient and robust infrastructure for multithreaded programming. Clojure is a compiled language - it compiles directly to JVM bytecode, yet remains completely dynamic. Every feature supported by Clojure is supported at runtime. Clojure provides easy access to the Java frameworks, with optional type hints and type inference, to ensure that calls to Java can avoid reflection.

Clojure is a dialect of Lisp, and shares with Lisp the code-as-data philosophy and a powerful macro system. Clojure is predominantly a functional programming language, and features a rich set of immutable, persistent data structures. When mutable state is needed, Clojure offers a software transactional memory system and reactive Agent system that ensure clean, correct, multithreaded designs. — www.clojure.org

Each of the key features is exciting to me, a functional LISP that integrates closely with the JVM and has baked-in concurrency. What's more, I think Clojure has a chance at making it big. Here's why:

  • Unique Vision. I don't think any new language can survive for long, unless it has a unique vision. Clojure's unique vision is to bring together a mix of performant, immutable data stuctures, baked-in concurrency, functional style, and close integration with the JVM.
  • JVM Integration. Rich Hickey had the incredible foresight to see the JVM as a platform to be embraced closely. This means that not only can you leverage 100% of existing Java code, but your Clojure code compiles to Java bytecode and benefits from the HotSpot JVM's dynamic optimizations. Compare that to a "from scratch" language that takes years to get a diverse set of libraries and an optimized implementation.
  • Benevolent Dictator. I have always thought that a new LISP (or any new language for that matter) needs a Benevolent Dictator. The BD is the friendly face of the community and sets the tone for how people treat each other. But more importantly the BD is a dictator who has a strong vision for the language, and will say "no" to feature requests that don't line up with his vision. This is Rich Hickey, friendly and open to suggestion, but not afraid to say "no."

If any of this sounds interesting to you, then check out the homepage. The quickest and easiest way to get involved in the community is to join the Google Group. Also, if you're into IRC, then check out #clojure on irc.freenode.net.

I am excited about the future of Clojure, and have really enjoyed working with it so far.

Monday, November 3, 2008

Migrating from wordpress.com to blogger.com

I won't go into all of the details about why I switched my blogging platform from wordpress.com to blogger.com, but the biggest reason is that Blogger will host a custom domain for free, whereas WordPress charges $10/year. Yes, $10/year is peanuts, and you're free to host your custom domain with them, but I like free.

The Switch

I had existing posts, and I decided that I wanted existing links to work so that if someone went to http://paul.stadig.name/2007/10/26/the-state-of-rdf-support-in-ruby-2007/ they would not get a 404 or a redirect or a jump page with an "oops-this-site-has-moved-click-here-to-go-to-the-real-site" link. Instead I opted for existing links going to a page that includes the original content, plus a little message that says "You're viewing a 'classic' blog entry. Check out the latest entries." This can be done with the Blogger missing files host.

My next problem was that my missing files host would have to be a server somewhere that I had to pay for (hmm...not free). Instead I decided to use the Google Sites service for my Google hosted domain. I created a site and created a structure to exactly mirror my existing links. I went into my Google Apps for Your Domain control panel and added a domain mapping for my new Google Site. Then I was able to test each post by replacing "pjstadig.wordpress.com" to "paul-classic.stadig.name" in the URL in the browser bar.

I wouldn't have gone through this whole process if I had hundreds of posts. However, for the small number of posts that I had, this was an ideal solution.