librelist archives

« back to archive

Direction of Shoes

Direction of Shoes

From:
MenTaLguY
Date:
2009-11-02 @ 19:12
So, at this point I'm pretty much committed to going with JRuby.  We
don't really seem to have the resources to maintain several Shoes ports;
there are too many weird platform-specific quirks.  JRuby also
(potentially) solves some problems with binary gems.  And it looks like
JRuby will have a solution for a self-contained native launcher with the
next release, so that's good too.

Rather than rewriting the C portions of Shoes in Java, though, what I'd
like to do is rewrite them in pure Ruby, and then once it all works port
any slow parts into Java, or perhaps Duby (which is a statically-typed
language for the JVM with Ruby syntax).

Thoughts?

-mental

Re: Direction of Shoes

From:
Paul McConnon
Date:
2009-11-02 @ 21:49
Double plus good!

Pauliephonic

On Mon, Nov 2, 2009 at 7:12 PM, MenTaLguY <mental@rydia.net> wrote:

> So, at this point I'm pretty much committed to going with JRuby.  We
> don't really seem to have the resources to maintain several Shoes ports;
> there are too many weird platform-specific quirks.  JRuby also
> (potentially) solves some problems with binary gems.  And it looks like
> JRuby will have a solution for a self-contained native launcher with the
> next release, so that's good too.
>
> Rather than rewriting the C portions of Shoes in Java, though, what I'd
> like to do is rewrite them in pure Ruby, and then once it all works port
> any slow parts into Java, or perhaps Duby (which is a statically-typed
> language for the JVM with Ruby syntax).
>
> Thoughts?
>
> -mental
>
>

Re: Direction of Shoes

From:
Dan Ross
Date:
2009-11-02 @ 19:52
I've been messing with JRuby and Jython recently and while I'm
hesitant to show exuberant enthusiasm (I don't really care for Java
that much but I love the idea of it's portability) I think this is a
good decision.

The idea of native launchers is rather exciting in particular.

Is there documentation for this upcoming JRuby feature/implementation?

On Mon, Nov 2, 2009 at 1:12 PM, MenTaLguY <mental@rydia.net> wrote:
> So, at this point I'm pretty much committed to going with JRuby.  We
> don't really seem to have the resources to maintain several Shoes ports;
> there are too many weird platform-specific quirks.  JRuby also
> (potentially) solves some problems with binary gems.  And it looks like
> JRuby will have a solution for a self-contained native launcher with the
> next release, so that's good too.
>
> Rather than rewriting the C portions of Shoes in Java, though, what I'd
> like to do is rewrite them in pure Ruby, and then once it all works port
> any slow parts into Java, or perhaps Duby (which is a statically-typed
> language for the JVM with Ruby syntax).
>
> Thoughts?
>
> -mental
>
>

Re: Direction of Shoes

From:
MenTaLguY
Date:
2009-11-02 @ 22:31
On Mon, 2009-11-02 at 13:52 -0600, Dan Ross wrote:
> The idea of native launchers is rather exciting in particular.
> 
> Is there documentation for this upcoming JRuby feature/implementation?

Not yet, there's still a lot of polish required.  But basically with the
upcoming release rather than having to explicitly call out to Java, on
Windows there should be an option to use a self-contained jruby.exe
(which contains the JRE etc.).  We could eventually use a hacked version
of that for Shoes.

(I would ask on the JRuby list or on #jruby on freenode if you want more
details.)

-mental

Re: Direction of Shoes

From:
Satoshi Asakawa
Date:
2009-11-03 @ 00:51
Awesome!

I'm really happy to join this `Shoes with JRuby` project.
Thank you for the great decision, evolving Shoes!
I have no experience so far, but I promise to do my best. :)

Cheers,
ashbb

Re: Direction of Shoes

From:
Martin DeMello
Date:
2009-11-02 @ 21:11
sounds good to me!

martin

