Well, this is obvious, but I would like to eliminate AOT and
distribution between units. This would give advantage over non-
functional languages like C++/Java since functions in Clojure should
be treated just like any other value. Currently they are handicapped.

Right now I can imagine that implementation would look like this. Each
function has it own raw input form (string which is parsed by clj
reader). On serialization, that raw form would be serialized and
received on the other unit. With first call, such deserialized
function would check if it is compiled, if not then it compiles its
raw form then executes it.

There is still one issue - dependences from modules used by serialized/
deserialized function. The solution for that is fact that each
function before serialization is compiled. During this compilation
process the list of class dependences would be included with such
function. Now during deserialization process RMI classloader would
automatically import all dependences. To decrease overhead due to raw
form and list of dependences each definition of such serializable
function had to be somehow marked just like all values are marked with
"implements Serializable" in Java.

On 11 Maj, 12:28, Konrad Hinsen <konrad.hin...@fastmail.net> wrote:
> On 11.05.2010, at 11:42, Michael Jaaka wrote:
>
> > Since in Clojure 1.2 all data structures are serializable and Clojure
> > is homoiconicity language. Why don't make functions serializable? I'm
> > trying to pass function with RMI and execute in on the second REPL.
>
> I didn't try this myself yet, but my understanding is that is possible to 
> serialize functions with Clojure 1.2. However, this requires that the JVM 
> that serializes and the JVM that deserializes use the same class files. In 
> practice, this means you have to AOT compile your code and use the same class 
> (or jar) files everywhere.
>
> Konrad.
>
> --
> 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 
> athttp://groups.google.com/group/clojure?hl=en

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