Re: Compilation troubles...

2009-07-13 Thread Jonathan Smith
On Jul 13, 5:51 pm, Morgan Allen wrote: > > It's definitely not necessary to implement the bulk of your code in Java to > > get performance. On the other hand, getting performance out of Clojure can > > be tricky. > > Well, yeah, that's the thing- getting maximal performance out of > clojure se

Re: Compilation troubles...

2009-07-13 Thread Morgan Allen
> It's definitely not necessary to implement the bulk of your code in Java to > get performance. On the other hand, getting performance out of Clojure can > be tricky. Well, yeah, that's the thing- getting maximal performance out of clojure seems to require a degree of expertise and patience tha

Re: Compilation troubles...

2009-07-13 Thread John Harrop
On Mon, Jul 13, 2009 at 3:11 PM, Morgan Allen wrote: > It's a shame about the lack of official support for java-side > invocation- the bulk of my code is still implemented in java (largely > for efficiency reasons), so it would be handy to be able to initiate > things largely from that side. It

Re: Compilation troubles...

2009-07-13 Thread Rayne
Hrm, I've never found it all that hard to type "ant" when I want my code compiled. :p I will admit, when I first used ant, I was scared to death because of stuff I had heard about it. I actually had fun using it. On Jul 13, 2:11 pm, Morgan Allen wrote: > > OK, cool. That is another benefit of A

Re: Compilation troubles...

2009-07-13 Thread Morgan Allen
> OK, cool. That is another benefit of AOT compilation. The primary use   > for :gen-class is when the Java side needs a class it can refer to   > explicitly by name. For other cases, a good way for Java to   > communicate with Clojure code is to use a proxy. On the Java side, you   > can define

Re: Compilation troubles...

2009-07-13 Thread Stephen C. Gilardi
On Jul 13, 2009, at 11:45 AM, Morgan Allen wrote: The speed difference isn't the main thing- but I *was* under the impression that the only way for java to communicate with clojure was using AOT class compilation. OK, cool. That is another benefit of AOT compilation. The primary use for :ge

Re: Compilation troubles...

2009-07-13 Thread Morgan Allen
> What is your development workflow that requires frequent manual   > recompilation? All Clojure source code is compiled "just in time" as   > it's being loaded and before it's run. What "ahead of time"   > compilation gets you is faster loading times and the ability to deploy   > in a "class file

Re: Compilation troubles...

2009-07-13 Thread Stephen C. Gilardi
On Jul 12, 2009, at 4:41 PM, Morgan Allen wrote: Fair enough. However, what I had in mind was that I could simply compile one namespace that would then act as a sort of 'bootstrap loader' for other clojure source, so that I wouldn't have to recompile manually all the time. Rayne's suggestion

Re: Compilation troubles...

2009-07-13 Thread Rayne
I suggest writing a short ant build file to automate building your project, that way you don't have to type all that stuff! I wrote a little build.xml file for a project I'm working on. You should be able to extend it to fit your project. I also suggest looking at Clojure and Clojure-contrib's own

Re: Compilation troubles...

2009-07-12 Thread Morgan Allen
> Note that no matter how you specify it, it must be in classpath and it   > must exist at the JVM used by Clojure is launched. Thanks again. > Absolutely. Note that you're compiling a namespace, not a file. Any   > namespaces you use or require while defining your namespace will also   > be co

Re: Compilation troubles...

2009-07-12 Thread Stephen C. Gilardi
On Jul 12, 2009, at 7:28 AM, Morgan Allen wrote: Thanks for the info- it works just fine now. A couple of questions, though: 1- How would I change the 'classes' directory to something else? There are at least two ways: You can specify it as a property on the command line you use to launch

Re: Compilation troubles...

2009-07-12 Thread Morgan Allen
Thanks for the info- it works just fine now. A couple of questions, though: 1- How would I change the 'classes' directory to something else? 2- Can I still use/require other files that haven't been compiled ahead of time? Much obliged. --~--~-~--~~~---~--~~ You

Re: Compilation troubles...

2009-07-11 Thread Meikel Brandmeyer
Hi, Am 11.07.2009 um 15:12 schrieb alfred.morgan.al...@gmail.com: And get: java.io.IOException: No such file or directory (character.clj:5) (-line 5 is where the ns declaration is made.) What am I doing wrong here? The source as well as the classes directory must be on the classpath. I sug

Re: Compilation troubles...

2009-07-11 Thread Stephen C. Gilardi
On Jul 11, 2009, at 9:12 AM, alfred.morgan.al...@gmail.com wrote: java -cp clojure.jar clojure.main Followed by: (compile 'sov.sim.character) The directory containing "sov/sim/" and the compilation destination (which defaults to "classes") must also be in classpath. In your test, classpa

Compilation troubles...

2009-07-11 Thread alfred.morgan.al...@gmail.com
I'm really sorry to have to bring up this kind of newb question, but I just can't seem to get clojure compilation to work. The clojure file involved couldn't be simpler: (ns sov.sim.character (:gen-class)) (defn -main [greetee] (println (str "Hello world !"))) ...and that's it. It's in the s