Clochure

A Better Clojure

Clochure is an educated attempt to solve Clojure's number one problem and first obstacle that puts away newcomers: parentheses

Get it now on Github

We've found an elegant and practical solution to the problem: interchange parentheses with square brackets. Why?

Since 2008 one programming language has seen an unprecedented growth in popularity despite its weird syntax: Objective-C. Why? Because to create applications for the App Store you have to code in Objective-C. Over 800.000 apps in the App Store are a testimony of the popularity of this language.

What does this have to do with Clochure? Well Objective-C syntax looks like this:

[[MyObject alloc] init]

Don't you see something familiar there? Yep. We also noticed it.

So now with Clochure you get all the advantages of the JVM, the elegance of Clojure and tons of Objective-C developers that can jump straight away to work in your startup code.

Also to makes things easier for library maintainers we kept the clojure namespaces to keep BC with existing Clojure projects.


Advantages

Some of the advantages of Clochure over Clojure are:

  • Easier to read, compare: (+ (expt 2 30) 2) with [+ [expt 2 30] 2].
  • It compiles faster, since the compiler don't need to differentiate Java parentheses from Clojure ones.
  • You can find thousands of iOS developers that can jump right on to Clochure Projects.
  • The [] keys are closer to the central row of your keyboard than the less comfortable ().
  • You don't need to hold the shift key to type [] therefore you can code faster.

TL;DR: Use Clochure

Why, How, When?

Usability is very important for a new programming language, and lets face it, Clojure usability and friendliness to newcomers is very bad. All those parentheses really hurt Clojure reputation. So on the eve of April 1st we sat down in a brainstorm session with a team of PLT experts. Ideas starting flying around:

  • We need monads –said one.
  • No, –said another one–, I think logic programming is what we actually need.
  • Actually we need a Clojure2Scala compiler –said a third.

Ideas kept mumbling around until the PLT expert with ironic moustache said:

  • I think the solution is simpler and it has been in front of our eyes since 2008.
  • And what is it?
  • Objective-C. Objective-C is massively popular and it has a syntax that resembles that of Clojure: [[MyObject alloc] init].
  • I don’t get it? –replied the first one.
  • We just swap Clojure parentheses for square brackets, and BAM!, millions of iOS developers can use our language.

And that’s pretty much how Clochure came to life.


See it in action