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.