Ruby and KDE (Re: [Kde-bindings] qtruby compile error)

Richard Dale Richard_Dale at tipitina.demon.co.uk
Tue Sep 28 02:42:18 UTC 2004


On Tuesday 28 September 2004 03:19, Navindra Umanee wrote:
> Richard Dale <Richard_Dale at tipitina.demon.co.uk> wrote:
> > Ah I see - that's interesting - I don't know about how the news
> > distribution system works and how one site coordinates with another.
> > Machiavellians are indeed somewhat paranoid :).
>
> It mostly works by volunteers/readers manually submitting stuff
> sadly...  Btw:
>
> http://www.osnews.com/story.php?news_id=8408
Great! It's a shame they've spelt wrongly - should be 'Rubydium'. It goes 
really well with Korundum though - an elements/minerals theme.

> Hopefully another couple of surprises in store.
>
> > Yes, it's much faster to develop apps without all that
> > makefile/preprocessor stuff.>
>
> I am feverishly learning Ruby now, although I can't afford the time
> and distraction!
Watch that, it's very addictive, the 'crack' of programming languages :)

> I love how you can just add or redefine a method in Object or Kernel
> and see it pop up everywhere.  Blocks still trouble me somewhat.  I'm
> still trying to understand how this is different or better than
> higher-order functions and such.  Although maybe for iterators in
> particular they are more elegant.
Have you tried passing a block to a constructor in Korundum - that's quite 
fun?

> Also, I don't like that you have to explicitly do Proc.call on a
> function object.  It reminds me of how nasty Common Lisp is with it's
> (funcall #'function) syntax compared to the elegance of Scheme.
Here a snippet of a discussion on today's ruby-talk:

"> in C this is known as __FUNCTION__.  so perhaps 'function'.  this could be
> o.k. if it were a method of Binding => Binding#function"

"Hmmmm... then we'd have proc, Proc, lambda, block, closure, method,
and function :-)"

It does sound as though there is an excess of names in that area..

> However, it might not actually be that bad in actual use and having
> KDE/Qt for Ruby is big plus over the archaic Lisp environments out
> there.  It's a killer combination every way you look at it.
>
> How slow is Ruby right now that it needs a JIT?  Can Korundum be
> realistically advocated for primary application development?
Quite slow, about half the speed of perl. But in practice apps always seem to 
be perfectly snappy. You only notice the speed if you run something like the 
'forever' example (see qtruby/rubylib/examples/qt-examples/forever). I get 
about 20000 shapes drawn per second in C++, 1000 in PerlQt and 500 in QtRuby.

Initial method lookup in QtRuby is quite slow, but there is a method selector 
cache. So probably the best thing to tune would be the cache lookup. At the 
moment the method overloading resolution is written in ruby, and that could 
be redone in C perhaps to speed it up. But if you have a loop, once the 
initial lookup is done, that's it.

-- Richard



More information about the Kde-bindings mailing list