On Tue, Nov 3, 2009 at 12:42 AM, MenTaLguY <mental@rydia.net> wrote:
> So, at this point I'm pretty much committed to going with JRuby.  We
> don't really seem to have the resources to maintain several Shoes ports;
> there are too many weird platform-specific quirks.  JRuby also
> (potentially) solves some problems with binary gems.  And it looks like
> JRuby will have a solution for a self-contained native launcher with the
> next release, so that's good too.
>
> Rather than rewriting the C portions of Shoes in Java, though, what I'd
> like to do is rewrite them in pure Ruby, and then once it all works port
> any slow parts into Java, or perhaps Duby (which is a statically-typed
> language for the JVM with Ruby syntax).
>
> Thoughts?
>
> -mental
>
>

Re: Direction of Shoes

From:
Vitor Peres
Date:
2009-11-02 @ 21:06
Em 02/11/2009, às 17:12, MenTaLguY escreveu:

> So, at this point I'm pretty much committed to going with JRuby.  We
> don't really seem to have the resources to maintain several Shoes  
> ports;
> there are too many weird platform-specific quirks.  JRuby also
> (potentially) solves some problems with binary gems.  And it looks  
> like
> JRuby will have a solution for a self-contained native launcher with  
> the
> next release, so that's good too.
>
> Rather than rewriting the C portions of Shoes in Java, though, what  
> I'd
> like to do is rewrite them in pure Ruby, and then once it all works  
> port
> any slow parts into Java, or perhaps Duby (which is a statically-typed
> language for the JVM with Ruby syntax).
>
> Thoughts?


That seems to me the perfect approach to make Shoes nicer to develop.  
And writing in Ruby and optimizing later seems like the perfect choice  
-- it was exactly what I was mulling over the past few days as I  
considered starting a topic like this, asking where the project was  
heading.
I'm all for it.

--
Vitor Peres (dodecaphonic)
---------------------------------------------
http://unabridgedhaiku.com
http://sotellmegod.com
http://twitter.com/dodecaphonic

Re: Direction of Shoes

From:
Chris Lemmons
Date:
2009-11-02 @ 21:10
Aye. The Shoes application I'm working on only really works in Linux. In
order to use it on Windows, they have to VNC into a Linux box. :(

I would love the portability and ease of installing that JRuby would
produce. Also, since most of the development effort is going into Linux, it
wouldn't make the Windows users feel like the red-headed step-child. (Even
if there is a certain karmic twist to it. :D)

On Mon, Nov 2, 2009 at 3:06 PM, Vitor Peres <dodecaphonic@gmail.com> wrote:

> Em 02/11/2009, às 17:12, MenTaLguY escreveu:
>
> > So, at this point I'm pretty much committed to going with JRuby.  We
> > don't really seem to have the resources to maintain several Shoes
> > ports;
> > there are too many weird platform-specific quirks.  JRuby also
> > (potentially) solves some problems with binary gems.  And it looks
> > like
> > JRuby will have a solution for a self-contained native launcher with
> > the
> > next release, so that's good too.
> >
> > Rather than rewriting the C portions of Shoes in Java, though, what
> > I'd
> > like to do is rewrite them in pure Ruby, and then once it all works
> > port
> > any slow parts into Java, or perhaps Duby (which is a statically-typed
> > language for the JVM with Ruby syntax).
> >
> > Thoughts?
>
>
> That seems to me the perfect approach to make Shoes nicer to develop.
> And writing in Ruby and optimizing later seems like the perfect choice
> -- it was exactly what I was mulling over the past few days as I
> considered starting a topic like this, asking where the project was
> heading.
> I'm all for it.
>
> --
> Vitor Peres (dodecaphonic)
> ---------------------------------------------
> http://unabridgedhaiku.com
> http://sotellmegod.com
> http://twitter.com/dodecaphonic
>
>

Re: Direction of Shoes

From:
Peter Fitzgibbons
Date:
2009-11-02 @ 19:34
I love this decision.  There are many ++ to choosing Jruby.

I also think the path from Ruby to Java optimization will be obviated once
the code is running in Ruby.  I have even read around that the areas where
Ruby to Java are necessary are becoming very narrow (nod to Charles Oliver
Nutter).

Happy Coding.

Peter Fitzgibbons
(847) 687-7646
Email: peter.fitzgibbons@gmail.com
IM GTalk: peter.fitzgibbons
IM AOL: peter.fitzgibbons@gmail.com


On Mon, Nov 2, 2009 at 1:12 PM, MenTaLguY <mental@rydia.net> wrote:

