Has anyone thought about a Lisp dialect that uses white space, like Python, to get rid of the ()?
Oh wait, you can just use a gradient of colors instead of random ones, with the more-nested paren pairs having colors farther in on the gradient. Silly me.
Good idea! Is it doable in VIM now? :|
For example, I don't see how (map (fn [x] (+ x 2)) (concat (take 5 my-series) etc...)) could be broken down with indentation alone without taking quite a few extra lines.
The biggest portion of the code was the bitmap/image manipulation libraries. Excluding those, it was about the same size.
You can see my videos at: http://www.youtube.com/watch?v=S1ZPSbImvFE http://www.youtube.com/watch?v=-_VFZ_ON0A8 http://www.youtube.com/watch?v=VbyQomrJSeU
Due to time constraints (I underestimated the time it would take to write a fast bitmap/polygon library) I only let those simulations run for ~1 hr each.
Yes. That means lambdas can be the cause of memory leaks.
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 know very little about Clojure, but that seems like a huge problem for Clojure, and other functional-ish JVM languages. Is it?
I've used Rhino (JavaScript on JVM) extensively, and I don't think it suffers from this.
The individual closures created as code executes are GC'ed like everything else.
Since eval is rather specialized, and everyone recommends it be avoided in "normal" code, this is not a major problem.
Plus, it is fixed.
- Comment from cgrand at the bottom of the article.
I advocate tracking down people from Sun and asking them in a personable, friendly tone of voice to please fix this kind of problem. On their front lawns.
http://markmail.org/message/axarlob7wwmnm2xe#query:clojure%2...
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.
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.
It seems an out dated idea today to have a separate space/special rules for generated code versus the rest of the heap - I think other VMs like JRockit didn't do that and didn't have that issue.
Although - I think the class/classloader relationship is in the spec, so to allow easy GC of generated classes you need to have 1 to 1 with classloaders (I hear that all this is going to change anyway to reflect how people really use things).
In response to this problem, Clojure now uses an ephemeral classloader. I don't know the JVM that well, but Rich Hickey says this means the anonymous classes generated by evaling fn forms can be collected.
Incidentally, now I want to learn clojure :).
I'm also working on genetic programming in Clojure, and with the PermGen fix in rev. 1232, it seems to be a great tool for the job.
I'm glad that got you interested in Clojure!
Credit and originality goes to : http://rogeralsing.com/2008/12/07/genetic-programming-evolut...
He was just using it as a demonstration of Clojure, nothing more.
Read the article before criticizing.
http://www.genetic-programming.com/coursemainpage.html
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.
http://www.scholarpedia.org/article/Evolutionary_programming
Neat.