On Tue, 22 Jun 2010 10:46:05 -0400
Rich Hickey <richhic...@gmail.com> wrote:
> -----------
> The claim that this primitive stuff is just for numeric-intensive  
> applications is outrageous and false, and ignores the implementation  
> of Clojure itself to an embarrassing degree. I've worked my tail off  
> to reduce the number of allocations inside things like sequences etc  
> to the absolute minimum. Now down to 1 per step, and with chunks 1/32  
> per step. Moving from 1 to 2 or 3 per step would result in a 2x to 3x  
> slowdown for every consumer of these fns.

Actually, I've acknowledged that for a while. What I've been trying to
get (and that git clone from github fails for me has made hard to
measure myself) is some measurements of how much this costs real - but
non-numeric - applications. The one measurement posted was - IIRC -
10-20%.

> Everyone has to realize the math you are advocating for the default,  
> on non-tagged architectures like the JVM and CLR, *must* do an  
> allocation on every +/-/* etc operation. And such ops are littered  
> throughout non-numeric data structure code, for indexes, offsets,  
> bounds etc. Allocating on every math op in something like the  
> persistent vector would make it completely unusably slow.

I disagree with that first statement, and will point to python as the
counterexample. Like Clojure, it has immutable integers. It avoids the
issue of having to allocate for those ops some of the time by keeping
a table of the first N (tunable at interpreter build time) integers
that *all* instances of small integers point to. So 5 + 5 doesn't
allocate a new object, it returns a pointer to the pre-allocated 10 in
that table.

> Well, guess what, all of the things I've written in my career have  
> been hard bits. Those languages were unusable for any of my production  
> work, for performance reasons. I wrote Clojure so I could stop writing  
> Java and C#, not Ruby, because I couldn't have used Ruby in the first  
> place.

Which merely means that the language you're writing may not be the
language I want. No problem. Personally, given that the default is 64
bits, it's not nearly the issue it was when Python changed (when most
of the world used 32 bit ints). I just don't want to get stuck having
to use obviously second class names (or having to put up with errors
about "rebinding core functions") to get the math I want.

> Now you're all sitting on the end of the food chain, eating gazelles  
> and saying, 'who needs photosynthesis to be easy'?
> 
> ;-)
> 
> I do. And so do you if you appreciate fast gazelles. You wouldn't be  
> able to use a Clojure written in the default Clojure you are advocating.

Would it be Clojure if it didn't run on the JVM? Personally, I could
live without the JVM. And the more I learn about the JVM, the more I
could live without it!

On the other hand, the PyPy folks don't seem to be making much noise
either.

      <mike
-- 
Mike Meyer <m...@mired.org>             http://www.mired.org/consulting.html
Independent Network/Unix/Perforce consultant, email for more information.

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org

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