<i>"Lambdas are not garbage collected.<p>Yes. That means lambdas can be the cause of memory leaks.<p>As described by Charles Nutter, each lambda in Clojure is an anonymous class in Java. The problem is that classes are never garbage collected. They reside in a special place called the PermGen."</i><p>I know very little about Clojure, but that seems like a <i>huge</i> problem for Clojure, and other functional-ish JVM languages. Is it?<p>I've used Rhino (JavaScript on JVM) extensively, and I don't think it suffers from this.
In this thread:<p><a href="http://markmail.org/message/axarlob7wwmnm2xe#query:clojure%20permgen+page:1+mid:axarlob7wwmnm2xe+state:results" rel="nofollow">http://markmail.org/message/axarlob7wwmnm2xe#query:clojure%2...</a><p>Rich Hickey claims that the PermGen issue alleged in this article doesn't actually exist. A new class is created every time a (fn) is compiled, but only a new instance of that class is created each time it is invoked.<p>The only thing that generates a new class each time it is called is (eval), which as we all remember from reading our PG, is generally regarded as suspect when used in production code. Obviously you can see this effect at the Clojure REPL, however.
For those interested in GP, here is Koza's course page (pdfs & source):<p><a href="http://www.genetic-programming.com/coursemainpage.html" rel="nofollow">http://www.genetic-programming.com/coursemainpage.html</a><p>Koza "invented" GP. However, parent article is really describing Evolutionary Programming, invented by Fogel in the 1960s. The difference? Ostensibly, no crossover operator in EP, only mutation.<p><a href="http://www.scholarpedia.org/article/Evolutionary_programming" rel="nofollow">http://www.scholarpedia.org/article/Evolutionary_programming</a>
Incidentally, I wrote the same thing for a class recently in Common Lisp. See <a href="http://github.com/smanek/ga" rel="nofollow">http://github.com/smanek/ga</a><p>The biggest portion of the code was the bitmap/image manipulation libraries. Excluding those, it was about the same size.
In the informal algorithm description, it says "Create Children from the best programs by mating and mutating them". By mating, do you mean actually taking two (or more) "programs" and merging the contents? I looked over the code, but I don't know enough clojure to find any part that looked like it merged two programs.<p>Incidentally, now I want to learn clojure :).
This has already been done and much better at that. Don't give props to someone copying anothers work a half year after the fact.<p>Credit and originality goes to : <a href="http://rogeralsing.com/2008/12/07/genetic-programming-evolution-of-mona-lisa/" rel="nofollow">http://rogeralsing.com/2008/12/07/genetic-programming-evolut...</a>