Hacker News new | ask | show | jobs
by grayrest 3854 days ago
I was roughly where you were at the beginning of the year. I've been in and out of the Clojure community for a couple years and decided to take a job writing clojurescript full time. App is around 15k loc and was initially in Om and has now been migrated to (my fork of) re-frame.

Positives: <3 re-frame. It's the first architecture in 15 years of frontend dev that I've been happy with and I've tried pretty much everything. cljs is a better language than es6. I like devcards.

Negatives: I've put two work weeks into dealing with tooling problems. I have a 5 minute build. This mostly doesn't matter because incremental builds but every so often (e.g. Tuesday) I hit a problem and have to bisect with a fresh build at each step.

While I'm happy with the language, I'm less happy than I expected to be. I'm in the process of porting devcards and re-frame patterns to (functional) Typescript for my personal projects. The language is a significant barrier to contribution from a larger community and I get a bigger lift from optional types+autocomplete than I do from protocols and macros.

Edit: Is anybody interested in a set of Sublime-ish keybindings for Cursive? I made the set for my coworkers and for the things I can't do via IdeaVim and they've been working fairly well for the past couple weeks.

3 comments

5 minutes for a 15KLOC project seems pretty strange to me unless you're building on a machine with very limited CPU/RAM. Make sure you're giving the JVM enough RAM. Also the next release of ClojureScript supports parallel builds, I've consistently seen users report 30%-300% faster builds (depends on # of cores, dependency graph).
This is on a 2012 MBA for a prod build. I see times of 140s or 180s on a fresh dev build. Times are lower on faster machines but still in the multiple-minute range. I'll tweak the build JVM settings tomorrow and see if that improves things.
Yeah just doesn't sound plausible to me. I've seen bigger projects take less than a minute on a 2014 desktop.

For big prod builds you'll definitely want to give the JVM at least 1gb of RAM, make sure you actually override Lein's defaults:

    :jvm-opts ^:replace ["-Xmx1g" "-server"]
Just as another data point, our project is 16k lines (including tests) and I just timed it at 2.7 minutes to run "lein cljsbuild once" with no difference when setting those jvm-opts. This is on a quad core 2.8ghz i7 MBP.
:compiler-stats has been a thing for a while now. This would give more information - like how much time in ClojureScript vs. advanced compilation. Also the compiler version matters - 1.7.170 is what you want to use. Otherwise you may need :recompile-dependents false.
Cool. I did not know about :compiler-stats. I'll check it out.
I'm definitely interested in those keybindings (I develop Cursive). Could you drop me a line? Email is in my profile, or cursive@cursiveclojure.com.
I see you're using IdeaVim. For very long time I was hesitant to move from WebStorm to Emacs. Until I discovered Spacemacs. Try it and I promise you - you'll be very happy.