text: What Sucks about Clojure...and Why You'll Love Itas Emerick makes a critique of Clojure outlining its weak points related to namespaces, declare, dynamic scope, STM, JVM and others.
  Sponsored Content
  Bio
  Chas Emerick is a coauthor of Clojure Programming from O'Reilly, and a contributor to Clojure itself and dozens of Clojure projects. He's been deploying Clojure in production since 2009 — primarily to solve various document extraction problems — having adopted it as his primary language the year before. He writes about software development, entrepreneurship, and other passions at cemerick.
  Sorry but it has an awful syntax !
  by
  Serge Bureau
  It might be my difficulty with the syntax, but I had difficulty with Scala, but I find it has incredibly more "features" than Clojure. And the extensibility of DSLs is much more natural to use.`
  So I see very little use case for Clojure.
  Re: Sorry but it has an awful syntax !
  by
  Timothy Baldridge.
  Re: Sorry but it has an awful syntax !
  by
  Serge Bureau
  And I found the opposite. After working with the simplicity of Clojure, the last thing I want is a complex type system, or even a strongly typed language at all..
  I suppose I do agree, I do like Statically typed system.
  I love the Object/Functional mixture.
  I do feel like Clojure has no structure, it can be considered freedom I suppose. But structure brings stability.
  As for parens, I gladly leave them to Clojure programmers.
  Clojure syntax makes using DSL's very unnatural
  Re: Sorry but it has an awful syntax !
  by
  paul iannazzo
  personally i find the lack of syntax in lisps to be very nice, as I can focus more on solving my problems than learning a language.
  clojure has typing too, though i haven't used it.
  the main things that draw me to clojure are the problems it solves and the way it does so. strong immutability (not as strong as haskell/erlang, but much more so than scala/groovy). also i was very interested in persistent data structures and agents.
  also, from what i've heard of scala, code bases for problems in it and clojure seem to be of similar sizes, so scala must be doing something very right, also i heard that scala has pattern matching, which is super cool.
  Re: Sorry but it has an awful syntax !
  by
  Paul Anders
  do you know what some times help? A little humility helps (IMHO).
  How many time have you spend with Scala or Clojure? Each 3 Month, 6 ? 1 year or more? Have you used in a commercial project? Read some papers which discus
  On DSL Syntax
  Scalas point free style is IMHO very limited and there are corner cases lurking everywhere..l
  On Syntax
  Clojure Syntax reads so much nicer (IMHO) because you use only white space and parens (no ; . etc.) Plus macros can clean up a lot of things, which leads me too...
  Features
  Lisp/Clojure have deep concepts(macros and many more) which allow for more, many more "features".
  Thats not to say Clojure doesn't have its mistakes (like flatten doesn't keep collection types)
  Plus I find Scala much more powerful for abstraction.
  So I see very little use case for Clojure.
  <- Little too much I for me IMHO :D
  So my advise: try to observe very carefully. Listen to people why they like or dislike the one or other language. And then maybe again you can share you thoughts and other people can take value form that judgement.
  Re: Sorry but it has an awful syntax !
  by
  Serge Bureau
  But sorry, a Lisp by another name is still lisp.
  It has always been very good at what it does.
  But sorry, a syntax based on "Clojure Syntax reads so much nicer (IMHO) because you use only white space and parens (no ; . etc.) " is not simple but anemic.
  Having to write a DSL where I will have parens everywhere is not a selling point at all for me.
  The whole point of a DSL is to make the user feel like he is almost not programming and immerse him in is domain. Having an artificial syntax is far from reaching that goal.
  As far as features, I think you underestimate Scala a lot.
  I of course know less about Clojure.
  People talk about the fact that Scala does not enforce immutability as a great weakness, I disagree for practical reasons. And I find that Clojure not enforcing types is a much greater weakness.
  I live in the real world, and bugs pops very often, an enforced type system is essential.
  Re: Sorry but it has an awful syntax !
  by
  Paul Anders
  I don't know if you heard, but Lisp is a very powerful concept. So powerful indeed that it can provide features via libraries that are actually 'backed' into other languages.
  Just to give you two examples from clojure:
  pattern matching is not supplied with the language but as a library: core.match (implemented via macros) see github.com/clojure/core.match
  You also mention static typing. You can actually supply that too as a library:
  github.com/frenchy64/typed-clojure
  So think about it how is that possible?
  You mention to disregard immutability for practical reasons. I disagree with that strongly. Please read papers : 'No Silver bullet' and 'Out of the Tar pit' it is worth, I Promise.
  If you struggle with functional programming I suggest a video with Neal Ford: Functional Thinking, it is a really good introduction and explains e.g. why it takes some time if your used to something different.
  Using the three principles suggest here you can develop on a new level:
  twitter.com/debasishg/status/215456651199787008
  I hope this stuff gets you started, if you are interested in improving your programming it certainly will.
  Finally I wanted to say I hope my last post didn't sound to harsh, I somehow felt a strong urge to answer it xkcd.com/386/ ;)
  Re: Sorry but it has an awful syntax !
  by
  Serge Bureau
  Many of the functional benefits are really extremely good, and this is why Scala is attractive, but the mixture with objects and more is even more interesting.
  If Clojure is so magnificent, why Lisp that is Clojure from the 50's never really became mainstream ?
  Syntax comes to mind, and having a lot of things in library is nice, but optional by design.
  Optional type system is to be left in the hands of programmers, I am more confident in the compiler.
  It remembers me of XML before the schemas, they said why should we need types ? They soon understood their mystique.
  Can you do a DSL without parenthesis in it ? What an incredible limitation.
  As far as extending by library, so is Scala. But the XML DSL for example looks like XML, not like XML with a mix of parenthesis.
  Clojure I am sure is powerful, but no forced type system, no objects and so much more.
  You say you can build it after, well I could also say that assembler is the ultimate in flexibility ; but I won't use it in any of my projects.
  So it is not for me, but I am sure learning more about functional programming. But I am not in adoration with it.
  I prefer the mix of paradigm provided by Scala.
  Functional is nice, but functional with objects and Akka is tremendous.
  So have fun, I am sure I will too ;-)
  Having a language that can modify itself is powerful, but impossible to secure.
  interesting self-critique
  by
  Arturo Hernandez
  Re: Sorry but it has an awful syntax !
  by
  Sergio Diaz
  If Clojure is so magnificent, why Lisp that is Clojure from the 50's never really became mainstream ?
  Syntax comes to mind
  Well that is an argument used by many people who just don't like Lisp. I don't know how you use it. If being mainstream is so important, why don't just stay with Java. Is certainly more mainstream than Scala. I think the reason why lisp it isn't mainstream is the same reason for Smalltalk, because with old hardware it was slow. And lisp got trapped as a AI niche language. Functional programming is taught after 3+ courses of imperative programming, so after you crossed the chasm from math in k-12 to imperative programming & going back to math-like thinking (FP) is not so easy.
  Optional type system is to be left in the hands of programmers, I am more confident in the compiler.
  If type systems are so great about catching errors, why you get bugs with those languages, including Haskell. I don't know Scala, but Can you define a type that will help you catch a memory leak at compile time?. I don't think so. There are many classes of bugs that are orthogonal to a type system. You get bugs anyway, type systems never helped me to catch any error, because it is not in my mind set. I caught them by reading my code as i type it, thats the best way to do so. If you get used to your compiler catching errors, your ability to read code won't be as sharp as it can get. Types are really useful for performance, nothing more.
  By the way, thank god i never found a blogpost i read a month ago about monads with Scala when i started to study them. Because i would've quit. It's funny you said clojure has an awful syntax, that is the first thing it comes to my mind when i here the word "Scala", sorry i don't like it. The type syntax for a stuff like Monad trait or Functor trait is really awful. Haskell syntax, even it's error messages are less cryptic than Scala's (IMHO).
  Can you do a DSL without parenthesis in it ? What an incredible limitation.
  Yes you can, see the loop macro from Common Lisp, no parens. As for parenthesis, Clojure has less than any other Lisp. And parens in any lisp code have a greater density but in total counting, I think you'll have less parens than an equivalent library in Java or even Scala (IMHO) we can try & do the counting. To me is not a limitation, to make a DSL look like is part of my language, that is a plus.
  As far as extending by library, so is Scala. But the XML DSL for example looks like XML, not like XML with a mix of parenthesis.
  In this case, its noise to me, like reading HTML mixed with javascript.
  So, have fun and try to be more open about the parens & syntax, any programming language is artificial after all. :)
  Re: Sorry but it has an awful syntax !
  by
  Serge Bureau
  It can modify itself, while interesting for academic reasons, remember that Smalltalk was distributed with no warranty for that reason, they could not support a language that could have been changed by the user ! Spped for Smalltalk was an issue for the machines at the time because of the integrated bitmap graphics, this part was not an issue for Lisp I believe.
  So your view on Type systems is that if it does not catch all errors it is not needed ? Your serious ?
  I prefer infinitely more catching error at compile time than at run time like dynamic languages.
  I fact unit testing has mainly become popular because it is essential for dynamic languages, but much less efficient than strictly typed system. Although for preventing errors, both have their use.
  As far as Scala complexity, it includes facility for all level of users: programmers, analyst, library designer's, ... The complexity is on an as needed basis. Java for example is good for regular programmers, but totally lacking for advanced user's.
  You said: """ To me is not a limitation, to make a DSL look like is part of my language, that is a plus.""". You must be joking. Please read what I wrote on the previous message again. The goal of a DSL is to serve people from a certain domain of expertise, not to bring this new domain to the host language ! It does not make sense otherwise.
  You also mentionned: """In this case, its noise to me, like reading HTML mixed with javascript."""
  Another strange comment, the goal for this is to allow people fluent in XML to transparently use it in their code, if you do not need it the do not use it ?
  But I want the same with SQL or even shell script for example. The point is to bring the most transparently possible another domain language.
  And in many cases to improve on it, like Squeryl for an ORM between Scala and SQL or the same for bringing Java SWING. In those case you are more diminishing the impedance between the host language and anothe domain.
  Parens and syntax are anoying but not the real issue (although for DSL it is). The main issue is self modification (even if it can be amusing) and no enforce type systems: I cannot compromise on that.
  But I am all for people having fun, life is short !
  Re: Sorry but it has an awful syntax !
  by
  Arturo Hernandez
  PHP has more than proved that adoption is not a function of quality. So any references to the adoption record of many languages are a hard buy.
  What I would like to see is more static checking of dynamic languages. And there are already such projects under way for Clojure.
  Re: Sorry but it has an awful syntax !
  by
  Sergio Diaz
  Re: Sorry but it has an awful syntax !
  by
  Greg Tewalt
  It will become clear why the syntax is the way it is.
  Shortly thereafter, with the help of any decent editor that has Paren matching, the parenthesis will disappear.
  Re: Sorry but it has an awful syntax !
  by
  Val Waeselynck
  Your best options to actually make a good comparison are:
  1. Try both options (giving them equal chances)
  2. (not as good): ask someone who has tried both options.
  I personally was used Scala for several months before learning Clojure, was very enthusiastic about it, and what you're saying totally echoed with my mindset of this time, I could totally imagine myself saying it too. Then I learned Clojure.
  And now, reading your comment, I think : "... nah, that's just not the way it works". I deeply prefer Clojure in the general case, including its syntax, and have found all your arguments invalid for reasons you can never understand until you give Clojure a fair try.
  Hello stranger!You need to Register an InfoQ account or Login or login to post comments. But there's so much more behind being registered.
  Get the most out of the InfoQ experience.
  Tell us what you think