On Tue, Jan 7, 2014 at 4:26 PM, Dave Tenny <dave.te...@gmail.com> wrote:
> 1) When and under what circumstances projects are compiled in  source versus
> .class form?

Most Clojure projects ship in source form (and are therefore compiled
to bytecode on demand as they are loaded).

> 2) Why there is no project.clj in the org.clojure jar file?

It's built with Maven. As are most of the Clojure contrib libraries
too, although some are now starting to sport project.clj files to make
local development easier. In the last round of development, I added
Leiningen support to clojure.java.jdbc to make it easier to "jack in"
with Emacs and test the code. It still uses Maven for primary testing
(on build.clojure.org) and packaging - and Clojure plus its contrib
libraries are hosted on Maven Central (where they are retrieved
primarily by Leiningen into other Clojure projects).

> 3) When the clojure 'compile' function comes into play in your typical
> clojure project deployments? (vs. :aot targets or other leiningen deployment
> techniques).

At World Singles, we AOT compile very little of our code. We only AOT
namespaces that generate Java-compatible classes for situations where
we must be natively callable from Java (e.g., we have a log4j appender
written in Clojure). Within that AOT-compiled code, we require
namespaces and resolve symbols dynamically (at runtime) to bind the
Java-called code to the rest of our code base.

Part of the reason is for the flexibility that source deployments
provide: the ability to REPL into a live, running process and reload
code from updated source files without needing to "stop the world",
for example.

If you're relatively new to Clojure, I'd recommend completely ignoring
the whole "compilation" thing unless you specifically need to generate
natively callable code for Java to Clojure interop.

In case anyone is interested, our pattern for bridging from the
AOT-compiled namespace to the rest of the code base tends to look like
this:

(def the-symbol
  (delay
    (do
      (require 'the.namespace)
      (resolve (symbol "the.namespace/the-symbol")))))

and then:

  ... (@the-symbol arg1 arg2) ...

Our AOT-compiled layer is deliberately minimal and serves only to
provide the Java-callable API so the rest of our code can be developed
and tested in our normal interactive, incremental way.
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to