Re: Desktop multi-plataform ruby app (Tk and swank for jruby)

View: New views
2 Messages — Rating Filter:   Alert me  

Parent Message unknown Re: Desktop multi-plataform ruby app (Tk and swank for jruby)

by mdiam :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Jun 8, 9:44 am, Charles Oliver Nutter <charles.nut...@...>
wrote:
> Victor Reyes wrote:
> > Can JRuby coexist with C-Ruby?
> y-nice.
>
> > Currently I am running Ruby 1.8.7 and on some servers I am playing 1.9. What
> > is the equivalent version of JRuby to the latest level of Ruby?

> Almost nobody is asking for 1.9 features, so we've only taken a marginal
> interest. If people want those features, it wouldn't take more than a
> couple dedicated weeks to get them in.

It seems that Ruby-1.8.7 has many features from ruby-1.9.
I think it's important to support these as soon as possible.
It seems obvious that this is going to come without asking for it.
As you, at sun staff are going a great job around jruby: no need
to ask for obvious feature... we know that it will be done some day
(no emergency).

But, about GUI tool kit, one thing that would be realy (realy) great
is to port the standard Tk tool kit to java. this would make it
possible
to migrate native Ruby/Tk application to Jruby.

The big part of this work seems to already be done by Bruce Johnson
with it's swank package (port of tk to java for use with jacl (port
of TCL language to java)
- http://www.onemoonscientific.com/swank/index.html
- https://swank.dev.java.net/
- http://wiki.tcl.tk/2858
If Tk whould be port to java, then Tk would be easier to install for
jruby
than for ruby!)

About other Gui toolkit, it seems that there is some confusion
between
true Gui user interface with complex event handling abilities
(key, mouse, ...) and power canvas drawing features with event binding
(like Tk and other) and just html forms like toolkit with some
graphic
capabilities.

I think it's easiest to switch a programm from one (stuctures or oo)
language to another language, than to move from one Gui system to
another
one in the same language.
So the choice of a Gui toolkit is important!



About startup jruby time:

>mdiam wrote:
>> ...jruby is still a litle slower than ruby at startup time, because
>> of the JVM)
>
>In 1.1.2 we have hopefully improved that...for me, startup time went
>from 1.5s to about .6s, which is a great improvement. Others have
>reported similar boost, maybe not as great. Work continues.

Yes I confirm the great startup improvemnt of the last jruby version,
but I had
to find some inconvenient of jruby ower ruby (but the big one is
about
native library bindings like Tk!)

-- Maurice



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: Desktop multi-plataform ruby app (Tk and swank for jruby)

by Charles Oliver Nutter-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

mdiam wrote:
> It seems that Ruby-1.8.7 has many features from ruby-1.9.
> I think it's important to support these as soon as possible.
> It seems obvious that this is going to come without asking for it.
> As you, at sun staff are going a great job around jruby: no need
> to ask for obvious feature... we know that it will be done some day
> (no emergency).

Are people upgrading to 1.8.7? We started adding those features, but
there seemed a lot of confusion about whether 1.8.7 was going to be
popular or whether people would move to it quickly. But we'll get those
features into 1.1.3 or 1.1.4 if people really want/need them.

> But, about GUI tool kit, one thing that would be realy (realy) great
> is to port the standard Tk tool kit to java. this would make it
> possible
> to migrate native Ruby/Tk application to Jruby.
>
> The big part of this work seems to already be done by Bruce Johnson
> with it's swank package (port of tk to java for use with jacl (port
> of TCL language to java)
> - http://www.onemoonscientific.com/swank/index.html
> - https://swank.dev.java.net/
> - http://wiki.tcl.tk/2858
> If Tk whould be port to java, then Tk would be easier to install for
> jruby
> than for ruby!)

I'd love to see someone try to wire this into JRuby, but to date almost
nobody has wanted to use Tk after trying JRuby with Swing. If you
thought it might be interesting to you, there's some suggestions below
on how to get started.

> I think it's easiest to switch a programm from one (stuctures or oo)
> language to another language, than to move from one Gui system to
> another
> one in the same language.
> So the choice of a Gui toolkit is important!

I agree wholeheartedly. And selecting a GUI framework is a decision you
don't want to have to make multiple times. I certainly consider Swing to
be powerful...sometimes over-powerful. But I can't imagine what you'd be
able to do in another toolkit you can't do in Swing. Plus tools like
Monkeybars and Matisse make it really easy.

Beyond that...Tk UIs are a lot harder to make pretty than Swing UIs.
Check out some of the great Swing skinning sites:

https://substance.dev.java.net/ (beautiful UIs)
http://napkinlaf.sourceforge.net/ (particularly cute)
http://www.pagosoft.com/products/pgslookandfeel/index.html?sid=4b6ebdac204dd4dfc00b45de4bc3fd3b
http://www.jgoodies.com/
https://liquidlnf.dev.java.net/

Adn there's dozens more out there.

> Yes I confirm the great startup improvemnt of the last jruby version,
> but I had
> to find some inconvenient of jruby ower ruby (but the big one is
> about
> native library bindings like Tk!)

Native library support is probably the most obvious feature missing, but
in my opinion Ruby's C API is the largest thing holding it back. Yes,
it's great you can wire in libraries directly to Ruby. But by exposing
all the internal types, structures, functions, and macros used to
manipulate Ruby directly it's nearly impossible to make the drastic
changes Ruby needs to survive (like a new garbage collector, impossible
because current extensions access memory directly).

There are several options, however:

- Use a Java library

Tk, for example, is pretty well covered by Swing frameworks for JRuby.
And the number of Java libraries available is legendary. You don't even
need to use any Java...just load them and call them from Ruby.

- Port the library to Java

This requires some Java knowledge, but it's usually far easier than
writing a library in C.

- Use a foreign function interface

JRuby ships with JNA, which is a Java API for programmatically loading
and calling any C library from Java with only a bit of pre-built JNI
code involved (we ship JNA with support for linux 32/64, solaris
sparc/x86, os x and windows). Using this library directly is one way to
call out to specific C libraries. There's an example on jna.dev.java.net.

Another alternative would be to help finish up JRuby's support for
Rubinius's FFI API, which is basically an improved DL library, or in
other terms a full Ruby equivalent to JNA. We have a mostly complete
library that we just need to wire in and test. You can inquire on the
JRuby list if you'd like to help.

Personally, I'd love to see people stop using the native Ruby API and
prefer FFI libraries for all extension writing, since those native
extensions are both holding Ruby back and limited to the C impl. And
even though both Rubinius and JRuby have starts on implementing that C
API through various tricks, those tricks will not be able to cover the
entire API and will never perform as well as we would like.

C API == bad. FFI == good.

- Charlie

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email