I want to find a solution in IronRuby to use RPC function. I tried SOAP, but it can''t work, any one could tell me how to implement RPC (or XMLRPC) in ironruby? Thanks, ------------------------------------ C++, Lua, living in Dalian http://sunxiunan.com/ http://twitter.com/sagasw ------------------------------------ -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100319/6f186342/attachment.html>
Ivan Porto Carrero
2010-Mar-19 06:41 UTC
[Ironruby-core] How could I get RPC in iron ruby?
There are several ways to do that with IronRuby. Very CLR centric: You can create a proxy to your webservice using visual studio, compile to a dll and use the proxy from your ruby code. CLR centric: You can use System.Net.HttpWebRequest to make the request and System.Xml.XmlDocument to parse the response Very Ruby centric: Use Net::HTTP to perform the request and REXML to parse the response --- Met vriendelijke groeten - Best regards - Salutations Ivan Porto Carrero Web: http://whiterabbitconsulting.eu - http://flanders.co.nz Twitter: http://twitter.com/casualjim Author of IronRuby in Action (http://manning.com/carrero) Microsoft IronRuby/C# MVP On Fri, Mar 19, 2010 at 7:19 AM, sagasw <sagasw at gmail.com> wrote:> I want to find a solution in IronRuby to use RPC function. > I tried SOAP, but it can''t work, any one could tell me how to implement RPC > (or XMLRPC) in ironruby? > Thanks, > > ------------------------------------ > C++, Lua, living in Dalian > http://sunxiunan.com/ > http://twitter.com/sagasw > ------------------------------------ > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100319/6fd177f4/attachment.html>
Or use hpricot or nokogiri Ruby libraries. You will find several libs to choose from. Sent from my iPhone On Mar 18, 2010, at 11:41 PM, Ivan Porto Carrero <ivan at whiterabbitconsulting.eu > wrote:> There are several ways to do that with IronRuby. > > Very CLR centric: > You can create a proxy to your webservice using visual studio, > compile to a dll and use the proxy from your ruby code. > > CLR centric: > You can use System.Net.HttpWebRequest to make the request and > System.Xml.XmlDocument to parse the response > > Very Ruby centric: > Use Net::HTTP to perform the request and REXML to parse the response > --- > Met vriendelijke groeten - Best regards - Salutations > Ivan Porto Carrero > Web: http://whiterabbitconsulting.eu - http://flanders.co.nz > Twitter: http://twitter.com/casualjim > Author of IronRuby in Action (http://manning.com/carrero) > Microsoft IronRuby/C# MVP > > > On Fri, Mar 19, 2010 at 7:19 AM, sagasw <sagasw at gmail.com> wrote: > I want to find a solution in IronRuby to use RPC function. > I tried SOAP, but it can''t work, any one could tell me how to > implement RPC (or XMLRPC) in ironruby? > Thanks, > > ------------------------------------ > C++, Lua, living in Dalian > http://sunxiunan.com/ > http://twitter.com/sagasw > ------------------------------------ > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100417/49fddc54/attachment.html>
2010/4/17 Ryan Riley <ryan.riley at panesofglass.org>:> Or use hpricot or nokogiri Ruby libraries. You will find several libs to > choose from.Does nokogiri work on IronRuby?! -- Seo Sanghyeon
Maybe I spoke too soon, but I thought it did. I was switching back and forth a lot at the time. I will try again once I get everything re- installed. Sent from my iPhone On Apr 17, 2010, at 1:47 AM, Seo Sanghyeon <sanxiyn at gmail.com> wrote:> 2010/4/17 Ryan Riley <ryan.riley at panesofglass.org>: >> Or use hpricot or nokogiri Ruby libraries. You will find several >> libs to >> choose from. > > Does nokogiri work on IronRuby?! > > -- > Seo Sanghyeon > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core
Ivan Porto Carrero
2010-Apr-18 07:01 UTC
[Ironruby-core] How could I get RPC in iron ruby?
nokogiri works on windows but not on IronRuby ... it needs a C-extension --- Met vriendelijke groeten - Best regards - Salutations Ivan Porto Carrero Web: http://whiterabbitconsulting.eu - http://flanders.co.nz Twitter: http://twitter.com/casualjim Author of IronRuby in Action (http://manning.com/carrero) Microsoft IronRuby/C# MVP On Sat, Apr 17, 2010 at 9:14 PM, Ryan Riley <ryan.riley at panesofglass.org>wrote:> Maybe I spoke too soon, but I thought it did. I was switching back and > forth a lot at the time. I will try again once I get everything > re-installed. > > Sent from my iPhone > > > On Apr 17, 2010, at 1:47 AM, Seo Sanghyeon <sanxiyn at gmail.com> wrote: > > 2010/4/17 Ryan Riley <ryan.riley at panesofglass.org>: >> >>> Or use hpricot or nokogiri Ruby libraries. You will find several libs to >>> choose from. >>> >> >> Does nokogiri work on IronRuby?! >> >> -- >> Seo Sanghyeon >> _______________________________________________ >> Ironruby-core mailing list >> Ironruby-core at rubyforge.org >> http://rubyforge.org/mailman/listinfo/ironruby-core >> > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100418/93474ee8/attachment.html>
So whose going to port it? :) or even implement FFI? ~Jimmy On Apr 18, 2010, at 12:02 AM, "Ivan Porto Carrero" <ivan at cloudslide.net<mailto:ivan at cloudslide.net>> wrote: nokogiri works on windows but not on IronRuby ... it needs a C-extension --- Met vriendelijke groeten - Best regards - Salutations Ivan Porto Carrero Web: <http://whiterabbitconsulting.eu> http://whiterabbitconsulting.eu - <http://flanders.co.nz> http://flanders.co.nz Twitter: <http://twitter.com/casualjim> http://twitter.com/casualjim Author of IronRuby in Action (<http://manning.com/carrero>http://manning.com/carrero) Microsoft IronRuby/C# MVP On Sat, Apr 17, 2010 at 9:14 PM, Ryan Riley <<mailto:ryan.riley at panesofglass.org>ryan.riley at panesofglass.org<mailto:ryan.riley at panesofglass.org>> wrote: Maybe I spoke too soon, but I thought it did. I was switching back and forth a lot at the time. I will try again once I get everything re-installed. Sent from my iPhone On Apr 17, 2010, at 1:47 AM, Seo Sanghyeon <<mailto:sanxiyn at gmail.com>sanxiyn at gmail.com<mailto:sanxiyn at gmail.com>> wrote: 2010/4/17 Ryan Riley <<mailto:ryan.riley at panesofglass.org>ryan.riley at panesofglass.org<mailto:ryan.riley at panesofglass.org>>: Or use hpricot or nokogiri Ruby libraries. You will find several libs to choose from. Does nokogiri work on IronRuby?! -- Seo Sanghyeon _______________________________________________ Ironruby-core mailing list <mailto:Ironruby-core at rubyforge.org>Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> <http://rubyforge.org/mailman/listinfo/ironruby-core>http://rubyforge.org/mailman/listinfo/ironruby-core _______________________________________________ Ironruby-core mailing list <mailto:Ironruby-core at rubyforge.org>Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> <http://rubyforge.org/mailman/listinfo/ironruby-core>http://rubyforge.org/mailman/listinfo/ironruby-core _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100418/4711dcc4/attachment-0001.html>
Daniele Alessandri
2010-Apr-18 09:41 UTC
[Ironruby-core] How could I get RPC in iron ruby?
On Sun, Apr 18, 2010 at 09:49, Jimmy Schementi <Jimmy.Schementi at microsoft.com> wrote:> So whose going to port it? :) or even implement FFI?Nokogiri is built on top of libxml2 and libxslt so we could have a C# Nokogiri that performs interop with those libraries, but a fully-managed Nokogiri would be cooler (BTW the JRuby guys are reaching the goal of a pure-Java version and they are close to passing all the tests). I did a very quick research on the subject a few weeks ago. The reader bits should be relatively easy to port since, as far as I remember, the reader interface of libxml2 is modeled after the XmlTextReader class of .NET. "SAX for .NET" could be used for the SAX parser to start (it''s BSD licensed but hasn''t been updated since ages... we just don''t have Xerces :-)). Mono has something for RelaxNG validation. -- Daniele Alessandri http://www.clorophilla.net/ http://twitter.com/JoL1hAHN
Speaking of FFI, what''s the tradeoff here? FFI let''s us use the existing libraries without porting, but a managed alternative should be more performant, right? Seems like FFI is the winner here, but I may be missing something. Ryan Riley Email: ryan.riley at panesofglass.org LinkedIn: http://www.linkedin.com/in/ryanriley Blog: http://wizardsofsmart.net/ Twitter: @panesofglass Website: http://panesofglass.org/ On Sun, Apr 18, 2010 at 12:49 AM, Jimmy Schementi < Jimmy.Schementi at microsoft.com> wrote:> So whose going to port it? :) or even implement FFI? > > ~Jimmy > > On Apr 18, 2010, at 12:02 AM, "Ivan Porto Carrero" <ivan at cloudslide.net> > wrote: > > nokogiri works on windows but not on IronRuby ... it needs a C-extension > --- > Met vriendelijke groeten - Best regards - Salutations > Ivan Porto Carrero > Web: <http://whiterabbitconsulting.eu>http://whiterabbitconsulting.eu - > <http://flanders.co.nz>http://flanders.co.nz > Twitter: <http://twitter.com/casualjim>http://twitter.com/casualjim > Author of IronRuby in Action ( <http://manning.com/carrero> > http://manning.com/carrero) > Microsoft IronRuby/C# MVP > > > On Sat, Apr 17, 2010 at 9:14 PM, Ryan Riley <<ryan.riley at panesofglass.org> > ryan.riley at panesofglass.org> wrote: > >> Maybe I spoke too soon, but I thought it did. I was switching back and >> forth a lot at the time. I will try again once I get everything >> re-installed. >> >> Sent from my iPhone >> >> >> On Apr 17, 2010, at 1:47 AM, Seo Sanghyeon < <sanxiyn at gmail.com> >> sanxiyn at gmail.com> wrote: >> >> 2010/4/17 Ryan Riley < <ryan.riley at panesofglass.org> >>> ryan.riley at panesofglass.org>: >>> >>>> Or use hpricot or nokogiri Ruby libraries. You will find several libs to >>>> choose from. >>>> >>> >>> Does nokogiri work on IronRuby?! >>> >>> -- >>> Seo Sanghyeon >>> _______________________________________________ >>> Ironruby-core mailing list >>> <Ironruby-core at rubyforge.org>Ironruby-core at rubyforge.org >>> <http://rubyforge.org/mailman/listinfo/ironruby-core> >>> http://rubyforge.org/mailman/listinfo/ironruby-core >>> >> _______________________________________________ >> Ironruby-core mailing list >> <Ironruby-core at rubyforge.org>Ironruby-core at rubyforge.org >> <http://rubyforge.org/mailman/listinfo/ironruby-core> >> http://rubyforge.org/mailman/listinfo/ironruby-core >> > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100418/c7a720bf/attachment.html>
Performance is one negative - since most of the logic that would normally be implemented in C, Java or C# is implemented in Ruby, it will be slower. Libxml is callback heavy, and depending on how well the FFI impl handles these, the rather large number of transitions between ruby and the native lib costs a lot. Portability is another - with a pure-ruby or C# impl, you don''t need to worry about having the appropriate native lib on the system - its plug and play. libxml is also a pretty nasty api to bind using something like FFI, and nokogiri really pushes FFI, so until you have a really complete FFI impl, you''ll have stability problems. In hindsight, I think JRuby would have been better served by just going for a java impl of nokogiri upfront rather than the nokogiri-over-FFI stopgap. On 19 April 2010 07:10, Ryan Riley <ryan.riley at panesofglass.org> wrote:> Speaking of FFI, what''s the tradeoff here? FFI let''s us use the existing > libraries without porting, but a managed alternative should be more > performant, right? Seems like FFI is the winner here, but I may be missing > something. > > Ryan Riley > > Email: ryan.riley at panesofglass.org > LinkedIn: http://www.linkedin.com/in/ryanriley > Blog: http://wizardsofsmart.net/ > Twitter: @panesofglass > Website: http://panesofglass.org/ > > > On Sun, Apr 18, 2010 at 12:49 AM, Jimmy Schementi > <Jimmy.Schementi at microsoft.com> wrote: >> >> So whose going to port it? :) or even implement FFI? >> >> ~Jimmy >> On Apr 18, 2010, at 12:02 AM, "Ivan Porto Carrero" <ivan at cloudslide.net> >> wrote: >> >> nokogiri works on windows but not on IronRuby ... it needs a C-extension >> --- >> Met vriendelijke groeten - Best regards - Salutations >> Ivan Porto Carrero >> Web: http://whiterabbitconsulting.eu - http://flanders.co.nz >> Twitter: http://twitter.com/casualjim >> Author of IronRuby in Action (http://manning.com/carrero) >> Microsoft IronRuby/C# MVP >> >> >> On Sat, Apr 17, 2010 at 9:14 PM, Ryan Riley <ryan.riley at panesofglass.org> >> wrote: >>> >>> Maybe I spoke too soon, but I thought it did. I was switching back and >>> forth a lot at the time. I will try again once I get everything >>> re-installed. >>> >>> Sent from my iPhone >>> >>> On Apr 17, 2010, at 1:47 AM, Seo Sanghyeon <sanxiyn at gmail.com> wrote: >>> >>>> 2010/4/17 Ryan Riley <ryan.riley at panesofglass.org>: >>>>> >>>>> Or use hpricot or nokogiri Ruby libraries. You will find several libs >>>>> to >>>>> choose from. >>>> >>>> Does nokogiri work on IronRuby?! >>>> >>>> -- >>>> Seo Sanghyeon >>>> _______________________________________________ >>>> Ironruby-core mailing list >>>> Ironruby-core at rubyforge.org >>>> http://rubyforge.org/mailman/listinfo/ironruby-core >>> >>> _______________________________________________ >>> Ironruby-core mailing list >>> Ironruby-core at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/ironruby-core >> >> _______________________________________________ >> Ironruby-core mailing list >> Ironruby-core at rubyforge.org >> http://rubyforge.org/mailman/listinfo/ironruby-core >> >> _______________________________________________ >> Ironruby-core mailing list >> Ironruby-core at rubyforge.org >> http://rubyforge.org/mailman/listinfo/ironruby-core >> > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > >
Using native code in your app also requires full trust (implying it won''t work in Silverlight) and is potentially a security issue. Any exploit in the library would make IronRuby vulnerable to attacks. Tomas -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Wayne Meissner Sent: Sunday, April 18, 2010 4:57 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] How could I get RPC in iron ruby? Performance is one negative - since most of the logic that would normally be implemented in C, Java or C# is implemented in Ruby, it will be slower. Libxml is callback heavy, and depending on how well the FFI impl handles these, the rather large number of transitions between ruby and the native lib costs a lot. Portability is another - with a pure-ruby or C# impl, you don''t need to worry about having the appropriate native lib on the system - its plug and play. libxml is also a pretty nasty api to bind using something like FFI, and nokogiri really pushes FFI, so until you have a really complete FFI impl, you''ll have stability problems. In hindsight, I think JRuby would have been better served by just going for a java impl of nokogiri upfront rather than the nokogiri-over-FFI stopgap. On 19 April 2010 07:10, Ryan Riley <ryan.riley at panesofglass.org> wrote:> Speaking of FFI, what''s the tradeoff here? FFI let''s us use the > existing libraries without porting, but a managed alternative should > be more performant, right? Seems like FFI is the winner here, but I > may be missing something. > > Ryan Riley > > Email: ryan.riley at panesofglass.org > LinkedIn: http://www.linkedin.com/in/ryanriley > Blog: http://wizardsofsmart.net/ > Twitter: @panesofglass > Website: http://panesofglass.org/ > > > On Sun, Apr 18, 2010 at 12:49 AM, Jimmy Schementi > <Jimmy.Schementi at microsoft.com> wrote: >> >> So whose going to port it? :) or even implement FFI? >> >> ~Jimmy >> On Apr 18, 2010, at 12:02 AM, "Ivan Porto Carrero" >> <ivan at cloudslide.net> >> wrote: >> >> nokogiri works on windows but not on IronRuby ... it needs a >> C-extension >> --- >> Met vriendelijke groeten - Best regards - Salutations Ivan Porto >> Carrero >> Web: http://whiterabbitconsulting.eu - http://flanders.co.nz >> Twitter: http://twitter.com/casualjim Author of IronRuby in Action >> (http://manning.com/carrero) Microsoft IronRuby/C# MVP >> >> >> On Sat, Apr 17, 2010 at 9:14 PM, Ryan Riley >> <ryan.riley at panesofglass.org> >> wrote: >>> >>> Maybe I spoke too soon, but I thought it did. I was switching back >>> and forth a lot at the time. I will try again once I get everything >>> re-installed. >>> >>> Sent from my iPhone >>> >>> On Apr 17, 2010, at 1:47 AM, Seo Sanghyeon <sanxiyn at gmail.com> wrote: >>> >>>> 2010/4/17 Ryan Riley <ryan.riley at panesofglass.org>: >>>>> >>>>> Or use hpricot or nokogiri Ruby libraries. You will find several >>>>> libs to choose from. >>>> >>>> Does nokogiri work on IronRuby?! >>>> >>>> -- >>>> Seo Sanghyeon >>>> _______________________________________________ >>>> Ironruby-core mailing list >>>> Ironruby-core at rubyforge.org >>>> http://rubyforge.org/mailman/listinfo/ironruby-core >>> >>> _______________________________________________ >>> Ironruby-core mailing list >>> Ironruby-core at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/ironruby-core >> >> _______________________________________________ >> Ironruby-core mailing list >> Ironruby-core at rubyforge.org >> http://rubyforge.org/mailman/listinfo/ironruby-core >> >> _______________________________________________ >> Ironruby-core mailing list >> Ironruby-core at rubyforge.org >> http://rubyforge.org/mailman/listinfo/ironruby-core >> > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > >_______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core
Just out of curiosity: What''s the process for making an ironruby port of something like Nokogiri? I looked at a blog post<http://blog.headius.com/2010/04/nokogiri-java-port-help-us-finish-it.html>by one of the people working on the JRuby port and it looks pretty involved, but essentially, to port it you would just implement all the "attach_functions" in libxml.rb in .NET? --c On Sun, Apr 18, 2010 at 18:46, Tomas Matousek <Tomas.Matousek at microsoft.com>wrote:> Using native code in your app also requires full trust (implying it won''t > work in Silverlight) and is potentially a security issue. Any exploit in the > library would make IronRuby vulnerable to attacks. > > Tomas > > -----Original Message----- > From: ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] On Behalf Of Wayne Meissner > Sent: Sunday, April 18, 2010 4:57 PM > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] How could I get RPC in iron ruby? > > Performance is one negative - since most of the logic that would normally > be implemented in C, Java or C# is implemented in Ruby, it will be slower. > Libxml is callback heavy, and depending on how well the FFI impl handles > these, the rather large number of transitions between ruby and the native > lib costs a lot. > > Portability is another - with a pure-ruby or C# impl, you don''t need to > worry about having the appropriate native lib on the system - its plug and > play. libxml is also a pretty nasty api to bind using something like FFI, > and nokogiri really pushes FFI, so until you have a really complete FFI > impl, you''ll have stability problems. > > In hindsight, I think JRuby would have been better served by just going for > a java impl of nokogiri upfront rather than the nokogiri-over-FFI stopgap. > > On 19 April 2010 07:10, Ryan Riley <ryan.riley at panesofglass.org> wrote: > > Speaking of FFI, what''s the tradeoff here? FFI let''s us use the > > existing libraries without porting, but a managed alternative should > > be more performant, right? Seems like FFI is the winner here, but I > > may be missing something. > > > > Ryan Riley > > > > Email: ryan.riley at panesofglass.org > > LinkedIn: http://www.linkedin.com/in/ryanriley > > Blog: http://wizardsofsmart.net/ > > Twitter: @panesofglass > > Website: http://panesofglass.org/ > > > > > > On Sun, Apr 18, 2010 at 12:49 AM, Jimmy Schementi > > <Jimmy.Schementi at microsoft.com> wrote: > >> > >> So whose going to port it? :) or even implement FFI? > >> > >> ~Jimmy > >> On Apr 18, 2010, at 12:02 AM, "Ivan Porto Carrero" > >> <ivan at cloudslide.net> > >> wrote: > >> > >> nokogiri works on windows but not on IronRuby ... it needs a > >> C-extension > >> --- > >> Met vriendelijke groeten - Best regards - Salutations Ivan Porto > >> Carrero > >> Web: http://whiterabbitconsulting.eu - http://flanders.co.nz > >> Twitter: http://twitter.com/casualjim Author of IronRuby in Action > >> (http://manning.com/carrero) Microsoft IronRuby/C# MVP > >> > >> > >> On Sat, Apr 17, 2010 at 9:14 PM, Ryan Riley > >> <ryan.riley at panesofglass.org> > >> wrote: > >>> > >>> Maybe I spoke too soon, but I thought it did. I was switching back > >>> and forth a lot at the time. I will try again once I get everything > >>> re-installed. > >>> > >>> Sent from my iPhone > >>> > >>> On Apr 17, 2010, at 1:47 AM, Seo Sanghyeon <sanxiyn at gmail.com> wrote: > >>> > >>>> 2010/4/17 Ryan Riley <ryan.riley at panesofglass.org>: > >>>>> > >>>>> Or use hpricot or nokogiri Ruby libraries. You will find several > >>>>> libs to choose from. > >>>> > >>>> Does nokogiri work on IronRuby?! > >>>> > >>>> -- > >>>> Seo Sanghyeon > >>>> _______________________________________________ > >>>> Ironruby-core mailing list > >>>> Ironruby-core at rubyforge.org > >>>> http://rubyforge.org/mailman/listinfo/ironruby-core > >>> > >>> _______________________________________________ > >>> Ironruby-core mailing list > >>> Ironruby-core at rubyforge.org > >>> http://rubyforge.org/mailman/listinfo/ironruby-core > >> > >> _______________________________________________ > >> Ironruby-core mailing list > >> Ironruby-core at rubyforge.org > >> http://rubyforge.org/mailman/listinfo/ironruby-core > >> > >> _______________________________________________ > >> Ironruby-core mailing list > >> Ironruby-core at rubyforge.org > >> http://rubyforge.org/mailman/listinfo/ironruby-core > >> > > > > > > _______________________________________________ > > Ironruby-core mailing list > > Ironruby-core at rubyforge.org > > http://rubyforge.org/mailman/listinfo/ironruby-core > > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100419/d8ae12f2/attachment.html>
Ivan Porto Carrero
2010-Apr-20 08:35 UTC
[Ironruby-core] How could I get RPC in iron ruby?
There are several approaches you can take. Nokogiri has been a b**** to get going on windows, and even now it only compiles on mingw based MRI AFAIK. To come close to the quality of the Nokogiri gem I think you would need to find a very fast .NET based xml library (it''s not XLinq :)), that also has a SAX parser, knows about CSS3 for parsing documents in addition to XPATH, and then provide an adapter to make it look like the nokogiri API. You could potentially use P/Invoke to call to libxml2 but then you take on a dependency on a native library. I''m also not sure if libxml2 actually performs in the same way on windows as it does on *nix. If we would have an implementation of FFI then we could use the FFI based nokogiri gem. I looked at it a few times but it would be a serious amount of work, too much for my taste :). --- Met vriendelijke groeten - Best regards - Salutations Ivan Porto Carrero Web: http://whiterabbitconsulting.eu - http://flanders.co.nz Twitter: http://twitter.com/casualjim Author of IronRuby in Action (http://manning.com/carrero) Microsoft IronRuby/C# MVP On Tue, Apr 20, 2010 at 12:22 AM, Chris Bilson <cbilson at pobox.com> wrote:> Just out of curiosity: What''s the process for making an ironruby port of > something like Nokogiri? > > I looked at a blog post<http://blog.headius.com/2010/04/nokogiri-java-port-help-us-finish-it.html>by one of the people working on the JRuby port and it looks pretty involved, > but essentially, to port it you would just implement all the > "attach_functions" in libxml.rb in .NET? > > > --c > > > > On Sun, Apr 18, 2010 at 18:46, Tomas Matousek < > Tomas.Matousek at microsoft.com> wrote: > >> Using native code in your app also requires full trust (implying it won''t >> work in Silverlight) and is potentially a security issue. Any exploit in the >> library would make IronRuby vulnerable to attacks. >> >> Tomas >> >> -----Original Message----- >> From: ironruby-core-bounces at rubyforge.org [mailto: >> ironruby-core-bounces at rubyforge.org] On Behalf Of Wayne Meissner >> Sent: Sunday, April 18, 2010 4:57 PM >> To: ironruby-core at rubyforge.org >> Subject: Re: [Ironruby-core] How could I get RPC in iron ruby? >> >> Performance is one negative - since most of the logic that would normally >> be implemented in C, Java or C# is implemented in Ruby, it will be slower. >> Libxml is callback heavy, and depending on how well the FFI impl handles >> these, the rather large number of transitions between ruby and the native >> lib costs a lot. >> >> Portability is another - with a pure-ruby or C# impl, you don''t need to >> worry about having the appropriate native lib on the system - its plug and >> play. libxml is also a pretty nasty api to bind using something like FFI, >> and nokogiri really pushes FFI, so until you have a really complete FFI >> impl, you''ll have stability problems. >> >> In hindsight, I think JRuby would have been better served by just going >> for a java impl of nokogiri upfront rather than the nokogiri-over-FFI >> stopgap. >> >> On 19 April 2010 07:10, Ryan Riley <ryan.riley at panesofglass.org> wrote: >> > Speaking of FFI, what''s the tradeoff here? FFI let''s us use the >> > existing libraries without porting, but a managed alternative should >> > be more performant, right? Seems like FFI is the winner here, but I >> > may be missing something. >> > >> > Ryan Riley >> > >> > Email: ryan.riley at panesofglass.org >> > LinkedIn: http://www.linkedin.com/in/ryanriley >> > Blog: http://wizardsofsmart.net/ >> > Twitter: @panesofglass >> > Website: http://panesofglass.org/ >> > >> > >> > On Sun, Apr 18, 2010 at 12:49 AM, Jimmy Schementi >> > <Jimmy.Schementi at microsoft.com> wrote: >> >> >> >> So whose going to port it? :) or even implement FFI? >> >> >> >> ~Jimmy >> >> On Apr 18, 2010, at 12:02 AM, "Ivan Porto Carrero" >> >> <ivan at cloudslide.net> >> >> wrote: >> >> >> >> nokogiri works on windows but not on IronRuby ... it needs a >> >> C-extension >> >> --- >> >> Met vriendelijke groeten - Best regards - Salutations Ivan Porto >> >> Carrero >> >> Web: http://whiterabbitconsulting.eu - http://flanders.co.nz >> >> Twitter: http://twitter.com/casualjim Author of IronRuby in Action >> >> (http://manning.com/carrero) Microsoft IronRuby/C# MVP >> >> >> >> >> >> On Sat, Apr 17, 2010 at 9:14 PM, Ryan Riley >> >> <ryan.riley at panesofglass.org> >> >> wrote: >> >>> >> >>> Maybe I spoke too soon, but I thought it did. I was switching back >> >>> and forth a lot at the time. I will try again once I get everything >> >>> re-installed. >> >>> >> >>> Sent from my iPhone >> >>> >> >>> On Apr 17, 2010, at 1:47 AM, Seo Sanghyeon <sanxiyn at gmail.com> wrote: >> >>> >> >>>> 2010/4/17 Ryan Riley <ryan.riley at panesofglass.org>: >> >>>>> >> >>>>> Or use hpricot or nokogiri Ruby libraries. You will find several >> >>>>> libs to choose from. >> >>>> >> >>>> Does nokogiri work on IronRuby?! >> >>>> >> >>>> -- >> >>>> Seo Sanghyeon >> >>>> _______________________________________________ >> >>>> Ironruby-core mailing list >> >>>> Ironruby-core at rubyforge.org >> >>>> http://rubyforge.org/mailman/listinfo/ironruby-core >> >>> >> >>> _______________________________________________ >> >>> Ironruby-core mailing list >> >>> Ironruby-core at rubyforge.org >> >>> http://rubyforge.org/mailman/listinfo/ironruby-core >> >> >> >> _______________________________________________ >> >> Ironruby-core mailing list >> >> Ironruby-core at rubyforge.org >> >> http://rubyforge.org/mailman/listinfo/ironruby-core >> >> >> >> _______________________________________________ >> >> Ironruby-core mailing list >> >> Ironruby-core at rubyforge.org >> >> http://rubyforge.org/mailman/listinfo/ironruby-core >> >> >> > >> > >> > _______________________________________________ >> > Ironruby-core mailing list >> > Ironruby-core at rubyforge.org >> > http://rubyforge.org/mailman/listinfo/ironruby-core >> > >> > >> _______________________________________________ >> Ironruby-core mailing list >> Ironruby-core at rubyforge.org >> http://rubyforge.org/mailman/listinfo/ironruby-core >> >> _______________________________________________ >> Ironruby-core mailing list >> Ironruby-core at rubyforge.org >> http://rubyforge.org/mailman/listinfo/ironruby-core >> > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100420/5a1c9590/attachment.html>
To me at least, it seems that it might be easier to take the approach of developing an FFI. I think JRuby took that approach and they''re just about at the point where they''ve got access to Nokogiri. Might be worth looking into if someone wants to put forth the effort. I might even look into it :). -Zac On 4/20/2010 1:35 AM, Ivan Porto Carrero wrote:> There are several approaches you can take. > > Nokogiri has been a b**** to get going on windows, and even now it > only compiles on mingw based MRI AFAIK. > To come close to the quality of the Nokogiri gem I think you would > need to find a very fast .NET based xml library (it''s not XLinq :)), > that also has a SAX parser, knows about CSS3 for parsing documents in > addition to XPATH, and then provide an adapter to make it look like > the nokogiri API. > You could potentially use P/Invoke to call to libxml2 but then you > take on a dependency on a native library. I''m also not sure if libxml2 > actually performs in the same way on windows as it does on *nix. > > If we would have an implementation of FFI then we could use the FFI > based nokogiri gem. > > I looked at it a few times but it would be a serious amount of work, > too much for my taste :). > > --- > Met vriendelijke groeten - Best regards - Salutations > Ivan Porto Carrero > Web: http://whiterabbitconsulting.eu - http://flanders.co.nz > Twitter: http://twitter.com/casualjim > Author of IronRuby in Action (http://manning.com/carrero) > Microsoft IronRuby/C# MVP > > > On Tue, Apr 20, 2010 at 12:22 AM, Chris Bilson <cbilson at pobox.com > <mailto:cbilson at pobox.com>> wrote: > > Just out of curiosity: What''s the process for making an ironruby > port of something like Nokogiri? > > I looked at a blog post > <http://blog.headius.com/2010/04/nokogiri-java-port-help-us-finish-it.html> > by one of the people working on the JRuby port and it looks pretty > involved, but essentially, to port it you would just implement all > the "attach_functions" in libxml.rb in .NET? > > > --c > > > > On Sun, Apr 18, 2010 at 18:46, Tomas Matousek > <Tomas.Matousek at microsoft.com > <mailto:Tomas.Matousek at microsoft.com>> wrote: > > Using native code in your app also requires full trust > (implying it won''t work in Silverlight) and is potentially a > security issue. Any exploit in the library would make IronRuby > vulnerable to attacks. > > Tomas > > -----Original Message----- > From: ironruby-core-bounces at rubyforge.org > <mailto:ironruby-core-bounces at rubyforge.org> > [mailto:ironruby-core-bounces at rubyforge.org > <mailto:ironruby-core-bounces at rubyforge.org>] On Behalf Of > Wayne Meissner > Sent: Sunday, April 18, 2010 4:57 PM > To: ironruby-core at rubyforge.org > <mailto:ironruby-core at rubyforge.org> > Subject: Re: [Ironruby-core] How could I get RPC in iron ruby? > > Performance is one negative - since most of the logic that > would normally be implemented in C, Java or C# is implemented > in Ruby, it will be slower. Libxml is callback heavy, and > depending on how well the FFI impl handles these, the rather > large number of transitions between ruby and the native lib > costs a lot. > > Portability is another - with a pure-ruby or C# impl, you > don''t need to worry about having the appropriate native lib on > the system - its plug and play. libxml is also a pretty nasty > api to bind using something like FFI, and nokogiri really > pushes FFI, so until you have a really complete FFI impl, > you''ll have stability problems. > > In hindsight, I think JRuby would have been better served by > just going for a java impl of nokogiri upfront rather than the > nokogiri-over-FFI stopgap. > > On 19 April 2010 07:10, Ryan Riley > <ryan.riley at panesofglass.org > <mailto:ryan.riley at panesofglass.org>> wrote: > > Speaking of FFI, what''s the tradeoff here? FFI let''s us use the > > existing libraries without porting, but a managed > alternative should > > be more performant, right? Seems like FFI is the winner > here, but I > > may be missing something. > > > > Ryan Riley > > > > Email: ryan.riley at panesofglass.org > <mailto:ryan.riley at panesofglass.org> > > LinkedIn: http://www.linkedin.com/in/ryanriley > > Blog: http://wizardsofsmart.net/ > > Twitter: @panesofglass > > Website: http://panesofglass.org/ > > > > > > On Sun, Apr 18, 2010 at 12:49 AM, Jimmy Schementi > > <Jimmy.Schementi at microsoft.com > <mailto:Jimmy.Schementi at microsoft.com>> wrote: > >> > >> So whose going to port it? :) or even implement FFI? > >> > >> ~Jimmy > >> On Apr 18, 2010, at 12:02 AM, "Ivan Porto Carrero" > >> <ivan at cloudslide.net <mailto:ivan at cloudslide.net>> > >> wrote: > >> > >> nokogiri works on windows but not on IronRuby ... it needs a > >> C-extension > >> --- > >> Met vriendelijke groeten - Best regards - Salutations Ivan > Porto > >> Carrero > >> Web: http://whiterabbitconsulting.eu - http://flanders.co.nz > >> Twitter: http://twitter.com/casualjim Author of IronRuby in > Action > >> (http://manning.com/carrero) Microsoft IronRuby/C# MVP > >> > >> > >> On Sat, Apr 17, 2010 at 9:14 PM, Ryan Riley > >> <ryan.riley at panesofglass.org > <mailto:ryan.riley at panesofglass.org>> > >> wrote: > >>> > >>> Maybe I spoke too soon, but I thought it did. I was > switching back > >>> and forth a lot at the time. I will try again once I get > everything > >>> re-installed. > >>> > >>> Sent from my iPhone > >>> > >>> On Apr 17, 2010, at 1:47 AM, Seo Sanghyeon > <sanxiyn at gmail.com <mailto:sanxiyn at gmail.com>> wrote: > >>> > >>>> 2010/4/17 Ryan Riley <ryan.riley at panesofglass.org > <mailto:ryan.riley at panesofglass.org>>: > >>>>> > >>>>> Or use hpricot or nokogiri Ruby libraries. You will find > several > >>>>> libs to choose from. > >>>> > >>>> Does nokogiri work on IronRuby?! > >>>> > >>>> -- > >>>> Seo Sanghyeon > >>>> _______________________________________________ > >>>> Ironruby-core mailing list > >>>> Ironruby-core at rubyforge.org > <mailto:Ironruby-core at rubyforge.org> > >>>> http://rubyforge.org/mailman/listinfo/ironruby-core > >>> > >>> _______________________________________________ > >>> Ironruby-core mailing list > >>> Ironruby-core at rubyforge.org > <mailto:Ironruby-core at rubyforge.org> > >>> http://rubyforge.org/mailman/listinfo/ironruby-core > >> > >> _______________________________________________ > >> Ironruby-core mailing list > >> Ironruby-core at rubyforge.org > <mailto:Ironruby-core at rubyforge.org> > >> http://rubyforge.org/mailman/listinfo/ironruby-core > >> > >> _______________________________________________ > >> Ironruby-core mailing list > >> Ironruby-core at rubyforge.org > <mailto:Ironruby-core at rubyforge.org> > >> http://rubyforge.org/mailman/listinfo/ironruby-core > >> > > > > > > _______________________________________________ > > Ironruby-core mailing list > > Ironruby-core at rubyforge.org <mailto:Ironruby-core at rubyforge.org> > > http://rubyforge.org/mailman/listinfo/ironruby-core > > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org <mailto:Ironruby-core at rubyforge.org> > http://rubyforge.org/mailman/listinfo/ironruby-core > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org <mailto:Ironruby-core at rubyforge.org> > http://rubyforge.org/mailman/listinfo/ironruby-core > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org <mailto:Ironruby-core at rubyforge.org> > http://rubyforge.org/mailman/listinfo/ironruby-core > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core >