TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Clojure: Genetic Mona Lisa problem in 250 beautiful lines

66 pointsby yndover 16 years ago

8 comments

tlrobinsonover 16 years ago
<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.
评论 #451134 未加载
评论 #451090 未加载
评论 #451553 未加载
dreishover 16 years ago
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.
评论 #451200 未加载
评论 #451781 未加载
ytersover 16 years ago
For those interested in GP, here is Koza's course page (pdfs &#38; 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>
smanekover 16 years ago
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.
评论 #451009 未加载
paulgbover 16 years ago
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 :).
评论 #451771 未加载
评论 #452487 未加载
biohacker42over 16 years ago
As python is beautiful, lisp is parenthesis-y.<p>Has anyone thought about a Lisp dialect that uses white space, like Python, to get rid of the ()?
评论 #451093 未加载
评论 #451057 未加载
评论 #451109 未加载
评论 #451051 未加载
评论 #452252 未加载
评论 #451284 未加载
评论 #451689 未加载
评论 #451176 未加载
peregrineover 16 years ago
I like this, it gives a clear set of code with a simple non important purpose.<p>Neat.
toodlestechover 16 years ago
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>
评论 #451446 未加载