> So, at this point I'm pretty much committed to going with JRuby.  We
> don't really seem to have the resources to maintain several Shoes ports;
> there are too many weird platform-specific quirks.  JRuby also
> (potentially) solves some problems with binary gems.  And it looks like
> JRuby will have a solution for a self-contained native launcher with the
> next release, so that's good too.
>
> Rather than rewriting the C portions of Shoes in Java, though, what I'd
> like to do is rewrite them in pure Ruby, and then once it all works port
> any slow parts into Java, or perhaps Duby (which is a statically-typed
> language for the JVM with Ruby syntax).
>
> Thoughts?
>
> -mental
>
>

Re: Direction of Shoes

From:
MenTaLguY
Date:
2009-11-02 @ 22:29
On Mon, 2009-11-02 at 13:34 -0600, Peter Fitzgibbons wrote:
> I also think the path from Ruby to Java optimization will be obviated
> once the code is running in Ruby.  I have even read around that the
> areas where Ruby to Java are necessary are becoming very narrow (nod
> to Charles Oliver Nutter).

We'll see how it goes -- once before in the past, I tried writing a
subset of Shoes in pure Ruby, and it was pretty slow, but that was
several years ago and since that time JRuby has certainly advanced
performance-wise as Charlie says.

-mental

Re: Direction of Shoes

From:
Martin DeMello
Date:
2009-11-03 @ 05:41
On Tue, Nov 3, 2009 at 3:59 AM, MenTaLguY <mental@rydia.net> wrote:
>
> We'll see how it goes -- once before in the past, I tried writing a
> subset of Shoes in pure Ruby, and it was pretty slow, but that was
> several years ago and since that time JRuby has certainly advanced
> performance-wise as Charlie says.

One immediate problem I can see is that there's no pure ruby
replacement for the graphics layer. We'll need to drop into Java right
away for that.

martin

Re: Direction of Shoes

From:
Joshua Ballanco
Date:
2009-11-03 @ 08:09
On Nov 2, 2009, at 9:41 PM, Martin DeMello wrote:

> On Tue, Nov 3, 2009 at 3:59 AM, MenTaLguY <mental@rydia.net> wrote:
>>
>> We'll see how it goes -- once before in the past, I tried writing a
>> subset of Shoes in pure Ruby, and it was pretty slow, but that was
>> several years ago and since that time JRuby has certainly advanced
>> performance-wise as Charlie says.
>
> One immediate problem I can see is that there's no pure ruby
> replacement for the graphics layer. We'll need to drop into Java right
> away for that.

Indeed, this is what I was referring to regarding a decision on style.  
For example, in Shoes "button" could be (in pseudocode):

call Java(draw_button(button_name, x, y, height, width))

...or it could be:

draw_line(x, y, x+width, y)
draw_line(x+width, y, x+width, y+height)
draw_line(x+width, y+height, x, y+height)
draw_line(x, y+height, x, y)
render_text(button_name, x+text_margin, y+text_margin)

...where each of the draw_line/render_text calls is then implemented  
at a lower level in Java/MacRuby/Cairo+Pango/etc.

