"Clojure is FAST"

2009-08-15 Thread fft1976
On Aug 15, 2:00 am, Meikel Brandmeyer wrote: > Hi, > > Am 14.08.2009 um 02:56 schrieb fft1976: > > > With type hints, you can get Java (?) code to run EXACTLY the same > > speed as Java, so Clojure is FAST. > > I think there is a simple misunderstanding here. &g

Re: Can Clojure be as fast as Java?

2009-08-14 Thread fft1976
On Aug 12, 1:30 am, Nicolas Oury wrote: > Next laziness was thought to be too slow to be practical, and now > someone used ghc in this thread as an example of fast language. There is a lot of misinformed people (and fanboys who are not misinformed but willing to "exaggerate", putting it charita

Adding optimizations to Clojure

2009-08-14 Thread fft1976
On Aug 13, 9:57 pm, Daniel Lyons wrote: > the code is open source and the techniques for adding   > optimizations to compilers are well known. So marshall your impulses   > for the good and we'll all benefit. It does seem that the optimizations Andy Fingernut did by hand are pretty braindead, a

Re: Transcript of Rich's "Clojure for Lispers" talk uploaded

2009-08-13 Thread fft1976
I was just watching that earlier. Here's an interesting part (as per earlier discussion). http://blip.tv/file/1313503 56:00 With type hints, you can get Java (?) code to run EXACTLY the same speed as Java, so Clojure is FAST. P.S. The moderators (Chouser) are now censoring my posts, so if you d

Re: Can Clojure be as fast as Java?

2009-08-12 Thread fft1976
On Aug 12, 2:25 am, Piyush Ranjan wrote: > This is a troll question. I have seen similar questions posted on other > forums about languages like ruby, CL, Haskell, Prolog, C, C++, fortran, > bigloo(?) etc by the same poster. > > Try this link:http://www.google.co.in/search?q=fft1

Re: Can Clojure be as fast as Java?

2009-08-11 Thread fft1976
On Aug 11, 7:39 pm, Chas Emerick wrote: > can to help -- but please don't assume that everyone else in the   > community shares your specific priorities. Why are you implying that that I assume that? You are replying to a message where I wrote that one should not assume others' priorities. --~

Re: Can Clojure be as fast as Java?

2009-08-11 Thread fft1976
On Aug 11, 5:19 pm, Daniel Lyons wrote: > I agree with him that unadorned   > functional code should perform well Huh?! Andy, can you explain to him what needs to be explained? I'm all out of politeness for today. --~--~-~--~~~---~--~~ You received this message

Re: Pure-functional N-body benchmark implementation

2009-08-11 Thread fft1976
On Aug 11, 2:26 pm, Andy Fingerhut wrote: > As always, suggestions or improved versions are welcome. I noticed that when I wrap ~new-mass in (double ...) in this (defmacro set-mass! [p new-mass] `(aset ~p 0 ~new-mass)) and other setters, I get warnings. --~--~-~--~~~--

Re: Can Clojure be as fast as Java?

2009-08-11 Thread fft1976
On Aug 11, 2:24 pm, tmountain wrote: > Well, the question posed in the subject is whether Clojure can be as > fast as Java. The question was: "If you use Java's arrays and declare all types, should Clojure be as fast as the equivalent Java?" I'm sorry if the current subject line appears ambiguou

Re: Can Clojure be as fast as Java?

2009-08-11 Thread fft1976
On Aug 11, 1:50 pm, Stuart Sierra wrote: > > I agree wholeheartedly.  Let's optimize wherever possible, but drop on > the side-by-side comparisons. > I think it's very immature to dictate to others what should be important to them. Speed may be of minor concern to some Ruby-on-Rails types, but

Re: Can Clojure be as fast as Java?

2009-08-11 Thread fft1976
On Aug 11, 1:09 pm, tmountain wrote: > Yes, Clojure can be just as fast as Java. Then why is Andy's code 10x slower? > There's an example on the > Clojure website that illustrates this. > http://clojure.org/java_interop I've seen that. There is a difference between "I can come up with two snip

Re: Can Clojure be as fast as Java?

2009-08-11 Thread fft1976
On Aug 11, 12:02 pm, ataggart wrote: > On Aug 11, 11:55 am, fft1976 wrote: > > > I feel that this question is important enough to warrant its own > > thread. > > http://groups.google.com/group/clojure/search?group=clojure&q=%22as+f... > Sounds like you are s

Can Clojure be as fast as Java?

2009-08-11 Thread fft1976
I feel that this question is important enough to warrant its own thread. If you use Java's arrays and declare all types, should Clojure be as fast as the equivalent Java? I had taken this for granted, but empirical evidence indicates otherwise: Andy's version of the Nbody benchmark still appears

Re: Pure-functional N-body benchmark implementation

2009-08-11 Thread fft1976
On Aug 11, 4:50 am, Jonathan Smith wrote: > I don't think you have to put *everything* in the let, just your > constants. (so days per year and solar mass, the bodies themselves). How will they "escape" from the LET though? I see that in your code everything is inside a LET. That's what I tried

Re: binary serialization

2009-08-11 Thread fft1976
On Aug 11, 8:15 am, John Harrop wrote: > Which in turn gives us this, otherwise sorely lacking from the Java standard > library, but much less useful to us Clojurians who tend to mainly use > immutable objects: > > (defn deep-copy [obj] >   (thaw (freeze obj))) Somebody should benchmark that vs

Re: binary serialization

2009-08-11 Thread fft1976
On Aug 11, 8:36 am, John Harrop wrote: > System.identityHashCode() and IdentityHashMap. These use a hash that > respects reference equality. So one in fact can implement one's own > serialization that is O(n) using O(1) hashmap lookups (and using reflection, > and not working if SecurityManage

Re: Pure-functional N-body benchmark implementation

2009-08-11 Thread fft1976
On Aug 11, 2:25 am, fft1976 wrote: > Hmmm > > I just ran your version #8, and it's almost as slow as mine > (nbody_v2.clj): 53 times slower than Java, but I'm running Clojure 1.0 > and Strike that. I f'ed up the namespaces and was actually measuring my own ve

Re: Pure-functional N-body benchmark implementation

2009-08-11 Thread fft1976
On Aug 11, 12:39 am, Andy Fingerhut wrote: > On Aug 10, 11:50 pm, Christophe Grand wrote: > > > Hi Andy, > > > On Tue, Aug 11, 2009 at 8:15 AM, Andy Fingerhut < > > > andy_finger...@alum.wustl.edu> wrote: > > > I've tried an approach like you suggest, using mutable Java arrays of > > > doubles

Re: Pure-functional N-body benchmark implementation

2009-08-11 Thread fft1976
On Aug 11, 12:39 am, Andy Fingerhut wrote: > > http://github.com/jafingerhut/clojure-benchmarks/blob/9dc56d8ff53f0b8... > Why isn't the array-using version as fast as Java? Shouldn't using Java's data structures, mutation and no reflection supposed to be equivalent to using Java? --~--~

Re: Pure-functional N-body benchmark implementation

2009-08-11 Thread fft1976
On Aug 10, 11:42 pm, Jonathan Smith wrote: > The way your code is setup, you will spend a lot of time in funcall > overhead just because you used a lot of functions instead of doing the > calculation in bigger chunks. I thought, as I understood from Rich's lectures, JVM inlines whatever it want

Re: binary serialization

2009-08-10 Thread fft1976
On Aug 10, 8:19 pm, "Kyle R. Burton" wrote: > > Does all this work with cycles, Java arrays, etc.? > > It will work with anything that implements the Serializable interface > in Java.  Arrays do implement that interface, as do all the > primitives.  With respect to cycles, I'd suspect it does, bu

Re: binary serialization

2009-08-10 Thread fft1976
On Aug 10, 7:57 pm, "Kyle R. Burton" wrote: > On Mon, Aug 10, 2009 at 10:42 PM, Kyle R. Burton wrote: > >> Is there a way to do binary serialization of Clojure/Java values? > >> ASCII (read) and (write) are nice, but they are wasting space, > >> truncating floats and are probably slow compared to

Re: Pure-functional N-body benchmark implementation

2009-08-10 Thread fft1976
On Aug 10, 2:19 pm, Jonathan Smith wrote: > 1.) use something mutable > 2.) unroll all the loops (mapping is a loop) > 3.) try not to coerce between seq/vec/hash-map too much. Are you saying this w.r.t. my code or in general? If the former, be specific, better yet, show us your code. I avoided (

creating classes in Clojure

2009-08-10 Thread fft1976
Is there a way to create a Java class (not instance) in Clojure without writing actual Java? e.g. public class person { public string name; public int num_children; public double weight; } --~--~-~--~~~---~--~~ You received this message because you are subscr

binary serialization

2009-08-10 Thread fft1976
Is there a way to do binary serialization of Clojure/Java values? ASCII (read) and (write) are nice, but they are wasting space, truncating floats and are probably slow compared to binary serialization. --~--~-~--~~~---~--~~ You received this message because you are

Re: Pure-functional N-body benchmark implementation

2009-08-10 Thread fft1976
On Aug 10, 5:15 pm, Andy Fingerhut wrote: > OK, I've got a new Clojure program for the n-body benchmark, and it is > significantly faster than my previous one -- down from 138 x Java run > time, to 37 x Java run time.  Still room for improvement somewhere > there, I'm sure, including perhaps us

Re: Pure-functional N-body benchmark implementation

2009-08-10 Thread fft1976
On Aug 10, 4:46 am, Jarkko Oranen wrote: > I'm not going to start optimising, Somebody'd better! You always hear this dogma that one should write "elegant" code first and optimize later, and when you do that, a few little changes can make Clojure as fast as Java. Here's your chance to show it

Pure-functional N-body benchmark implementation

2009-08-10 Thread fft1976
I just uploaded to the group an implementation of the n-body benchmark in Clojure (see nbody_init.clj) http://shootout.alioth.debian.org/u32/benchmark.php?test=nbody&lang=java&box=1 My goal was to write a pure-functional version and to avoid any micro- optimizations. There are no type declaratio

Re: Clojure without Rich Hickey

2009-08-01 Thread fft1976
On Aug 1, 7:24 pm, Chouser wrote: > On Sat, Aug 1, 2009 at 6:22 PM, Vagif Verdi wrote: > > > Since i'm using clojure in my business i got worried at a sudden > > thought what would happen to clojure if Ruch calls it a day. > > If Rich quit working on Clojure for whatever reason, it > would be a h

Re: Clojure without Rich Hickey

2009-08-01 Thread fft1976
On Aug 1, 3:22 pm, Vagif Verdi wrote: > Today i saw the > announcementhttp://groups.google.com/group/Qilang/browse_thread/thread/592773c562... > that the creator and maintainer of  another modern lisp dialect Qi > closed the shop and went to India. The guy certainly has some self-image: """ An

Re: Clojure performance tests and clojure a little slower than Java

2009-07-28 Thread fft1976
On Jul 28, 8:26 pm, Berlin Brown wrote: > On Jul 28, 2:37 pm, fft1976 wrote: > > > Thanks, AndyF for writing the code! I'm glad someone's done a > > comparison of idiomatic code instead of making unsubstantiated claims. > > Are you implying that my claims ar

Re: Clojure performance tests and clojure a little slower than Java

2009-07-28 Thread fft1976
Thanks, AndyF for writing the code! I'm glad someone's done a comparison of idiomatic code instead of making unsubstantiated claims. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this grou

Re: Does anyone need any clojure work done?

2009-07-07 Thread fft1976
On Jul 7, 10:18 pm, ataggart wrote: > After having spent the last decade doing server-side java, lots of > infrastructure level code which I enjoy), and going blind on xml, I'd > really like to get more into clojure. > > I've been playing with it off and on for about a year now, reading > whateve

Re: loneclojurian at ICFP programming contest

2009-07-07 Thread fft1976
On Jul 6, 6:08 pm, Bradbev wrote: > On Jul 6, 4:30 pm, fft1976 wrote:> On Jul 5, 11:42 pm, > Bradbev wrote: > > > > more to modern x86 chips.  After you have the best algorithm for the > > > job, you very quickly find that going fast is entirely bound by memory

Re: loneclojurian at ICFP programming contest

2009-07-06 Thread fft1976
On Jul 5, 11:42 pm, Bradbev wrote: > more to modern x86 chips.  After you have the best algorithm for the > job, you very quickly find that going fast is entirely bound by memory > speed (actually latency) - cache misses are the enemy. IME (outside JVM), this depends strongly on the kind of pro

Re: loneclojurian at ICFP programming contest

2009-07-05 Thread fft1976
On Jul 5, 10:53 am, igorrumiha wrote: > I think it's safe to say that once again it's proved that Clojure > easily matches the Java level of performance. I think one shouldn't generalize from one [unverified] example. Personally, I'll wait for Jon Harrop or someone to port the relevant Shootou

Re: loneclojurian at ICFP programming contest

2009-07-05 Thread fft1976
On Jul 5, 2:31 am, Nicolas Oury wrote: > After, when I run the benchmark in -server with a big enough CacheCode area > (1000m), and enough iterations to have everything JITed, I get more than > 860.000 iterations per second. (I benchmarked 100 000 000 iterations in 121 > sec, on my 2.4GHz comput

Re: loneclojurian at ICFP programming contest

2009-07-04 Thread fft1976
On Jul 3, 5:52 pm, Jon Harrop wrote: > On Thursday 02 July 2009 07:58:11 you wrote: > > > I wonder if Jon Harrop is still planning to write Clojure for > > Scientists or Scala for Scientists or both? > > I am certainly interested in writing both books. I reviewed Scala back in 2007 > and decide

Re: loneclojurian at ICFP programming contest

2009-07-02 Thread fft1976
On Jul 2, 1:01 am, Daniel Lyons wrote: > On Jul 2, 2009, at 12:58 AM, fft1976 wrote: > > > On Jun 30, 3:02 pm, igorrumiha wrote: > > >> Some people claim > >> that the JVM can give you C-like performance, but I would be more   > >> than > >&g

Re: loneclojurian at ICFP programming contest

2009-07-01 Thread fft1976
On Jun 30, 3:02 pm, igorrumiha wrote: > Some people claim > that the JVM can give you C-like performance, but I would be more than > happy if I got my VM to be 10x slower than the C ones :) I like your honesty! You can come to my house and * my sister! I wonder if Jon Harrop is still plannin

Re: Foreclojure

2009-07-01 Thread fft1976
I just changed my mind about releasing this. If anyone wants to use the name, it's yours! On Jun 25, 12:17 am, Emeka wrote: >  accounting software in Clojure? > Which area of accounting will it cover? > > Emeka > > On Thu, Jun 25, 2009 at 3:41 AM, fft1976 wrote: >

Re: loneclojurian at ICFP programming contest

2009-07-01 Thread fft1976
On Jul 1, 1:10 pm, igorrumiha wrote: > On Jul 1, 8:25 pm, fft1976 wrote: > > > On Jun 30, 3:02 pm, igorrumiha wrote: > > > > According to some of the people on the #icfp-contest channel my > > > VM implementation is 500x to 1000x slower than a typical > &g

Re: loneclojurian at ICFP programming contest

2009-07-01 Thread fft1976
On Jun 30, 3:02 pm, igorrumiha wrote: > According to some of the people on the #icfp-contest channel my > VM implementation is 500x to 1000x slower than a typical > implementation written in C. It is, on the other hand, in the same > performance range as some VMs written in Python. On Jun 30,

Re: loneclojurian at ICFP programming contest

2009-06-30 Thread fft1976
On Jun 30, 3:02 pm, igorrumiha wrote: > Greetings everyone, > > I didn't actually plan it but I ended up participating in the ICFP > programming contest (http://www.icfpcontest.org). This year the task > was to move satellites from one orbit to another, to meet with other > satellites etc. Quit

Re: Clojure for Scientific and other CPU-intensive Computing

2009-06-30 Thread fft1976
On Jun 30, 12:55 am, Daniel Lyons wrote: > I don't see why that wouldn't be the case, if you were using Java's   > native multidimensional arrays. I don't think it would be as much fun,   That's my point. It's often argued that you can just optimize the teeny "bottleneck" by adding type declara

Re: Clojure for Scientific and other CPU-intensive Computing

2009-06-29 Thread fft1976
On Jun 29, 1:39 pm, Richard Newman wrote: > > I would be curious to know if anyone is using Clojure for CPU- > > intensive work where performance really counts. > > Respectfully, I wouldn't class telephony as "non-CPU-intensive". :) I would have thought those kinds of things are bandwidth-limite

Clojure for Scientific and other CPU-intensive Computing

2009-06-29 Thread fft1976
Based on the recent survey "What are people using Clojure for?", people are mostly using it for non-CPU-intensive work, like parsing, report generation, GUIs, "glue" code. It's been argued by some that Clojure is as fast as Java, because at worst, you can implement your bottlenecks in Java. I hav

Re: Convincing others about Clojure

2009-06-26 Thread fft1976
On Jun 24, 11:38 pm, Konrad Hinsen wrote: > I'd reply that you can always fall back to Java for time-critical   > stuff. Is this really relevant? You may fall back to Java for some of your procedure implementations, but your data structures that they need to work on would be the dynamically typ

Foreclojure

2009-06-24 Thread fft1976
I know some of you are searching for names for your projects. I just wanted to say that "Foreclojure" is taken! This will be an open-source (but not GPL) accounting software in Clojure. Stay tuned. --~--~-~--~~~---~--~~ You received this message because you are subs

Re: How to call function (or Java method) using string name?

2009-04-27 Thread fft1976
On Apr 26, 9:21 am, Stuart Sierra wrote: > "resolve" will find the Var > that is named by the symbol.   Can there be Vars without names? Can I have a vector of Vars? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: ICFP 2009

2009-04-22 Thread fft1976
On Apr 22, 4:55 am, Rich Hickey wrote: > > I think it would be great if a Clojure team could have a go. > > Rich Interestingly, in the 11 year history of the ICFP contest, a Lisp variant never won, not even a third prize (unless you consider Dylan a Lisp), and not for lack of trying. http://en

Re: On Stuart's Book

2009-04-20 Thread fft1976
On Apr 19, 3:20 am, Antony Blakey wrote: > If I use Clojure commercially, I'll certainly pay for it. Please do not forget to pay for JVM, Java, Linux, tar and others. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Ctrl-C terminates REPL

2009-04-13 Thread fft1976
Pressing Ctrl-C terminates the REPL and not the evaluation/editing. Is this the intended behavior? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegr

Re: Has anyone on this group ever tried Forth?

2009-04-11 Thread fft1976
On Apr 10, 12:13 am, CuppoJava wrote: > Hi everyone, > I was browsing through webpages and the language Forth caught my eye. > Reading through it's supposed advantages it sounded very interesting, > and I was wondering if anyone here has any experience with it, and can > comment. > > I'm asking

compare bug?

2009-04-11 Thread fft1976
user=> (doc compare) - clojure.core/compare ([x y]) Comparator. Returns 0 if x equals y, -1 if x is logically 'less than' y, else 1. Same as Java x.compareTo(y) except it also works for nil, and compares numbers and collections in a type-independent manner. x must i