There's lots of ways to 'eval' a script. One way is to embed something like LLVM, a compiler within the app, compile something, get back a function pointer and run it. This is what Cloudera Impala does to run real-time HiveQL queries. http://blog.cloudera.com/blog/2013/02/inside-cloudera-impala-runtime-code-generation/
You could also implement a clojure interpreter, which sounds interesting, too. What's the best bang for the buck? On Tue, Apr 23, 2013 at 4:37 PM, Steven Degutis <sbdegu...@gmail.com> wrote: > While this is certainly neat, it doesn't allow Clojure to be used as > an embedded scripting language inside an ObjC app. > > On Tue, Apr 23, 2013 at 2:50 PM, Gary Trakhman <gary.trakh...@gmail.com> > wrote: > > It's already possible via > https://github.com/takeoutweight/clojure-scheme > > > > Gambit scheme provides objective-C interop. The author demonstrated > this > > stuff at Clojure/West this year. One difference between your proposed > > approach is it's both compiled and highly optimized. > > > > > > On Tue, Apr 23, 2013 at 3:38 PM, Steven Degutis <sbdegu...@gmail.com> > wrote: > >> > >> Currently Clojure exists on the JVM, the CLR, and the JSVM. > >> > >> Why not put it on top of ObjC too? > >> > >> Then we could create stand-alone executables written in Clojure! Or it > >> could be used as an embedded scripting language. The ObjC runtime and > >> Foundation.framework are close enough to Java that it shouldn't be too > >> hard to port. > >> > >> Rather than compiling to bytecode, it would be interpreted at runtime > >> (like Python/Ruby). All dynamic class/method lookups and such would > >> have to be done via <objc/runtime.h> and libffi. > >> > >> And there's the obvious downside that this would really only be > >> beneficial for Mac OS X users (or people willing to put up with > >> GNUStep). But there are plenty of us to make this worth it. > >> > >> What do you all think of this specific idea? > >> > >> I'm willing to work on such a project in my spare time, since I have a > >> fair bit of knowledge about the ObjC runtime. But I have to admit I'm > >> not a Clojure expert, so it would be helpful if more Clojure people > >> were interested in helping out with such a project. > >> > >> Note: I've already looked into running ClojureScript via JS inside > >> JSCocoa, it's not feasible for many reasons that are out of the scope > >> of this topic; this post is specifically about porting Clojure to > >> ObjC. > >> > >> -Steven > >> > >> -- > >> -- > >> 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. > >> > >> > > > > -- > > -- > > 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. > > > > > > -- > -- > 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. > > > -- -- 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.