Martin, based on his response to your GUI challenge, I believe _why  
was favoring the second method. That said, the second method will be  
more work (initially), slower, and look less native (this is why I  
wondered if we're ok with Shoes having its own style). The first  
method will be easier to implement (initially) and faster, but also  
less portable and more off-putting to any ambitious young hackers that  
want to dive down under the covers (tongue?) of shoes.

My opinion is that if shoes == general_purpose_gui_toolkit, we go for  
the first mechanism. If, however, shoes == teaching_gui_toolkit, I  
think I'd favor the second.

Cheers,

Josh

Re: Direction of Shoes

From:
Martin DeMello
Date:
2009-11-04 @ 11:46
On Tue, Nov 3, 2009 at 1:39 PM, Joshua Ballanco <jballanc@gmail.com> wrote:
>
> Martin, based on his response to your GUI challenge, I believe _why
> was favoring the second method. That said, the second method will be
> more work (initially), slower, and look less native (this is why I
> wondered if we're ok with Shoes having its own style). The first
> method will be easier to implement (initially) and faster, but also
> less portable and more off-putting to any ambitious young hackers that
> want to dive down under the covers (tongue?) of shoes.

I believe there are lots of gui toolkits that render to native widgets
already; the nice thing about shoes (and the motivation behind my gui
challenge in the first place) was to have toolkits where you could
define your own fundamental widgets that were in some sense "first
class". I would personally like to see shoes go down this route, if it
would not slow down the runtime to an unacceptable extent. At the very
least, even if we use native widgets for the common case we should
fully support user-created widgets, and composite widgets freely
mixing native and user-created.

m.

Re: Direction of Shoes

From:
Cecil Coupe
Date:
2009-11-03 @ 09:46
Someone has to replace all the Cairo and C calls and callbacks with Java
(AWT or SWT?) Shoes calls the Cairo api and the ruby embedding api (and
the net libs and and).

It's a distraction to cast it as Ruby vs Java issue It's C or Java for
the the nitty gritty of the next platform for shoes. C plus friends vs
Java plus friends. _why picked C. I would have picked wxWidgets but I've
been down this reinvent road too many times,

On Tue, 2009-11-03 at 00:09 -0800, Joshua Ballanco wrote:
> On Nov 2, 2009, at 9:41 PM, Martin DeMello wrote:
> 
> > On Tue, Nov 3, 2009 at 3:59 AM, MenTaLguY <mental@rydia.net> wrote:
> >>
> >> We'll see how it goes -- once before in the past, I tried writing a
> >> subset of Shoes in pure Ruby, and it was pretty slow, but that was
> >> several years ago and since that time JRuby has certainly advanced
> >> performance-wise as Charlie says.
> >
> > One immediate problem I can see is that there's no pure ruby
> > replacement for the graphics layer. We'll need to drop into Java right
> > away for that.
> 
> Indeed, this is what I was referring to regarding a decision on style.  
> For example, in Shoes "button" could be (in pseudocode):
> 
> call Java(draw_button(button_name, x, y, height, width))
> 
> ...or it could be:
> 
> draw_line(x, y, x+width, y)
> draw_line(x+width, y, x+width, y+height)
> draw_line(x+width, y+height, x, y+height)
> draw_line(x, y+height, x, y)
> render_text(button_name, x+text_margin, y+text_margin)
> 
> ...where each of the draw_line/render_text calls is then implemented  
> at a lower level in Java/MacRuby/Cairo+Pango/etc.
> 
> Martin, based on his response to your GUI challenge, I believe _why  
> was favoring the second method. That said, the second method will be  
> more work (initially), slower, and look less native (this is why I  
> wondered if we're ok with Shoes having its own style). The first  
> method will be easier to implement (initially) and faster, but also  
> less portable and more off-putting to any ambitious young hackers that  
> want to dive down under the covers (tongue?) of shoes.
> 
> My opinion is that if shoes == general_purpose_gui_toolkit, we go for  
> the first mechanism. If, however, shoes == teaching_gui_toolkit, I  
> think I'd favor the second.
> 
> Cheers,
> 
> Josh

Re: Direction of Shoes

From:
MenTaLguY
Date:
2009-11-03 @ 15:15
On Tue, 2009-11-03 at 11:11 +0530, Martin DeMello wrote:
> One immediate problem I can see is that there's no pure ruby
> replacement for the graphics layer. We'll need to drop into Java right
> away for that.

Well, yes and no.  JRuby lets you use (most) Java APIs from Ruby without
needing to write any Java code of your own.

My plan is to use Swing/Java2D (with something other than the crappy
default widget theme), but have some abstraction around the backend so
that it wouldn't be too hard to do things like write a second backend to
work under MRI using e.g. the Ruby Gtk/Pango/etc. bindings.

-mental

Re: Direction of Shoes

From:
Robert C Corsaro
Date:
2009-11-03 @ 18:15
MenTaLguY wrote:
> On Tue, 2009-11-03 at 11:11 +0530, Martin DeMello wrote:
>   
>> One immediate problem I can see is that there's no pure ruby
>> replacement for the graphics layer. We'll need to drop into Java right
>> away for that.
>>     
>
> Well, yes and no.  JRuby lets you use (most) Java APIs from Ruby without
> needing to write any Java code of your own.
>
> My plan is to use Swing/Java2D (with something other than the crappy
> default widget theme), but have some abstraction around the backend so
> that it wouldn't be too hard to do things like write a second backend to
> work under MRI using e.g. the Ruby Gtk/Pango/etc. bindings.
>
> -mental
>
>   
You wouldn't rather use swt?

Re: Direction of Shoes

From:
Peter Fitzgibbons
Date:
2009-11-03 @ 20:22
This seems to be an opening for a review of GUI libs in Java.

What would you all suggest be :

1. The list of reviewed widgets (Swing/Java2D and SWT appear to be the start
of this list)
2. The criteria to be observed.  Should this start as something around how
easy each lib will be to wrapper using the current Shoes API ?

Y'all's thoughts?

Peter Fitzgibbons
(847) 687-7646
Email: peter.fitzgibbons@gmail.com
IM GTalk: peter.fitzgibbons
IM AOL: peter.fitzgibbons@gmail.com


On Tue, Nov 3, 2009 at 12:15 PM, Robert C Corsaro <rcorsaro@gmail.com>wrote:

> MenTaLguY wrote:
> > On Tue, 2009-11-03 at 11:11 +0530, Martin DeMello wrote:
> >
> >> One immediate problem I can see is that there's no pure ruby
> >> replacement for the graphics layer. We'll need to drop into Java right
> >> away for that.
> >>
> >
> > Well, yes and no.  JRuby lets you use (most) Java APIs from Ruby without
> > needing to write any Java code of your own.
> >
> > My plan is to use Swing/Java2D (with something other than the crappy
> > default widget theme), but have some abstraction around the backend so
> > that it wouldn't be too hard to do things like write a second backend to
> > work under MRI using e.g. the Ruby Gtk/Pango/etc. bindings.
> >
> > -mental
> >
> >
> You wouldn't rather use swt?
>

Re: Direction of Shoes

From:
MenTaLguY
Date:
2009-11-03 @ 21:26
On Tue, 2009-11-03 at 14:22 -0600, Peter Fitzgibbons wrote:
> 2. The criteria to be observed.  Should this start as something around
> how easy each lib will be to wrapper using the current Shoes API ?

The main thing is that I don't want to have to ship any extra native
libraries if I can avoid it.  Swing works "out of the box" without any
extra native stuff.

One advantage to SWT is that it uses Cairo for some drawing operations,
though; Java2D has different stroking rules and things which we would
need to compensate for.

Anyway, I'm open to ideas, but at the moment I'm looking at using
Swing/Java2D for the first pass at least.

-mental

Re: Direction of Shoes

From:
Anuj Dutta
Date:
2009-11-03 @ 22:39
2009/11/4 MenTaLguY <mental@rydia.net>

> On Tue, 2009-11-03 at 14:22 -0600, Peter Fitzgibbons wrote:
> > 2. The criteria to be observed.  Should this start as something around
> > how easy each lib will be to wrapper using the current Shoes API ?
>
> The main thing is that I don't want to have to ship any extra native
> libraries if I can avoid it.  Swing works "out of the box" without any
> extra native stuff.
>
> One advantage to SWT is that it uses Cairo for some drawing operations,
> though; Java2D has different stroking rules and things which we would
> need to compensate for.
>
> Anyway, I'm open to ideas, but at the moment I'm looking at using
> Swing/Java2D for the first pass at least.
>
> -mental
>
>
I never liked Java 2D or Swing for that matter but I guess it can be given
another chance and I am sure it hsa improved over the years. Moving to JRuby
and Java means, I can actually contribute to code since I started out as a
Java programmer and it would be good to go back to it. So, when would the
community actually finalise on the list of tasks and how would they be
divided up so that all the resources are used efficiently? and what do I
need to do to be a part of it apart from following the mailing list.


Anuj

-- 
Anuj DUTTA

Re: Direction of Shoes

From:
MenTaLguY
Date:
2009-11-04 @ 23:51
On Wed, 2009-11-04 at 04:09 +0530, Anuj Dutta wrote:
> So, when would the community actually finalise on the list of tasks
> and how would they be divided up so that all the resources are used
> efficiently? and what do I need to do to be a part of it apart from
> following the mailing list.

I think the main thing right now is to experiment and make sure that
various things are feasible.

One of the biggest items, in terms of using Java2D, is writing a custom
path stroking implementation which has compatible stroking rules to
Cairo's.  If that doesn't work out I expect we will need to look harder
at SWT.

-mental

Re: Direction of Shoes

From:
jonty
Date:
2009-11-05 @ 22:47
Thanks guys - the recent discussions have reassured me somewhat - 
checking out java2D sounds like a good first step

Re: Direction of Shoes

From:
Seth Thomas Rasmussen
Date:
2009-11-02 @ 19:32
On Mon, Nov 2, 2009 at 2:12 PM, MenTaLguY <mental@rydia.net> wrote:
> So, at this point I'm pretty much committed to going with JRuby.  We
> don't really seem to have the resources to maintain several Shoes ports;
> there are too many weird platform-specific quirks.  JRuby also
> (potentially) solves some problems with binary gems.  And it looks like
> JRuby will have a solution for a self-contained native launcher with the
> next release, so that's good too.
>
> Rather than rewriting the C portions of Shoes in Java, though, what I'd
> like to do is rewrite them in pure Ruby, and then once it all works port
> any slow parts into Java, or perhaps Duby (which is a statically-typed
> language for the JVM with Ruby syntax).
>
> Thoughts?

Sounds kind of awesome. The notion of most of the implementation being
done in Ruby is particularly exciting.

Re: Direction of Shoes

From:
Joshua Ballanco
Date:
2009-11-02 @ 22:00
Hey Mental,

On Nov 2, 2009, at 11:12 AM, MenTaLguY wrote:

> So, at this point I'm pretty much committed to going with JRuby.  We
> don't really seem to have the resources to maintain several Shoes  
> ports;
> there are too many weird platform-specific quirks.  JRuby also
> (potentially) solves some problems with binary gems.  And it looks  
> like
> JRuby will have a solution for a self-contained native launcher with  
> the
> next release, so that's good too.

So last summer, in the heady heydays of the ShoesFests, I brought up  
the possibility of Shoes serving as a sort of implementation agnostic  
"common subset" of all the Gooey Libraries that existed up to that  
point...

I was rather thoroughly shot down. All the usual suspect arguments  
were brought out, particularly the one I really can't contest: cross  
platform GUI libraries don't look/feel native anywhere.

That's true. However! If Shoes is more about supporting H-ety H, and  
not about being a FXRuby/RubyQT/TkRuby/blahblahgooeyruby replacement,  
then I see no problem with Shoes remaining somewhat distinctive in  
style. It's my opinion that Shoes apps shouldn't feel like Java/ 
Windows/OS X/GTK apps. They should feel like Shoes apps (see Squeak/ 
Etoys for example).  Obviously, though, this is a decision that need  
to be made by the community.

> Rather than rewriting the C portions of Shoes in Java, though, what  
> I'd
> like to do is rewrite them in pure Ruby, and then once it all works  
> port
> any slow parts into Java, or perhaps Duby (which is a statically-typed
> language for the JVM with Ruby syntax).
>
> Thoughts?

OK, so as all of the JRuby talk has been going on, I've been holding  
my tongue...mostly because I believe in actions over words, and I  
don't have any results to show yet. That said, I've been planing all  
along to look at moving shoes (at least on OS X) to run on top of  
MacRuby. The first order of business, then, is rewriting Shoes.app and  
friends in pure Ruby. So, I'm definitely on board with that part of  
your plan...and really, the rest is up to me.

Thoughts? You could call them thoughts...anyone have some opinions?  
Those are always the juicy bits.

Cheers,

Josh

Re: Direction of Shoes

From:
MenTaLguY
Date:
2009-11-02 @ 22:24
On Mon, 2009-11-02 at 14:00 -0800, Joshua Ballanco wrote:
> That said, I've been planing all  
> along to look at moving shoes (at least on OS X) to run on top of  
> MacRuby. The first order of business, then, is rewriting Shoes.app and  
> friends in pure Ruby. So, I'm definitely on board with that part of  
> your plan...and really, the rest is up to me.

Cool.  I'm kinda hoping to enable that sort of thing too.

-mental