12 ms·
Reasons I believe Clojure will never be successful: (1) it's a lisp. This is 2013, compilers can deal with +-*/, I don't need to. (2) it lacks good documentat
by tomp 13y ago
Reasons I believe Clojure will never be successful:
(1) it's a lisp. This is 2013, compilers can deal with +-*/, I don't need to.
(2) it lacks good documentation. Most functions are documented, but badly. In particular, they lack examples; sometimes they are really tricky to use
(3) it lacks tutorials (on the main page). There is a set of pages that explain the basic concepts of clojure, such as datatypes, variables and multimethods/protocols, but they are really terse. I think Clojure assumes you already know lisp, quote, unquote, syntax trees, defs, vars, etc...
(4) it's full of magic. You can feel it, but you can't really understand it without digging through the source code.
I know OCaml, can read Haskell, and wrote a small library in closure. I still find it very hard do get around and very hard to learn.
- llambda 13y ago> it's full of magic. You can feel it, but you can't really understand it without digging through the source code. Are you trolling? If not, care to provide concrete examples? I've written a number of small applications in Clojure and I find that it /lacks/ magic, even in comparison to something like Python (which is generally highly un-magical). For instance, Clojure's namespaces prevent circular dependencies; while a simple example, this is idiomatic to the larger philosophy of Clojure and indicative of a general dislike of magic that permeates the language as a whole, in my experience.
- leishulang 13y agoLisper trend to write one-liners with functions such as map, doseq etc. with big combination chains with many other functions. When doing this in a dynamic type language with no documentation, I guess that's why he calls it magic.
- s_kilk 13y agoHow in hell does 'map' qualify as a magical function? Though I suppose that for a programmer who couldn't understand a simple concept like map, damn near anything would look like sorcery to them. ( to clarify, I'm not accusing you of being unintelligent , just wondering-out-loud )
- obviouslygreen 13y agoAs a Clojure noob I can see 'map' and quite a few other functional things seeming seeming like magic to programmers who aren't used to the paradigm. Until you get used to thinking that way and using the tools, they seem a lot less intuitive.
- fogus 13y agoI can't speak a speck of German. The words look so long and intimidating and I find that if I try to pronounce them I get lost from the beginning to the end. The worst part is that sometimes German words look like something in English and when I try to use them in sentences my German speaking friends giggle at me. German definitely seems less intuitive as a spoken human language.
- agentultra 13y agoThere is very little that is 'magical' about a lisp-like language (in terms of the bastardized vision of 'magic' popularized by blessed hashes, operator overloading, and dynamically constructed objects in various scripting languages). There are few concepts required to understand it: (function arg arg) ; is the default form And every form is passed to eval, which calls apply, which calls eval... until you get to a fully expanded form and the final call to eval. (map #'my-func '(1 2 3 4)) ; might eval to (lambda () (my-func 1) (my-func 2) ...) ; which when passed to apply might result in (list 1 4 9 16) ; which eval's to itself, a list object... 'list being a primitive I just describe a theoretical evaluator (#'map is probably not implemented this way in most lisps). You can implement eval/apply in terms of a register machine if that makes you happy. Just read SICP for a good, basic description of one. I appreciate what the Algol-derivative languages have done and what they're useful for; but there are a large class of programming problems where telling the compiler how to solve your problem for you is far more efficient than manipulating the machine with primitives. It all boils down to that eventually and lisp-like languages simply take you to higher levels of abstractions with consistent semantics.
- dkarl 13y agoI think magic is not the right word here (and I see that you do not endorse it yourself, merely attributing it to him, a distinction others are ignoring.) Instead of magic, I would call it bad or unfamiliar style caused by a habit of doing everything in a single expression with large unnamed sub-expressions. This is much easier to do in functional languages because of how well functional idioms compose with each other. Martin Odersky gave an example of this in Scala in his style talk at Scaladays. Sometimes it seems simplest to express things in one expression: jp.getRawClasspath.filter( _.getEntryKind == IClasspathEntry.CPE_SOURCE). iterator.flatMap(entry => flatten(ResourcesPlugin.getWorkspace. getRoot.findMember(entry.getPath))) But giving informative names to the subexpressions can make things clearer for the next programmer to come along: val sources = jp.getRawClasspath.filter( _.getEntryKind == IClasspathEntry.CPE_SOURCE) def workspaceRoot = ResourcesPlugin.getWorkspace.getRoot def filesOfEntry(entry: Set[File]) = flatten(workspaceRoot.findMember(entry.getPath) sources.iterator flatMap filesOfEntry When to use named vals instead of subexpressions is a matter of style and judgment. From my limited and dated experience, the "one big expression" style is more common and more culturally accepted in Common Lisp than in other languages I've used. You could even call it the norm. In less expressive imperative OO languages, programmers are used to using a plethora of named variables, simply because they usually can't avoid it. In languages like Scala and Clojure, there's bound to be some culture clash when people who are used to more or fewer explicit names have to read each others' code.
- tomp 13y agoI understand map. Here's the code I was trying to understand. https://github.com/nakkaya/net-eval/blob/master/src/net_eval/core.clj#L16 https://github.com/nakkaya/net-eval/blob/master/src/net_eval... I'm not sure I do even now. I mean, I kinda know what different symbols and functions do, but I couldn't write it myself.
- nickik 13y agoWhen you say full, of magic I think you mean the core langauge, witch is actually very simple. The example you provide is from a small test lib somewhere one github. Lets look at the macro, once you understand the basic macro concepts, witch are actually quite simple but still hard to understand. Its like a normal function, exept that the function code will be added to the var as data.
- llambda 13y agoIt's a (fairly simple) macro that defines a function which while doing so associates a quoted function definition (the same as the function being defined) with the metadata of the defined function's var: it might require a double reading (based on my inferior description) because it's got some meta-ness going on. But the salient point here is there's really nothing magical about what's happening there.
- andrewvc 13y agoIf you understand clojure that code sample isn't hard to understand. Of course, I don't really know what it does, because reading 4 lines in a library without knowing anything else is always confusing.
- Anderkent 13y agoIt puts the code of a function into its metadata so that it can send it for remote evaluation easily (see fire-request below that extracts the :task metadata and sends it to a remote nrepl server).
- fogus 13y agoI'm confused. Is it magical because you don't understand it, or do you not understand it because it's magical? It seems like you're saying the first one.
- blueatlas 13y agoI've always wondered how a company can scale a development group using lispy languages. I can read Clojure fairly efficiently, but I don't assume that all developers, even good developers, can. I don't doubt that one can develop rapidly with them, but we all know that more time is spent in maintenance. How many developers out there 1) can read and visualize what is going on, 2) have the tolerance to work with lispy languages?
- aphyr 13y agoI work at Factual, which I'd estimate has about 20 Clojure engineers. We've found folks generally enjoy working with the language--both newly hired programmers who already use Clojure, and internal converts. Code structure for maintainability is always a concern, but because Clojure doesn't impose as much rigid OO hierarchy as other languages, refactoring is a little simpler, I think. It decimates your hiring pool--but the programmers who are fluent in Clojure or other Lisps tend to be skilled. I also think Clojure is more concise and more productive than, say, Java--which reduces the volume of code, and lets you do more with fewer people. Keeping the team small reduces the number of meetings and managers, and keeping the codebase small makes it easier to understand and maintain. YMMV, naturally--but I wouldn't consider these concerns as insurmountable obstacles to using the language in production.
- Mikeb85 13y agoClojure is already successful. Not Java or C++ successful, but successful enough that there's a decent eco-system around it. As for the reasons I use it, it has great development tools, a good amount of libraries, Java interop (a big one), and it's just a well designed language.
- moomin 13y agoDon't agree with 1&4, but 2&3 are subsets of a feature of the Clojure landscape: the guys behind Clojure aren't laser focused on driving adoption like, for instance, Scala is. Indeed, some of them don't really like the idea of a "Clojure Community". http://stuartsierra.com/2013/01/16/the-reluctant-dictator http://stuartsierra.com/2013/01/16/the-reluctant-dictator On the other hand, there's an amazing focus on doing the right thing rather than throwing features at a wall, which I like immensely. Sadly, long lists of new features seems to drive adoption. :(
- fhd2 13y ago> (1) it's a lisp. This is 2013, compilers can deal with +-*/, I don't need to. I don't understand what you mean here, the lack of infix operators in Lisp? You make it sound like prefix notation is inferior. But given how Lispers usually sell it as the best thing since sliced bread, such reactions don't surprise me. Anyway, you're right. It really seems like C-style syntax has won, and deviating from that is certainly a barrier of adoption. Clojure has been remarkably successful despite this, but I really don't see it becoming the next Java.
- shangaslammi 13y agoThe thing with infix operators is not about being C-like, but rather about mathematical expressions looking like they do in actual mathematics (not to mention that each term potentially adds another level of nesting). At least I've personally found that doing linear algebra, physics calculations or anything with more complex equations in Lisp-like languages is a huge pain.
- tensor 13y agoThis can easily be addressed with a DSL. http://data-sorcery.org/2010/05/14/infix-math/ http://data-sorcery.org/2010/05/14/infix-math/
- gtani 13y agoClojure is one of the best documented languages, bookwise, especially the ones from Pragmatic, 2 from OReilly and 2 from Manning(Joy of, especially). (4) it's full of very reasoned data structures and designs, like, e.g. HAMT, transients. You can write dense/nested functions, and people do, and yes, other people have problems with it, see https://olabini.com/blog/2012/08/6-months-with-clojure/ https://olabini.com/blog/2012/08/6-months-with-clojure/ (5) Being a haskeller/ocamler I thought you were going to make a type system argument, which is a valid argument, liek this blogger i saw yesterday http://failex.blogspot.com/ http://failex.blogspot.com/
- yogthos 13y ago>(1) it's a lisp. This is 2013, compilers can deal with +-/, I don't need to. The s-exp notation is actually more* programmer friendly because when you're using a decent editor you can work with code at structural level. When I work in Clojure I'm not thinking in term of manipulating lines. I think in terms of expressions. I want to take this expression and parent it here or there, I do that. I want to factor out a piece of logic I can select the block and move it out, etc. This also facilitates the powerful macro system where I can trivially write code that templates code for me or create DSLs to express the particular problem domain I'm working on. The whole aversion to prefix notation is incredibly superficial. >it lacks good documentation. Most functions are documented, but badly. In particular, they lack examples; sometimes they are really tricky to use This is simply false. There's excellent documentation available at http://clojuredocs.org/quickref/Clojure%20Core http://clojuredocs.org/quickref/Clojure%20Core and http://clojure-doc.org/articles/content.html#clojure_language_guides http://clojure-doc.org/articles/content.html#clojure_languag... with lots of examples for each function, tutorials, and guides. Furthermore, there's tons of traditional documentation available in form of books. >it's full of magic. You can feel it, but you can't really understand it without digging through the source code. It's quite the opposite in my experience. >I know OCaml, can read Haskell, and wrote a small library in closure. I still find it very hard do get around and very hard to learn. I find Haskell is much more difficult to read than Clojure. Perhaps it has something to do with familiarity as opposed to any inherent difficulty?
- RivieraKid 13y agoWhen I work in Clojure I'm not thinking in term of manipulating lines. I think in terms of expressions. I want to take this expression and parent it here or there, I do that. I want to factor out a piece of logic I can select the block and move it out, etc. Lips has just a really tiny (if any) advantage over other languages in this. I can move code around quite easily in Java. And I don't have to care about formatting (I use autoformatter). In Lisps, formatting code manually is needed and it's a bit of a PITA especially when changing the code. This also facilitates the powerful macro system where I can trivially write code that templates code for me or create DSLs to express the particular problem domain I'm working on. The whole aversion to prefix notation is incredibly superficial. Usefulness of macros is overrated. In my experience, the s-exp syntax is too high price for macros. I like Julia's approach to macros much more.
- RivieraKid 13y agoI was quite enthusiastic about Clojure at first, I rally enjoyed experimenting with it but when the novelty fade off I lost interest because of: 1. The minimal syntax makes it harder to read than more traditional languages. 2. It's uncomfortable to do imperative or object-oriented programming in Clojure. (Yes, many problems are easier to express in other than the functional paradigm.) 3. Using state is not a priori wrong but it's difficult in Clojure. 4. The parentheses are sometimes annoying, especially when I want to quickly test something in the REPL. Some lispers (like Paul Graham) believe in something like "macros make lisp the most productive language on Earth, at least for the top x % programmers". From my experince, this is just wishful thinking. It makes them feel special and better than others.
- fogus 13y ago> It makes them feel special and better than others. That's an incredibly cynical view. I'm sorry that Clojure was not for you -- it happens. People have different ways of thinking and the language that makes sense to you might not make sense to me. This is natural I would say and not likely reflective of general intelligence. There's no need to be bitter about it.
- RivieraKid 13y agoI loved playing with Clojure, especially with the overtone library. But I just couldn't see myself be more productive in Clojure than in Python. > People have different ways of thinking and the language that makes sense to you might not make sense to me. This is natural I would say and not likely reflective of general intelligence. There's no need to be bitter about it. I was mostly refering to the essay by Paul Graham that is sometimes referenced here on HN. I find some of PG's claims about lisp's productivity ridiculous and almost religious.
- kaoD 13y agoMacros are frowned-upon within the Clojure community, and for very good reasons. EDIT: okay, I got downvoted for some reason. Care to explain why? The mantra in Clojure is "don't write macros until you NEED macros" (or some alternative[1]). They make things horribly complicated and are awful to debug and make code that uses them hard to debug too... especially within a JVM environment (your code gets translated twice). [1] http://clojurefun.wordpress.com/2013/01/09/when-do-you-need-macros-in-clojure/ http://clojurefun.wordpress.com/2013/01/09/when-do-you-need-...
- abraininavat 13y agoSo we're agreed that we can throw (4) out right? You're wrong about Clojure being "full of magic." As to your example, you don't understand Clojure macros so you don't understand that simple Clojure macro. That's not magic. Now, of (1)-(3), the only one which has the hope of backing up your point is (1). Why should Clojure not having good documentation right now be a reason Clojure will never be successful? Why should Clojure not having tutorials right now be a reason Clojure will never be successful? It doesn't make sense. What if those "facts" change?
- tomp 13y agoYou're right; "never" was a bit too long-term.
- aphyr 13y agoit's a lisp. This is 2013, compilers can deal with +-/, I don't need to.* Modern Lisps use homoiconicity not because it is easier for the compiler, but because it is easier for the human. In languages with syntactic macros, (as opposed to string-interpolating macros), one manipulates the program's AST directly as a data structure. Making the code's AST regular, predictable, and explicit facilitates code transformation, which is an integral part of programming in a Lisp dialect.
- lcedp 13y ago1) It seems hard because you didn't learn this way in school. I agree that writing 1 + 2 * 5 is easier than (+ 1 (* 2 5)). It's true for very simple expressions. But as your expression grown you end up (if you haven't forgot) adding parentheses to ensure your operators executed in the right order. Multi-line expressions are just unreadable in traditional notation. But lisp notation with indentation is just fine. 2, 3) There is tons of material on Clojure. Read a book or two, google for christ's sake to get live examples on stackoverflow and hackers' blogs. Also great features are (doc fname) and (source fname) to get source right away without even leaving your REPL. 4) It's very subjective what you wrote, so it can't be falsified.
- sultezdukes 13y agoClojure is already successful for many people. What you probably meant to say is that Clojure will never be mainstream. That's probably true, but I have been subscribed to the clojure mailing list for quite a while now and actually quite surprised how much Clojure code is in production. That said, the two big "strikes" against clojure for "mainstream" adoption are as you pointed out, it's a Lisp, and it's dynamically typed. I like the core concepts of Clojure. That there are a small set of primitives that have a uniform interface and how Clojure is anti-OO. Clojure actually does OO better than OO languages do, but that's another story. If I could just get a Clojure with some optional typing, a python-like syntax, and awesome tools, I'd be a happy camper.