Charles Nutter, Rich Hickey, and Gavin King each discovered that 'simplicity' doesn't mean the same thing
Computer languages reflect the goals, target audiences, and to some degree the personalities of their creators and their communities. As a result, even languages that are created with similar goals in mind may yield highly disparate final results, depending on how their communities understand those goals. Ruby, Clojure, and Ceylon are three such languages.
Ruby is the oldest of the three. Created in the mid-1990s, it didnโt achieve widespread popularity until the 2000s. One reason for Rubyโs growth is the work of Charles Nutter, who created jRuby, a port of Ruby to the Java virtual machine (JVM). Ruby is a dynamic, object-oriented language, whereas Clojure and Ceylon use a functional programming approach.
Clojure appeared in 2007, created by Rich Hickey. Although Clojure is new, itโs a derivative of Lisp, the listy processing language specified in 1958, making it the second-oldest high-level language. Then thereโs Ceylon (the brainchild of Gavin King, the creator of the Hibernate ORM framework), which is on its second milestone prerelease.
In interviewing Rubyโs Nutter, Clojureโs Hickey, and Ceylonโs King, I was surprised at how โ despite ending up with vastly divergent outcomes โ they share common goals and viewpoints. Each believe their language is designed to simplify the job of the developer, yet the approaches they each take toward achieving that simplicity vary wildly.
A key idea behind Ruby is to โfeel as natural as possible, so you can do powerful things with Ruby but it doesnโt get in your way,โ Nutter says. On the other hand, it โdoes not limit you to programs and development styles that fit into a strict statically typed world.โ
Ceylon, Nutter says, aims to be โan evolutionary โbetter Javaโ that doesnโt try to take a revolutionary leap forward (Scala) or completely change paradigms (Ruby).โ Its creator, King, seems to agree; he considers โCeylon to be an alternative to Java that interoperates well with Java.โ Ceylon focuses more on tooling and is itself developed using the Ceylon IDE. Due to their dynamic nature, โyouโll never ever find a tool like Ceylon IDE for a language like Ruby, Python, or Smalltalk,โ he says.
Clojureโs simplicity at first may appear more complex
Clojure is the most unique of the three. The syntax for Lisp was heavily influenced by lambda calculus (PDF). Like Ruby, Clojure is dynamically typed, but where Ruby is a more nominally imperative object-oriented programming language, Clojure is functional. Hickeyโs idea of simplicity doesnโt exactly match up with Kingโs and Nutterโs. Clojure aims to remove โself-inflicted complexity derived from their programming languages, approaches, and tools,โ Hickey says.
Clojureโs simplicity is fundamentally different from that in Ceylon or Ruby. The best way to understand Clojureโs simplicity is by an example. Stuart Halloway, who runs a consulting company down the street from me, recently gave a talk to the New York City Clojure Userโs Group and provided a code sample of Clojure reflecting on the java.lang.String class and printing out members named โlastโ:
(describe String (named "last"))
He said that code could be โsimplifiedโ in Clojure to:
(->>
(reflect java.lang.String)
:members
(filters
#(.startWith (str (:name %)) "last"))
(print-table)
)
Initially, the latter appears more complicated. To the uninitiated, it is at least harder to read. However, it introduces the least number of new concepts to the language. In the words of Clojureโs Hickey, โSimplicity means lack of entanglement. For a programming language, it means delivering abstractions and mechanisms that each do one thing well, and can be composed as needed.โ The first example cannot be composed at all.
King explains that โwe read code a lot more often than we write it, so readability is the most important criteria for judging the syntax of a language. A programming language is for communicating algorithms to humans.โ If youโre familiar with Java, Pascal, C#, or any of the other widely used higher-level languages, the syntax of Ceylon or Ruby will probably be more readable to you. If you come from a more mathematical background, I believe Clojure will be an easier fit. Indeed, when writing software that is heavily algorithmic in nature, Clojureโs syntax looks brief and relatively clear.
Choose your preferred version of simplicity
King and Hickey agree that removing complexity is a goal. King views his job as being the โnasty ogre who says no all the time,โ trimming unneeded features and syntax. Hickey believes that โwe can build better software using significantly simpler constructs and techniques, with a corresponding reduction in complexity and increase in robustness.โ
At first, it surprised me that each languageโs creator directly or indirectly identified simplicity as his goal, as well as how differently the three creators and their languagesโ communities define what simplicity is. For Ruby, it is about a language that feels natural and gets out of your way to do what you want. For Clojure, it is about keeping the language itself simple. For Ceylon, it is a compromise between enabling the language to help, in Kingโs words, โcommunicating algorithms to humansโ and providing proper tooling support: the same general goal, three very different results.
Iโve found the Ruby, Clojure, and Ceylon communities all very friendly and approachable. Developers looking to pick up a new skill cannot go wrong trying one of these on for size. Managers looking to find a better fit for some of their software problems that just donโt fit Java or C# will find help in these communities, as well. Ruby, Clojure, and Ceylon can all be used on the Java platform with existing APIs, so you can easily choose to mix and match the vision of simplicity that suits your problem space. But this polyglot language architecture may create its own form of complexity.
This article, โRuby, Clojure, and Ceylon: Same goal, three very different results,โ was originally published at InfoWorld.com. Follow the latest developments in business technology news and get a digest of the key stories each day in the InfoWorld Daily newsletter. For the latest business technology news, follow InfoWorld on Twitter.


