On Thu, 9 Sep 2010 16:35:15 +0100
Bruce Durling <[email protected]> wrote:
> Mike,
>
> If you are happy with cgi and if we posit that clojure is a compiled
> language and leiningen is the same as make. The I submit the following
> bit of fluff:
>
> At a prompt:
>
> $ lein new hw
> $ cd hw
> $ lein deps
>
> Then edit project.clj to look as follows:
>
> (defproject hw "0.0.1"
> :description "The smallest hello world that will work."
> :dependencies [[org.clojure/clojure "1.2.0"]
> [org.clojure/clojure-contrib "1.2.0"]]
> :aot [hw.core]
> :main hw.core)
>
> Then edit hw/core.clj as follows:
>
> (ns hw.core
> (:gen-class))
> (defn -main [& args] (println "Hello World."))
>
> At a prompt:
>
> $ lein uberjar
>
> And create the following shell script hw.sh
>
> #! /bin/bash
> java -jar hw-0.0.1-standalone.jar
>
> I'm sure you can wire the shell script into your apache. And this
> isn't as short as a shell/python/perl script that does print or echo.
>
> I also fear this is descending into perl golf, but I fancied having a
> crack at this anyway on a brain fried day.
Yup, and I've seriously thought about something like that. Two issues:
my measurements show that using a jar doesn't really improve runtime
that much. The other is that, lein works sorta-kinda like make. I like
make. But as I just posted, I don't use it for one-file programs or
programs that don't need building. That doesn't seem to be possible
with lein.
<mike
--
Mike Meyer <[email protected]> http://www.mired.org/consulting.html
Independent Network/Unix/Perforce consultant, email for more information.
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en