I don't think option 2 would take that long. Even my clojure startup is not half a second on a modern machine.
On May 27, 10:29 pm, Jason Smith <ja...@lilypepper.com> wrote: > The issue that you'll run into is that there is one lexical scope that > is shared by all calls toClojure. The only ways around this are (1) > run it in another process, and (2) load theClojureJARs into a > ClassLoader at runtime, and throw the ClassLoader away after every > call. > > The overhead for option 2 is between 0.5 and 1 second per call, > becauseClojurehas to be re-inited. For option 1, it's even more > because you are starting Java, then initing Java. > > Threads have nothing to do with theClojurelexical scoping. If you > run 100 threads, they normally all share the same variables, > namespaces, and functions. > > For more info, you can check > outhttp://sandflea.googlecode.com/svn/site/maven-clojure-plugin/1.1.0/cl... > (http://code.google.com/p/sandflea/source/browse/maven-clojure-plugin/ > trunk/clojure-commons/src/main/java/sandflea/clojure/scripting/ > ClojureScripting.java). > > On May 27, 3:46 pm, BerlinBrown <berlin.br...@gmail.com> wrote: > > > I enjoyclojureand I think I am breaking all the rules. I have an > > app that I originally created inclojure. It has been a year off and > > on. And I merged that code with some existing java database code. > > > Theclojurecode invokes the java code. Now, I want to have a script > > environment where users can invoke their ownclojurecode. But I was > > think theclojurecode should run in a completely new, separate > > environment, via a thread. > > > Basically. > > > 1.Clojureis invokved (clojure.main) > > 2. I haveclojurecode that invokes code originally written in Java > > 3. That java code creates another separateclojureinstance, parsing a > >clojurescript. (an embedded dsl) > > > It isn't that confusing. It is almost akin to invoking a JSP page > > from a running web server. -- 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