12 ms·
State of Clojure 2015: Survey Results
- vvanders 11y agoLink current shows a 404. Correct link is http://blog.cognitect.com/blog/2016/1/28/state-of-clojure-2015-survey-results http://blog.cognitect.com/blog/2016/1/28/state-of-clojure-20...
- jffry 11y agoWhoops, paste fail. Good catch. It looks like somebody at Cognitect has also added a redirect now. Sorry about that!
- votr 11y agoCorrected link: http://blog.cognitect.com/blog/2016/1/28/state-of-clojure-2015-survey-results http://blog.cognitect.com/blog/2016/1/28/state-of-clojure-20...
- pookeh 11y agoQuick note to HN readers: if you Ctrl+A / Command+A (Select ALl) you can actually read the article.
- jfaucett 11y agoHow much does clojure take advantage of its hosted status? Can anyone who builds clojure software for multiple runtimes comment? It would obviously be extremely nice if you could program libraries once and have them run on the JVM, CLR, and inside the Browser. In practicality how difficult/easy is it to build cross-runtime libraries and how much reuse can you get out of clojure libs b/c of its hosted status?
- 147 11y agoThere's cljc which is a conditional reader that lets you code in clj and cljs in the same file. It's not that difficult to write a library that runs on both. But there are differences in the runtimes, of course. Some examples: https://github.com/stuartsierra/component https://github.com/stuartsierra/component https://github.com/plumatic/schema https://github.com/plumatic/schema (uses .cljx, the precursor to .cljc)
- jfaucett 11y agoNice examples. Am I correct in guessing that this code: (ns com.stuartsierra.component (:require [com.stuartsierra.dependency :as dep] [com.stuartsierra.component.platform :as platform])) requires the correct platform.clj or platform.cljs depending on the runtime? And that this: #?(:clj (defmethod clojure.core/print-method SystemMap [system ^java.io.Writer writer] (.write writer "#<SystemMap>")) :cljs (extend-protocol IPrintWithWriter SystemMap (-pr-writer [this writer opts] (-write writer "#<SystemMap>")))) is how you perform different operations in a single file based on runtime?
- 147 11y agoThe first part requires platform on both platforms. You are correct about the latter.
- jffry 11y agoI can't speak to running Clojure outside the JVM, but on the JVM there's good interop with native Java, which allows using Java-based tools and libraries. This instantly gives you access to a whole ecosystem of stuff written for Java. It's very easy to use the Java AWS SDK directly from Clojure code, for example.
- diomedestydeus 11y agoI was working on a clojure/clojurescript app a while ago. I was hoping to share code between the two. This was pre-clj 1.7 with reader conditionals, so I did some manual footwork to try and resolve the small differences. However the biggest issue I repeatedly ran into was libraries. One of clj's biggest strengths (and why it has an awesome library ecosystem) is that you can just nab a battle tested java lib and write a tiny clj wrapper around it. Those libraries are, obviously, not going to run in js land. As clj matures and we see more pure clj libraries the situation will hopefully improve, but I felt somewhat thwarted by my attempt.
- arohner 11y ago> In practicality how difficult/easy is it to build cross-runtime libraries and how much reuse can you get out of clojure libs b/c of its hosted status? It depends on what you're trying to do, and whether the platforms help. Doing something 'pure' like math or datastructures: trivial. Writing a common interface to two different host libraries (e.g. DateTime in JVM & Browser): manageable. Doing something 'host-y', like graphics, with no host libraries in common: very hard. Basically, Clojure doesn't get in the way of cross-platform concerns, but it might still be a difficult problem.
- harlanji 11y agoTo add, it's not great at the moment and will be more confusing until Clojure/ClojureScript 1.7.x is the minimum supported due to the introduction of reader conditionals (cljc), as they're not backwards compatible. Cljx is the old method that cljc should obviate, but there'll be a transition period. I work for a SaaS/PaaS company using Clojure internally for 2 years and was looking into making a universal client (jvm, clr, js, ios, android)... I'd surely have used a Cljx core with Lein profiles for each platform prior but now it's up in the air, may still have to go that way if we're supporting older Clojure. Each approach on its own is easy, but now there are two and the unofficial one (cljx) is more widely supported than the official one (cljc).
- sotojuan 11y agoI wish I had the time to dive deeply into ClojureScript. It's the part of the Clojure ecosystem that interests me the most. Hope it keeps getting better—a lot of interesting ideas coming from there.
- mej10 11y agoClojureScript is awesome, and soooo much progress has been made in the past year. It has made writing browser based UIs so much more fun. I am really excited about what is in store for it this year -- personally, I am going all-in with ClojureScript.
- muraiki 11y agoClojure was one of the first languages I picked up when I started coding and I really enjoyed using it. The instarepl in Light Table was a huge boon for learning and helped to offset the infamous Clojure stack traces of doom. :) However, I'd be very much interested in hearing more from people who have gone from Java, C#, or another statically typed language to Clojure, particularly in regards to designing, maintaining, and refactoring large codebases. I don't mean to turn this into yet another static vs dynamic flamewar. I'm just very interested in the patterns that professional Clojure programmers use to help manage this complexity. I know that code in Clojure is normally structured very differently than one would find in a more imperative or OO language, whether dynamic or static. I also realize there are things available, such as Prismatic Schema and Typed Clojure, to assist with these problems. Really, I'd love to come back to Clojure but the problems I run into in my day job often have me thinking, "types would have made this so much easier." :( As a result, I haven't given Clojure the time to really delve deeply into it. As someone with limited time to try out whole new languages, I'd love to be convinced to go further!
- evanspa 11y agoSo I worked exclusively in the statically typed (and imperative / OO) world for the first 10 years of my professional career. Several years ago I decided to learn functional programming. I started with Scheme and moved to Clojure. I really enjoy Clojure; it's a real joy coding in it using Emacs with paredit (or smartparens). I wrote a REST API using Clojure; the code also has to interact with a Postgres database. This is for a side project, but it's not a trivial code base. I definitely miss Java/Eclipse style refactoring (right-click, rename, and EVERYTHING is properly updated). Can't do that in Clojure. Also, I find that I have to write more unit tests with Clojure in order to make up for the fact the compiler can't help me. Not that I wouldn't write tests in Java; but I find I have to write more in Clojure to keep the codebase manageable. So again, for me, I use unit testing to make up for the fact I don't have the compiler helping me as much.
- puredanger 11y agoThe Cursive IntelliJ IDE for Clojure does allow you to rename everything in this manner (even keywords used across your codebase). Others may as well, not sure.
- overcast 11y agoI respect it's usefulness, but the LISP syntax just never worked for me. (((())))))()()))(()))())) is not something I want to read and write all day.
- mordocai 11y agoHave you actually tried it for a significant period of time? Most (but not all) people who have used lisp for significant projects find that they either like the parens or are simply neutral about them. There are very few people I have heard from that have stuck through a significant project in lisp and came out hating the parens still.
- overcast 11y agoAdmittedly, I've not used it for any significant period of time. But I do base a lot of language learning on the ease of use of its syntax for newcomers. Having to force my way through a significant project with it, just to potentially enjoy it, keeps it at the bottom of the interest list.
- dragonwriter 11y ago> But I do base a lot of language learning on the ease of use of its syntax for newcomers. From what I've observed of learners, people without lots of programming background seem to have no more problem with parens in lisps (in the broad sense -- mostly, I've seen this with Scheme and Racket) than with syntax features of various Algol-family (C, etc.) languages. People with extensive experience in programming that is mostly restricted to Algol-family languages seem to be the people who are most put-off by lisps and their parens. Which is to say, there are different kinds of newcomers.
- overcast 11y agoI was referring to "newcomers", as just people new to LISP, and not complete newcomers to programming languages. So more the latter of what you wrote.
- AlwaysBCoding 11y agoMy $0.02 on the state of Clojure - For building stateful UI's Clojurescript + Reagent beats anything else out there. For data science and algorithms Clojure beats anything else I've used. For backend web development Rails is still miles ahead of any Clojure workflow. Datomic is interesting but there's still too much incidental complexity to be super productive with it. It's hard to build a startup on Datomic because of the pricing and productivity hit, but could see it being useful in the enterprise where speed is less important. I'm very interested in mobile development with Clojurescript on top of React Native, but haven't found a tutorial that wasn't written in hieroglyphics, so assuming that needs some more time to mature.
- devty 11y agoI had not realized that Clojure is well regarded in data science. Could you point to some libraries you find especially strong?
- ohnomrbill 11y agoI personally use this in place of R, where possible: https://github.com/incanter/incanter https://github.com/incanter/incanter
- mej10 11y agoIt has a very small portion of the mindshare. Almost everyone uses R, Python, or one of the proprietary things. I use Clojure for any data science type tasks I have, but that is because I am primarily a Clojure developer. It is very nice for a lot of basic data analytics -- but I doubt many full time data scientists use Clojure as their primary tool. The number of libraries available for R and Python is pretty amazing.
- dkersten 11y agoThe number of libraries available for R and Python is pretty amazing. I wrote some proof-of-concept code for submitting Python Celery tasks from Clojure. I should polish it up, get return values working and publish it... You could then farm out certain tasks to Python when it makes sense (eg because of existing code, libraries or just familiarity of team members). Best of both worlds, kinda ;-)
- arh68 11y ago> What is your company size? ~44% 1-10 ~26% 10-100 ~17% 101-1000 ~13% 1000+ Wow, that's stark. Huge tilt towards small businesses / startups. I imagine the chart for Java tilts the other way, but I'm speculating. I guess this goes hand-in-hand with hiring / staffing frustrations. I'm glad the Cursive / IntelliJ IDE is gaining popularity; I think it's a fantastic option for development. If you are comfortable with IntelliJ.. go download it.
- dmix 11y agoNot surprising really. Big corps always pick safe languages. Primarily because they need a large recruiting base and middle-managers are typically career oriented and therefore risk adverse.
- timbuckley 11y agoAlso, big companies tend to be older and change their tech stack less often.
- Jach 11y agoIt wouldn't surprise me to see a large fraction of Java use being at b2b startups/small companies since a lot of those 2bs are large and using enterprise tech can make the acquisition story sweeter...
- collyw 11y agoNever thought of that before. Would be a good reason for a startup to choose Java (I can't think of many others)
- incepted 11y agoHuge workforce to hire from (crucial for start ups), vibrant and huge cosystem, battle tested, can scale to pretty much any size, write once, develop anywhere, ... I know HN is a bit in a bubble but I've dealt with hundreds of startups over the past ten years and I can tell you that easily 90% of them pick Java from day one.
- brianolson 11y agoThe first graph I saw was that a poll of Clojure fans shows they like the language features in it. This of course fails to survey the people not using it and why not, and what undesired features prevent them from using it or what lack of features prevent them from using it.
- puredanger 11y agoThat sounds like a challenging poll to conduct.
- fnordsensei 11y agoThat's why it's always worthwhile to do some interviews to get the whys behind the behavior. It's always a risky business to go entirely by quantitative data and then speculate on the underlying motivation.
- baldfat 11y agoI find getting people's input on things they don't use or participate in to be pretty useless. The people's lack of practical knowledge and prejudice just comes down to perceptions. So people have a perception about X and don't use it because. A) To difficult B) To different C) doesn't meet a need D) Y is better then X for A B C reasons....
- j_m_b 11y agoWasn't there a question regarding React Clojurescript usage? I don't see the results for that.
- puredanger 11y agoThere was just the question about whether you use a React binding and that's in the post.
- kimi 11y ago80% of people said they use it
- kimi 11y ago80% of people said they use it
- hellofunk 11y agoI have been working in Clojure and Clojurescript full-time for 2 years and feel blessed to have had the experience, and here is what I've taken from it: 1) It changed how I think about programming, big time. I came from Objective-C and pre-2011 C++, and the functional paradigm blew my mind open. It is now the first habit approach I have when working in any language. 2) I really miss types. While I understand the argument about "fighting the type system", I'd still prefer to occasionally tweak my line of code to satisfy an average type system like C++ rather than deal with the lack of safety and clarity that functions with no type specification for input or output provide. I've recently started doing much more in C++, but this time the modern variant (where I'm using lambdas and the algorithm library all over the place, thanks to what Clojure taught me), and it's been a wash of relief to use my brain for things other than remembering what to feed a function I wrote days, weeks, or months ago: just let the compiler tell me, verify that I've done it right. The ability to quickly test an idea in Clojure is great, but I feel like a large dynamically-typed code base is tremendous opportunity for significant run-time problems, since no compiler has verified that a big category of easy-to-make bugs aren't in there. I'm often having to look at the actual implementation of functions that I don't want to study any more, just so I can remember what types to give them, and what to expect back from them. Run-time assertions and :pre/:post are great, but still not the same thing at all -- and verbose, and added runtime overhead. I don't consider Core.Typed to be the solution to this problem; really, this is something that should be at a core language level, and Clojure is dynamically typed, that's its ball-game, and that's fine for many folks. But I'm slowly moving on towards an exploration of static languages like OCaml, Modern C++, and others. That said, the elegance of Clojure syntax is extraordinary. I don't think it can be beat. It is a joy to use. So all languages have their unique characteristics. I've come to learn what characteristics are important to me, and adjusting my workflow and choices accordingly. But I can't imagine the programming landscape without Clojure.