For the past week or two, I've been investigating what it would take
to write something that would allow *.clj  and *.java files to
seamlessly compile together, such that they could be freely intermixed
in a project. I knew it was a difficult problem, but I think the
adoption benefits would be substantial, and the benefits huge for
those stuck in Java-land at work.

My conclusion (and *please* tell me if I'm missing something) is,
unfortunately, that the problem requires full compiler support from
both ends. Either a new compiler needs to be written that can compile
both Clojure and Java, or the existing Java/Clojure compilers need
some fairly extensive patching to make this possible, to share a
dependency graph and symbol tables.

The exception would be if it were possible to simply "pass through"
class references when compiling *.clj files to *.class files, and not
resolve them until run-time (or perhaps a seperate "resolution" phase
of the compile process, for more compile-time safety). I realize this
can't be done for dependencies between Clojure source files, since
macro definitions are required at compile time. But is there any
reason you couldn't do this for Java references from Clojure files?

Then, it'd be very easy - just compile all the Clojure, put the
classes in the classpath, and compile the Java.

Any thoughts?



-- 
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

Reply via email to