Hi, I think the reason for Ruby being so much slower is because it is an interpreted language rather than a compiled language. So when you run the program, a Ruby interpreter has to translate the instructions to machine code as they are running, instead of a compiled language like C where this is done at compile time.
As for my opinions on languages, most of my experience is with C/C++, but I have begun using Java recently. Java is what I am using for the Go program I am writing, mainly because even after years of using C++, I still find it easier and faster to code in Java (using Eclipse) than with C++. The OP mentioned that Java is slow, but I have actually read that in the recent years it has become comparably faster to C++, although I haven't tested this personally (I hope this isn't going to start a holy war between the Java and C++ people here). I have also done quite a bit of Perl programming, although it's use seems much more specialized that C++ or Java. I basically only use it in two situations: When I have to do a lot of processing with text, or when I want to create a program very quickly to perform a certain task and I don't care that I won't be able to understand what I wrote if I look at it a week later. Colin (I just joined this list last week, this is my first post) On Nov 20, 2007 9:58 AM, Chuck Paulson <[EMAIL PROTECTED]> wrote: > > > > > My 2 cents about languages. > > > > C is the universal "assembly language". I don't think I've ever used a > computer family that didn't have a C compiler on it (after C was invented of > course). Often new languages, to get started, will just translate into C > code and then compile with the C compiler. > > > > I wrote my first Go programs earlier this year. I first used Ruby and it was > short and easy to write. The GTP protocol (enough for CGOS) took only about > 1 page of code. However in timing tests, it could only do about 30 game > simulations per second. This was unacceptable and I abandoned Ruby. > > > > Next I translated the ideas into C++. Everything was more work, but I > anticipated a 10-20 times speed up so it seemed the tradeoff would be worth > it. After finishing, I did the same timing tests as with Ruby and it did > 9000 game simulations per second without much optimization. I knew, of > course, that Ruby is slower than C++ but a factor of 300 is amazing. It > helps to have explicit control of memory and mature C compilers that > generate fast code. > > > > I am still wondering how Ruby could be so much slower than C++. Perhaps this > problem is just not suited for Ruby. > > > > Chuck Paulson > > > _______________________________________________ > computer-go mailing list > computer-go@computer-go.org > http://www.computer-go.org/mailman/listinfo/computer-go/ > _______________________________________________ computer-go mailing list computer-go@computer-go.org http://www.computer-go.org/mailman/listinfo/computer-go/