8 ms·
This is something that clojure got right before any other language I'm familiar with did. You do not "install" clojure. You depend on clojure just like you mig
by babs474 14y ago
This is something that clojure got right before any other language I'm familiar with did.
You do not "install" clojure. You depend on clojure just like you might log4j or joda-time
- matthavener 14y agoYou still need to install the JVM. Python/perl/ruby require installers because you need some platform-specific stuff for each. Running everything inside the JVM means you only need to ship what any arbitrary JVM library requires. In this case, its as simple as a .jar.
- babs474 14y agoTrue clojure assumes the existence of the JVM. However no other jvm language has gone with the language as library system which is a shame. Also, I don't think anything would preclude non jvm hosted languages from doing something similar. I think it is a better solution than say virtualenv from python.
- eeperson 14y agoI believe that is what all of the other JVM languages do. How is what Clojure does any different that what Scala or Groovy does?
- pekk 14y agomatthavener wrote: "Running everything inside the JVM means you only need to ship what any arbitrary JVM library requires. In this case, its as simple as a .jar." Considering a .jar is a zipped directory tree, and a virtualenv is a directory tree, would you be happy if we zipped up virtualenvs and called them .par or something? I'm not sure what "language as library" will mean if you are not installing a VM or interpreter such as the JVM.
- babs474 14y agoI think the important difference between virtualenv and lein is not the implementation detail of whether it is a zipped file or whatever, but in how you use them. If you run a python program with virtualenv who decides weather to use python2.5 python2.7 or python3? Is it the author of the program? No, typically it is the user of the program who decides by symlinking /usr/bin/python If you run a clojure program "lein run" who decides weather to use clojure1.3 clojure1.4 or clojure1.5. It is the author of the clojure program who decides by specifying in the project.clj file. What I am saying is, I really prefer what seems to be the idomatic way of running clojure programs. This is totally possible with any programming language, but other jvm languages seem want to emulate the /usr/bin/runtime strategy. For instance the idomatic way to run a groovy script is to point /usr/bin/groovy --> ~/groovy-2.0/bin/groovy and $>groovy myscript.groovy
- eeperson 14y agoThat is exactly what the other JVM languages do. You download your version, of the language compiler and runtime, as libraries with a build tool. Then the build tool uses that compiler library to build your code. Saying that the idiomatic way of running groovy code is 'groovy myscript.groovy' is no more true than saying that the idiomatic way of running clojure code is 'clojure myscript.clj' edit: grammer
- draegtun 14y ago... and called them .par or something? .par is already taken. See PAR, the Perl Archiving Toolkit, which attempts to replicate jar for Perl. - http://par.perl.org/ http://par.perl.org/ - https://metacpan.org/module/PAR https://metacpan.org/module/PAR
- pekk 14y agoSo Clojure has over (say) Ruby the feature that you don't have to install it. Yet you do have to install a JVM... How is installing a JVM better than installing any other interpreter or runtime?
- weavejester 14y agoThe JVM tends to change less often than a language runtime, so you can use the JVM version that's packaged for your operating system, but still take advantage of the latest language runtime.
- martinced 14y ago"How is installing a JVM better than installing any other interpreter or runtime?" Maybe, just maybe, the fact that Clojure isn't exactly the only program on earth running on the JVM and that, hence, there's a probability p far from zero that the JVM is already installed on your system / on your users' systems!?
- pekk 14y agoThere's a good chance that a Perl interpreter is installed on any Linux system, but this is really an incredibly trivial reason to prefer a language. If you can't use (say) a ruby installer you are going to have even bigger problems building almost any kind of software.
- jamesbritt 14y agoThis is the same advantage JRuby has in that Java developers don't have to convince someone in some chain of command about installing a new tool; it's just a jar file. It's more of a plus if you already have a JVM in place.
- mdellabitta 14y agoDid they pull this off before JRuby?