
Waitin' (on Leiningen) - mikeflynn
http://swannodette.github.io/2014/12/22/waitin/
======
garrettdreyfus
I would just like to thank Swannodette for all the amazing work he has done
for Clojure and its community. You are the best.

~~~
pandeiro
+1

Besides being a prolific coder, he's a great writer with a knack for bridging
the academic and the practical.

What's more, the Clojure community has a great number of similarly education-
minded and highly talented and effective programmers.

------
kcorbitt
It probably isn't the same issue that is causing the Leiningen slowdown, but
as near as I can tell the really slow startup time is the main reason Clojure
on Android isn't currently a viable option. Which is too bad, because I'd love
to see the Clojure community's take on Android development. I can imagine a UI
framework spiritually similar to Facebook's ReactJS appearing and making
everything so much cleaner. And with a Lisp like Clojure there would no longer
be any reason to use XML for layout and Java for logic -- it could all be
unified into one cohesive language. Maybe I'm dreaming too big, but that would
be an exciting future.

~~~
pjmlp
Clojure is too slow, because of the vars creation that it does on startup.

Work is ongoing to improve the situation for Clojure 1.7, but apparently the
slowness won't go fully away.

There as a post a few weeks ago on the mailing list about using ClojureScript
instead, with compilation to Java bytecodes via Nashorn, before feeding the
class files to Dalvik/ART.

All of this is just too hacky for me.

I would rather have a strong typed Clojure instead that wouldn't suffer from
these pain points.

------
reitzensteinm
I'd be careful about introducing more caching to the ClojureScript build
process - I've been getting some really strange errors occasionally, the kind
that leave garbled errors in the js that the source maps can't decypher, that
disappear after a full clean & rebuild.

I just released a site based on Clojure + Clojurescript, with the front end
written in Reagent, and it was a pretty good experience overall. The above was
my main issue with the setup.

I've written more about the experience here (it seems there's not much
interest in the site here, but at least the writeup should be interesting to
those reading this post):

[https://news.ycombinator.com/item?id=8791129](https://news.ycombinator.com/item?id=8791129)

(Edit: it has since got a few upvotes, only to be killed by I guess the voting
ring detection. C'est la vie.)

~~~
swannodette
The issues you encountered likely arise from not recompiling _dependent_
namespaces when you change a source file. It's something we'll probably
address soon.

~~~
reitzensteinm
Ah, interesting. This was both with the advanced and no optimisations, if that
matters?

My overall impression was that ClojureScript was already 90% the way there, so
you've done a damn fine job of maintaining and pushing the project forward.
Thank you very much for that!

------
rcarmo
I wish leiningen wouldn't take so long to run. The only real trouble with
Clojure is how unbearably _slow_ the tools are. I can deal with the runtime
taking its time to get going (mostly), but the tooling...

~~~
TylerE
That's not even a Clojure thing really. That's been the Achille's Heal of
every interactive java app ever.

~~~
kyllo
Hence the need for:
[http://docs.oracle.com/javase/6/docs/api/java/awt/SplashScre...](http://docs.oracle.com/javase/6/docs/api/java/awt/SplashScreen.html)

------
nightwolf
It's not actually that JVM startup time is slow, it's Clojure startup time in
particular. See:

[https://nicholaskariniemi.github.io/2014/02/11/jvm-slow-
star...](https://nicholaskariniemi.github.io/2014/02/11/jvm-slow-startup.html)

And the other articles here:

[https://nicholaskariniemi.github.io/](https://nicholaskariniemi.github.io/)

------
retrogradeorbit
Hmmm. I bumped my clojurescript to 0.0-2511, and I get the following:

$ lein trampoline run -m clojure.main

Exception in thread "main" java.io.FileNotFoundException: Could not locate
cljsbuild/compiler__init.class or cljsbuild/compiler.clj on classpath: ,
compiling:(.../target/66ddb53f4f237c7eb26e49c2637097e7cd8567d9-init.clj:1:4)
...

Everything else works fine.

Do we have a more complete example project that I can check mine against?

~~~
huahaiy
I got the same error. Seems to be relevant to this issue:

[https://github.com/emezeske/lein-
cljsbuild/issues/204](https://github.com/emezeske/lein-cljsbuild/issues/204)

The suggestion seems to be "In the meantime: don't use trampoline, or chain
the task explicitly, before the trampoline, e.g. lein do cljsbuild once,
trampoline repl."

------
grandalf
This is great progress. I anticipate that fairly soon javascript will become
the dominant compile target / runtime for clojure.

------
programminggeek
As cool of a language as clojure might be, bad tooling is bad UX. Bad UX makes
for a bad product. I don't care how many amazing features a language has,
without great tools, it sucks.

PHP is a terrible language in terms of design, but deploys are ridiculously
easy, and refreshing a page is near instantaneous. There are plenty of other
things to complain about with PHP, but part of its popularity is the
relatively pleasant experience with the main tools.

~~~
swannodette
Extrapolating from the post that Clojure tooling is bad seems like a strange
conclusion. I'm actually surprised that such a narrow post would find this
much interest on HN.

Clojure deploys are pretty ridiculously easy - and refreshing pages on a
Clojure based web stack is also instantaneous.

Seriously, Leiningen _is_ great tooling. On pretty much every axis except
startup speed I prefer it to everything else I've needed to use for work in
other languages (Python, Ruby, and Node.js).

~~~
phren0logy
I wholeheartedly agree. I wish every language had a Leiningen equivalent,
despite the speed issues.

------
htor
Nice! Never occurred to me to compile ClojureScript itself.

------
bachback
Leining is a very useful tool. Starting up Clojure indeed is noticeable. I
wonder how much of the performance is due to Maven, and if gradle would do
better. Gradle is a newer project with a custom DSL based on Groovy.

~~~
wtetzner
Not sure what you mean? Leiningen is its own build tool, it isn't using Maven.
I believe it uses the aether library for dependency management, but as far as
I know that's all they have in common.

~~~
robert_tweed
Leiningen uses Maven for everything internally, it just goes to some effort to
hide it most of the time.

~~~
weavejester
No it doesn't. I don't know why people think this.

~~~
kyllo
Because it interoperates with Maven. It can fetch and install code from Maven
repositories, can read and write a pom.xml file, and uses the same
groupId/artifactId/version format for specifying dependencies. And it also
depends on a few org.apache.maven packages. So without looking at the source
it would be easy to mistake lein for a Clojure wrapper around mvn. But it's
more like a Clojure implementation of a superset of Maven's functionality, I
guess.

~~~
robert_tweed
You and I are definitely both correct about it being a dependency: it caused
me some installation headaches. I may have misunderstood the docs about how
deep of a dependency it is; I haven't read the source.

Returning to the OP's point, given that it is a dependency, it's still
possible there is some resulting startup overhead, but I couldn't say for sure
without profiling it.

~~~
kyllo
My biggest headache with it was just figuring out how to tell it to use a
local jar. It really wanted to fetch it from clojars or maven central but
sometimes you just need to use a jar that's sitting on your hard disk. IIRC
there's no standard way to do this and I had to create a local maven repo for
lein to pull it from.

------
daxfohl
Way to kick a guy when he's down. Next thing you know he'll be relegated to
selling half-finished keyboards out of Thailand.

~~~
SwellJoe
What does this even mean?

~~~
pbiggar
technomancy, the author of leiningen, is moving to Thailand and has a side-
business of selling keyboards. See
[http://technomancy.us/177](http://technomancy.us/177)

