From: Kristof Bastiaensen Date: 2004-04-24T18:49:06+09:00 Subject: Re: Psyco On Sat, 24 Apr 2004 16:27:58 +0900, Jean-Hugues ROBERT wrote: > For sure, nowadays C optimizing compilers do a great job and > it is rare that you have to resort to "register" (which is not a #pragma, > sorry for my distorted memory) anymore. Yet, at its time, register > helped. > Yes, I believe gcc even just ignores any 'register' you specify, because it can find a better solution than you anyway. > MinMax strategy: Minimize work for Ruby implementors, Maximize > user profit. In a perfect world, only implementors would work, > in today's world, users' skills could legitimately be leveraged. > That's the way it should be (sorry Matz!). If Ruby would be much faster, it could be used for more tasks, and take away more time from programmers. And they wouldn't have to think about performance to much. > I believe that a syntax oriented solution is often > better looking and is worth the effort for frequent constructions. > I don't believe that Ruby syntax should be poluted with type information (public static Numeric inline parm ... ew!). It would be great to have a new language resembling Ruby that would contain some static information (and sacrifice dynamism), but could be compiled into machine code (cRuby?). A good way to speed up Ruby's method calling would be to cache Class-information. It should cache only one value, because mostly methods are called on the same class, except the generic ones (like each, etc..). If it finds the same class, it could directly call the associated method, (with a dirty bit, if the method was changed recently). Otherwise it would look up the method. > As an example, think about the attr() method family. It is great, > for sure. Yet attr :myAttr is kind of surprising for a newbie, attr myAttr > would seem more direct (of course, once you understand that attr: is just > another method and that you may have your own variations of it... you > love that !). I remember finding it strange when I started learning Ruby, but when you learn something new, you just accept some facts, and later learn why they are like that. And Ruby is remarkably consistent, it keeps surprising me every time! >>But speed may not be very important anyway... ;) > > I suppose that I would be using C++ if it were :-) What about Objective-C? The Object model of Objective-C resembles that of small-talk and Ruby, and is far more dynamic than C++. It is a shame that it is used so little, instead of C++. (is that because it is an Apple-thing?) > > The Psyco motto is that "higher level languages should actually > outperform lower level ones in terms of speed". I totally agree with > that statement, but I am slightly impatient. > Me too. When you express something very clearly, the compiler should be able to find the fastest solution for you. But this "super-compiler" still doesn't exist (or does it?).