On Fri, Jul 17, 2009 at 6:09 AM, Daniel Derr<[email protected]> wrote:
> Hi Richard,
>
> The Wt bindings to Ruby see very interesting. The one question I have, is how 
> do the Ruby bindings lead to an efficient way to share source code with Ruby 
> and C++. For example, if I created a nice Image gallery widget in C++ which 
> is used in a production C++ application, how would I instantiate the same 
> widget in Ruby without having to maintain two separate code bases? Or vice 
> versa, if I create a widget in Ruby::Wt, how can I leverage that work in my 
> C++ code?
The Ruby bindings are automatically generated by a perl script called
'kalyptus' directly from the C++ headers. So if you change the C++
widget class it is easy to regenerate the 'smoke library'  for the
widget binding. Each of these smoke libraries has a corresponding Ruby
extension which normally wouldn't need to be changed much once it was
created. I would by happy to help you get a custom C++ widget Ruby
binding. It isn't really documented at the moment, and perhaps we
could add some notes about what to do on the wtruby github project
wiki for other people to read.

To go the other way, and use custom Ruby widgets from C++ I haven't
really thought about yet. I think it would be possible, but I'm not
sure if it makes sense because you can easily have Wt apps written in
both C++ and Ruby on the same website and the users wouldn't be able
to tell which was which. So maybe something like the Mandelbrot
example would be implmented in C++, and other less performance
critical or database-centric parts of the app could be written in
Ruby.

> Another example may be to create a nice data grid and use it in all of my 
> Rails and C++ applications. I am trying to find a way to have two separate 
> development teams and projects become more Wt centric and to gain 
> efficiencies without completely rewriting existing code bases.

I've done some work to integrate Rails libs with Wt::Ruby, and
ActiveRecord works great the the model based widgets to use as data
grids. To integrate Wt data tables directly into a Rails app is harder
though as the Wt urls are normally formed quite differently to the
Rails ones. It is possible to customize Wt urls, but I haven't got as
far as implemented Rails-style RESTful urls in Wt::Ruby.

> I would like to spend some time using your Ruby bindings. It looks like a 
> great addition to the Wt ecosystem.
Yes please do - I'm very interested in getting some user feedback
about them, especially when combined with Rails technology..

-- Richard

>
> Regards,
>
> Daniel
>
> -----Original Message-----
> From: Richard Dale [mailto:[email protected]]
> Sent: Monday, July 13, 2009 8:41 AM
> To: [email protected]
> Subject: Re: [Wt-interest] Wt widgets with Ruby
>
> On Fri, Jul 10, 2009 at 7:34 AM, Daniel Derr<[email protected]> wrote:
>> Is there a good way to create widgets in Wt which can be accessed from Ruby
>> and C++? My goal is to create custom Wt widgets in C++ which I can integrate
>> and reuse in my Rails and C++ applications. Wt seems appropriate for
>> creating complex widgets, and also has the benefit of allowing users to
>> access them on their IPhones since they do not support flash.
>>
>>
>>
>> BTW, for anyone who is new to this group, Wt is an excellent technology and
>> works very well. After trying out Wt, I was impressed about how well it
>> works and how intuitive application programming can be for a non web
>> developer.
> There are Wt::Ruby ruby bindings for Wt which integrate well with
> Rails in that they make it easy to use ActiveRecord and other Rails
> libraries with Wt. The project is hosted on github:
>
> http://github.com/rdale/wtruby/tree/master
>
> Or download a tarball from here:
>
> http://rubyforge.org/projects/wtruby/
>
> -- Richard
>
> ------------------------------------------------------------------------------
> Enter the BlackBerry Developer Challenge
> This is your chance to win up to $100,000 in prizes! For a limited time,
> vendors submitting new applications to BlackBerry App World(TM) will have
> the opportunity to enter the BlackBerry Developer Challenge. See full prize
> details at: http://p.sf.net/sfu/Challenge
> _______________________________________________
> witty-interest mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/witty-interest
>
> ------------------------------------------------------------------------------
> Enter the BlackBerry Developer Challenge
> This is your chance to win up to $100,000 in prizes! For a limited time,
> vendors submitting new applications to BlackBerry App World(TM) will have
> the opportunity to enter the BlackBerry Developer Challenge. See full prize
> details at: http://p.sf.net/sfu/Challenge
> _______________________________________________
> witty-interest mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/witty-interest
>

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to