> A certain proportion of new clojure users are coming from > non-Java/non-JVM backgrounds. To them, "how do I make an executable" > is a perfectly valid question. And "clojure doesn't do executables" > isn't a particularly encouraging answer (not even if you blame Java > for it :-)) Classpaths, server vs client JVMs, ant/maven, all of these > are confusing hurdles to get over if you don't have any Java > experience.
Thanks Paul, you get it. :-) To Mike: I of course know what a jar file is, but your nitpicking at my choice of words of "executable" is unhelpful, abrasive, and totally counterproductive. A jar file with a main class is the pretty much an executable for all intents and purposes. The question "how do I make an executable from my source code in Clojure?" is, as Paul points out, a perfectly valid question that newbs to Clojure *will ask*, and they need a good answer. Not "there's not such thing as an executable you n00b! Bah humbug!" BTW, I really like Paul's Q&A's, how would one go about getting something like that on either clojure.org or the Assembla wiki? - Greg On Jun 28, 2010, at 4:02 PM, Paul Moore wrote: > On 28 June 2010 19:49, Mike Meyer > <mwm-keyword-googlegroups.620...@mired.org> wrote: >>> Yet another set of choices n00bs are faced with is figuring out how >>> to actually compile their source into an executable. >> >> Executable? We're talking about Java here. It doesn't do executables - >> it does jar files. There's little reason to build those as a newb, as >> it's not noticeably harder to run the source than it is to run a jar >> file - or to import them if you're building libraries. > > We're not talking about Java here, we're talking about clojure! > > A certain proportion of new clojure users are coming from > non-Java/non-JVM backgrounds. To them, "how do I make an executable" > is a perfectly valid question. And "clojure doesn't do executables" > isn't a particularly encouraging answer (not even if you blame Java > for it :-)) Classpaths, server vs client JVMs, ant/maven, all of these > are confusing hurdles to get over if you don't have any Java > experience. > > For such people, introductory clojure material needs to (a) assume no > JVM/Java knowledge, and (b) provide some guidance for how to interpret > the inevitable Java terminology that a newcomer will encounter. For > example: > > Q: How do I make an executable in clojure? > A: Clojure scripts can be executed in a similar manner to scripting > languages like Python or Perl - clj myscript.clj. [Note: a standard > clj wrapper script should be supplied with clojure!] However, even > when executed like this, clojure code is compiled (for more details > read up on JVM bytecode, and the Java "just in time" compilers). You > can compile clojure code into a "jar" file - which is a JVM executable > format which can be run using the "java" command (insert reference to > more detailed explanation here). More or less self-contained formats > (bundling dependencies, or hiding the invocation of the "java" > command) are possible, but are generally reserved for more specialised > applications. > > Q: What are ant, maven? > A: JVM build systems, commonly used in the Java world. The clojure > community is beginning to standardise on Leiningen (insert reference > here) which uses a more clojure-like language for describing builds, > but which works with the existing ant/maven infrastructure (so all of > the existing libraries available via these tools are available for > free in Leiningen). > > If these examples are useful, feel free to add them to a FAQ or newbie > documentation. > > Paul. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en