-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 15.08.2015 20:25, Divyansh Prakash wrote:
> I love Clojure, but am severely hindered by not being able to write
> scripts due to high start-up times. Once I have a REPL running and
> hot, I actually don't mind it much, but it would still be fun to
> have a tool that lets me say
> 
> lein-node new fun-script cd fun-script/
> 
> And then have an instant REPL up by saying
> 
> lein-node repl
> 
> .. and generally hacking away like we do in Clojure. But all of it
> without the JVM. Basically, a first-class JS host for Cljs.
> 
> I would love to be able to write quick and dirty scripts in
> Clojure. Is there something like this available that I'm missing
> out on? Or does this sound completely heretical?
> 
People in general have the wrong impression of the JVM as the
bottleneck. A simple hello world in Java or even a plain Clojure REPL
without leiningen takes less than a second to run (on newer machines
as my 5 year old laptop):

➜  ~  time clojure -e '(println "Hello world")'
Hello world
clojure -e '(println "Hello world")'  1,17s user 0,63s system 121% cpu
1,473 total

http://blog.ndk.io/2014/02/11/jvm-slow-startup.html

lein-exec also performs fairly quickly for me.

The problem is that you need to run the leiningen dependency
management and most likely the compilation of all the namespaces you
require. node.js in general is not faster than the JVM and a weaker
runtime (but it has some benefits like lower management requirements).
I think the problem is largely AOT compilation and caching as this is
how core cljs startup time itself got sped up. There have been some
attempts lately to bring down startup time of Clojure projects, but I
am haven't followed closely.

http://blog.ndk.io/2014/02/11/jvm-slow-startup.html
http://dev.clojure.org/display/design/'Lean'+Runtime

See also:
https://github.com/technomancy/leiningen/wiki/Faster

Christian
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQEcBAEBAgAGBQJVz4vKAAoJEKel+aujRZMkf6oH/0Q8Pl6fRTK6xY6UN/ghn7R/
6JZWlzlD9HVTcysXwxjVs3Zy5OCgCSfh7Vr9bnjgjc32QC3gCzSmSVs45rTxqSFC
INGX0ilRZ9IB2JKjy+O0f2zTqUps0WWI3YOc0W9KD79NVZnAB1oTiXFQ5fJXiBqd
/gNelFlHVewpsgnCyajd8WpDUc539b4dJcf+tdDo8maHeD12AbrtIKaKV72RKDE1
3OFsRa7BwuOraSM2W+56QGCZHCfkdO521zII/1u734mNCHjpNaLXXhec5Zbgauja
OCOCFCRIUtNRtxOA8ApXsqoToTcFPKuRIDd9ZLxRIN/1zcKvECgKtWtTwuM2m10=
=x6Wk
-----END PGP SIGNATURE-----

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/clojurescript.

Reply via email to