Re:Why we are choosing Clojure as our main programming language
by cdavid on Monday March 21, 2011 @01:17PM
(#2350618)
He mentioned python issues such as deployment and the GIL. While python is my language of choise, I agree those are significant pain points. Unfortunately, he did not mention how clojure solves deployment - is it solved through maven and other java solutions ? It did not strike me as a nice solution either.
[ Parent
| on HN ]
Re:Why we are choosing Clojure as our main programming language
by gislik on Monday March 21, 2011 @01:33PM
(#2350692)
Just to collaborate a little bit on this point. With leiningen things are not too bad.
A typical deployment instruction file (project.clj) looks like this and with "lein deps" you're all set up in a few seconds.
(defproject leiningen "0.5.0-SNAPSHOT" :description "A build tool designed to not set your hair on fire." :url "http://github.com/technomancy/leiningen :dependencies [[org.clojure/clojure "1.1.0"] [org.clojure/clojure-contrib "1.1.0"]] :dev-dependencies [[swank-clojure "1.2.1"]])
Re:Why we are choosing Clojure as our main programming language
by gislik on Monday March 21, 2011 @01:34PM
(#2350695)
ouch ... formatting is clearly not preserved :(
But take a look at https://github.com/technomancy/leiningen
Re:Why we are choosing Clojure as our main programming language
by dpritchett on Monday March 21, 2011 @01:53PM
(#2350798)
(defproject leiningen "1.5.0-RC1"
:description "A build tool designed not to set your hair on fire."
:url "https://github.com/technomancy/leiningen"
:license {:name "Eclipse Public License"}
:dependencies [[org.clojure/clojure "1.2.0"]
[org.clojure/clojure-contrib "1.2.0"]
[lancet "1.0.0"]
[jline "0.9.94"]
[robert/hooke "1.1.0"]
[org.apache.maven/maven-ant-tasks "2.0.10" :exclusions [ant]]]
:disable-implicit-clean true
:eval-in-leiningen true)
Re:Why we are choosing Clojure as our main programming language
by cdavid on Monday March 21, 2011 @10:51PM
(#2352830)
I am not familiar with leiningen or clojure, but it looks like you are just adding a list of requirements + version, which is exactly what you get with pip + requirements.txt file ?
Re:Why we are choosing Clojure as our main programming language
by dpritchett on Tuesday March 22, 2011 @10:15AM
(#2354413)
I believe that's what's going on, yes. Leiningen runs on top of Maven and so it's downloading the jars you need and storing them in ~/.m2/ where they will be linked in at compile time.
A "lein uberjar" will roll your whole program up into one .jar file, ready for deployment.
Re:Why we are choosing Clojure as our main programming language
by jedsmith on Monday March 21, 2011 @01:47PM
(#2350759)
Four spaces in front of each line will preserve formatting.
int main(int argc, char **argv) {
printf("whee!\n");
return 0;
}
Re:Why we are choosing Clojure as our main programming language
by runevault on Monday March 21, 2011 @01:21PM
(#2350636)
Maven is not thrilling, but with lein over the top and clojars for clojure specific jar files, it's reasonably painless IME.
Re:Why we are choosing Clojure as our main programming language
by cdavid on Monday March 21, 2011 @01:32PM
(#2350685)
But what's the difference with python at that point ? Is is because the JVM makes it inherently easier ("one" jvm, one bytecode, no difference between version/build options for C extensions) ?
Re:Why we are choosing Clojure as our main programming language
by runevault on Monday March 21, 2011 @01:49PM
(#2350780)
That and by default you have the classpath so each setup has exactly which version of the various jars you specify in your project.clj file, without needing external tools like virtualenv.
Re:Why we are choosing Clojure as our main programming language
by true_religion on Monday March 21, 2011 @01:19PM
(#2350628)
Isn't java deployment as simple as distributing a .jar or a .war----one file? Python deployment on the otherhand is a tarball of several files.
Re:Why we are choosing Clojure as our main programming language
by runevault on Monday March 21, 2011 @01:25PM
(#2350659)
yes all deployment options that work for normal java apps can be done with clojure as well, since in the end it's all bytecode, you just require the one extra chunk that's made up of the clojure.jar and probably contrib to get your baseline to make things work.