From: William Djaja Tjokroaminata Date: 2002-09-29T11:30:23+09:00 Subject: Re: R Hi, Alan Chen wrote: > Ruby-C integration really isn't that complicated. In fact, from my use, Ruby > has one of the simplest C interfaces to a scripting language. It's even easier > if you use a tool like SWIG. I think it is true in general, but please see also my discussion with Paul Brannan in a topic with title "Object-Oriented struct Model in C". I probably will try SWIG when I am moving to C++. > I think you'll always have tradeoffs between speed, memory, and > usability. Assembly programmers know that hand written assembly is > often faster than compiler generated C. However, most asm programmers > will be the first to tell you, that it's usually not worth writing > code in all assembly, just the key performance bottlenecks. Agreed. In my case only the core will be (or is being) written in C. All the peripherals and interfaces are in Ruby. That's the current plan. R is for now just a (probably hypothetical) alternative that is being thought. > Trying to optimize for the general case is far more difficult that > optimizing for a specific application. If you read the Linux Kernel > list for example, you always see the scheduler and VM programmers > going back and forth on various optimizations -- for example, how do > you maximize IO transfers without knocking out interactive response on > other processes? The problem is that "performance" means vastly > different things in different applications. Agreed also. The current Ruby gc may be the best for general applications on average, but I feel my application would probably work best with a ref counting gc. > I think you're asking interesting questions which (if we can progress > toward answering them) might be valuable for everybody. However, I > also think you might make faster progress with your specific network > sims problem if you were to spend more time examining optimized C/C++ > code with a ruby interface. Also agreed. The discussion on R is (for now) more for brainstorming and hopefully some people, or someone, will get a very good idea for a next computer language (whether it is Ruby-based or not). My current bottleneck is the Ruby gc, so I will try to create two heaps; one for the dynamic objects and one for the static objects (which will never be swept). Thanks for your thoughts. Regards, Bill