From m.david at xmlhacker.com Wed Jan 2 03:24:57 2008 From: m.david at xmlhacker.com (M. David Peterson) Date: Wed, 02 Jan 2008 01:24:57 -0700 Subject: [Ironruby-core] Ruby.NET vs. IronRuby: Overview Posted to O'ReilyNet/Windows DevCenter Message-ID: FYI... This post is *LONG* overdue, but later is better than never. :D http://www.oreillynet.com/windows/blog/2008/01/rubynet_vs_ironruby_whats_the.html Please don't hesitate to correct anything that needs correcting via a follow-up comment to the above post or inline to this thread. Thanks! -- /M:D M. David Peterson Co-Founder & Chief Architect, 3rd&Urban, LLC Email: m.david at 3rdandUrban.com | m.david at amp.fm | Mobile: (206) 418-9027 http://3rdandUrban.com/ | http://amp.fm/ | http://www.oreillynet.com/pub/au/2354/ From sanxiyn at gmail.com Wed Jan 2 04:12:34 2008 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Wed, 2 Jan 2008 18:12:34 +0900 Subject: [Ironruby-core] Ruby.NET vs. IronRuby: Overview Posted to O'ReilyNet/Windows DevCenter In-Reply-To: References: Message-ID: <5b0248170801020112o95801blff171a8e4ef62036@mail.gmail.com> 2008/1/2, M. David Peterson : http://www.oreillynet.com/windows/blog/2008/01/rubynet_vs_ironruby_whats_the.html You wrote: What about support for Ruby on Rails? >From the Ruby.NET side there are only a handful of obstacles left to overcome... This is not my impression. For example, there needs to be an implementation of Socket. And Mutex. And another "same name" issue, i.e. thread.rb and thread.so. And who know what. Not to mention ADO.NET backend to ActiveRecord (like ActiveRecord-JDBC) and other niceties. By the way, I think a lot of Ruby and .NET integration can be developed right now, without waiting for IronRuby or Ruby.NET, by using RubyCLR which has no compatibility problems. -- Seo Sanghyeon From jflam at microsoft.com Wed Jan 2 11:17:53 2008 From: jflam at microsoft.com (John Lam (DLR)) Date: Wed, 2 Jan 2008 08:17:53 -0800 Subject: [Ironruby-core] Ruby.NET vs. IronRuby: Overview Posted to O'ReilyNet/Windows DevCenter In-Reply-To: References: Message-ID: <372109E149E8084D8E6C7D9CFD82E06329DD22B21D@NA-EXMSG-C115.redmond.corp.microsoft.com> M. David Peterson: > > FYI... This post is *LONG* overdue, but later is better than never. :D > > http://www.oreillynet.com/windows/blog/2008/01/rubynet_vs_ironruby_what > s_the.html > > Please don't hesitate to correct anything that needs correcting via a > follow-up comment to the above post or inline to this thread. > > Thanks! Thanks for the write-up, David! I posted a response on my blog: http://www.iunknown.com/2008/01/ironruby-vs-rub.html since I really do need an excuse to blog these days :) T-John From m.david at xmlhacker.com Wed Jan 2 12:37:09 2008 From: m.david at xmlhacker.com (M. David Peterson) Date: Wed, 02 Jan 2008 10:37:09 -0700 Subject: [Ironruby-core] Ruby.NET vs. IronRuby: Overview Posted to O'ReilyNet/Windows DevCenter In-Reply-To: References: Message-ID: On 1/2/08, John Lam (DLR) wrote: >> I posted a response on my blog: >> http://www.iunknown.com/2008/01/ironruby-vs-rub.html Thanks! I've updated the post and integrated your comments inline to the post where applicable. >> since I really do need an excuse to blog these days :) Oh, I'm sure you've just got just oodles of time on your hands these days, huh?! ;-) Well, since you're obviously looking for things to do with the extra seven seconds you have each week to work on "side" projects ;-), before I forget > http://ironruby.net still points to the GoDaddy default parked page where as http://www.ironruby.net properly points to your server. Not a huge thing, but seems worth pointing out. Hope your Holidays were great, John! -- /M:D M. David Peterson Co-Founder & Chief Architect, 3rd&Urban, LLC Email: m.david at 3rdandUrban.com | m.david at amp.fm | Mobile: (206) 418-9027 http://3rdandUrban.com | http://amp.fm | http://www.oreillynet.com/pub/au/2354 From jomes at microsoft.com Wed Jan 2 17:21:54 2008 From: jomes at microsoft.com (John Messerly) Date: Wed, 2 Jan 2008 14:21:54 -0800 Subject: [Ironruby-core] $0 global variable In-Reply-To: <000001c84996$f60a95b0$e21fc110$@com> References: <000001c84996$f60a95b0$e21fc110$@com> Message-ID: <918705E903F4714CB713D89AB5F1857D73A7DFECF5@NA-EXMSG-C116.redmond.corp.microsoft.com> Peter Bacon Darwin: > I would really like to be able to do this: > > if __FILE__ == $0 > require File.dirname(__FILE__) + '/../../Util/simple_test.rb' > end > > But, since $0 currently always returns nil, I can't. > > Any chance you could squeeze it into the next SVN revision? John Lam has ARGV working--presumably it's not too hard to make $0 work too. - John From bacondarwin at googlemail.com Wed Jan 2 17:44:39 2008 From: bacondarwin at googlemail.com (Peter Bacon Darwin) Date: Wed, 2 Jan 2008 22:44:39 -0000 Subject: [Ironruby-core] $0 global variable In-Reply-To: <918705E903F4714CB713D89AB5F1857D73A7DFECF5@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <000001c84996$f60a95b0$e21fc110$@com> <918705E903F4714CB713D89AB5F1857D73A7DFECF5@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <001401c84d91$0fec7310$2fc55930$@com> Thanks Johns. I have worked around it so it is not so important now. Nearly got the rest of the number stuff done. Look out for a big new year patch soon. Pete -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of John Messerly Sent: Wednesday,02 January 02, 2008 22:22 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] $0 global variable Peter Bacon Darwin: > I would really like to be able to do this: > > if __FILE__ == $0 > require File.dirname(__FILE__) + '/../../Util/simple_test.rb' > end > > But, since $0 currently always returns nil, I can't. > > Any chance you could squeeze it into the next SVN revision? John Lam has ARGV working--presumably it's not too hard to make $0 work too. - John _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core From lists at ruby-forum.com Fri Jan 4 03:10:03 2008 From: lists at ruby-forum.com (Softmind Technology) Date: Fri, 4 Jan 2008 09:10:03 +0100 Subject: [Ironruby-core] IronRuby on Rails or Ruby on Rails... Are we getting it Message-ID: Hi, I believe IronRuby is making good progress, though i do not get to see any news on progress. Blogs and informative details are totally missing regarding the DLR and Ironruby progress. Can any one confirm, whether we shall be getting Ruby on Rails or IronRuby on Rails with the final version of IronRuby.Is it really worth waiting for IronRuby or it would be nice to switch to original Ruby on Rails immediately, without wasting many more months with a hope....? I have read few good information in the ruby.net VS IronRuby discussion recently, but that discussion was too far to cover the Ruby on Rails support with IronRuby. The only positive answer i could found was an interview of John Lam on akitaonrails, where he was positive for Rails support with IronRuby. But even that was not a promise, it was just a hope Can some one on the developer team please focus on this. I think this would be really great if we can get it working on IronRuby. Thanks SoftMind. -- Posted via http://www.ruby-forum.com/. From sanxiyn at gmail.com Fri Jan 4 03:19:14 2008 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Fri, 4 Jan 2008 17:19:14 +0900 Subject: [Ironruby-core] IronRuby on Rails or Ruby on Rails... Are we getting it In-Reply-To: References: Message-ID: <5b0248170801040019h40345e76p81edb5520442e66@mail.gmail.com> 2008/1/4, Softmind Technology : > Can any one confirm, whether we shall be getting Ruby on Rails or > IronRuby on Rails with the final version of IronRuby.Is it really worth > waiting for IronRuby or it would be nice to switch to original Ruby on > Rails immediately, without wasting many more months with a hope....? If you want to try Ruby on Rails, I don't understand why anyone would wait for IronRuby to run it. When IronRuby runs it, it will run it in identical manner with classic Ruby, so everything you learned while trying Ruby on Rails with classic Ruby will not be wasted. -- Seo Sanghyeon From lewistm at gmail.com Fri Jan 4 09:52:40 2008 From: lewistm at gmail.com (Terence Lewis) Date: Fri, 4 Jan 2008 16:52:40 +0200 Subject: [Ironruby-core] Bug report: Assigning different blocks to the click events of separate buttons Message-ID: <2f1decf20801040652n6ef11ce6w9a5769e8f46cbe4d@mail.gmail.com> Hello list, I was playing around with the code Scott Guthrie put up back in July about calling WPF from ironruby (http://weblogs.asp.net/scottgu/archive/2007/07/23/first-look-at-ironruby.aspx) and I came across the following issue: I took the sample code and added another button with another ruby block for the click event just below the one labeled "Push Me". This second block never gets executed when I click the second button, but rather the first block gets executed. Is this a known issue, and if so, what is causing the problem? Thanks Terence From curt at hagenlocher.org Fri Jan 4 11:19:35 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Fri, 4 Jan 2008 08:19:35 -0800 Subject: [Ironruby-core] Bug report: Assigning different blocks to the click events of separate buttons In-Reply-To: <2f1decf20801040652n6ef11ce6w9a5769e8f46cbe4d@mail.gmail.com> References: <2f1decf20801040652n6ef11ce6w9a5769e8f46cbe4d@mail.gmail.com> Message-ID: On Jan 4, 2008 6:52 AM, Terence Lewis wrote: > > I took the sample code and added another button with another ruby > block for the click event just below the one labeled "Push Me". This > second block never gets executed when I click the second button, but > rather the first block gets executed. Is this a known issue, and if > so, what is causing the problem? It's a known issue. At the time it was previously identified, John Lam wrote: "We're trying to track down the cause of this, but we know that we're not building the correct rules for all cases in our ActionBinder. It's likely related to this, but we're not sure right now." -- Curt Hagenlocher curt at hagenlocher.org From jflam at microsoft.com Fri Jan 4 12:00:58 2008 From: jflam at microsoft.com (John Lam (DLR)) Date: Fri, 4 Jan 2008 09:00:58 -0800 Subject: [Ironruby-core] Patch submission - sockets In-Reply-To: <2f1decf20712290535t5a46ab6ch913e587fe16815ba@mail.gmail.com> References: <2f1decf20712290535t5a46ab6ch913e587fe16815ba@mail.gmail.com> Message-ID: <372109E149E8084D8E6C7D9CFD82E06329DD22BABC@NA-EXMSG-C115.redmond.corp.microsoft.com> Terence Lewis: > Please find attached the beginnings of a sockets implementation for > IronRuby. Included in this patch is the following: Hi Terrence, Thanks for sending in this patch; John Messerly is reviewing it so we'll be in touch soon! Thanks, -John PS We've got your contributor agreement, so that's OK as well. From jflam at microsoft.com Fri Jan 4 12:15:05 2008 From: jflam at microsoft.com (John Lam (DLR)) Date: Fri, 4 Jan 2008 09:15:05 -0800 Subject: [Ironruby-core] IronRuby on Rails or Ruby on Rails... Are we getting it In-Reply-To: References: Message-ID: <372109E149E8084D8E6C7D9CFD82E06329DD22BAD0@NA-EXMSG-C115.redmond.corp.microsoft.com> Softmind Technology: > Can any one confirm, whether we shall be getting Ruby on Rails or > IronRuby on Rails with the final version of IronRuby.Is it really worth > waiting for IronRuby or it would be nice to switch to original Ruby on > Rails immediately, without wasting many more months with a hope....? We have always maintained that we will run Rails. It wouldn't be Ruby if it couldn't run Rails. Thanks, -John From ivan at flanders.co.nz Fri Jan 4 14:07:51 2008 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Sat, 5 Jan 2008 08:07:51 +1300 Subject: [Ironruby-core] General advice Message-ID: Hi For the book I'm writing on IronRuby I'm deciding which way to go to demonstrate how IronRuby can leverage the .NET framework. The beginning of the sample application should implement some database layer. My first instinct is to go with Linq-to-SQL and consume those classes from a ruby application. I have a problem with ActiveRecord that comes with Rails, because often it doesn't allow me to the things I want to do out of the box. And when I'm in App Dev mode I don't really want to think about customizing the framework I'm using so that it fits my needs. I should just have to configure it and start developing. For this reason I don't consider ActiveRecord to be sufficient for most enterprise database systems and definitely not legacy ones. I don't think it would be a good idea to let .NET devs jump to an ORM that won't handle the more complex enterprise scenario's out of the box. I'm thinking of writing a real ORM for Ruby ala NHibernate one that uses a DataMapper with an IdentityMap backed by a Unit Of Work, when I'm finished with the book. It should also have Sql Generation that is highly optimized for each platform it supports (not just say because mssql is from ms we won't provide the best support for it we can) and maybe make it support linq-to-sql syntax. Obviously I can't build that in 2 days so I'll have to drop that idea for a while ;) A second option I have in mind is rolling my own implementation of the ActiveRecord pattern, using database reflection, an ADO.NET backend and metaprogramming since it has a very limited scope for the book. I'm always much in favor for a unit of work implementation for my dataaccess. At this moment I'm favoring the Linq-to-Sql (C#) approach because it has benefits : 1. I demonstrate interop with one of my own project assemblies and how you can extend that using IronRuby. 2. I don't have to write my own ORM 3. I won't be stopped in my writing by features that haven't been implemented yet. The downside of that approach is that it will be hard to show an example that makes real extensive use of metaprogramming. A second concern I have for the Linq-to-SQL approach is that that will only work on a windows box, because I don't think the mono-project has an implementation already. Then a last way of doing it would be to use ActiveRecord from the castle project or SubSonic where the ActiveRecord implementation of the CastleProject will be the one that handles most edge cases. The reason I bring these 2 up is that I already got questions from people asking me to put examples up on my blog about using those things from IronRuby. At this point I haven't put too much on my blog yet because I'm pretty busy writing. And I think every week I wait I'm more close to being able to use as much pure ruby as I can. Any thoughts ? Cheers Ivan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/ironruby-core/attachments/20080105/18fff09e/attachment.html From blowmage at gmail.com Fri Jan 4 16:12:07 2008 From: blowmage at gmail.com (Mike Moore) Date: Fri, 4 Jan 2008 14:12:07 -0700 Subject: [Ironruby-core] General advice In-Reply-To: References: Message-ID: Hi Ivan, I have some thoughts. I know I've been away from this list a while, sorry about that. On Jan 4, 2008 12:07 PM, Ivan Porto Carrero wrote: > Hi > > For the book I'm writing on IronRuby I'm deciding which way to go to > demonstrate how IronRuby can leverage the .NET framework. > > The beginning of the sample application should implement some database > layer. My first instinct is to go with Linq-to-SQL and consume those classes > from a ruby application. Ultimately, we should be able to call any .NET lib from IronRuby. So to an extent I don't think it matters what your pre-existing data access layer is written in, as long as it is valid .NET code. That said, if I were buying a book on IronRuby, I would want to know how Ruby approaches data access. I already know ADO.NET, and possibly the various.NET-based ORM frameworks. What I probably don't know are the Ruby libraries like DBI. > I have a problem with ActiveRecord that comes with Rails, because often it > doesn't allow me to the things I want to do out of the box. And when I'm in > App Dev mode I don't really want to think about customizing the framework > I'm using so that it fits my needs. I should just have to configure it and > start developing. For this reason I don't consider ActiveRecord to be > sufficient for most enterprise database systems and definitely not legacy > ones. I don't think it would be a good idea to let .NET devs jump to an ORM > that won't handle the more complex enterprise scenario's out of the box. Regardless whether you consider ActiveRecord sufficient, alot of developers will want to know how to use ActiveRecord from IronRuby. I think you are missing an great opportunity if AR isn't covered, along with what changes might be needed to get it to work with IronRuby. Besides, there are always the other ORM libraries that you can cover which may be a closer to what you think a good ORM should be: DataMapper - http://datamapper.org/ Sequel - http://sequel.rubyforge.org/ rBatis - http://ibatis.apache.org/docs/ruby/ > I'm thinking of writing a real ORM for Ruby ala NHibernate one that uses a > DataMapper with an IdentityMap backed by a Unit Of Work, when I'm finished > with the book. It should also have Sql Generation that is highly optimized > for each platform it supports (not just say because mssql is from ms we > won't provide the best support for it we can) and maybe make it support > linq-to-sql syntax. Obviously I can't build that in 2 days so I'll have to > drop that idea for a while ;) > > A second option I have in mind is rolling my own implementation of the > ActiveRecord pattern, using database reflection, an ADO.NET backend and > metaprogramming since it has a very limited scope for the book. I'm always > much in favor for a unit of work implementation for my dataaccess. > > At this moment I'm favoring the Linq-to-Sql (C#) approach because it has > benefits : > 1. I demonstrate interop with one of my own project assemblies and how you > can extend that using IronRuby. > 2. I don't have to write my own ORM > 3. I won't be stopped in my writing by features that haven't been > implemented yet. > > The downside of that approach is that it will be hard to show an example > that makes real extensive use of metaprogramming. > A second concern I have for the Linq-to-SQL approach is that that will > only work on a windows box, because I don't think the mono-project has an > implementation already. > > Then a last way of doing it would be to use ActiveRecord from the castle > project or SubSonic where the ActiveRecord implementation of the > CastleProject will be the one that handles most edge cases. The reason I > bring these 2 up is that I already got questions from people asking me to > put examples up on my blog about using those things from IronRuby. At this > point I haven't put too much on my blog yet because I'm pretty busy writing. > And I think every week I wait I'm more close to being able to use as much > pure ruby as I can. > > Any thoughts ? > If it were me, I'd avoid anything that required readers to use any language other than IronRuby. Good luck! > Cheers > Ivan > > > > > _______________________________________________ > 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/20080104/26aa0f82/attachment-0001.html From charles.nutter at sun.com Fri Jan 4 18:32:02 2008 From: charles.nutter at sun.com (Charles Oliver Nutter) Date: Fri, 04 Jan 2008 17:32:02 -0600 Subject: [Ironruby-core] Port of JvYAML Message-ID: <477EC1F2.8070100@sun.com> I thought of a perfect name for a .NET port of JvYAML for IronRuby: IronY. - Charlie From jomes at microsoft.com Fri Jan 4 18:50:25 2008 From: jomes at microsoft.com (John Messerly) Date: Fri, 4 Jan 2008 15:50:25 -0800 Subject: [Ironruby-core] Port of JvYAML In-Reply-To: <477EC1F2.8070100@sun.com> References: <477EC1F2.8070100@sun.com> Message-ID: <918705E903F4714CB713D89AB5F1857D73A7DFF70C@NA-EXMSG-C116.redmond.corp.microsoft.com> Charles Oliver Nutter: > I thought of a perfect name for a .NET port of JvYAML for IronRuby: > > IronY. Nice--I like it :) - John From lists at ruby-forum.com Fri Jan 4 21:55:53 2008 From: lists at ruby-forum.com (Softmind Technology) Date: Sat, 5 Jan 2008 03:55:53 +0100 Subject: [Ironruby-core] IronRuby on Rails or Ruby on Rails... Are we getting it In-Reply-To: <5b0248170801040019h40345e76p81edb5520442e66@mail.gmail.com> References: <5b0248170801040019h40345e76p81edb5520442e66@mail.gmail.com> Message-ID: <5cf0bb03b440579b054e251031823197@ruby-forum.com> Sanghyeon Seo wrote: > If you want to try Ruby on Rails, I don't understand why anyone would > wait for IronRuby to run it. When IronRuby runs it, it will run it in > identical manner with classic Ruby, so everything you learned while > trying Ruby on Rails with classic Ruby will not be wasted. ----------------------------------------------------------- Hi Seo, I am too keen on IronRuby since i do not want to leave the .Net Platform. Plain Ruby on Rails will drag me to LAMP world, which i do not want. I love Ruby and I think it can do wonders as IronRuby. I need to dive in to get proper information and a right move in the right direction. O.K... Since now i have a confirmation from Mr. John Lam, this has made my day and now i can relax and study more hard on this direction and get ready for future when IronRuby actually arrives. Thanks -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Sat Jan 5 01:50:23 2008 From: lists at ruby-forum.com (Softmind Technology) Date: Sat, 5 Jan 2008 07:50:23 +0100 Subject: [Ironruby-core] General advice In-Reply-To: References: Message-ID: <24f2c5f0f319d4287b45392e2c504d0a@ruby-forum.com> Hi, Few Suggestions here. (1) Do Not Avoid Active Record at any cost. Active Record and Migrations should be covered in depth. SubSonic is working very hard to get major parts implemented in Asp.Net MVC and General Asp.Net soon. Plus... Subsonic is very famous due to Active Record only. Majority of Developers will jump into IronRuby to take full advantage of Ruby and Ruby on rails. As per "Rob Connery" he is suppose to write a book on " SubSonic and MVC ", you may talk to him about his coverage with MVC and get a rough idea about Subsonic and Active Record implementation in Asp.Net. (2) Start building an existing Startkerkit in IronRuby, along the way you explain IronRuby. A Real life approach will be highly appreciated. You get 3 advantages with it... (a) Existing Starterkits are discussed with a working site in VB and C# currently and hence are easy to discuss further. (b) Existing developers gets an idea about comparing dynamic language with C#/Vb. They will know what a clear syntax and ironruby code can do. How many coding lines are saved by comparing C# with Ironruby. (c) New Ruby developers entering IronRuby gets a treat of working example (3) Try to make IronRuby + Asp.Net a mission. Do not waste much efforts teaching Ruby in your book. Plenty of Ruby books are already available. Developers/Students will prefer to read a Book that implements Ironruby with Asp.Net and get it started immediately. (4) Since this is a first ever book on IronRuby... It would be better to get more and more suggestions that the Ruby community wants for a real life approach. There are plenty of hopes build up on IronRuby and your book should not let them down. Mr. John Lam, has taken a practical approach by choosing this RubyForge rather than Codeplex, since he wanted more and more developers to share. Taking the same approach will justify your efforts and get the real Ironruby out. (5) IronPython ( Few Chapters ) and Jruby books are also available as a reference. (6) Do not waste pages explaining the advantages of DLR , Asp.Net and .Net framework. You can always give links for further reference. (5) I am just pointing a very good blog, that clearly requests MSFT to stop wasting much time on C# 4.0 and rather send few more hands to IronRuby team. They all are banking on IronRuby. http://codebetter.com/blogs/jeremy.miller/archive/2008/01/02/c-vnext-take-2.aspx I am just suggesting it, since i have read plenty of books and know what helps in real life. Wrox publisher's " Beer StarterKit " is very famous and preserved on shelf. You can also take inspiration building such a kit with Ironruby or other existing Kits, which can help in Real Life. Learn... Gain... and Earn... Should be the motto of the book. After all.... you are the author... you are the better judge. Thanks for listening me. SoftMind. -- Posted via http://www.ruby-forum.com/. From ivan at flanders.co.nz Sat Jan 5 02:43:05 2008 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Sat, 5 Jan 2008 20:43:05 +1300 Subject: [Ironruby-core] General advice In-Reply-To: <24f2c5f0f319d4287b45392e2c504d0a@ruby-forum.com> References: <24f2c5f0f319d4287b45392e2c504d0a@ruby-forum.com> Message-ID: Thanks for that. I can't believe I didn't know about DataMapper and rBatis, those seem like a better fit to what I want. I can follow your reasoning on ActiveRecord and it does have some weight for me, most people will be using active record because it comes with rails. I guess I could take some relevant snippets from that source code to illustrate how it has been done, because i wanted to use a model layer as an example of metaprogramming. I'll have a play with the ones you just proposed and maybe cover one in addition to ActiveRecord so that readers know there are options. The Sequel one looks like a nice and easy one to use. At this point I'm only planning to talk about using another .NET language for illustrative purposes but I want to create a pure ironruby solution that's for sure. However talking about IronRuby wouldn't be complete without talking about the Iron in IronRuby and highlighting some of the interop possibilities there are too. Because suddenly you're not limited anymore to libraries in your favorite language but you can use libraries from a collection of languages and a more vast community. That being said about 99.5% of the code samples will be Ruby. The book will take the reader through building an application built with IronRuby that leverages most of the .NET technologies like WPF, Silverlight, ASP.NET MVC, Webforms etc. I don't really want to spend a lot of time explaining rails, because there is also plenty of information available about rails, but i will show that you can do with rails and IronRuby. I'll also demonstrate how gems can make your life easier etc. A downside of showing WPF is that the reader won't be able to run those samples on mono, or will he? Keep the feedback coming, I like it :) On Jan 5, 2008 7:50 PM, Softmind Technology wrote: > Hi, > > Few Suggestions here. > > (1) Do Not Avoid Active Record at any cost. Active Record and Migrations > should be covered in depth. SubSonic is working very hard to get major > parts implemented in Asp.Net MVC and General Asp.Net soon. Plus... > Subsonic is very famous due to Active Record only. Majority of > Developers will jump into IronRuby to take full advantage of Ruby and > Ruby on rails. > > As per "Rob Connery" he is suppose to write a book on " SubSonic and MVC > ", you may talk to him about his coverage with MVC and get a rough idea > about Subsonic and Active Record implementation in Asp.Net. > > (2) Start building an existing Startkerkit in IronRuby, along the way > you explain IronRuby. A Real life approach will be highly appreciated. > You get 3 advantages with it... > > (a) Existing Starterkits are discussed with a working site in VB and C# > currently and hence are easy to discuss further. > > (b) Existing developers gets an idea about comparing dynamic language > with C#/Vb. They will know what a clear syntax and ironruby code can do. > How many coding lines are saved by comparing C# with Ironruby. > > (c) New Ruby developers entering IronRuby gets a treat of working > example > > (3) Try to make IronRuby + Asp.Net a mission. Do not waste much efforts > teaching Ruby in your book. Plenty of Ruby books are already available. > Developers/Students will prefer to read a Book that implements Ironruby > with Asp.Net and get it started immediately. > > (4) Since this is a first ever book on IronRuby... It would be better to > get more and more suggestions that the Ruby community wants for a real > life approach. > > There are plenty of hopes build up on IronRuby and your book should not > let them down. Mr. John Lam, has taken a practical approach by choosing > this RubyForge rather than Codeplex, since he wanted more and more > developers to share. Taking the same approach will justify your efforts > and get the real Ironruby out. > > (5) IronPython ( Few Chapters ) and Jruby books are also available as a > reference. > > (6) Do not waste pages explaining the advantages of DLR , Asp.Net and > .Net framework. You can always give links for further reference. > > (5) I am just pointing a very good blog, that clearly requests MSFT to > stop wasting much time on C# 4.0 and rather send few more hands to > IronRuby team. They all are banking on IronRuby. > > > http://codebetter.com/blogs/jeremy.miller/archive/2008/01/02/c-vnext-take-2.aspx > > I am just suggesting it, since i have read plenty of books and know what > helps in real life. Wrox publisher's " Beer StarterKit " is very famous > and preserved on shelf. You can also take inspiration building such a > kit with Ironruby or other existing Kits, which can help in Real Life. > > Learn... Gain... and Earn... Should be the motto of the book. > > After all.... you are the author... you are the better judge. > > Thanks for listening me. > > SoftMind. > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > 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/20080105/3d758af2/attachment.html From m.david at xmlhacker.com Sat Jan 5 15:06:12 2008 From: m.david at xmlhacker.com (M. David Peterson) Date: Sat, 05 Jan 2008 13:06:12 -0700 Subject: [Ironruby-core] Port of JvYAML In-Reply-To: References: <477EC1F2.8070100@sun.com> Message-ID: On 1/4/08, Charles Oliver Nutter wrote: > > I thought of a perfect name for a .NET port of JvYAML for IronRuby: > > IronY. How about we just skip right over Yet Another "I Hate XML Cuz' I Didn't Invent It, That's Why I Created This Half A$$ Attempt At A" Markup Language and use nothin' but Good Ol' Plain Ol' XML config files from here on out? Irony? Poetic Justice? It's all the same to me ;-) :D PLEASE NOTE: Hate mail, as always, is lovingly received @ YetAnotherLoveLetterInDisguise at xmlhacker.com. ;-) -- /M:D M. David Peterson Co-Founder & Chief Architect, 3rd&Urban, LLC Email: m.david at 3rdandUrban.com | m.david at amp.fm Mobile: (206) 418-9027 http://3rdandUrban.com | http://amp.fm | http://www.oreillynet.com/pub/au/2354 From thibaut.barrere at gmail.com Sat Jan 5 22:19:07 2008 From: thibaut.barrere at gmail.com (=?ISO-8859-1?Q?Thibaut_Barr=E8re?=) Date: Sun, 6 Jan 2008 04:19:07 +0100 Subject: [Ironruby-core] Up-to-date hosting sample ? Message-ID: <4a68b8cf0801051919u39fee047w2414317480baac31@mail.gmail.com> Hi! I'm preparing an IronRuby article for a french newspaper, and would like to demonstrate the hosting features (possibly to show how to build a small dsl to script a C# application for instance). I'm sitting on SVN at revision 68 but can't get the wiki sample [1] to compile - I believe the hosting stuff is currently under heavy modification, right ? Does anyone have an up-to-date hosting sample, or should I go back a few revisions ? cheers! [1] http://ironruby.rubyforge.org/wiki/wiki.pl?ExecutingIronRubyFromCSharp Thibaut Barr?re -- LoGeek http://evolvingworker.com - tools for a better day http://blog.logeek.fr - about writing software From jomes at microsoft.com Sun Jan 6 00:51:03 2008 From: jomes at microsoft.com (John Messerly) Date: Sat, 5 Jan 2008 21:51:03 -0800 Subject: [Ironruby-core] Patch submission - sockets In-Reply-To: <2f1decf20712290535t5a46ab6ch913e587fe16815ba@mail.gmail.com> References: <2f1decf20712290535t5a46ab6ch913e587fe16815ba@mail.gmail.com> Message-ID: <918705E903F4714CB713D89AB5F1857D73A7DFF802@NA-EXMSG-C116.redmond.corp.microsoft.com> Terence Lewis: > Please find attached the beginnings of a sockets implementation for > IronRuby. Included in this patch is the following: > > - Class BasicSocket > - Class IPSocket > - Class TCPSocket > - Class TCPServer Thanks for the patch. I'm checking it in now; it'll be included in the next SVN update. > These classes aren't completely fleshed out, but they are functional > to the point where I could create a very primitive web server using > TCPServer that returns a dynamic HTML page which displays the current > time, and read that page using either TCPSocket or my web browser. I created a very simple manual test written in Ruby (will be under tests/libraries/socket/manual_socket.rb). It's really basic, hopefully we can expand it into an better test. (although, it was pretty cool seeing IronRuby serve up a web page :) ) > A couple of points: > > > 2) This is my first contribution to an open source project, and > I'm > under no illusions as to the many flaws in this code. Any comments, > criticism or suggestion is welcome, and I assume that the code will be > reviewed before being accepted. Overall, it looks great. I made some small changes before checking in. Basically: 1. Added a method to convert AddressFamily values into strings (you're right, it doesn't appear System.Net has anything like that) 2. Added Protocols.CastToString in a few places & improved conversions. Protocol handling in Ruby is tricky--I usually test methods out in MRI and see what conversion methods they call if passed an arbitrary object. to_str & to_int being the common ones. I think we have a Protocol method for most of the MRI conversions now, so typically you should just need to call one of them. 3. TCPSocket#open needed a different implementation. This is a thing to watch out for in singleton methods--do they return an instance of the derived type, if you call them from a derived class? For example, if you do "class MyTCPSocket < TCPSocket; end" then MyTCPSocket.open, you actually get back an instance of MyTCPSocket. The way to do this in our system is to create a dynamic site that calls "new". Also, TCPSocket#open needed to yield to the block. I added that, which had the nice side effect of removing the need for TCPServer#open. 4. For TCPServer#new, we support optional parameters in the middle of the argument list, so I changed the code to use that. Also changed it to just take two args. Usually you don't need a params array unless the method takes an arbitrary number of args. 5. I added some to/from byte array helpers to MutableString to make those conversions easier. (Should get even easier once we convert to a byte-array based string like Ruby uses) > 3) There are no automated tests with this code :(. I'm more than > happy > to write tests, but I need some help and guidance about what tests to > write (or use if there are existing tests for this functionality in > JRuby or Rubinius). It seems to me that testing sockets is quite hard, > because of the need to make sure the tests run on different machines > and networks. Yeah, I couldn't find any Rubinius tests for socket. JRuby might have some, I'll need to check. > Thanks for your time Likewise! - John From charles.nutter at sun.com Sun Jan 6 01:16:10 2008 From: charles.nutter at sun.com (Charles Oliver Nutter) Date: Sun, 06 Jan 2008 00:16:10 -0600 Subject: [Ironruby-core] Patch submission - sockets In-Reply-To: <918705E903F4714CB713D89AB5F1857D73A7DFF802@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <2f1decf20712290535t5a46ab6ch913e587fe16815ba@mail.gmail.com> <918705E903F4714CB713D89AB5F1857D73A7DFF802@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <4780722A.7010802@sun.com> John Messerly wrote: > Yeah, I couldn't find any Rubinius tests for socket. JRuby might have some, I'll need to check. We have some but they're not great. Better than nothing I suppose. If you have any additions, we'd love to get patches and additions (or port the lot to rubyspecs and submit back). - Charlie From ckponnappa at gmail.com Sun Jan 6 13:43:11 2008 From: ckponnappa at gmail.com (C. K. Ponnappa) Date: Mon, 07 Jan 2008 00:13:11 +0530 Subject: [Ironruby-core] Need some help building IronRuby Message-ID: <4781213F.1070508@gmail.com> Hi everyone, I've just checked out revision 68 and everything compiles in VS. However, when running rake, I get an error. Here's the truncated rake --trace, with the error at the end. I'm running Win XP Pro 32bit with VS2008 and Ruby 1.8.6 from the one click installer. I've also installed the pathelement2 gem. D:\SVN_Storage\IronRuby\trunk>rake --trace compile (in D:/SVN_Storage/IronRuby/trunk) ** Invoke compile (first_time) ** Invoke happy (first_time) ** Execute happy ** Invoke clean_build (first_time) ** Execute clean_build ** Invoke compile_dlr (first_time) ** Execute compile_dlr resgen "D:\SVN_Storage\IronRuby\trunk\src\microsoft.scripting\Math\MathResources.resx" "D:\SVN_Storage\IronRuby\trunk\bu ild\debug\Microsoft.Scripting.Math.MathResources.resources" Read in 17 resources from "D:\SVN_Storage\IronRuby\trunk\src\microsoft.scripting\Math\MathResources.resx" Writing resource file... Done. resgen "D:\SVN_Storage\IronRuby\trunk\src\microsoft.scripting\Resources.resx" "D:\SVN_Storage\IronRuby\trunk\build\debug \Microsoft.Scripting.Resources.resources" Read in 47 resources from "D:\SVN_Storage\IronRuby\trunk\src\microsoft.scripting\Resources.resx" Writing resource file... Done. csc /nologo /noconfig /nowarn:1591,1701,1702 /errorreport:prompt /warn:4 /warnaserror+ /define:"DEBUG;TRACE" /debug+ /de bug:full /optimize- /target:library /out:"D:\SVN_Storage\IronRuby\trunk\build\debug\Microsoft.Scripting.dll" /reference: "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Configuration.dll" /reference:"C:\WINDOWS\Microsoft.NET\Framework\ v2.0.50727\System.dll" /resource:"D:\SVN_Storage\IronRuby\trunk\build\debug\Microsoft.Scripting.Math.MathResources.resou rces" /resource:"D:\SVN_Storage\IronRuby\trunk\build\debug\Microsoft.Scripting.Resources.resources" "D:\SVN_Storage\Iron Ruby\trunk\src\microsoft.scripting\ActionOnCallAttribute.cs" ... ... ... Command failed with status (0): [csc /nologo /noconfig /nowarn:1591,1701,17...] c:/languages/ruby/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:719:in `sh' Thanks, Sidu. http://blog.sidu.in -- Two's an SMS. Three's a Mob. Get your free group SMS from Activ Mobs! SMS "register your_nickname" to +91 98446 22848 to start Mobbing. http://blog.inactiv.com From Tomas.Matousek at microsoft.com Mon Jan 7 02:05:07 2008 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Sun, 6 Jan 2008 23:05:07 -0800 Subject: [Ironruby-core] Up-to-date hosting sample ? In-Reply-To: <4a68b8cf0801051919u39fee047w2414317480baac31@mail.gmail.com> References: <4a68b8cf0801051919u39fee047w2414317480baac31@mail.gmail.com> Message-ID: You're right. The Hosting API is currently under (re)construction. Therefore the example is currently not so nice: IScriptEnvironment runtime = ScriptEnvironment.GetEnvironment(); IScriptEngine engine = IronRuby.GetEngine(runtime); IScriptScope scope = engine.CreateScope(); List strings = new List(); strings.Add("one"); strings.Add("two"); IronRuby.GetExecutionContext(runtime).GlobalVariables[SymbolTable.StringToId("strings")] = strings; SourceUnit script = engine.CreateScriptSourceFromString( @" puts ""Hello World! There are #{$strings.count.to_s} strings:"" $strings.each_with_index { |s,i| puts ""#{i}: #{s}"" } "); engine.Execute(scope, script); It will get better soon. Tomas -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Thibaut Barr?re Sent: Saturday, January 05, 2008 7:19 PM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] Up-to-date hosting sample ? Hi! I'm preparing an IronRuby article for a french newspaper, and would like to demonstrate the hosting features (possibly to show how to build a small dsl to script a C# application for instance). I'm sitting on SVN at revision 68 but can't get the wiki sample [1] to compile - I believe the hosting stuff is currently under heavy modification, right ? Does anyone have an up-to-date hosting sample, or should I go back a few revisions ? cheers! [1] http://ironruby.rubyforge.org/wiki/wiki.pl?ExecutingIronRubyFromCSharp Thibaut Barr?re -- LoGeek http://evolvingworker.com - tools for a better day http://blog.logeek.fr - about writing software _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core From thibaut.barrere at gmail.com Mon Jan 7 04:20:11 2008 From: thibaut.barrere at gmail.com (=?ISO-8859-1?Q?Thibaut_Barr=E8re?=) Date: Mon, 7 Jan 2008 10:20:11 +0100 Subject: [Ironruby-core] Up-to-date hosting sample ? In-Reply-To: References: <4a68b8cf0801051919u39fee047w2414317480baac31@mail.gmail.com> Message-ID: <4a68b8cf0801070120l3e703c42j7a55d43eca97b06e@mail.gmail.com> Hi Tomas, thanks for your answer ! That will be nice enough :) Thibaut Barr?re -- LoGeek http://evolvingworker.com - tools for a better day http://blog.logeek.fr - about writing software From jflam at microsoft.com Tue Jan 8 14:59:49 2008 From: jflam at microsoft.com (John Lam (DLR)) Date: Tue, 8 Jan 2008 11:59:49 -0800 Subject: [Ironruby-core] SVN Revsion 70 Message-ID: <372109E149E8084D8E6C7D9CFD82E06329DD626484@NA-EXMSG-C115.redmond.corp.microsoft.com> I just pushed out our latest SVN release. Included is the Socket contribution from Terence Lewis (thanks!). Other highlights of this release (for folks building libraries) are: An implementation of IO that implements console and file operations. STDOUT, STDIN, STDERR are all implemented now. An updated test running infrastructure that supports running specs individually. Here are some examples: 1) Run all IO specs: rake spec io 2) Run a specific IO spec (seek): rake spec io seek 3) Run a specific IO spec with a different reporter, fail, which dumps stack traces only for the failed specs. rake spec io seek fail 4) Run all IO specs with the fail reporter: rake spec io - fail The specs also support exclusions as well - see the .spec/* files for each type for examples. It's probably a good idea to drive all specs to zero failures using exclusions. The next piece of work we're going to do is exactly this so that we can use the specs to detect regressions in our SNAP testing harness (this is the farm of machines that we use to run IronRuby on all supported configurations / platforms). Thanks, -John From geraldbauer2007 at gmail.com Wed Jan 9 15:54:02 2008 From: geraldbauer2007 at gmail.com (Gerald Bauer) Date: Wed, 9 Jan 2008 12:54:02 -0800 Subject: [Ironruby-core] RubyCamp 2008 (Vancouver-Jan/26th) - Call for Speakers, Sponsors, Hack-a-thon Projects Message-ID: <7e7cb8940801091254l7ea0731we1bbe76d91c9bf41@mail.gmail.com> Hello, == Call for RubyCamp Speakers == Just a reminder that you're invited to sign-up for a talk at the upcoming RubyCamp 2008. The sooner you send in your talk proposal the better your chances to getting approved. Official RubyCamp talk proposal deadline is January 20th, 2008. Hurry. Find details @ http://rubycamp.wordpress.com/about/#talks Need talk ideas? Have talk ideas? Stop at our wiki page @ http://barcamp.org/RubyCampVancouver == Call for Hack-a-thon or Code Sprint Projects == You're also invited to sign-up for leading a more informal RubyCamp unconference-style coding sprint, hack-a-thon or hands-on project discussion. To get started post some information about your Ruby project you're interested in leading a coding sprint or hands-on informal discussion on our wiki and send a posting to the Vancouver Ruby/Rails Mailing List/Forum @ http://forum.vanrb.com to stir up some interest from fellow Rubyists and/or Railers. == Help us get the word out == Blog about RubyCamp. Blog about your Hack-a-thon project. Blog about your RubyCamp talk or code sprint. Blog about Rubyize This! and Refactor My Code Live in Vancouver etcetera. Sign-up for our event on Facebook @ http://www.facebook.com/event.php?eid=7049363283 and/or on Yahoo! Upcoming @ http://upcoming.yahoo.com/event/390144 == Call for RubyCamp Sponsors == We love sponsors. If you're interested in sponsoring the RubyCamp, please contact the organizers. We offer sponsorship packages starting at CAN$300. More @ http://rubycamp.wordpress.com/about/#sponsors See you all at RubyCamp 2008 in Vancouver, B.C. in the Americas on Canada's Pacific West Coast. Cheers. -- Gerald Bauer - Internet Professional - http://geraldbauer.wordpress.com From bacondarwin at googlemail.com Wed Jan 9 16:20:11 2008 From: bacondarwin at googlemail.com (Peter Bacon Darwin) Date: Wed, 9 Jan 2008 21:20:11 -0000 Subject: [Ironruby-core] SVN Revsion 70 In-Reply-To: <372109E149E8084D8E6C7D9CFD82E06329DD626484@NA-EXMSG-C115.redmond.corp.microsoft.com> References: <372109E149E8084D8E6C7D9CFD82E06329DD626484@NA-EXMSG-C115.redmond.corp.microsoft.com> Message-ID: <000801c85305$6c2783d0$44768b70$@com> John Lam wrote: >> An updated test running infrastructure that supports running specs individually. and >> The next piece of work we're going to do is exactly this so that we can use the specs to detect regressions in our SNAP testing harness (this is the farm of machines that we use to run IronRuby on all supported configurations / platforms). I notice from the rake file that the :test_libs task is going to become obsolete soon. From the look of this email, it seems that all tests written in Ruby are now basically Rubinius specs. Is this the case? What happens if we right our own specs for IronRuby? Do we have to get them included in the Rubinius specs in order that they filter down to the IronRuby codebase? Cheers, Pete From jflam at microsoft.com Wed Jan 9 16:23:44 2008 From: jflam at microsoft.com (John Lam (DLR)) Date: Wed, 9 Jan 2008 13:23:44 -0800 Subject: [Ironruby-core] SVN Revsion 70 In-Reply-To: <000801c85305$6c2783d0$44768b70$@com> References: <372109E149E8084D8E6C7D9CFD82E06329DD626484@NA-EXMSG-C115.redmond.corp.microsoft.com> <000801c85305$6c2783d0$44768b70$@com> Message-ID: <372109E149E8084D8E6C7D9CFD82E06329DD626B2D@NA-EXMSG-C115.redmond.corp.microsoft.com> Peter Bacon Darwin: > I notice from the rake file that the :test_libs task is going to become > obsolete soon. From the look of this email, it seems that all tests > written > in Ruby are now basically Rubinius specs. Is this the case? What > happens > if we right our own specs for IronRuby? Do we have to get them > included in > the Rubinius specs in order that they filter down to the IronRuby > codebase? The library tests will be rubinius specs. However, we will continue to use lower-level test harnesses for testing the language. I'm working with Brian Ford to figure out what to do about integrating changes back into the rubinius specs (which will have their own home sometime soon). I've already checked in additional specs for IO into our tree. I think it should be fine to continue to work on our additions in parallel and then RI those changes back into the ruby spec tree once it gets spun up. Thanks, -John From bacondarwin at googlemail.com Thu Jan 10 03:00:51 2008 From: bacondarwin at googlemail.com (Peter Bacon Darwin) Date: Thu, 10 Jan 2008 08:00:51 -0000 Subject: [Ironruby-core] System.Double question Message-ID: <000001c8535e$ec70b620$c5522260$@com> I added this to the FloatOps class: [RubyConstant] public const double MAX = double.MaxValue; But this generated the following code in InitializerGenerated.cs: def11.SetConstant("MAX", 1.79769313486232E+308); This won't compile. The compiler says that this number is too large for a double. Double.MaxValue is actually 1.7976931348623157E+308. The initializer generator code calls ToString on the value of the constant to generate the SetConstant line of code. Unfortunately this only outputs 15 significant figures, causing the number to be rounded up to 1.79769313486232E+308, which of course is larger than double.MaxValue. Any good ideas on how to work around this? Cheers, Pete -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/ironruby-core/attachments/20080110/889fb2ab/attachment-0001.html From jflam at microsoft.com Thu Jan 10 10:06:48 2008 From: jflam at microsoft.com (John Lam (DLR)) Date: Thu, 10 Jan 2008 07:06:48 -0800 Subject: [Ironruby-core] System.Double question In-Reply-To: <000001c8535e$ec70b620$c5522260$@com> References: <000001c8535e$ec70b620$c5522260$@com> Message-ID: <372109E149E8084D8E6C7D9CFD82E06329DD6E62BC@NA-EXMSG-C115.redmond.corp.microsoft.com> I fixed this on our side and will go out in the next push to SVN. The fix was easy - rather than emitting the constant value, we emit a reference to the constant: def11.SetConstant("MAX", FloatOps.MAX); Thanks, -John From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Peter Bacon Darwin Sent: Thursday, January 10, 2008 12:01 AM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] System.Double question I added this to the FloatOps class: [RubyConstant] public const double MAX = double.MaxValue; But this generated the following code in InitializerGenerated.cs: def11.SetConstant("MAX", 1.79769313486232E+308); This won't compile. The compiler says that this number is too large for a double. Double.MaxValue is actually 1.7976931348623157E+308. The initializer generator code calls ToString on the value of the constant to generate the SetConstant line of code. Unfortunately this only outputs 15 significant figures, causing the number to be rounded up to 1.79769313486232E+308, which of course is larger than double.MaxValue. Any good ideas on how to work around this? Cheers, Pete -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/ironruby-core/attachments/20080110/5888c912/attachment.html From jflam at microsoft.com Thu Jan 10 11:39:34 2008 From: jflam at microsoft.com (John Lam (DLR)) Date: Thu, 10 Jan 2008 08:39:34 -0800 Subject: [Ironruby-core] SVN Revision 71 Message-ID: <372109E149E8084D8E6C7D9CFD82E06329DD6E6317@NA-EXMSG-C115.redmond.corp.microsoft.com> Whoops - sent to wrong list :) The major Ruby-visible change is the addition of super thanks to John Messerly. The constant generation bug that Peter reported is now fixed in this revision. You'll also see some of the beginnings of our hosting API work on console streams. The rake test runner is broken on a StringScanner test issue. On examining the test that fails, I really don't understand what the test is trying to do after looking at the sources. I've inverted the test in a shelveset that I have here which does a bunch of other test-related fixes (the goal is to drive all spec failures to zero using the exclude functionality and use zero failures as a baseline for regression testing). Tomas is now working on fixing the scanner (yay). One of the outcomes I want to see out of that work is zero failures out of the parser. Right now we still blow up on some specs due to parser exceptions. This will help drive the zero spec failure baseline from above. Thanks, -John From bacondarwin at googlemail.com Thu Jan 10 13:17:36 2008 From: bacondarwin at googlemail.com (Peter Bacon Darwin) Date: Thu, 10 Jan 2008 18:17:36 -0000 Subject: [Ironruby-core] SVN Revision 71 In-Reply-To: <372109E149E8084D8E6C7D9CFD82E06329DD6E6317@NA-EXMSG-C115.redmond.corp.microsoft.com> References: <372109E149E8084D8E6C7D9CFD82E06329DD6E6317@NA-EXMSG-C115.redmond.corp.microsoft.com> Message-ID: <000f01c853b5$157cb720$40762560$@com> John Lam: > Tomas is now working on fixing the scanner (yay). One of the outcomes I want to see out of that work is zero failures out of the > parser. Right now we still blow up on some specs due to parser exceptions. This will help drive the zero spec failure baseline > from above. Does that include "turning on" Bignum? From jflam at microsoft.com Thu Jan 10 13:18:49 2008 From: jflam at microsoft.com (John Lam (DLR)) Date: Thu, 10 Jan 2008 10:18:49 -0800 Subject: [Ironruby-core] SVN Revision 71 In-Reply-To: <000f01c853b5$157cb720$40762560$@com> References: <372109E149E8084D8E6C7D9CFD82E06329DD6E6317@NA-EXMSG-C115.redmond.corp.microsoft.com> <000f01c853b5$157cb720$40762560$@com> Message-ID: <372109E149E8084D8E6C7D9CFD82E06329DD6E63EF@NA-EXMSG-C115.redmond.corp.microsoft.com> Peter Bacon Darwin: > Does that include "turning on" Bignum? Yes. I was hacking on turning on Bignum in another shelveset earlier, but I think we can do it as part of that change. Thanks, -John From ckponnappa at gmail.com Thu Jan 10 16:42:36 2008 From: ckponnappa at gmail.com (C. K. Ponnappa) Date: Fri, 11 Jan 2008 03:12:36 +0530 Subject: [Ironruby-core] IS there a problem building usinf 3.5? Message-ID: <4786914C.50309@gmail.com> I'm using Visual C# 2008 Compiler version 3.5.21022.8 to try to build, but csc simply terminates when I do a rake compile. Should I be using only the compiler which ships with.Net 2.0? Thanks, Sidu. -- Two's an SMS. Three's a Mob. Get your free group SMS from Activ Mobs! SMS "register your_nickname" to +91 98446 22848 to start Mobbing. http://blog.inactiv.com From bacondarwin at googlemail.com Thu Jan 10 16:36:40 2008 From: bacondarwin at googlemail.com (Peter Bacon Darwin) Date: Thu, 10 Jan 2008 21:36:40 -0000 Subject: [Ironruby-core] RUBY_VERSION Message-ID: <000301c853d0$e472c950$ad585bf0$@com> Currently RUBY_VERSION reports 1.0.0.0. This is set in Ruby.Runtime.RubyContext. public const string/*!*/ Version = "1.0.0.0"; What is the strategy for this value? Will it be set to the CRuby version that we are targeting, e.g. 1.8.6 or will IronRuby run its own version numbering? Pete -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/ironruby-core/attachments/20080110/d3095837/attachment.html From Tomas.Matousek at microsoft.com Thu Jan 10 16:50:52 2008 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Thu, 10 Jan 2008 13:50:52 -0800 Subject: [Ironruby-core] RUBY_VERSION In-Reply-To: <000301c853d0$e472c950$ad585bf0$@com> References: <000301c853d0$e472c950$ad585bf0$@com> Message-ID: It should be CRuby version. We can introduce additional constant IRONRUBY_VERSION if necessary. Tomas From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Peter Bacon Darwin Sent: Thursday, January 10, 2008 1:37 PM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] RUBY_VERSION Currently RUBY_VERSION reports 1.0.0.0. This is set in Ruby.Runtime.RubyContext. public const string/*!*/ Version = "1.0.0.0"; What is the strategy for this value? Will it be set to the CRuby version that we are targeting, e.g. 1.8.6 or will IronRuby run its own version numbering? Pete -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/ironruby-core/attachments/20080110/b6da5b8a/attachment-0001.html From lewistm at gmail.com Thu Jan 10 18:33:17 2008 From: lewistm at gmail.com (Terence Lewis) Date: Fri, 11 Jan 2008 01:33:17 +0200 Subject: [Ironruby-core] Patch submission - sockets In-Reply-To: <918705E903F4714CB713D89AB5F1857D73A7DFF802@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <2f1decf20712290535t5a46ab6ch913e587fe16815ba@mail.gmail.com> <918705E903F4714CB713D89AB5F1857D73A7DFF802@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <2f1decf20801101533k60077d05y543ecf227ff17c96@mail.gmail.com> Hi John, Thanks for taking the time to tidy up my code and check it in :). I've got a few more questions... > 3. TCPSocket#open needed a different implementation. This is a thing to watch out for in singleton methods--do they return an instance of the derived type, if you call them from a derived class? For example, if you do "class MyTCPSocket < TCPSocket; end" then MyTCPSocket.open, you actually get back an instance of MyTCPSocket. The way to do this in our system is to create a dynamic site that calls "new". Also, TCPSocket#open needed to yield to the block. I added that, which had the nice side effect of removing the need for TCPServer#open. 1) I don't see any "open" method anywhere in Socket.cs anymore. I tested it though and it still works, so I did a quick search through the code and came up with [RubyMethod("open")] in IoOps.cs. I assume this is what's being called now for both TCPSocket.open and TCPServer.open because of BasicSocket's inheritance from RubyIO - this is the dynamic site to which you refer? It is a nice side effect not having to handle the block :) 2) Regarding the ConvertToPort function (which is currently incorrectly spelled with only 1 t in the middle), there is a function in the winsock dll called getservbyname which will do this conversion for you - unfortunately it's not exposed to .NET at all as far as I can tell. It's also exposed directly by Ruby's socket class as the method "getservbyname", so we are going to need to call it. I've written a simple P/Invoke call which will call into ws2_32.dll to get this information, but I realized only after almost finishing the code that you guys may want to steer clear of P/Invoke for compatibility reasons. Is that true and if so, how can I go about implementing this function manually - does anybody know where I can get a list of what it can return? If not (i.e p/invoke is OK), does something special have to be done to make that code work on mono? I thought I'd get an answer on these questions before tidying up my code and submitting it. 3) Can I get a quick yes/no answer as to whether I'm allowed to look at MRI's source code and still contribute to this project? Also, are you guys (Microsoft employees) allowed to look at this code - and if you're not, can I still refer to MRI source code in questions I post to this list regarding implementation details? Thanks Terence From jomes at microsoft.com Thu Jan 10 18:56:00 2008 From: jomes at microsoft.com (John Messerly) Date: Thu, 10 Jan 2008 15:56:00 -0800 Subject: [Ironruby-core] Patch submission - sockets In-Reply-To: <2f1decf20801101533k60077d05y543ecf227ff17c96@mail.gmail.com> References: <2f1decf20712290535t5a46ab6ch913e587fe16815ba@mail.gmail.com> <918705E903F4714CB713D89AB5F1857D73A7DFF802@NA-EXMSG-C116.redmond.corp.microsoft.com> <2f1decf20801101533k60077d05y543ecf227ff17c96@mail.gmail.com> Message-ID: <918705E903F4714CB713D89AB5F1857D73A7F0149A@NA-EXMSG-C116.redmond.corp.microsoft.com> Terence Lewis: > > 3. TCPSocket#open needed a different implementation. This is a thing > to watch out for in singleton methods--do they return an instance of > the derived type, if you call them from a derived class? For example, > if you do "class MyTCPSocket < TCPSocket; end" then MyTCPSocket.open, > you actually get back an instance of MyTCPSocket. The way to do this in > our system is to create a dynamic site that calls "new". Also, > TCPSocket#open needed to yield to the block. I added that, which had > the nice side effect of removing the need for TCPServer#open. > > 1) I don't see any "open" method anywhere in Socket.cs anymore. I > tested it though and it still works, so I did a quick search through > the code and came up with [RubyMethod("open")] in IoOps.cs. I assume > this is what's being called now for both TCPSocket.open and > TCPServer.open because of BasicSocket's inheritance from RubyIO - this > is the dynamic site to which you refer? It is a nice side effect not > having to handle the block :) Yup, there's just IO#open. I think it's that way in MRI: [BasicSocket,IPSocket,TCPSocket,TCPServer].any? { |x| x.methods(false).include? "open" } # => false IO.methods(false).include? "open" # => true > 2) Regarding the ConvertToPort function (which is currently incorrectly > spelled with only 1 t in the middle), there is a function in the > winsock dll called getservbyname which will do this conversion for you > - unfortunately it's not exposed to .NET at all as far as I can tell. > It's also exposed directly by Ruby's socket class as the method > "getservbyname", so we are going to need to call it. I've written a > simple P/Invoke call which will call into ws2_32.dll to get this > information, but I realized only after almost finishing the code that > you guys may want to steer clear of P/Invoke for compatibility reasons. > Is that true and if so, how can I go about implementing this function > manually - does anybody know where I can get a list of what it can > return? If not (i.e p/invoke is OK), does something special have to be > done to make that code work on mono? I thought I'd get an answer on > these questions before tidying up my code and submitting it. Yup, we're trying to avoid pinvokes. Would be better if we could find a managed way to do it. Unfortunately this post suggests there isn't a nice API: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=347426&SiteID=1. > 3) Can I get a quick yes/no answer as to whether I'm allowed to look at > MRI's source code and still contribute to this project? Also, are you > guys (Microsoft employees) allowed to look at this code - and if you're > not, can I still refer to MRI source code in questions I post to this > list regarding implementation details? Not sure whether you're allowed to look at MRI code. We aren't. - John From sanxiyn at gmail.com Thu Jan 10 19:06:50 2008 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Fri, 11 Jan 2008 09:06:50 +0900 Subject: [Ironruby-core] Patch submission - sockets In-Reply-To: <2f1decf20801101533k60077d05y543ecf227ff17c96@mail.gmail.com> References: <2f1decf20712290535t5a46ab6ch913e587fe16815ba@mail.gmail.com> <918705E903F4714CB713D89AB5F1857D73A7DFF802@NA-EXMSG-C116.redmond.corp.microsoft.com> <2f1decf20801101533k60077d05y543ecf227ff17c96@mail.gmail.com> Message-ID: <5b0248170801101606s2079dc9am33de45d3e980b5b8@mail.gmail.com> 2008/1/11, Terence Lewis : > 2) Regarding the ConvertToPort function (which is currently > incorrectly spelled with only 1 t in the middle), there is a function > in the winsock dll called getservbyname which will do this conversion > for you - unfortunately it's not exposed to .NET at all as far as I > can tell. It's also exposed directly by Ruby's socket class as the > method "getservbyname", so we are going to need to call it. I've > written a simple P/Invoke call which will call into ws2_32.dll to get > this information, but I realized only after almost finishing the code > that you guys may want to steer clear of P/Invoke for compatibility > reasons. Is that true and if so, how can I go about implementing this > function manually - does anybody know where I can get a list of what > it can return? If not (i.e p/invoke is OK), does something special > have to be done to make that code work on mono? I thought I'd get an > answer on these questions before tidying up my code and submitting it. In theory, getservbyname returns IANA-specified port numbers. http://www.iana.org/assignments/port-numbers In practice, implementing common ports like FTP and HTTP would suffice. Re: P/Invoke. You need to specify the different DLL name, otherwise it's same. In this case, socket functions are in libc, So [DllImport("libc")]. -- Seo Sanghyeon From lists at ruby-forum.com Fri Jan 11 03:29:01 2008 From: lists at ruby-forum.com (Softmind Technology) Date: Fri, 11 Jan 2008 09:29:01 +0100 Subject: [Ironruby-core] Any dates for Beta Versions and Implenting IronRuby..? Message-ID: <6a7d87069e1c86d16762abe6094eed78@ruby-forum.com> Hi, After reading this blog on IronRuby, I am tempted to start working on Beta Versions. http://ironruby.blogspot.com/2008/01/classic-ruby-losing-against-ironruby.html Since i am just new, and do not know procedures. I am not comfortable working with subversions. I am looking for an easy way to implement IronRuby on Ruby On Steel or any other IDE available currently that implements such thing. Initially only IRonRuby support without Rails is enough for me. I always wanted an IDE like IronPython Studio and finally my half prayers are heard. We have the Steel IDE, but for plain ruby only. http://www.sapphiresteel.com/Ruby-In-Steel-Text-Edition Silverlight 2.0 Beta is declared to be around March 2008, so i presume DLR would be almost completed by then, it would not be longer for IronRuby to Run on DLR then....am i right...? IronRuby and DLR were announced at MIX 2007 on April 2007 and the New MIX 2008 is round the corner on march 5th 2008. Its almost a year for IronRuby and i still see only alpha label around.IronRuby in fact have trademarked many codes from Ruby.Net and have been in the process since long. Its surprising to see the Pre-Alpha label still hanging around. I have been writing currently ruby codes on NetBeans and I am basically a .net guy, i am really tempted to get working with IronRuby. Pl. guide me with the Beta Stage or CTP details. Thanks -- Posted via http://www.ruby-forum.com/. From lewistm at gmail.com Fri Jan 11 08:04:39 2008 From: lewistm at gmail.com (Terence Lewis) Date: Fri, 11 Jan 2008 15:04:39 +0200 Subject: [Ironruby-core] Patch submission - sockets In-Reply-To: <5b0248170801101606s2079dc9am33de45d3e980b5b8@mail.gmail.com> References: <2f1decf20712290535t5a46ab6ch913e587fe16815ba@mail.gmail.com> <918705E903F4714CB713D89AB5F1857D73A7DFF802@NA-EXMSG-C116.redmond.corp.microsoft.com> <2f1decf20801101533k60077d05y543ecf227ff17c96@mail.gmail.com> <5b0248170801101606s2079dc9am33de45d3e980b5b8@mail.gmail.com> Message-ID: <2f1decf20801110504h38dd089cq3bce90c56e7c2c72@mail.gmail.com> > In theory, getservbyname returns IANA-specified port numbers. > http://www.iana.org/assignments/port-numbers > > In practice, implementing common ports like FTP and HTTP would suffice. Cool - will leave it as is for now. On a slightly different tack then, there is the following comment in the code: // TODO: this won't work at all with the existing RubyIO implementation until I implement a proxy class that wraps Socket in a Stream // TODO: i think that stream should do all of the IO mode checking and throw where appropriate ... in the case of sockets, only // the socket class knows whether it can read or write from a given socket - the IOMode flags don't exist at all ... I tried to use the System.IO.NetworkStream class to pass a stream object through to RubyIO (John - was this what you meant by the above comment?), but I ran into a few problems - notably: 1) RubyIO calls IsEndOfStream which tries to do a peek, which in turn tries to get the stream's position - NetworkStream throws an exception when Position is called. As a temporary solution to work around this I made IsEndOfStream virtual and overrode it in BasicSocket to always return false, which lead me onto... 2) I could then read data off the socket via the NetworkStream in RubyIOOps.ReadLine, but as soon as I hit '\r' GetChar() again does a peek to see if a '\n' is coming and NetworkStream once again throws an exception. These hacks on my part lead me to believe that you do not intend to use NetworkStream directly, but rather a custom stream implementation that will behave itself properly according to how RubyIO uses the System.IO.Stream interface. Is that correct? If so, I'm going to try and make a start on that custom stream (I'll look at ConsoleStream for insipration) - but in that case I have a few more questions (for now :) : For peek to work properly, I assume I'm going to have to read data off the socket and buffer it inside the stream-socket-wrapper class - is that correct? If so, I suppose the stream's Position property will have to not throw an exception (else we're no better off than NetworkStream when it comes to peeking), but what should it do instead? Should it just be a do-nothing getter and setter to satisfy RubyIO's peek? Thanks for your patience Terence From bacondarwin at googlemail.com Fri Jan 11 08:09:30 2008 From: bacondarwin at googlemail.com (Peter Bacon Darwin) Date: Fri, 11 Jan 2008 13:09:30 -0000 Subject: [Ironruby-core] Automatic conversion of bool to int Message-ID: <000b01c85453$35264b60$9f72e220$@com> In irb we have: 1 + true => TypeError: true can't be coerced into Fixnum In rbx we have: 1 + true => 2 There are the following methods for + in Fixnum: public static object Add(int self, int other) public static double Add(int self, double other) public static object Add(CodeContext/*!*/ context, object self, object other) I expected that passing a bool into + operator would have ended up at the third overload, which would give the correct behaviour when it tries to coerce on the bool. But it actually gets mapped to the first overload and there is an implicit conversion of true to 1. You can see this in the resulting AST dump: (FixnumOps.Add)( (.bound $arg0), (Converter.ConvertToInt32)( (Object)(.bound $arg1), ), ) After some digging I found this method in Ruby.Runtime.Converter: private static bool HasImplicitNumericConversion(Type fromType, Type toType) { if (fromType.IsEnum) return false; if (fromType == typeof(BigInteger)) { if (toType == typeof(double)) return true; if (toType == typeof(float)) return true; if (toType == typeof(Complex64)) return true; return false; } if (fromType == typeof(bool)) { if (toType == typeof(int)) return true; return HasImplicitNumericConversion(typeof(int), toType); } ... Here you can see that bool is automatically converted to an int. Is this correct behaviour? I appreciate that we can take any non-nil value as true and nil as false but not the other way round. ASIDE: In fact all three methods are added as "Applicable Targets" but the int version gets there first. Is there a heuristic for the order in which overloads are considered? Regards, Pete -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/ironruby-core/attachments/20080111/d10a93c6/attachment-0001.html From thibaut.barrere at gmail.com Fri Jan 11 10:25:44 2008 From: thibaut.barrere at gmail.com (=?ISO-8859-1?Q?Thibaut_Barr=E8re?=) Date: Fri, 11 Jan 2008 16:25:44 +0100 Subject: [Ironruby-core] Requiring home-baked C# dlls Message-ID: <4a68b8cf0801110725h18d83419u17a5e5d794495407@mail.gmail.com> Hi, a quick report: when requiring a home-baked C# dll from ruby (require 'service.dll') I get a Ruby.Builtins.LoadError - french error message on my machine, but it could mean something like informations about an absolute path are required. In case its useful to newcomers like myself, this can be solved using for instance: require File.dirname(__FILE__) + "/service.dll" I guess it is something which will change in the future, right ? Is it useful to file a bug for that ? cheers -- Thibaut From Tomas.Matousek at microsoft.com Fri Jan 11 12:15:54 2008 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Fri, 11 Jan 2008 09:15:54 -0800 Subject: [Ironruby-core] Automatic conversion of bool to int In-Reply-To: <000b01c85453$35264b60$9f72e220$@com> References: <000b01c85453$35264b60$9f72e220$@com> Message-ID: The conversions are wrong. In fact, they are quire arbitrary (the code is in fact partly copied from IronPython). We have an item on our todo list to reimplement them from scratch. Tomas From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Peter Bacon Darwin Sent: Friday, January 11, 2008 5:10 AM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] Automatic conversion of bool to int In irb we have: 1 + true => TypeError: true can't be coerced into Fixnum In rbx we have: 1 + true => 2 There are the following methods for + in Fixnum: public static object Add(int self, int other) public static double Add(int self, double other) public static object Add(CodeContext/*!*/ context, object self, object other) I expected that passing a bool into + operator would have ended up at the third overload, which would give the correct behaviour when it tries to coerce on the bool. But it actually gets mapped to the first overload and there is an implicit conversion of true to 1. You can see this in the resulting AST dump: (FixnumOps.Add)( (.bound $arg0), (Converter.ConvertToInt32)( (Object)(.bound $arg1), ), ) After some digging I found this method in Ruby.Runtime.Converter: private static bool HasImplicitNumericConversion(Type fromType, Type toType) { if (fromType.IsEnum) return false; if (fromType == typeof(BigInteger)) { if (toType == typeof(double)) return true; if (toType == typeof(float)) return true; if (toType == typeof(Complex64)) return true; return false; } if (fromType == typeof(bool)) { if (toType == typeof(int)) return true; return HasImplicitNumericConversion(typeof(int), toType); } ... Here you can see that bool is automatically converted to an int. Is this correct behaviour? I appreciate that we can take any non-nil value as true and nil as false but not the other way round. ASIDE: In fact all three methods are added as "Applicable Targets" but the int version gets there first. Is there a heuristic for the order in which overloads are considered? Regards, Pete -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/ironruby-core/attachments/20080111/a3475fc9/attachment.html From dinov at exchange.microsoft.com Fri Jan 11 12:17:40 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Fri, 11 Jan 2008 09:17:40 -0800 Subject: [Ironruby-core] Automatic conversion of bool to int In-Reply-To: References: <000b01c85453$35264b60$9f72e220$@com> Message-ID: <7AD436E4270DD54A94238001769C2227FB8EC173DD@DF-GRTDANE-MSG.exchange.corp.microsoft.com> And regarding your applicable targets question: Yes, infact there's two ways to specify the preference, hopefully that'll go back down to 1 someday :). The ActionBinder provides the conversion helpers and has two methods related to this. The first is the PreferConvert method where you're passed two types and you select which one you want. The 2nd (and more likely to survive long term) is SelectBestConversionFor where you get the actual type passed in, and the two types that are candidates for method selection, as well as the current NarrowingLevel. Currently we first consult SelectBestConversionFor and the last thing we do is check PreferConvert if we still haven't figured out the best method. This is done on a parameter by parameter basis and so all of the parameters need to be better than the parameters for another method otherwise we'll have an ambiguous match. From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Tomas Matousek Sent: Friday, January 11, 2008 9:16 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Automatic conversion of bool to int The conversions are wrong. In fact, they are quire arbitrary (the code is in fact partly copied from IronPython). We have an item on our todo list to reimplement them from scratch. Tomas From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Peter Bacon Darwin Sent: Friday, January 11, 2008 5:10 AM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] Automatic conversion of bool to int In irb we have: 1 + true => TypeError: true can't be coerced into Fixnum In rbx we have: 1 + true => 2 There are the following methods for + in Fixnum: public static object Add(int self, int other) public static double Add(int self, double other) public static object Add(CodeContext/*!*/ context, object self, object other) I expected that passing a bool into + operator would have ended up at the third overload, which would give the correct behaviour when it tries to coerce on the bool. But it actually gets mapped to the first overload and there is an implicit conversion of true to 1. You can see this in the resulting AST dump: (FixnumOps.Add)( (.bound $arg0), (Converter.ConvertToInt32)( (Object)(.bound $arg1), ), ) After some digging I found this method in Ruby.Runtime.Converter: private static bool HasImplicitNumericConversion(Type fromType, Type toType) { if (fromType.IsEnum) return false; if (fromType == typeof(BigInteger)) { if (toType == typeof(double)) return true; if (toType == typeof(float)) return true; if (toType == typeof(Complex64)) return true; return false; } if (fromType == typeof(bool)) { if (toType == typeof(int)) return true; return HasImplicitNumericConversion(typeof(int), toType); } ... Here you can see that bool is automatically converted to an int. Is this correct behaviour? I appreciate that we can take any non-nil value as true and nil as false but not the other way round. ASIDE: In fact all three methods are added as "Applicable Targets" but the int version gets there first. Is there a heuristic for the order in which overloads are considered? Regards, Pete -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/ironruby-core/attachments/20080111/56cae141/attachment-0001.html From jomes at microsoft.com Fri Jan 11 19:54:57 2008 From: jomes at microsoft.com (John Messerly) Date: Fri, 11 Jan 2008 16:54:57 -0800 Subject: [Ironruby-core] Patch submission - sockets In-Reply-To: <918705E903F4714CB713D89AB5F1857D73A7F0149A@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <2f1decf20712290535t5a46ab6ch913e587fe16815ba@mail.gmail.com> <918705E903F4714CB713D89AB5F1857D73A7DFF802@NA-EXMSG-C116.redmond.corp.microsoft.com> <2f1decf20801101533k60077d05y543ecf227ff17c96@mail.gmail.com> <918705E903F4714CB713D89AB5F1857D73A7F0149A@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <918705E903F4714CB713D89AB5F1857D73B26BB7F4@NA-EXMSG-C116.redmond.corp.microsoft.com> John Messerly: > > 3) Can I get a quick yes/no answer as to whether I'm allowed to look > > at MRI's source code and still contribute to this project? Also, are > > you guys (Microsoft employees) allowed to look at this code - and if > > you're not, can I still refer to MRI source code in questions I post > > to this list regarding implementation details? > > Not sure whether you're allowed to look at MRI code. We aren't. Got clarification. Basically, the only requirement for contributors is to follow the contributor agreement. Otherwise, look at anything you want. (Also referring to MRI code on the list is fine too--people do it on ruby-core, to which I'm subscribed, I don't see how that would be any different from this list) - John From jlangston at evolutionbenefits.com Fri Jan 11 21:10:16 2008 From: jlangston at evolutionbenefits.com (Langston, Jason) Date: Fri, 11 Jan 2008 21:10:16 -0500 Subject: [Ironruby-core] IS there a problem building usinf 3.5? Message-ID: <01B8DC4558C7B2449D0505F2B63C4255B6E9E4@whamail.wha.com> I've successfully(*) built using "rake compile" and the Visual C# 2008 Compiler version 3.5.21022.8. I think you'll have to post a bit more about the exact error you are getting. Jason Langston http://rubydoes.net * I'll caveat that with the fact I am running into a problem building the IronRubyTestHost (the path to System.Windows.Forms.dll is wacked). But rbx, tests, etc. all work. -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of C. K. Ponnappa Sent: Thursday, January 10, 2008 4:43 PM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] IS there a problem building usinf 3.5? I'm using Visual C# 2008 Compiler version 3.5.21022.8 to try to build, but csc simply terminates when I do a rake compile. Should I be using only the compiler which ships with.Net 2.0? Thanks, Sidu. -- Two's an SMS. Three's a Mob. Get your free group SMS from Activ Mobs! SMS "register your_nickname" to +91 98446 22848 to start Mobbing. http://blog.inactiv.com _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core From jason.langston at gmail.com Fri Jan 11 21:30:29 2008 From: jason.langston at gmail.com (Jason Langston) Date: Fri, 11 Jan 2008 21:30:29 -0500 Subject: [Ironruby-core] Minor nit in Rakefile (-r71) Message-ID: Hey all, Don't know if it's just me (I had to tweak the Rakefile to run under cygwin), but noticed a problem running the Rakefile. Specifically the compile IronRubyTestHost task was failing with the message: can't find file C:\WINDOWS\Microsoft.NET\Framework\v2.0.50722\C:\WINDOWS\Microsoft.NET\Framework\v2.0.50722\System.Windows.Forms.dll I tracked it down to the FRAMEWORK_DIR being prepended to the reference "!System.Windows.Forms.dll" in two places: def self.references(*refs) references = COMMON_REFERENCES #here we replace the ! token with FRAMEWORK_DIR refs.each { |ref| references << (ref =~ /^\!/ ? FRAMEWORK_DIR + ref[1..ref.length] : Environment.build + ref) } references end ... def self.compile(files, references, switches, path, resources, output) switches << "out:\"#{Environment.build + output}\"" resgen path, resources if resources != {} #we again prepend the FRAMEWORK_DIR here references.each { |ref| switches << "reference:\"#{ref.absolute? ? ref : FRAMEWORK_DIR + ref}\"" } ... locally I fixed it by replacing the last reference with: references.each { |ref| switches << "reference:\"#{ref}\"" } HTH, Jason Langston http://rubydoes.net -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/ironruby-core/attachments/20080111/7cefe5aa/attachment.html From thibaut.barrere at gmail.com Sat Jan 12 04:33:14 2008 From: thibaut.barrere at gmail.com (=?ISO-8859-1?Q?Thibaut_Barr=E8re?=) Date: Sat, 12 Jan 2008 10:33:14 +0100 Subject: [Ironruby-core] Float parsing is culture dependent (patch included) Message-ID: <4a68b8cf0801120133m4c8f84ebh325db56030bfd199@mail.gmail.com> Hi, if you type "1.0" then enter under rbx on a french machine (or any machine with something different than dot for the decimal separator), you'll get an exception. I've attached a patch which works for me. -- Thibaut -------------- next part -------------- A non-text attachment was scrubbed... Name: float_parsing_culture_dependent.patch Type: application/octet-stream Size: 633 bytes Desc: not available Url : http://rubyforge.org/pipermail/ironruby-core/attachments/20080112/61d977ff/attachment.obj From dinov at exchange.microsoft.com Sat Jan 12 05:09:27 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Sat, 12 Jan 2008 02:09:27 -0800 Subject: [Ironruby-core] Float parsing is culture dependent (patch included) In-Reply-To: <4a68b8cf0801120133m4c8f84ebh325db56030bfd199@mail.gmail.com> References: <4a68b8cf0801120133m4c8f84ebh325db56030bfd199@mail.gmail.com> Message-ID: <7AD436E4270DD54A94238001769C2227FB8E9C69D7@DF-GRTDANE-MSG.exchange.corp.microsoft.com> FYI we've also recently ran into some IronPython bugs which were "culture" dependent as well. In our case these were date/time methods. If anyone's interested in taking it on it might be interesting to see all the results from running the various tests under alternate "cultures". ________________________________________ From: ironruby-core-bounces at rubyforge.org [ironruby-core-bounces at rubyforge.org] On Behalf Of Thibaut Barr?re [thibaut.barrere at gmail.com] Sent: Saturday, January 12, 2008 1:33 AM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] Float parsing is culture dependent (patch included) Hi, if you type "1.0" then enter under rbx on a french machine (or any machine with something different than dot for the decimal separator), you'll get an exception. I've attached a patch which works for me. -- Thibaut From thibaut.barrere at gmail.com Sat Jan 12 05:53:31 2008 From: thibaut.barrere at gmail.com (=?ISO-8859-1?Q?Thibaut_Barr=E8re?=) Date: Sat, 12 Jan 2008 11:53:31 +0100 Subject: [Ironruby-core] Float parsing is culture dependent (patch included) In-Reply-To: <7AD436E4270DD54A94238001769C2227FB8E9C69D7@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <4a68b8cf0801120133m4c8f84ebh325db56030bfd199@mail.gmail.com> <7AD436E4270DD54A94238001769C2227FB8E9C69D7@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <4a68b8cf0801120253r564b7be4h145767833b9054a7@mail.gmail.com> I ran rake specs. Before my patch, it blew up at core/struct/each_pair_spec.rb (the very beginning). After applying the patch, I get this amount of failures: Total failures: 347 out of 1029 examples Not sure how this compares to an english machine ? Running "rake test" also blew up just after Dir tests. Applying the patch managed to let the runner reach third test of StringScanner#new (which blows up and makes rake abort). If someone would like to get the full "rake specs" output, drop me a line (it's 370kb long - I thought I wouldn't send it to the list directly). cheers -- Thibaut From Cory.Foy at microsoft.com Sat Jan 12 08:49:32 2008 From: Cory.Foy at microsoft.com (Cory Foy) Date: Sat, 12 Jan 2008 05:49:32 -0800 Subject: [Ironruby-core] IS there a problem building usinf 3.5? Message-ID: <1AC17FAF2165B641AC2AF42BBEED58CF3BFE75A0E2@NA-EXMSG-C110.redmond.corp.microsoft.com> Note that there shouldn't be any difference between 2.0 and 3.5 - 2.0, 3.0 and 3.5 all use the 2.0 CLR. They just add additional features (like workflow, WCF and WPF) Cory -----Original Message----- From: "Langston, Jason" To: "ironruby-core at rubyforge.org" Sent: 1/11/08 9:10 PM Subject: Re: [Ironruby-core] IS there a problem building usinf 3.5? I've successfully(*) built using "rake compile" and the Visual C# 2008 Compiler version 3.5.21022.8. I think you'll have to post a bit more about the exact error you are getting. Jason Langston http://rubydoes.net * I'll caveat that with the fact I am running into a problem building the IronRubyTestHost (the path to System.Windows.Forms.dll is wacked). But rbx, tests, etc. all work. -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of C. K. Ponnappa Sent: Thursday, January 10, 2008 4:43 PM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] IS there a problem building usinf 3.5? I'm using Visual C# 2008 Compiler version 3.5.21022.8 to try to build, but csc simply terminates when I do a rake compile. Should I be using only the compiler which ships with.Net 2.0? Thanks, Sidu. -- Two's an SMS. Three's a Mob. Get your free group SMS from Activ Mobs! SMS "register your_nickname" to +91 98446 22848 to start Mobbing. http://blog.inactiv.com _______________________________________________ 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 From ckponnappa at gmail.com Sat Jan 12 10:27:48 2008 From: ckponnappa at gmail.com (C. K. Ponnappa) Date: Sat, 12 Jan 2008 20:57:48 +0530 Subject: [Ironruby-core] IS there a problem building usinf 3.5? In-Reply-To: <1AC17FAF2165B641AC2AF42BBEED58CF3BFE75A0E2@NA-EXMSG-C110.redmond.corp.microsoft.com> References: <1AC17FAF2165B641AC2AF42BBEED58CF3BFE75A0E2@NA-EXMSG-C110.redmond.corp.microsoft.com> Message-ID: <4788DC74.50705@gmail.com> Ok, I'm quoting my previous mail describing the issue - could you guys take a look and see if you can spot the problem? It still occurs even on revision 71. I'd appreciate any help you can give me. -Sidu > I've just checked out revision 68 and everything compiles in VS. > However, when running rake, I get an error. Here's the truncated rake > --trace, with the error at the end. I'm running Win XP Pro 32bit with > VS2008 and Ruby 1.8.6 from the one click installer. I've also > installed the pathelement2 gem. > > D:\SVN_Storage\IronRuby\trunk>rake --trace compile > (in D:/SVN_Storage/IronRuby/trunk) > ** Invoke compile (first_time) > ** Invoke happy (first_time) > ** Execute happy > ** Invoke clean_build (first_time) > ** Execute clean_build > ** Invoke compile_dlr (first_time) > ** Execute compile_dlr > resgen > "D:\SVN_Storage\IronRuby\trunk\src\microsoft.scripting\Math\MathResources.resx" > "D:\SVN_Storage\IronRuby\trunk\bu > ild\debug\Microsoft.Scripting.Math.MathResources.resources" > Read in 17 resources from > "D:\SVN_Storage\IronRuby\trunk\src\microsoft.scripting\Math\MathResources.resx" > > Writing resource file... Done. > resgen > "D:\SVN_Storage\IronRuby\trunk\src\microsoft.scripting\Resources.resx" > "D:\SVN_Storage\IronRuby\trunk\build\debug > \Microsoft.Scripting.Resources.resources" > Read in 47 resources from > "D:\SVN_Storage\IronRuby\trunk\src\microsoft.scripting\Resources.resx" > Writing resource file... Done. > csc /nologo /noconfig /nowarn:1591,1701,1702 /errorreport:prompt > /warn:4 /warnaserror+ /define:"DEBUG;TRACE" /debug+ /de > bug:full /optimize- /target:library > /out:"D:\SVN_Storage\IronRuby\trunk\build\debug\Microsoft.Scripting.dll" > /reference: > "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Configuration.dll" > /reference:"C:\WINDOWS\Microsoft.NET\Framework\ > v2.0.50727\System.dll" > /resource:"D:\SVN_Storage\IronRuby\trunk\build\debug\Microsoft.Scripting.Math.MathResources.resou > > rces" > /resource:"D:\SVN_Storage\IronRuby\trunk\build\debug\Microsoft.Scripting.Resources.resources" > "D:\SVN_Storage\Iron > Ruby\trunk\src\microsoft.scripting\ActionOnCallAttribute.cs" ... > ... > ... > Command failed with status (0): [csc /nologo /noconfig > /nowarn:1591,1701,17...] > c:/languages/ruby/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:719:in > `sh' Cory Foy wrote: > Note that there shouldn't be any difference between 2.0 and 3.5 - 2.0, 3.0 and 3.5 all use the 2.0 CLR. They just add additional features (like workflow, WCF and WPF) > > Cory > > -----Original Message----- > From: "Langston, Jason" > To: "ironruby-core at rubyforge.org" > Sent: 1/11/08 9:10 PM > Subject: Re: [Ironruby-core] IS there a problem building usinf 3.5? > > > I've successfully(*) built using "rake compile" and the Visual C# 2008 > Compiler version 3.5.21022.8. > > I think you'll have to post a bit more about the exact error you are > getting. > > Jason Langston > http://rubydoes.net > > > * I'll caveat that with the fact I am running into a problem building > the IronRubyTestHost (the path to System.Windows.Forms.dll is wacked). > But rbx, tests, etc. all work. > > -----Original Message----- > From: ironruby-core-bounces at rubyforge.org > [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of C. K. Ponnappa > Sent: Thursday, January 10, 2008 4:43 PM > To: ironruby-core at rubyforge.org > Subject: [Ironruby-core] IS there a problem building usinf 3.5? > > I'm using Visual C# 2008 Compiler version 3.5.21022.8 to try to build, > but csc simply terminates when I do a rake compile. Should I be using > only the compiler which ships with.Net 2.0? > > Thanks, > Sidu. > > -- > Two's an SMS. Three's a Mob. Get your free group SMS from Activ Mobs! > SMS "register your_nickname" to +91 98446 22848 to start Mobbing. > http://blog.inactiv.com > > _______________________________________________ > 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 > > -- Two's an SMS. Three's a Mob. Get your free group SMS from Activ Mobs! SMS "register your_nickname" to +91 98446 22848 to start Mobbing. http://blog.inactiv.com From jflam at microsoft.com Sun Jan 13 00:29:41 2008 From: jflam at microsoft.com (John Lam (DLR)) Date: Sat, 12 Jan 2008 21:29:41 -0800 Subject: [Ironruby-core] IS there a problem building usinf 3.5? In-Reply-To: <4788DC74.50705@gmail.com> References: <1AC17FAF2165B641AC2AF42BBEED58CF3BFE75A0E2@NA-EXMSG-C110.redmond.corp.microsoft.com> <4788DC74.50705@gmail.com> Message-ID: <372109E149E8084D8E6C7D9CFD82E06329E80726AD@NA-EXMSG-C115.redmond.corp.microsoft.com> C. K. Ponnappa: > Ok, I'm quoting my previous mail describing the issue - could you guys > take a look and see if you can spot the problem? It still occurs even > on > revision 71. I'd appreciate any help you can give me. When you do msbuild ironruby.sln, does it compile for you? The only other possibility is that there's some other file that got into your directory. The rakefile builds everything it sees in a given dir, and will barf if something unexpected shows up there. Can you delete your SVN dir and grab the latest revision and see what happens? -John From jflam at microsoft.com Sun Jan 13 00:30:58 2008 From: jflam at microsoft.com (John Lam (DLR)) Date: Sat, 12 Jan 2008 21:30:58 -0800 Subject: [Ironruby-core] Float parsing is culture dependent (patch included) In-Reply-To: <4a68b8cf0801120253r564b7be4h145767833b9054a7@mail.gmail.com> References: <4a68b8cf0801120133m4c8f84ebh325db56030bfd199@mail.gmail.com> <7AD436E4270DD54A94238001769C2227FB8E9C69D7@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <4a68b8cf0801120253r564b7be4h145767833b9054a7@mail.gmail.com> Message-ID: <372109E149E8084D8E6C7D9CFD82E06329E80726AE@NA-EXMSG-C115.redmond.corp.microsoft.com> Thibaut Barr?re: > Running "rake test" also blew up just after Dir tests. Applying the > patch managed to let the runner reach third test of StringScanner#new > (which blows up and makes rake abort). This is a known bug. I've got a shelveset with a fix for it that I'm going to commit with the next set of changes early next week. Thanks, -John From jflam at microsoft.com Sun Jan 13 00:33:11 2008 From: jflam at microsoft.com (John Lam (DLR)) Date: Sat, 12 Jan 2008 21:33:11 -0800 Subject: [Ironruby-core] Float parsing is culture dependent (patch included) In-Reply-To: <4a68b8cf0801120133m4c8f84ebh325db56030bfd199@mail.gmail.com> References: <4a68b8cf0801120133m4c8f84ebh325db56030bfd199@mail.gmail.com> Message-ID: <372109E149E8084D8E6C7D9CFD82E06329E80726AF@NA-EXMSG-C115.redmond.corp.microsoft.com> Thibaut Barr?re: > if you type "1.0" then enter under rbx on a french machine (or any > machine with something different than dot for the decimal separator), > you'll get an exception. > > I've attached a patch which works for me. Thanks for sending in this patch! I'll make sure this makes it into our next push. -John From jflam at microsoft.com Sun Jan 13 00:36:37 2008 From: jflam at microsoft.com (John Lam (DLR)) Date: Sat, 12 Jan 2008 21:36:37 -0800 Subject: [Ironruby-core] IS there a problem building usinf 3.5? In-Reply-To: <01B8DC4558C7B2449D0505F2B63C4255B6E9E4@whamail.wha.com> References: <01B8DC4558C7B2449D0505F2B63C4255B6E9E4@whamail.wha.com> Message-ID: <372109E149E8084D8E6C7D9CFD82E06329E80726B0@NA-EXMSG-C115.redmond.corp.microsoft.com> Langston, Jason: > I've successfully(*) built using "rake compile" and the Visual C# 2008 > Compiler version 3.5.21022.8. > > I think you'll have to post a bit more about the exact error you are > getting. We're all using the 3.5.21022.8 compiler here (but aren't using any of the C# 3.0 features in the codebase to maintain compat with the C# 2.0 compiler). -John From bacondarwin at googlemail.com Sun Jan 13 03:35:27 2008 From: bacondarwin at googlemail.com (Peter Bacon Darwin) Date: Sun, 13 Jan 2008 08:35:27 -0000 Subject: [Ironruby-core] Float parsing is culture dependent (patch included) In-Reply-To: <372109E149E8084D8E6C7D9CFD82E06329E80726AF@NA-EXMSG-C115.redmond.corp.microsoft.com> References: <4a68b8cf0801120133m4c8f84ebh325db56030bfd199@mail.gmail.com> <372109E149E8084D8E6C7D9CFD82E06329E80726AF@NA-EXMSG-C115.redmond.corp.microsoft.com> Message-ID: <000001c855bf$412a39e0$c37eada0$@com> Isn't this patch hitting Tokenizer.cs inside the IronRuby.dll? -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of John Lam (DLR) Sent: Sunday,13 January 13, 2008 05:33 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Float parsing is culture dependent (patch included) Thibaut Barr?re: > if you type "1.0" then enter under rbx on a french machine (or any > machine with something different than dot for the decimal separator), > you'll get an exception. > > I've attached a patch which works for me. Thanks for sending in this patch! I'll make sure this makes it into our next push. -John _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core From jflam at microsoft.com Sun Jan 13 11:26:35 2008 From: jflam at microsoft.com (John Lam (DLR)) Date: Sun, 13 Jan 2008 08:26:35 -0800 Subject: [Ironruby-core] Float parsing is culture dependent (patch included) Message-ID: <372109E149E8084D8E6C7D9CFD82E06329E81EACE7@NA-EXMSG-C115.redmond.corp.microsoft.com> Yes it is. But its a trivial one-line patch that doesn't have any clear alternative implementation, so it's ok. - John Sent from my phone -----Original Message----- From: Peter Bacon Darwin Sent: Sunday, January 13, 2008 12:35 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Float parsing is culture dependent (patch included) Isn't this patch hitting Tokenizer.cs inside the IronRuby.dll? -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of John Lam (DLR) Sent: Sunday,13 January 13, 2008 05:33 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Float parsing is culture dependent (patch included) Thibaut Barr?re: > if you type "1.0" then enter under rbx on a french machine (or any > machine with something different than dot for the decimal separator), > you'll get an exception. > > I've attached a patch which works for me. Thanks for sending in this patch! I'll make sure this makes it into our next push. -John _______________________________________________ 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 From coreyhaines at gmail.com Sun Jan 13 13:51:07 2008 From: coreyhaines at gmail.com (Corey Haines) Date: Sun, 13 Jan 2008 13:51:07 -0500 Subject: [Ironruby-core] problem in rbx Message-ID: <6bdacb70801131051h38316d6bh2fd0b31ac5499613@mail.gmail.com> Hi, all, I'm new to the list, as I'm interested in getting involved in the IronRuby project (combine my two loves: ruby and C#). I followed John's video on downloading and installing it, and I noticed one major difference: there is no release folder. Instead, I find rbx.exe in the c:\svn\trunk\build\debug. When I cd into it and run it, the console comes up. I can do the first step a = [1,2,3] but, when I try to do anything with a, it throws a System.MissingMethodException: undefined local variable or method 'a' for main:Ruby.Builtins.RubyClass Any thoughts? Also, here is a jinq video capture of the thing: http://screencast.com/t/XXlL4EluXK5 -Corey -- http://www.coreyhaines.com The Internet's Premiere source of information about Corey Haines -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/ironruby-core/attachments/20080113/d2650e52/attachment.html From lewistm at gmail.com Sun Jan 13 13:53:29 2008 From: lewistm at gmail.com (Terence Lewis) Date: Sun, 13 Jan 2008 20:53:29 +0200 Subject: [Ironruby-core] problem in rbx In-Reply-To: <6bdacb70801131051h38316d6bh2fd0b31ac5499613@mail.gmail.com> References: <6bdacb70801131051h38316d6bh2fd0b31ac5499613@mail.gmail.com> Message-ID: <2f1decf20801131053i63514f9fyac7160249d0e4df4@mail.gmail.com> I believe this is due to a bug (for now) in rbx.exe regarding local variables. I think the current advice is to make the variable a global like so: @a = [1, 2, 3] Hope this helps Terence From coreyhaines at gmail.com Sun Jan 13 13:57:26 2008 From: coreyhaines at gmail.com (Corey Haines) Date: Sun, 13 Jan 2008 13:57:26 -0500 Subject: [Ironruby-core] problem in rbx In-Reply-To: <2f1decf20801131053i63514f9fyac7160249d0e4df4@mail.gmail.com> References: <6bdacb70801131051h38316d6bh2fd0b31ac5499613@mail.gmail.com> <2f1decf20801131053i63514f9fyac7160249d0e4df4@mail.gmail.com> Message-ID: <6bdacb70801131057j4dff9344h940ab0490cdeb61c@mail.gmail.com> Thanks, Terrence, that worked! -Corey On Jan 13, 2008 1:53 PM, Terence Lewis wrote: > I believe this is due to a bug (for now) in rbx.exe regarding local > variables. I think the current advice is to make the variable a global > like so: > > @a = [1, 2, 3] > > > Hope this helps > > > Terence > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > -- http://www.coreyhaines.com The Internet's Premiere source of information about Corey Haines -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/ironruby-core/attachments/20080113/ce8a14a7/attachment.html From charles.nutter at sun.com Sun Jan 13 14:03:55 2008 From: charles.nutter at sun.com (Charles Oliver Nutter) Date: Sun, 13 Jan 2008 13:03:55 -0600 Subject: [Ironruby-core] problem in rbx In-Reply-To: <2f1decf20801131053i63514f9fyac7160249d0e4df4@mail.gmail.com> References: <6bdacb70801131051h38316d6bh2fd0b31ac5499613@mail.gmail.com> <2f1decf20801131053i63514f9fyac7160249d0e4df4@mail.gmail.com> Message-ID: <478A609B.2050803@sun.com> Terence Lewis wrote: > I believe this is due to a bug (for now) in rbx.exe regarding local > variables. I think the current advice is to make the variable a global > like so: > > @a = [1, 2, 3] @ is for instance variables. $ is for globals. The above code assigns [1,2,3] to the instance variable @a on the toplevel object. - Charlie From lewistm at gmail.com Sun Jan 13 14:07:45 2008 From: lewistm at gmail.com (Terence Lewis) Date: Sun, 13 Jan 2008 21:07:45 +0200 Subject: [Ironruby-core] problem in rbx In-Reply-To: <478A609B.2050803@sun.com> References: <6bdacb70801131051h38316d6bh2fd0b31ac5499613@mail.gmail.com> <2f1decf20801131053i63514f9fyac7160249d0e4df4@mail.gmail.com> <478A609B.2050803@sun.com> Message-ID: <2f1decf20801131107k607866dai2abe4c24060d328e@mail.gmail.com> Aargh, apologies - you're right of course :P. Thanks for the clarification. From bacondarwin at googlemail.com Mon Jan 14 08:39:00 2008 From: bacondarwin at googlemail.com (Peter Bacon Darwin) Date: Mon, 14 Jan 2008 13:39:00 -0000 Subject: [Ironruby-core] Module#class_eval Message-ID: <001101c856b2$d3024d50$7906e7f0$@com> I have been playing around with implementing Module#class_eval, partly because I wanted to use it in a test case and partly because I thought it would help my understanding of the guts of IronRuby. I managed to get the following code to work but it is not pretty. [RubyMethod("class_eval")] public static object Evaluate(CodeContext/*!*/ context, RubyModule/*!*/ module, MutableString code) { // Create a new context for running the code string - not sure if this is necessary. CodeContext context2 = new CodeContext(context); // We need a localscope for GetRfc. RubyScope localScope = RubyUtils.GetScope(context); // Create a local scope for this module definition. // (This has a side-effect that context2 has the new module scope attached in its LocalScope property.) RubyScope moduleScope = RubyOps.CreateModuleScope(context2, localScope.RuntimeFlowControl, module); // Compile up the code in the new context SourceUnit sourceUnit = context2.LanguageContext.CreateSnippet(code); ScriptCode scriptCode = sourceUnit.Compile(context2.LanguageContext.GetModuleCompilerOptions(context 2.Scope), null); // Run the code in the new context. // (This overload is currently private but we need to be able to pass in the new context). return scriptCode.Run(context2, false); } I added superfluous comments for the benefit of posting it her. The main issue, as noted at the bottom of the code, is that the overload of ScriptCode.Run that is called is currently private. All the public overloads create a new CodeContext and you lose the LocalScope which is needed to ensure that the code is run in the context of the module being defined. Any comments on this? I assume that as the Hosting spec evolves this could get a lot cleaner. Is there a better way right now to achieve the same result? Also, one thing that really messed my head up for quite a while is the use of the word scope. It took me a while to come to terms with the fact that there are numerous completely separate scopes: Scope, ScopeExtension (which contains a Scope property), ScriptScope (which implements IScriptScope) and RubyScope (which derives from LocalScope). Am I right in saying: Scope is the global scope in which the current Ruby program is running (with ScopeExtension just wrapping that and ScriptScope being a container for code being run within that scope)? RubyScope is the local scope within a Ruby program that tells you things like what the current self object is and what variables are accessible? Regards, Pete http://ironingruby.blogspot.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/ironruby-core/attachments/20080114/371128ca/attachment-0001.html From lewistm at gmail.com Mon Jan 14 16:29:59 2008 From: lewistm at gmail.com (Terence Lewis) Date: Mon, 14 Jan 2008 23:29:59 +0200 Subject: [Ironruby-core] New sockets.cs patch submission Message-ID: <2f1decf20801141329l7892bb80kfa456fa0ada06b61@mail.gmail.com> Hello list, Please find attached another patch for Socket.cs with the following changes: 1) Added class SocketStream : System.IO.Stream which wraps the socket and provides some stream-like functionality which RubyIO can use. I've tested the following methods and they appear to work well now on sockets: - readline - readlines - gets puts also works, but I'm not as confident that it's correct - see below under "Issues". I've also included a test file I used to compare output between ruby.exe and rbx.exe (I tested against a default install of IE7 - which returns a 404 for the address requested and both executables appear to produce the same output except for line-ending issues) 2) Fixed up the spacing/tabbing issues in the file as per Seo's comments - everything is now 4 spaces and no tabs, and I also moved the opening curly braces up to match the style in the rest of the solution. I know this code isn't perfect - but I think it is a step in the right direction. I have some concerns about it which I've listed below - any comments or suggestions will be most welcome. Issues: - Can only peek 1 byte - there is no buffering of data off the socket - I don't know if this will have a performance / efficiency impact? - There is no error handling code around the socket calls - is this OK? If not, what should be done? - The third parameter passed to RubyIO's constructor - "r+" - what should this be? "r+" allows me to read and write to the socket through the stream interface so maybe it's OK? - None of the IO mode checking referred to in the TODO comment above the SocketStream class has been implemented - I presume this means checking whether the socket has been shutdown either for sending or receiving before actually trying to do the read/write - instead of letting it throw an exception. - How should I trigger a flush on write? At the moment it's done on seeing a newline (hard-coded) in the stream, but I don't think that's clean or correct (certainly ruby.exe seems to send my test request (which has 2 newlines at the end) in one go - not in two separate pieces - which is the minor difference I referred to above regarding "puts").. - Not sure if Flush is efficient - should I somehow use an array rather than a list of bytes? Thanks for your time Terence -------------- next part -------------- A non-text attachment was scrubbed... Name: socket.patch Type: application/octet-stream Size: 12146 bytes Desc: not available Url : http://rubyforge.org/pipermail/ironruby-core/attachments/20080114/5064c0ef/attachment.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: basic.rb Type: application/octet-stream Size: 1340 bytes Desc: not available Url : http://rubyforge.org/pipermail/ironruby-core/attachments/20080114/5064c0ef/attachment-0001.obj From thibaut.barrere at gmail.com Tue Jan 15 04:58:28 2008 From: thibaut.barrere at gmail.com (=?ISO-8859-1?Q?Thibaut_Barr=E8re?=) Date: Tue, 15 Jan 2008 10:58:28 +0100 Subject: [Ironruby-core] Float parsing is culture dependent (patch included) In-Reply-To: <372109E149E8084D8E6C7D9CFD82E06329E80726AF@NA-EXMSG-C115.redmond.corp.microsoft.com> References: <4a68b8cf0801120133m4c8f84ebh325db56030bfd199@mail.gmail.com> <372109E149E8084D8E6C7D9CFD82E06329E80726AF@NA-EXMSG-C115.redmond.corp.microsoft.com> Message-ID: <4a68b8cf0801150158m5d798800i8714cc6a6073582c@mail.gmail.com> > Thanks for sending in this patch! I'll make sure this makes it into our next push. Great - is it sure to be included by the end of this month ? (I'm pretty sure so). If it is, I won't have to include the patch in my article. cheers -- Thibaut From thibaut.barrere at gmail.com Tue Jan 15 05:06:52 2008 From: thibaut.barrere at gmail.com (=?ISO-8859-1?Q?Thibaut_Barr=E8re?=) Date: Tue, 15 Jan 2008 11:06:52 +0100 Subject: [Ironruby-core] Littl' question about the build process Message-ID: <4a68b8cf0801150206h13c474deoc77308d21d0ec07a@mail.gmail.com> I need some clarifications for my readers: I believe we have three ways of compiling IronRuby today: - through the rake compile task (is it the preferred way ?) - through IronRuby.sln (for 2005) - through Ruby.sln (for 2008 ?) Are both the .sln files maintained ? Is my guess correct about 2005/2008 ? In the long run, are all these intented to be maintained ? ps: John I wrote you an email a while back but I'm not sure you got it actually. I was suggesting we could (in a couple of weeks maybe, unless it's already done internally at ms ?) grab a couple of the most widely used ruby gems, focus on those with unit tests or specs (or write a couple of integration tests ourselves), and setup a continuous integration server to run those gems tests through rbx. Is it already done somewhat ? What do you think ? regards, -- Thibaut From jflam at microsoft.com Tue Jan 15 09:56:25 2008 From: jflam at microsoft.com (John Lam (DLR)) Date: Tue, 15 Jan 2008 06:56:25 -0800 Subject: [Ironruby-core] Littl' question about the build process In-Reply-To: <4a68b8cf0801150206h13c474deoc77308d21d0ec07a@mail.gmail.com> References: <4a68b8cf0801150206h13c474deoc77308d21d0ec07a@mail.gmail.com> Message-ID: <372109E149E8084D8E6C7D9CFD82E06329E8072D72@NA-EXMSG-C115.redmond.corp.microsoft.com> Thibaut Barr?re: > I need some clarifications for my readers: I believe we have three > ways of compiling IronRuby today: > - through the rake compile task (is it the preferred way ?) > - through IronRuby.sln (for 2005) > - through Ruby.sln (for 2008 ?) > > Are both the .sln files maintained ? Is my guess correct about > 2005/2008 ? The IronRuby.sln file is for external folks to use. Ruby.sln is one that reflects the legacy source code layout in our internal tree. > In the long run, are all these intented to be maintained ? For the forseeable future, yes. > ps: John I wrote you an email a while back but I'm not sure you got it > actually. I was suggesting we could (in a couple of weeks maybe, > unless it's already done internally at ms ?) grab a couple of the most > widely used ruby gems, focus on those with unit tests or specs (or > write a couple of integration tests ourselves), and setup a continuous > integration server to run those gems tests through rbx. I'm going to forward my reply to you - I sent a reply out yesterday, but to myself :) But for the benefit of the list, we're focusing on doing gap analysis- there's a new task that I've added to the rakefile that uses set_trace_func to trace all calls that a target application makes. It also reflects over the IronRuby libraries and diffs the output for standard library types. This way we have a complete list of all of the library methods that need to be implemented to run that app. I've completed the analysis for gem install, which is the first 'real app' milestone that we want to get working. We're about 140 methods short today, with the bulk of those mapping to regex and YAML and socket-based IO. -John From jflam at microsoft.com Tue Jan 15 09:58:42 2008 From: jflam at microsoft.com (John Lam (DLR)) Date: Tue, 15 Jan 2008 06:58:42 -0800 Subject: [Ironruby-core] Float parsing is culture dependent (patch included) In-Reply-To: <4a68b8cf0801150158m5d798800i8714cc6a6073582c@mail.gmail.com> References: <4a68b8cf0801120133m4c8f84ebh325db56030bfd199@mail.gmail.com> <372109E149E8084D8E6C7D9CFD82E06329E80726AF@NA-EXMSG-C115.redmond.corp.microsoft.com> <4a68b8cf0801150158m5d798800i8714cc6a6073582c@mail.gmail.com> Message-ID: <372109E149E8084D8E6C7D9CFD82E06329E8072D76@NA-EXMSG-C115.redmond.corp.microsoft.com> Thibaut Barr?re: > Great - is it sure to be included by the end of this month ? (I'm > pretty sure so). > > If it is, I won't have to include the patch in my article. This is fixed already as part of some other work that Tomas is doing on the tokenizer, so yes - definitely by the end of this month. -John From thibaut.barrere at gmail.com Tue Jan 15 10:03:31 2008 From: thibaut.barrere at gmail.com (=?ISO-8859-1?Q?Thibaut_Barr=E8re?=) Date: Tue, 15 Jan 2008 16:03:31 +0100 Subject: [Ironruby-core] Float parsing is culture dependent (patch included) In-Reply-To: <372109E149E8084D8E6C7D9CFD82E06329E8072D76@NA-EXMSG-C115.redmond.corp.microsoft.com> References: <4a68b8cf0801120133m4c8f84ebh325db56030bfd199@mail.gmail.com> <372109E149E8084D8E6C7D9CFD82E06329E80726AF@NA-EXMSG-C115.redmond.corp.microsoft.com> <4a68b8cf0801150158m5d798800i8714cc6a6073582c@mail.gmail.com> <372109E149E8084D8E6C7D9CFD82E06329E8072D76@NA-EXMSG-C115.redmond.corp.microsoft.com> Message-ID: <4a68b8cf0801150703td7e1c3fw13b8241fa6e27369@mail.gmail.com> > This is fixed already as part of some other work that Tomas is doing on the tokenizer, so yes - definitely by the end of this month. Perfect - thanks! -- Thibaut From jomes at microsoft.com Tue Jan 15 16:08:39 2008 From: jomes at microsoft.com (John Messerly) Date: Tue, 15 Jan 2008 13:08:39 -0800 Subject: [Ironruby-core] Littl' question about the build process In-Reply-To: <4a68b8cf0801150206h13c474deoc77308d21d0ec07a@mail.gmail.com> References: <4a68b8cf0801150206h13c474deoc77308d21d0ec07a@mail.gmail.com> Message-ID: <918705E903F4714CB713D89AB5F1857D73B26BC111@NA-EXMSG-C116.redmond.corp.microsoft.com> Thibaut Barr?re: > I need some clarifications for my readers: I believe we have three ways > of compiling IronRuby today: > - through the rake compile task (is it the preferred way ?) > - through IronRuby.sln (for 2005) > - through Ruby.sln (for 2008 ?) > > Are both the .sln files maintained ? Is my guess correct about > 2005/2008 ? > > In the long run, are all these intented to be maintained ? As John said, IronRuby.sln is the one that is correctly transformed to SVN folder layout. Ruby.sln is against our TFS folder layer. Maybe we could rename them to make it more obvious which is which. Also, I'm wondering what VS version we should target with IronRuby.sln. Are enough people using 2008 to justify upgrading it? Or should we have one for 2005 and one for 2008? Or keep it 2005 for now? - John From thibaut.barrere at gmail.com Wed Jan 16 04:17:02 2008 From: thibaut.barrere at gmail.com (=?ISO-8859-1?Q?Thibaut_Barr=E8re?=) Date: Wed, 16 Jan 2008 10:17:02 +0100 Subject: [Ironruby-core] IronRuby with Silverlight, already possible ? Message-ID: <4a68b8cf0801160117m6cfbca8fo9912eda2f1481783@mail.gmail.com> Hi, just curious here, and willing to try out things! Is there any way - even complicated - to code Silverlight bits with IronRuby today ? -- Thibaut From jflam at microsoft.com Wed Jan 16 09:27:02 2008 From: jflam at microsoft.com (John Lam (DLR)) Date: Wed, 16 Jan 2008 06:27:02 -0800 Subject: [Ironruby-core] IronRuby with Silverlight, already possible ? In-Reply-To: <4a68b8cf0801160117m6cfbca8fo9912eda2f1481783@mail.gmail.com> References: <4a68b8cf0801160117m6cfbca8fo9912eda2f1481783@mail.gmail.com> Message-ID: <372109E149E8084D8E6C7D9CFD82E06329E8073328@NA-EXMSG-C115.redmond.corp.microsoft.com> Thibaut Barr?re: > just curious here, and willing to try out things! Is there any way - > even complicated - to code Silverlight bits with IronRuby today ? John Messerly usually works some spooky magic incantations to get us a build of SL that works with IronRuby. That happens whenever we need to demonstrate progress. Short answer is that we can, but only with private builds of SL (AFAIK). However, we should just work out of the box with the next time a public release of SL ships (which should be at MIX 08). -John From jflam at microsoft.com Wed Jan 16 09:30:54 2008 From: jflam at microsoft.com (John Lam (DLR)) Date: Wed, 16 Jan 2008 06:30:54 -0800 Subject: [Ironruby-core] Littl' question about the build process In-Reply-To: <918705E903F4714CB713D89AB5F1857D73B26BC111@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <4a68b8cf0801150206h13c474deoc77308d21d0ec07a@mail.gmail.com> <918705E903F4714CB713D89AB5F1857D73B26BC111@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <372109E149E8084D8E6C7D9CFD82E06329E807332A@NA-EXMSG-C115.redmond.corp.microsoft.com> John Messerly: > As John said, IronRuby.sln is the one that is correctly transformed to > SVN folder layout. Ruby.sln is against our TFS folder layer. Maybe we > could rename them to make it more obvious which is which. > > Also, I'm wondering what VS version we should target with IronRuby.sln. > Are enough people using 2008 to justify upgrading it? Or should we have > one for 2005 and one for 2008? Or keep it 2005 for now? To amplify this a bit more: Is there anyone out there still using VS 2005 to hack on IronRuby? Thanks, -John From thibaut.barrere at gmail.com Wed Jan 16 09:36:58 2008 From: thibaut.barrere at gmail.com (=?ISO-8859-1?Q?Thibaut_Barr=E8re?=) Date: Wed, 16 Jan 2008 15:36:58 +0100 Subject: [Ironruby-core] Littl' question about the build process In-Reply-To: <372109E149E8084D8E6C7D9CFD82E06329E807332A@NA-EXMSG-C115.redmond.corp.microsoft.com> References: <4a68b8cf0801150206h13c474deoc77308d21d0ec07a@mail.gmail.com> <918705E903F4714CB713D89AB5F1857D73B26BC111@NA-EXMSG-C116.redmond.corp.microsoft.com> <372109E149E8084D8E6C7D9CFD82E06329E807332A@NA-EXMSG-C115.redmond.corp.microsoft.com> Message-ID: <4a68b8cf0801160636h31171beatfa4e680d15203b58@mail.gmail.com> Hi, I'm using VS 2005 so far (and my readers will use it next month when they read their article), I've not yet switched to 2008 express. It seems reasonable to switch to 2008 in a couple of months though (and maintain only 2008). -- Thibaut From rbazinet at gmail.com Wed Jan 16 09:42:33 2008 From: rbazinet at gmail.com (Robert Bazinet) Date: Wed, 16 Jan 2008 09:42:33 -0500 Subject: [Ironruby-core] Littl' question about the build process In-Reply-To: <372109E149E8084D8E6C7D9CFD82E06329E807332A@NA-EXMSG-C115.redmond.corp.microsoft.com> References: <4a68b8cf0801150206h13c474deoc77308d21d0ec07a@mail.gmail.com> <918705E903F4714CB713D89AB5F1857D73B26BC111@NA-EXMSG-C116.redmond.corp.microsoft.com> <372109E149E8084D8E6C7D9CFD82E06329E807332A@NA-EXMSG-C115.redmond.corp.microsoft.com> Message-ID: John, I am using VS2005 still. I do have VS2008 installed, is there a technical reason to move to VS2008 for IronRuby hacking? -Rob Bazinet On Jan 16, 2008 9:30 AM, John Lam (DLR) wrote: > John Messerly: > > > As John said, IronRuby.sln is the one that is correctly transformed to > > SVN folder layout. Ruby.sln is against our TFS folder layer. Maybe we > > could rename them to make it more obvious which is which. > > > > Also, I'm wondering what VS version we should target with IronRuby.sln. > > Are enough people using 2008 to justify upgrading it? Or should we have > > one for 2005 and one for 2008? Or keep it 2005 for now? > > To amplify this a bit more: > > Is there anyone out there still using VS 2005 to hack on IronRuby? > > Thanks, > -John > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > -- Rob Bazinet http://www.accidentaltechnologist.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/ironruby-core/attachments/20080116/cab7e13b/attachment.html From thibaut.barrere at gmail.com Wed Jan 16 09:43:44 2008 From: thibaut.barrere at gmail.com (=?ISO-8859-1?Q?Thibaut_Barr=E8re?=) Date: Wed, 16 Jan 2008 15:43:44 +0100 Subject: [Ironruby-core] IronRuby with Silverlight, already possible ? In-Reply-To: <372109E149E8084D8E6C7D9CFD82E06329E8073328@NA-EXMSG-C115.redmond.corp.microsoft.com> References: <4a68b8cf0801160117m6cfbca8fo9912eda2f1481783@mail.gmail.com> <372109E149E8084D8E6C7D9CFD82E06329E8073328@NA-EXMSG-C115.redmond.corp.microsoft.com> Message-ID: <4a68b8cf0801160643i7887f0c2n426c451f2bb1629f@mail.gmail.com> > John Messerly usually works some spooky magic incantations to get us a build of SL that works with IronRuby. That happens whenever we need to demonstrate progress. Short answer is that we can, but only with private builds of SL (AFAIK). If you happen to release a private build of those once in a while, please drop a line ! It will be most welcome. > However, we should just work out of the box with the next time a public release of SL ships (which should be at MIX 08). That would be great. thanks for your answer! -- Thibaut From jb at nurv.fr Wed Jan 16 09:54:35 2008 From: jb at nurv.fr (Jb Evain) Date: Wed, 16 Jan 2008 15:54:35 +0100 Subject: [Ironruby-core] Littl' question about the build process In-Reply-To: <918705E903F4714CB713D89AB5F1857D73B26BC111@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <4a68b8cf0801150206h13c474deoc77308d21d0ec07a@mail.gmail.com> <918705E903F4714CB713D89AB5F1857D73B26BC111@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <69f7d8470801160654u275d25cftd9517914a90b410d@mail.gmail.com> Hey, On 1/15/08, John Messerly wrote: > Also, I'm wondering what VS version we should target with IronRuby.sln. Are enough people using 2008 to justify upgrading it? Or should we have one for 2005 and one for 2008? Or keep it 2005 for now? That's probably the best way to reach and ease most people. I tend to simply suffix the filename with the VS version it targets, ex: IronRuby-2008.csproj. Along with a script to update the csprojs to keep them in sync :) -- Jb Evain From jflam at microsoft.com Wed Jan 16 10:04:05 2008 From: jflam at microsoft.com (John Lam (DLR)) Date: Wed, 16 Jan 2008 07:04:05 -0800 Subject: [Ironruby-core] Littl' question about the build process In-Reply-To: <69f7d8470801160654u275d25cftd9517914a90b410d@mail.gmail.com> References: <4a68b8cf0801150206h13c474deoc77308d21d0ec07a@mail.gmail.com> <918705E903F4714CB713D89AB5F1857D73B26BC111@NA-EXMSG-C116.redmond.corp.microsoft.com> <69f7d8470801160654u275d25cftd9517914a90b410d@mail.gmail.com> Message-ID: <372109E149E8084D8E6C7D9CFD82E06329E8073344@NA-EXMSG-C115.redmond.corp.microsoft.com> Jb Evain: > That's probably the best way to reach and ease most people. I tend to > simply suffix the filename with the VS version it targets, ex: > IronRuby-2008.csproj. > Along with a script to update the csprojs to keep them in sync :) It's not VS that we're concerned about, it's C#. It would be so nice to be able to type: var greaterThanSharedSite = DynamicSite.Create(InstanceCallAction(">", ArgumentKind.Simple)); DynamicSite greaterThanSharedSite = DynamicSite.Create(InstanceCallAction(">", ArgumentKind.Simple)); But we can't move to the new compiler until we get enough folks agreeing to switch over ... -John From rbazinet at gmail.com Wed Jan 16 10:07:37 2008 From: rbazinet at gmail.com (Robert Bazinet) Date: Wed, 16 Jan 2008 10:07:37 -0500 Subject: [Ironruby-core] Littl' question about the build process In-Reply-To: <372109E149E8084D8E6C7D9CFD82E06329E8073344@NA-EXMSG-C115.redmond.corp.microsoft.com> References: <4a68b8cf0801150206h13c474deoc77308d21d0ec07a@mail.gmail.com> <918705E903F4714CB713D89AB5F1857D73B26BC111@NA-EXMSG-C116.redmond.corp.microsoft.com> <69f7d8470801160654u275d25cftd9517914a90b410d@mail.gmail.com> <372109E149E8084D8E6C7D9CFD82E06329E8073344@NA-EXMSG-C115.redmond.corp.microsoft.com> Message-ID: Has the goal of IronRuby to require .NET 3.5 all this time? If so, I guess I missed it but it makes sense and makes the technology better. -Rob On Jan 16, 2008 10:04 AM, John Lam (DLR) wrote: > Jb Evain: > > > That's probably the best way to reach and ease most people. I tend to > > simply suffix the filename with the VS version it targets, ex: > > IronRuby-2008.csproj. > > Along with a script to update the csprojs to keep them in sync :) > > It's not VS that we're concerned about, it's C#. It would be so nice to be > able to type: > > var greaterThanSharedSite = DynamicSite object>.Create(InstanceCallAction(">", ArgumentKind.Simple)); > > DynamicSite greaterThanSharedSite = > DynamicSite.Create(InstanceCallAction(">", > ArgumentKind.Simple)); > > But we can't move to the new compiler until we get enough folks agreeing > to switch over ... > > -John > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > -- Rob Bazinet http://www.accidentaltechnologist.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/ironruby-core/attachments/20080116/39a37368/attachment.html From tomas at winterdom.com Wed Jan 16 10:12:01 2008 From: tomas at winterdom.com (Tomas Restrepo) Date: Wed, 16 Jan 2008 10:12:01 -0500 Subject: [Ironruby-core] Littl' question about the build process In-Reply-To: <372109E149E8084D8E6C7D9CFD82E06329E8073344@NA-EXMSG-C115.redmond.corp.microsoft.com> References: <4a68b8cf0801150206h13c474deoc77308d21d0ec07a@mail.gmail.com> <918705E903F4714CB713D89AB5F1857D73B26BC111@NA-EXMSG-C116.redmond.corp.microsoft.com> <69f7d8470801160654u275d25cftd9517914a90b410d@mail.gmail.com> <372109E149E8084D8E6C7D9CFD82E06329E8073344@NA-EXMSG-C115.redmond.corp.microsoft.com> Message-ID: Hey John, > It's not VS that we're concerned about, it's C#. It would be so nice to be able to type: > > var greaterThanSharedSite = DynamicSite.Create(InstanceCallAction(">", ArgumentKind.Simple)); > > DynamicSite greaterThanSharedSite = DynamicSite.Create(InstanceCallAction(">", ArgumentKind.Simple)); > > But we can't move to the new compiler until we get enough folks agreeing to switch over ... Personally, I'm building with VS2008 for now, and wouldn't mind being forced to use VS2008 to develop. The more interesting question is whether .NET 3.5 would become the minimum requirement for the DLR and IronRuby *at runtime*. If the idea is to still be targeting plain .NET 2.0 for runtime, I think that would be a lot better and more palatable for many people. -- Tomas Restrepo http://www.winterdom.com/weblog/ From thibaut.barrere at gmail.com Wed Jan 16 10:20:22 2008 From: thibaut.barrere at gmail.com (=?ISO-8859-1?Q?Thibaut_Barr=E8re?=) Date: Wed, 16 Jan 2008 16:20:22 +0100 Subject: [Ironruby-core] Littl' question about the build process In-Reply-To: References: <4a68b8cf0801150206h13c474deoc77308d21d0ec07a@mail.gmail.com> <918705E903F4714CB713D89AB5F1857D73B26BC111@NA-EXMSG-C116.redmond.corp.microsoft.com> <69f7d8470801160654u275d25cftd9517914a90b410d@mail.gmail.com> <372109E149E8084D8E6C7D9CFD82E06329E8073344@NA-EXMSG-C115.redmond.corp.microsoft.com> Message-ID: <4a68b8cf0801160720x79b2641cn10f67d37431485f@mail.gmail.com> > If the idea is to still be targeting plain .NET > 2.0 for runtime, I think that would be a lot better and more palatable > for many people. +1 on this. -- Thibaut From jb at nurv.fr Wed Jan 16 10:20:42 2008 From: jb at nurv.fr (Jb Evain) Date: Wed, 16 Jan 2008 16:20:42 +0100 Subject: [Ironruby-core] Littl' question about the build process In-Reply-To: <372109E149E8084D8E6C7D9CFD82E06329E8073344@NA-EXMSG-C115.redmond.corp.microsoft.com> References: <4a68b8cf0801150206h13c474deoc77308d21d0ec07a@mail.gmail.com> <918705E903F4714CB713D89AB5F1857D73B26BC111@NA-EXMSG-C116.redmond.corp.microsoft.com> <69f7d8470801160654u275d25cftd9517914a90b410d@mail.gmail.com> <372109E149E8084D8E6C7D9CFD82E06329E8073344@NA-EXMSG-C115.redmond.corp.microsoft.com> Message-ID: <69f7d8470801160720o4291130apf75fe4ea0e777bef@mail.gmail.com> Hey John, On 1/16/08, John Lam (DLR) wrote: > It's not VS that we're concerned about, it's C#. It would be so nice to be able to type: It wasn't clear to me that this discussion was about the language version, and not about the VS version. > var greaterThanSharedSite = DynamicSite.Create(InstanceCallAction(">", ArgumentKind.Simple)); > > DynamicSite greaterThanSharedSite = DynamicSite.Create(InstanceCallAction(">", ArgumentKind.Simple)); That would be nice indeed. And if we're talking about C#, I would not mind seeing IronRuby focusing on C#3, as the project itself is ?relatively? new. -- Jb Evain From jflam at microsoft.com Wed Jan 16 10:25:47 2008 From: jflam at microsoft.com (John Lam (DLR)) Date: Wed, 16 Jan 2008 07:25:47 -0800 Subject: [Ironruby-core] Littl' question about the build process In-Reply-To: References: <4a68b8cf0801150206h13c474deoc77308d21d0ec07a@mail.gmail.com> <918705E903F4714CB713D89AB5F1857D73B26BC111@NA-EXMSG-C116.redmond.corp.microsoft.com> <69f7d8470801160654u275d25cftd9517914a90b410d@mail.gmail.com> <372109E149E8084D8E6C7D9CFD82E06329E8073344@NA-EXMSG-C115.redmond.corp.microsoft.com> Message-ID: <372109E149E8084D8E6C7D9CFD82E06329E8073366@NA-EXMSG-C115.redmond.corp.microsoft.com> Tomas Restrepo: > Personally, I'm building with VS2008 for now, and wouldn't mind being > forced to use VS2008 to develop. The more interesting question is > whether .NET 3.5 would become the minimum requirement for the DLR and > IronRuby *at runtime*. If the idea is to still be targeting plain .NET > 2.0 for runtime, I think that would be a lot better and more palatable > for many people. We're targeting CLR v2.0 which is the version of the CLR that ships in .NET 3.5 (confusing, yes :)). C# 3.0 doesn't require new features from the CLR, just some new libraries (System.Core and friends). -John From jflam at microsoft.com Wed Jan 16 10:27:13 2008 From: jflam at microsoft.com (John Lam (DLR)) Date: Wed, 16 Jan 2008 07:27:13 -0800 Subject: [Ironruby-core] Littl' question about the build process In-Reply-To: <69f7d8470801160720o4291130apf75fe4ea0e777bef@mail.gmail.com> References: <4a68b8cf0801150206h13c474deoc77308d21d0ec07a@mail.gmail.com> <918705E903F4714CB713D89AB5F1857D73B26BC111@NA-EXMSG-C116.redmond.corp.microsoft.com> <69f7d8470801160654u275d25cftd9517914a90b410d@mail.gmail.com> <372109E149E8084D8E6C7D9CFD82E06329E8073344@NA-EXMSG-C115.redmond.corp.microsoft.com> <69f7d8470801160720o4291130apf75fe4ea0e777bef@mail.gmail.com> Message-ID: <372109E149E8084D8E6C7D9CFD82E06329E807336B@NA-EXMSG-C115.redmond.corp.microsoft.com> Jb Evain: > That would be nice indeed. And if we're talking about C#, I would not > mind seeing IronRuby focusing on C#3, as the project itself is > new. Me too. But we don't want to slow down folks who are working on libraries as well. There are plenty on our team that want to switch, but we haven't made a call on that yet. But if y'all make enough noise it will help us advance our cause inside :) -John From jason.langston at gmail.com Wed Jan 16 10:30:26 2008 From: jason.langston at gmail.com (Jason Langston) Date: Wed, 16 Jan 2008 10:30:26 -0500 Subject: [Ironruby-core] Littl' question about the build process In-Reply-To: <372109E149E8084D8E6C7D9CFD82E06329E807336B@NA-EXMSG-C115.redmond.corp.microsoft.com> References: <4a68b8cf0801150206h13c474deoc77308d21d0ec07a@mail.gmail.com> <918705E903F4714CB713D89AB5F1857D73B26BC111@NA-EXMSG-C116.redmond.corp.microsoft.com> <69f7d8470801160654u275d25cftd9517914a90b410d@mail.gmail.com> <372109E149E8084D8E6C7D9CFD82E06329E8073344@NA-EXMSG-C115.redmond.corp.microsoft.com> <69f7d8470801160720o4291130apf75fe4ea0e777bef@mail.gmail.com> <372109E149E8084D8E6C7D9CFD82E06329E807336B@NA-EXMSG-C115.redmond.corp.microsoft.com> Message-ID: +1 for C# 3.0 I'm assuming you'd update the Rakefile? This would involve a little work since it currently uses a single constant for both the location of Framework libraries and the compiler (csc). We'd have to split those but that's not too much work. (The alternative to changing the Rakefile is to instruct everyone to run it from the VS or SDK command prompt, which seems less desirable to me.) - Jason Langston http://rubydoes.net From thibaut.barrere at gmail.com Wed Jan 16 10:31:11 2008 From: thibaut.barrere at gmail.com (=?ISO-8859-1?Q?Thibaut_Barr=E8re?=) Date: Wed, 16 Jan 2008 16:31:11 +0100 Subject: [Ironruby-core] Littl' question about the build process In-Reply-To: <372109E149E8084D8E6C7D9CFD82E06329E8073366@NA-EXMSG-C115.redmond.corp.microsoft.com> References: <4a68b8cf0801150206h13c474deoc77308d21d0ec07a@mail.gmail.com> <918705E903F4714CB713D89AB5F1857D73B26BC111@NA-EXMSG-C116.redmond.corp.microsoft.com> <69f7d8470801160654u275d25cftd9517914a90b410d@mail.gmail.com> <372109E149E8084D8E6C7D9CFD82E06329E8073344@NA-EXMSG-C115.redmond.corp.microsoft.com> <372109E149E8084D8E6C7D9CFD82E06329E8073366@NA-EXMSG-C115.redmond.corp.microsoft.com> Message-ID: <4a68b8cf0801160731k744ef9e9h7f2030fb43746f9a@mail.gmail.com> > C# 3.0 doesn't require new features from the CLR, just some new libraries (System.Core and friends). Thanks for the clarification. Then yes, I'll vote for the switch to C# 3.0. Like Jb said, it's a new project, let's move on! From rbazinet at gmail.com Wed Jan 16 10:34:48 2008 From: rbazinet at gmail.com (Robert Bazinet) Date: Wed, 16 Jan 2008 10:34:48 -0500 Subject: [Ironruby-core] Littl' question about the build process In-Reply-To: References: <4a68b8cf0801150206h13c474deoc77308d21d0ec07a@mail.gmail.com> <918705E903F4714CB713D89AB5F1857D73B26BC111@NA-EXMSG-C116.redmond.corp.microsoft.com> <69f7d8470801160654u275d25cftd9517914a90b410d@mail.gmail.com> <372109E149E8084D8E6C7D9CFD82E06329E8073344@NA-EXMSG-C115.redmond.corp.microsoft.com> <69f7d8470801160720o4291130apf75fe4ea0e777bef@mail.gmail.com> <372109E149E8084D8E6C7D9CFD82E06329E807336B@NA-EXMSG-C115.redmond.corp.microsoft.com> Message-ID: If the target is going to be CLR 2.0 anyway, why not just do it now? Does the RakeFile even work for us externally? I have tried it a few times and it always blows up. Apparently there needs to be something fed to it I am not doing. -Rob On Jan 16, 2008 10:30 AM, Jason Langston wrote: > +1 for C# 3.0 > > I'm assuming you'd update the Rakefile? This would involve a little > work since it currently uses a single constant for both the location > of Framework libraries and the compiler (csc). We'd have to split > those but that's not too much work. (The alternative to changing the > Rakefile is to instruct everyone to run it from the VS or SDK command > prompt, which seems less desirable to me.) > > - Jason Langston > http://rubydoes.net > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > -- Rob Bazinet http://www.accidentaltechnologist.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/ironruby-core/attachments/20080116/5105dae6/attachment.html From thibaut.barrere at gmail.com Wed Jan 16 11:19:51 2008 From: thibaut.barrere at gmail.com (=?ISO-8859-1?Q?Thibaut_Barr=E8re?=) Date: Wed, 16 Jan 2008 17:19:51 +0100 Subject: [Ironruby-core] Littl' question about the build process In-Reply-To: References: <4a68b8cf0801150206h13c474deoc77308d21d0ec07a@mail.gmail.com> <918705E903F4714CB713D89AB5F1857D73B26BC111@NA-EXMSG-C116.redmond.corp.microsoft.com> <69f7d8470801160654u275d25cftd9517914a90b410d@mail.gmail.com> <372109E149E8084D8E6C7D9CFD82E06329E8073344@NA-EXMSG-C115.redmond.corp.microsoft.com> <69f7d8470801160720o4291130apf75fe4ea0e777bef@mail.gmail.com> <372109E149E8084D8E6C7D9CFD82E06329E807336B@NA-EXMSG-C115.redmond.corp.microsoft.com> Message-ID: <4a68b8cf0801160819r2c2d03deu90fde7cf290a5769@mail.gmail.com> > Does the RakeFile even work for us externally? I have tried it a few times > and it always blows up. Apparently there needs to be something fed to it I > am not doing. "rake compile" works for me. In case you want to compare, here's my configuration: ruby 1.8.5 (2006-12-25 patchlevel 12) [i386-mswin32] rake, version 0.8.1 cheers -- Thibaut From thibaut.barrere at gmail.com Wed Jan 16 11:21:14 2008 From: thibaut.barrere at gmail.com (=?ISO-8859-1?Q?Thibaut_Barr=E8re?=) Date: Wed, 16 Jan 2008 17:21:14 +0100 Subject: [Ironruby-core] Littl' question about the build process In-Reply-To: References: <4a68b8cf0801150206h13c474deoc77308d21d0ec07a@mail.gmail.com> <918705E903F4714CB713D89AB5F1857D73B26BC111@NA-EXMSG-C116.redmond.corp.microsoft.com> <69f7d8470801160654u275d25cftd9517914a90b410d@mail.gmail.com> <372109E149E8084D8E6C7D9CFD82E06329E8073344@NA-EXMSG-C115.redmond.corp.microsoft.com> <69f7d8470801160720o4291130apf75fe4ea0e777bef@mail.gmail.com> <372109E149E8084D8E6C7D9CFD82E06329E807336B@NA-EXMSG-C115.redmond.corp.microsoft.com> Message-ID: <4a68b8cf0801160821r1470c6aq75af6de891cc8b74@mail.gmail.com> > Does the RakeFile even work for us externally? I have tried it a few times and it always blows up. > Apparently there needs to be something fed to it I am not doing. Did you try running the "rake happy" task to see if your environment is ok ? (PATH must include folders with csc.exe and resgen.exe) -- Thibaut From bacondarwin at googlemail.com Wed Jan 16 11:23:10 2008 From: bacondarwin at googlemail.com (Peter Bacon Darwin) Date: Wed, 16 Jan 2008 16:23:10 -0000 Subject: [Ironruby-core] Littl' question about the build process In-Reply-To: <4a68b8cf0801160819r2c2d03deu90fde7cf290a5769@mail.gmail.com> References: <4a68b8cf0801150206h13c474deoc77308d21d0ec07a@mail.gmail.com> <918705E903F4714CB713D89AB5F1857D73B26BC111@NA-EXMSG-C116.redmond.corp.microsoft.com> <69f7d8470801160654u275d25cftd9517914a90b410d@mail.gmail.com> <372109E149E8084D8E6C7D9CFD82E06329E8073344@NA-EXMSG-C115.redmond.corp.microsoft.com> <69f7d8470801160720o4291130apf75fe4ea0e777bef@mail.gmail.com> <372109E149E8084D8E6C7D9CFD82E06329E807336B@NA-EXMSG-C115.redmond.corp.microsoft.com> <4a68b8cf0801160819r2c2d03deu90fde7cf290a5769@mail.gmail.com> Message-ID: <002001c8585c$16e21550$44a63ff0$@com> Note the ruby version. If you use the Windows installer then the latest one (Ruby-186-26) crashes inside Pathname2. Drop back to Ruby-186-25 and you should be fine. Pete -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Thibaut Barr?re Sent: Wednesday,16 January 16, 2008 16:20 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Littl' question about the build process > Does the RakeFile even work for us externally? I have tried it a few times > and it always blows up. Apparently there needs to be something fed to it I > am not doing. "rake compile" works for me. In case you want to compare, here's my configuration: ruby 1.8.5 (2006-12-25 patchlevel 12) [i386-mswin32] rake, version 0.8.1 cheers -- Thibaut _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core From rbazinet at gmail.com Wed Jan 16 11:30:10 2008 From: rbazinet at gmail.com (Robert Bazinet) Date: Wed, 16 Jan 2008 11:30:10 -0500 Subject: [Ironruby-core] Littl' question about the build process In-Reply-To: <002001c8585c$16e21550$44a63ff0$@com> References: <4a68b8cf0801150206h13c474deoc77308d21d0ec07a@mail.gmail.com> <918705E903F4714CB713D89AB5F1857D73B26BC111@NA-EXMSG-C116.redmond.corp.microsoft.com> <69f7d8470801160654u275d25cftd9517914a90b410d@mail.gmail.com> <372109E149E8084D8E6C7D9CFD82E06329E8073344@NA-EXMSG-C115.redmond.corp.microsoft.com> <69f7d8470801160720o4291130apf75fe4ea0e777bef@mail.gmail.com> <372109E149E8084D8E6C7D9CFD82E06329E807336B@NA-EXMSG-C115.redmond.corp.microsoft.com> <4a68b8cf0801160819r2c2d03deu90fde7cf290a5769@mail.gmail.com> <002001c8585c$16e21550$44a63ff0$@com> Message-ID: Ah yes, I think that is my problem. Thanks Pete. On Jan 16, 2008 11:23 AM, Peter Bacon Darwin wrote: > Note the ruby version. If you use the Windows installer then the latest > one > (Ruby-186-26) crashes inside Pathname2. Drop back to Ruby-186-25 and you > should be fine. > Pete > > -----Original Message----- > From: ironruby-core-bounces at rubyforge.org > [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Thibaut Barr?re > Sent: Wednesday,16 January 16, 2008 16:20 > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] Littl' question about the build process > > > Does the RakeFile even work for us externally? I have tried it a few > times > > and it always blows up. Apparently there needs to be something fed to > it > I > > am not doing. > > "rake compile" works for me. In case you want to compare, here's my > configuration: > > ruby 1.8.5 (2006-12-25 patchlevel 12) [i386-mswin32] > rake, version 0.8.1 > > cheers > > -- Thibaut > _______________________________________________ > 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 > -- Rob Bazinet http://www.accidentaltechnologist.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/ironruby-core/attachments/20080116/730ef441/attachment.html From jb at nurv.fr Wed Jan 16 11:30:22 2008 From: jb at nurv.fr (Jb Evain) Date: Wed, 16 Jan 2008 17:30:22 +0100 Subject: [Ironruby-core] [patch] downto/upto Message-ID: <69f7d8470801160830u703662c0ye4dfe556959d41c7@mail.gmail.com> Hey, In the process of running one of my script on IronRuby I needed upto, so here it is, along with his downto friend. I was wondering if I could simply call Step with the relevant limit and step from upto/downto, but wasn't sure that was correct. I've basically monkey saw, monkey did the whole thing, please correct me if I got some parts wrong. -- Jb Evain -------------- next part -------------- A non-text attachment was scrubbed... Name: integer.patch Type: application/octet-stream Size: 3265 bytes Desc: not available Url : http://rubyforge.org/pipermail/ironruby-core/attachments/20080116/84c43101/attachment.obj From enicholson at gmail.com Wed Jan 16 13:03:41 2008 From: enicholson at gmail.com (Eric Nicholson) Date: Wed, 16 Jan 2008 13:03:41 -0500 Subject: [Ironruby-core] Littl' question about the build process In-Reply-To: <372109E149E8084D8E6C7D9CFD82E06329E8073366@NA-EXMSG-C115.redmond.corp.microsoft.com> References: <4a68b8cf0801150206h13c474deoc77308d21d0ec07a@mail.gmail.com> <918705E903F4714CB713D89AB5F1857D73B26BC111@NA-EXMSG-C116.redmond.corp.microsoft.com> <69f7d8470801160654u275d25cftd9517914a90b410d@mail.gmail.com> <372109E149E8084D8E6C7D9CFD82E06329E8073344@NA-EXMSG-C115.redmond.corp.microsoft.com> <372109E149E8084D8E6C7D9CFD82E06329E8073366@NA-EXMSG-C115.redmond.corp.microsoft.com> Message-ID: Sorry to beat this to death, but IronRuby would still run on a .NET 2.0 only system? I'd say this is pretty important because some of us still have to support Windows 2000 as a runtime environment... On Jan 16, 2008 10:25 AM, John Lam (DLR) wrote: > Tomas Restrepo: > > > Personally, I'm building with VS2008 for now, and wouldn't mind being > > forced to use VS2008 to develop. The more interesting question is > > whether .NET 3.5 would become the minimum requirement for the DLR and > > IronRuby *at runtime*. If the idea is to still be targeting plain .NET > > 2.0 for runtime, I think that would be a lot better and more palatable > > for many people. > > We're targeting CLR v2.0 which is the version of the CLR that ships in > .NET 3.5 (confusing, yes :)). > > C# 3.0 doesn't require new features from the CLR, just some new libraries > (System.Core and friends). > > -John > > _______________________________________________ > 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/20080116/9450cf83/attachment.html From jeff.stong at live.com Wed Jan 16 13:46:29 2008 From: jeff.stong at live.com (Jeff Stong) Date: Wed, 16 Jan 2008 13:46:29 -0500 Subject: [Ironruby-core] Littl' question about the build process In-Reply-To: <372109E149E8084D8E6C7D9CFD82E06329E807336B@NA-EXMSG-C115.redmond.corp.microsoft.com> References: <4a68b8cf0801150206h13c474deoc77308d21d0ec07a@mail.gmail.com> <918705E903F4714CB713D89AB5F1857D73B26BC111@NA-EXMSG-C116.redmond.corp.microsoft.com> <69f7d8470801160654u275d25cftd9517914a90b410d@mail.gmail.com> <372109E149E8084D8E6C7D9CFD82E06329E8073344@NA-EXMSG-C115.redmond.corp.microsoft.com> <69f7d8470801160720o4291130apf75fe4ea0e777bef@mail.gmail.com> <372109E149E8084D8E6C7D9CFD82E06329E807336B@NA-EXMSG-C115.redmond.corp.microsoft.com> Message-ID: John, > There are plenty on our team that want to switch, but we haven't made a call on that yet. But if y'all make enough noise it will help us advance our cause inside :) Consider this some noise! :) Jeff > From: jflam at microsoft.com> To: ironruby-core at rubyforge.org> Date: Wed, 16 Jan 2008 07:27:13 -0800> Subject: Re: [Ironruby-core] Littl' question about the build process> > Jb Evain:> > > That would be nice indeed. And if we're talking about C#, I would not> > mind seeing IronRuby focusing on C#3, as the project itself is> > new.> > Me too. But we don't want to slow down folks who are working on libraries as well. There are plenty on our team that want to switch, but we haven't made a call on that yet. But if y'all make enough noise it will help us advance our cause inside :)> > -John> > _______________________________________________> Ironruby-core mailing list> Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core _________________________________________________________________ Get the power of Windows + Web with the new Windows Live. http://www.windowslive.com?ocid=TXT_TAGHM_Wave2_powerofwindows_012008 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/ironruby-core/attachments/20080116/78dc0add/attachment.html From jomes at microsoft.com Wed Jan 16 14:39:39 2008 From: jomes at microsoft.com (John Messerly) Date: Wed, 16 Jan 2008 11:39:39 -0800 Subject: [Ironruby-core] Littl' question about the build process In-Reply-To: <372109E149E8084D8E6C7D9CFD82E06329E8073366@NA-EXMSG-C115.redmond.corp.microsoft.com> References: <4a68b8cf0801150206h13c474deoc77308d21d0ec07a@mail.gmail.com> <918705E903F4714CB713D89AB5F1857D73B26BC111@NA-EXMSG-C116.redmond.corp.microsoft.com> <69f7d8470801160654u275d25cftd9517914a90b410d@mail.gmail.com> <372109E149E8084D8E6C7D9CFD82E06329E8073344@NA-EXMSG-C115.redmond.corp.microsoft.com> <372109E149E8084D8E6C7D9CFD82E06329E8073366@NA-EXMSG-C115.redmond.corp.microsoft.com> Message-ID: <918705E903F4714CB713D89AB5F1857D73B26BC621@NA-EXMSG-C116.redmond.corp.microsoft.com> John Lam (DLR): > Tomas Restrepo: > > > Personally, I'm building with VS2008 for now, and wouldn't mind being > > forced to use VS2008 to develop. The more interesting question is > > whether .NET 3.5 would become the minimum requirement for the DLR and > > IronRuby *at runtime*. If the idea is to still be targeting plain > .NET > > 2.0 for runtime, I think that would be a lot better and more > palatable > > for many people. > > We're targeting CLR v2.0 which is the version of the CLR that ships in > .NET 3.5 (confusing, yes :)). > > C# 3.0 doesn't require new features from the CLR, just some new > libraries (System.Core and friends). Don't you still need to install the .NET 3.5 runtime though, if we start using System.Core features? I think if we just use compiler features (like "var" & the new closure syntax), we can still target .NET 2.0 runtime. - John From jflam at microsoft.com Wed Jan 16 14:41:51 2008 From: jflam at microsoft.com (John Lam (DLR)) Date: Wed, 16 Jan 2008 11:41:51 -0800 Subject: [Ironruby-core] Littl' question about the build process In-Reply-To: <918705E903F4714CB713D89AB5F1857D73B26BC621@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <4a68b8cf0801150206h13c474deoc77308d21d0ec07a@mail.gmail.com> <918705E903F4714CB713D89AB5F1857D73B26BC111@NA-EXMSG-C116.redmond.corp.microsoft.com> <69f7d8470801160654u275d25cftd9517914a90b410d@mail.gmail.com> <372109E149E8084D8E6C7D9CFD82E06329E8073344@NA-EXMSG-C115.redmond.corp.microsoft.com> <372109E149E8084D8E6C7D9CFD82E06329E8073366@NA-EXMSG-C115.redmond.corp.microsoft.com> <918705E903F4714CB713D89AB5F1857D73B26BC621@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <372109E149E8084D8E6C7D9CFD82E06329E8073565@NA-EXMSG-C115.redmond.corp.microsoft.com> John Messerly: > Don't you still need to install the .NET 3.5 runtime though, if we > start using System.Core features? > I think if we just use compiler features (like "var" & the new closure > syntax), we can still target .NET 2.0 runtime. Sure, but I didn't think that we were planning on using LINQ anytime soon (modulo my IronRuby.Libraries.Scanner project which is more of a plaything than anything else). -John From bacondarwin at googlemail.com Wed Jan 16 15:49:18 2008 From: bacondarwin at googlemail.com (Peter Bacon Darwin) Date: Wed, 16 Jan 2008 20:49:18 -0000 Subject: [Ironruby-core] Automatic conversion of bool to int In-Reply-To: References: <000b01c85453$35264b60$9f72e220$@com> Message-ID: <000001c85881$44ece360$cec6aa20$@com> Since you are going to reimplement the conversions from scratch at some point, can I offer the following patch to fix the particular bool to int conversion problem for now? It is also pretty trivial. Regards, Pete From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Tomas Matousek Sent: Friday,11 January 11, 2008 17:16 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Automatic conversion of bool to int The conversions are wrong. In fact, they are quire arbitrary (the code is in fact partly copied from IronPython). We have an item on our todo list to reimplement them from scratch. Tomas From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Peter Bacon Darwin Sent: Friday, January 11, 2008 5:10 AM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] Automatic conversion of bool to int In irb we have: 1 + true => TypeError: true can't be coerced into Fixnum In rbx we have: 1 + true => 2 There are the following methods for + in Fixnum: public static object Add(int self, int other) public static double Add(int self, double other) public static object Add(CodeContext/*!*/ context, object self, object other) I expected that passing a bool into + operator would have ended up at the third overload, which would give the correct behaviour when it tries to coerce on the bool. But it actually gets mapped to the first overload and there is an implicit conversion of true to 1. You can see this in the resulting AST dump: (FixnumOps.Add)( (.bound $arg0), (Converter.ConvertToInt32)( (Object)(.bound $arg1), ), ) After some digging I found this method in Ruby.Runtime.Converter: private static bool HasImplicitNumericConversion(Type fromType, Type toType) { if (fromType.IsEnum) return false; if (fromType == typeof(BigInteger)) { if (toType == typeof(double)) return true; if (toType == typeof(float)) return true; if (toType == typeof(Complex64)) return true; return false; } if (fromType == typeof(bool)) { if (toType == typeof(int)) return true; return HasImplicitNumericConversion(typeof(int), toType); } ... Here you can see that bool is automatically converted to an int. Is this correct behaviour? I appreciate that we can take any non-nil value as true and nil as false but not the other way round. ASIDE: In fact all three methods are added as "Applicable Targets" but the int version gets there first. Is there a heuristic for the order in which overloads are considered? Regards, Pete -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/ironruby-core/attachments/20080116/7d8cc88c/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: Converter.patch Type: application/octet-stream Size: 681 bytes Desc: not available Url : http://rubyforge.org/pipermail/ironruby-core/attachments/20080116/7d8cc88c/attachment.obj From lewistm at gmail.com Wed Jan 16 15:52:57 2008 From: lewistm at gmail.com (Terence Lewis) Date: Wed, 16 Jan 2008 22:52:57 +0200 Subject: [Ironruby-core] Littl' question about the build process In-Reply-To: <372109E149E8084D8E6C7D9CFD82E06329E8073565@NA-EXMSG-C115.redmond.corp.microsoft.com> References: <4a68b8cf0801150206h13c474deoc77308d21d0ec07a@mail.gmail.com> <918705E903F4714CB713D89AB5F1857D73B26BC111@NA-EXMSG-C116.redmond.corp.microsoft.com> <69f7d8470801160654u275d25cftd9517914a90b410d@mail.gmail.com> <372109E149E8084D8E6C7D9CFD82E06329E8073344@NA-EXMSG-C115.redmond.corp.microsoft.com> <372109E149E8084D8E6C7D9CFD82E06329E8073366@NA-EXMSG-C115.redmond.corp.microsoft.com> <918705E903F4714CB713D89AB5F1857D73B26BC621@NA-EXMSG-C116.redmond.corp.microsoft.com> <372109E149E8084D8E6C7D9CFD82E06329E8073565@NA-EXMSG-C115.redmond.corp.microsoft.com> Message-ID: <2f1decf20801161252r5d23b204s52974bc837f45577@mail.gmail.com> Would this impact moonlight? On Jan 16, 2008 9:41 PM, John Lam (DLR) wrote: > John Messerly: > > > Don't you still need to install the .NET 3.5 runtime though, if we > > start using System.Core features? > > I think if we just use compiler features (like "var" & the new closure > > syntax), we can still target .NET 2.0 runtime. > > Sure, but I didn't think that we were planning on using LINQ anytime soon (modulo my IronRuby.Libraries.Scanner project which is more of a plaything than anything else). > > -John > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > From jb at nurv.fr Wed Jan 16 15:58:19 2008 From: jb at nurv.fr (Jb Evain) Date: Wed, 16 Jan 2008 21:58:19 +0100 Subject: [Ironruby-core] Littl' question about the build process In-Reply-To: <2f1decf20801161252r5d23b204s52974bc837f45577@mail.gmail.com> References: <4a68b8cf0801150206h13c474deoc77308d21d0ec07a@mail.gmail.com> <918705E903F4714CB713D89AB5F1857D73B26BC111@NA-EXMSG-C116.redmond.corp.microsoft.com> <69f7d8470801160654u275d25cftd9517914a90b410d@mail.gmail.com> <372109E149E8084D8E6C7D9CFD82E06329E8073344@NA-EXMSG-C115.redmond.corp.microsoft.com> <372109E149E8084D8E6C7D9CFD82E06329E8073366@NA-EXMSG-C115.redmond.corp.microsoft.com> <918705E903F4714CB713D89AB5F1857D73B26BC621@NA-EXMSG-C116.redmond.corp.microsoft.com> <372109E149E8084D8E6C7D9CFD82E06329E8073565@NA-EXMSG-C115.redmond.corp.microsoft.com> <2f1decf20801161252r5d23b204s52974bc837f45577@mail.gmail.com> Message-ID: <69f7d8470801161258m16f4d67bw28128a2e5da72448@mail.gmail.com> Hey, On 1/16/08, Terence Lewis wrote: > Would this impact moonlight? No, it should not. Our compiler is mostly C#3 ready. -- Jb Evain From jomes at microsoft.com Wed Jan 16 17:45:03 2008 From: jomes at microsoft.com (John Messerly) Date: Wed, 16 Jan 2008 14:45:03 -0800 Subject: [Ironruby-core] IronRuby with Silverlight, already possible ? In-Reply-To: <4a68b8cf0801160643i7887f0c2n426c451f2bb1629f@mail.gmail.com> References: <4a68b8cf0801160117m6cfbca8fo9912eda2f1481783@mail.gmail.com> <372109E149E8084D8E6C7D9CFD82E06329E8073328@NA-EXMSG-C115.redmond.corp.microsoft.com> <4a68b8cf0801160643i7887f0c2n426c451f2bb1629f@mail.gmail.com> Message-ID: <918705E903F4714CB713D89AB5F1857D73B26BC778@NA-EXMSG-C116.redmond.corp.microsoft.com> Thibaut Barr?re: > > John Messerly usually works some spooky magic incantations to get us > a build of SL that works with IronRuby. That happens whenever we need > to demonstrate progress. Short answer is that we can, but only with > private builds of SL (AFAIK). > > If you happen to release a private build of those once in a while, > please drop a line ! It will be most welcome. Unfortunately, we can't build IronRuby against the SL 1.1 alpha release. Our current sources target the next public release, which is coming soon. - John From lists at ruby-forum.com Thu Jan 17 23:30:38 2008 From: lists at ruby-forum.com (Softmind Technology) Date: Fri, 18 Jan 2008 05:30:38 +0100 Subject: [Ironruby-core] Any dates for Beta Versions and Implenting IronRuby..? In-Reply-To: <6a7d87069e1c86d16762abe6094eed78@ruby-forum.com> References: <6a7d87069e1c86d16762abe6094eed78@ruby-forum.com> Message-ID: Hi, I found few important details about the current status and expected date of IronRuby here. http://www.infoq.com/articles/state-of-ironruby This is a nice interview of Mr.John Lam, who clarifies many things. I suggest you all to read it. I was bit upset to see that there are no steps taken by Microsoft to provide a perfect IDE for IronRuby. They all are depending on Sapphire Steel. Since Sapphire Steel is supporting only VS2008, majority will not be able to take advantage of Visual Web Developer, which is more popular and Free of course. Netbeans is a great IDE and Free to. Why not we too can have something like that. Thanks SoftMind -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Fri Jan 18 05:47:16 2008 From: lists at ruby-forum.com (Huw Collingbourne) Date: Fri, 18 Jan 2008 11:47:16 +0100 Subject: [Ironruby-core] Any dates for Beta Versions and Implenting IronRuby..? In-Reply-To: References: <6a7d87069e1c86d16762abe6094eed78@ruby-forum.com> Message-ID: <90b7059060ed20f4864b84dbbd3a942a@ruby-forum.com> I should carify that we support VS2005 and VS2008. We also have a new low cost ($49) edition which comes complete with its own copy of VS2008 at no extra cost. No third party languages can be installed into the Visual Web Developer so that is not an option that is open to us. Our low cost edition does, however, contain all the HTML design and JavaScript funtionality of the full version of VS2008. As you may know we have already demoed an IronRuby form designer and IronRuby Intellisense. Our IronRuby support is (like IronRuby itself) still 'pre-release'. We are committed to offering first class support for IronRuby but it is at too early a stage to make any detailed announcements of any specific IronRuby IDEs. best wishes Huw Collingbourne SapphireSteel Software Ruby and Rails In Visual Studio http://www.sapphiresteel.com -- Posted via http://www.ruby-forum.com/. From bacondarwin at googlemail.com Fri Jan 18 09:13:29 2008 From: bacondarwin at googlemail.com (Peter Bacon Darwin) Date: Fri, 18 Jan 2008 14:13:29 -0000 Subject: [Ironruby-core] Numeric stuff Message-ID: <000b01c859dc$4e0a3c70$ea1eb550$@com> Here is a patch for the rest of the number stuff. The main patch (NumericBits.patch) modifies the following files: Numeric.cs: minor fixes and documentation FixnumOps.cs and BignumOps.cs: minor fixes and improvements FloatOps.cs: complete implementation Integer.cs: complete implementation (I know Jb Evain beat me to it on the upto/downto front but I hope that, without stealing his thunder, this is a complete implantation of the methods). Precision.cs: complete implementation LibrarySites.cs: Added a couple of extra sites and fixed a bug with abs site. Of course you have to regenerate Initializer.Generated.cs to get it to compile. I have also added a file (BignumLiteral.patch) which "turns on"the Bignum literal in IronRuby. It affects the following files: BigInteger.cs: Adds a new Create method Tokenizer.cs : Calls the BigInteger.Create method. I appreciate that this is not going to get included in the build but I thought I would provide it for people who want to get into Bignums (or get most of the specs to actually run) before the official fix for this is released. To keep things simple I have not added the many unit tests (specs) that I have written for these classes, even though these have probably taken 75% of the time spent. This is because the old builtin specs are being deprecated and it seems more sensible to try and push these specs into the Rubinius test suite instead. Hopefully Charles Nutter will be pleased! Finally if you do run the specs there will be a number of failures: The match method has not yet been defined so any specs that check for runtime type or version number will fail. I believe that these are primarily due to issues with the Ruby.Runtime.Converter class and Ruby.Runtime.StringFormatter. I will push through bug reports on RubyForge for these soon. There are also some issues with IronRuby throwing FloatDomainError where CRuby throws RangeError. I have not convinced myself whether this is an issue inside Protocols or FloatOps so I have left them as they are for now. Ironically, FloatDomainError derives from RangeError so it would not make much difference in a real application anyway. By the way, there is an interesting issue with Float#to_s. It appears that on Windows you get an extra zero in the exponent in both CRuby and IronRuby, which given the Rubinius specs doesn't appear on other platforms: 1.4e046 rather than 1.4e46. Finally, all the Rubinius specs think that 0x40000000 is a Bignum but in IronRuby (and JRuby) this is Fixnum. Therefore most of the bignum specs are actually testing against Fixnum instead of Bignum. So the Bignum functionality is not being given a work-out and more annoyingly, where there are different semantics between Fixnum and Bignum, the specs fail (i.e. Fixnum#div vs Bignum#div). Looking forward to the feedback. Regards, Pete -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/ironruby-core/attachments/20080118/ad9599a7/attachment-0001.html -------------- next part -------------- A non-text attachment was scrubbed... Name: BignumLiteral.patch Type: application/octet-stream Size: 2505 bytes Desc: not available Url : http://rubyforge.org/pipermail/ironruby-core/attachments/20080118/ad9599a7/attachment-0002.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: NumericBits.patch Type: application/octet-stream Size: 104578 bytes Desc: not available Url : http://rubyforge.org/pipermail/ironruby-core/attachments/20080118/ad9599a7/attachment-0003.obj From jflam at microsoft.com Fri Jan 18 10:26:20 2008 From: jflam at microsoft.com (John Lam (DLR)) Date: Fri, 18 Jan 2008 07:26:20 -0800 Subject: [Ironruby-core] Numeric stuff In-Reply-To: <000b01c859dc$4e0a3c70$ea1eb550$@com> References: <000b01c859dc$4e0a3c70$ea1eb550$@com> Message-ID: <372109E149E8084D8E6C7D9CFD82E06329E83CB715@NA-EXMSG-C115.redmond.corp.microsoft.com> Peter Bacon Darwin: > Here is a patch for the rest of the number stuff. Thanks for sending this in, Peter! We'll review and get comments back out soon. > Finally, all the Rubinius specs think that 0x40000000 is a Bignum but > in IronRuby (and JRuby) this is Fixnum. Therefore most of the bignum > specs are actually testing against Fixnum instead of Bignum. So the > Bignum functionality is not being given a work-out and more > annoyingly, where there are different semantics between Fixnum and > Bignum, the specs fail (i.e. Fixnum#div vs Bignum#div). This is a known problem in JRuby as well since they use 64 bit longs to represent Fixnums. Since the size of a Fixnum is a platform dependent thing (have no idea how 64 bit Ruby behaves) the specs are wrong and need to be fixed. I've cc'd Brian Ford, the spec owner on this. Thanks, -John From jomes at microsoft.com Fri Jan 18 18:37:50 2008 From: jomes at microsoft.com (John Messerly) Date: Fri, 18 Jan 2008 15:37:50 -0800 Subject: [Ironruby-core] Module#class_eval In-Reply-To: <001101c856b2$d3024d50$7906e7f0$@com> References: <001101c856b2$d3024d50$7906e7f0$@com> Message-ID: <918705E903F4714CB713D89AB5F1857D73B2A2E112@NA-EXMSG-C116.redmond.corp.microsoft.com> Peter Bacon Darwin: > I have been playing around with implementing Module#class_eval, partly > because I wanted to use it in a test case and partly because I thought > it would help my understanding of the guts of IronRuby. I managed to > get the following code to work but it is not pretty. > > [RubyMethod("class_eval")] > public static object Evaluate(CodeContext/*!*/ context, > RubyModule/*!*/ module, MutableString code) { > > // Create a new context for running the code string - not > sure if this is necessary. > CodeContext context2 = new CodeContext(context); > > // We need a localscope for GetRfc. > RubyScope localScope = RubyUtils.GetScope(context); > > // Create a local scope for this module definition. > // (This has a side-effect that context2 has the new module > scope attached in its LocalScope property.) > RubyScope moduleScope = RubyOps.CreateModuleScope(context2, > localScope.RuntimeFlowControl, module); > > // Compile up the code in the new context > SourceUnit sourceUnit = > context2.LanguageContext.CreateSnippet(code); > ScriptCode scriptCode = > sourceUnit.Compile(context2.LanguageContext.GetModuleCompilerOptions(co > n > text2.Scope), null); > > // Run the code in the new context. > // (This overload is currently private but we need to be > able to pass in the new context). > return scriptCode.Run(context2, false); > > } > > I added superfluous comments for the benefit of posting it her. The > main issue, as noted at the bottom of the code, is that the overload of > ScriptCode.Run that is called is currently private. All the public > overloads create a new CodeContext and you lose the LocalScope which is > needed to ensure that the code is run in the context of the module > being defined. > > Any comments on this? I assume that as the Hosting spec evolves this > could get a lot cleaner. Is there a better way right now to achieve > the same result? Nice that you got that working! I think the main issue you're running into is that hosting APIs are in flux. That's been a delaying factor on getting all the string-based "evals" working. Also, there might be some more work in the compiler too; e.g. are we burning in references where we should be looking them up dynamically, etc. There might be other things that Tomas has in mind that need to be changed. Anyway, I think it makes sense for us to do all the eval-related stuff in one push. > Also, one thing that really messed my head up for quite a while is the > use of the word scope. It took me a while to come to terms with the > fact that there are numerous completely separate scopes: Scope, > ScopeExtension (which contains a Scope property), ScriptScope (which > implements IScriptScope) and RubyScope (which derives from LocalScope). > > Am I right in saying: > > Scope is the global scope in which the current Ruby program is running > (with ScopeExtension just wrapping that and ScriptScope being a > container for code being run within that scope)? > > RubyScope is the local scope within a Ruby program that tells you > things like what the current self object is and what variables are > accessible? I think that's correct. Scope is the DLR global scope thing, while ScriptScope is the hosting API version. RubyScope will probably end up roughly equivalent to a binding (but it doesn't have all the stuff yet--e.g. locals) - John From Tomas.Matousek at microsoft.com Fri Jan 18 19:06:39 2008 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Fri, 18 Jan 2008 16:06:39 -0800 Subject: [Ironruby-core] Module#class_eval In-Reply-To: <918705E903F4714CB713D89AB5F1857D73B2A2E112@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <001101c856b2$d3024d50$7906e7f0$@com> <918705E903F4714CB713D89AB5F1857D73B2A2E112@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: Well, evals are actually not blocked by hosting API (rather the opposite is true for Ruby hosting in console). There is some other stuff that needs to be done in DLR and also in Ruby compiler to make eval happen. I'm on it, but it will take some time. Tomas -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of John Messerly Sent: Friday, January 18, 2008 3:38 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Module#class_eval Peter Bacon Darwin: > I have been playing around with implementing Module#class_eval, partly > because I wanted to use it in a test case and partly because I thought > it would help my understanding of the guts of IronRuby. I managed to > get the following code to work but it is not pretty. > > [RubyMethod("class_eval")] > public static object Evaluate(CodeContext/*!*/ context, > RubyModule/*!*/ module, MutableString code) { > > // Create a new context for running the code string - not > sure if this is necessary. > CodeContext context2 = new CodeContext(context); > > // We need a localscope for GetRfc. > RubyScope localScope = RubyUtils.GetScope(context); > > // Create a local scope for this module definition. > // (This has a side-effect that context2 has the new module > scope attached in its LocalScope property.) > RubyScope moduleScope = RubyOps.CreateModuleScope(context2, > localScope.RuntimeFlowControl, module); > > // Compile up the code in the new context > SourceUnit sourceUnit = > context2.LanguageContext.CreateSnippet(code); > ScriptCode scriptCode = > sourceUnit.Compile(context2.LanguageContext.GetModuleCompilerOptions(co > n > text2.Scope), null); > > // Run the code in the new context. > // (This overload is currently private but we need to be > able to pass in the new context). > return scriptCode.Run(context2, false); > > } > > I added superfluous comments for the benefit of posting it her. The > main issue, as noted at the bottom of the code, is that the overload of > ScriptCode.Run that is called is currently private. All the public > overloads create a new CodeContext and you lose the LocalScope which is > needed to ensure that the code is run in the context of the module > being defined. > > Any comments on this? I assume that as the Hosting spec evolves this > could get a lot cleaner. Is there a better way right now to achieve > the same result? Nice that you got that working! I think the main issue you're running into is that hosting APIs are in flux. That's been a delaying factor on getting all the string-based "evals" working. Also, there might be some more work in the compiler too; e.g. are we burning in references where we should be looking them up dynamically, etc. There might be other things that Tomas has in mind that need to be changed. Anyway, I think it makes sense for us to do all the eval-related stuff in one push. > Also, one thing that really messed my head up for quite a while is the > use of the word scope. It took me a while to come to terms with the > fact that there are numerous completely separate scopes: Scope, > ScopeExtension (which contains a Scope property), ScriptScope (which > implements IScriptScope) and RubyScope (which derives from LocalScope). > > Am I right in saying: > > Scope is the global scope in which the current Ruby program is running > (with ScopeExtension just wrapping that and ScriptScope being a > container for code being run within that scope)? > > RubyScope is the local scope within a Ruby program that tells you > things like what the current self object is and what variables are > accessible? I think that's correct. Scope is the DLR global scope thing, while ScriptScope is the hosting API version. RubyScope will probably end up roughly equivalent to a binding (but it doesn't have all the stuff yet--e.g. locals) - John _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core From jomes at microsoft.com Fri Jan 18 20:01:23 2008 From: jomes at microsoft.com (John Messerly) Date: Fri, 18 Jan 2008 17:01:23 -0800 Subject: [Ironruby-core] [patch] downto/upto In-Reply-To: <69f7d8470801160830u703662c0ye4dfe556959d41c7@mail.gmail.com> References: <69f7d8470801160830u703662c0ye4dfe556959d41c7@mail.gmail.com> Message-ID: <918705E903F4714CB713D89AB5F1857D73B2A2E173@NA-EXMSG-C116.redmond.corp.microsoft.com> Jb Evain: > In the process of running one of my script on IronRuby I needed upto, > so here it is, along with his downto friend. > > I was wondering if I could simply call Step with the relevant limit > and step from upto/downto, but wasn't sure that was correct. > > I've basically monkey saw, monkey did the whole thing, please correct > me if I got some parts wrong. Looks good. I think you're right about Step though. I'll try replacing the methods with direct calls to Step and see if it works. - John From ivan at flanders.co.nz Sat Jan 19 14:20:46 2008 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Sun, 20 Jan 2008 08:20:46 +1300 Subject: [Ironruby-core] WPF etc Message-ID: Hi In the IronPython samples for Silverlight I can see a really nice way of attaching a python file to the canvas. which for ruby becomes as soon as there is a silverlight refresh I presume. Doesn't the current silverlight download not support Ruby yet ? Anyway my real question is, is such a construct available for WPF as well. When i tried to put it in, it didn't want to work. How is this done for silverlight? Is that because the silverlight host application extends the code element? Would it be hard to make WPF work in the same way? I would love to be able to test some of the samples I will have with silverlight as well, does anybody have any idea as to when we would be able to get something? Thanks Ivan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/ironruby-core/attachments/20080120/4a0f3b7a/attachment.html From ivan at flanders.co.nz Sat Jan 19 15:52:29 2008 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Sun, 20 Jan 2008 09:52:29 +1300 Subject: [Ironruby-core] Linq etc. Message-ID: Hi What are the plans regarding Linq support for IronRuby. In the presentations I've seen you were using vbx to perform linq stuff in Silverlight. Is that only applicable to the from .. where ... select syntax and we can still use the extension method syntax collection.where ? Thanks Ivan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/ironruby-core/attachments/20080120/3ad21a7d/attachment.html From bacondarwin at googlemail.com Sun Jan 20 13:44:45 2008 From: bacondarwin at googlemail.com (Peter Bacon Darwin) Date: Sun, 20 Jan 2008 18:44:45 -0000 Subject: [Ironruby-core] New sockets.cs patch submission In-Reply-To: <2f1decf20801141329l7892bb80kfa456fa0ada06b61@mail.gmail.com> References: <2f1decf20801141329l7892bb80kfa456fa0ada06b61@mail.gmail.com> Message-ID: <001b01c85b94$89cdc330$9d694990$@com> By the way, the latest Rubinius specs have a host of specs for Socket et al: http://git.rubini.us/?p=code;a=tree;f=spec/ruby/1.8/library/socket;hb=HEAD Sadly most of them are empty at this stage. But at least it gives you something to start testing with. Pete -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Terence Lewis Sent: Monday,14 January 14, 2008 21:30 To: ironruby-core at rubyforge.org Subject: [Ironruby-core] New sockets.cs patch submission Hello list, Please find attached another patch for Socket.cs with the following changes: 1) Added class SocketStream : System.IO.Stream which wraps the socket and provides some stream-like functionality which RubyIO can use. I've tested the following methods and they appear to work well now on sockets: - readline - readlines - gets puts also works, but I'm not as confident that it's correct - see below under "Issues". I've also included a test file I used to compare output between ruby.exe and rbx.exe (I tested against a default install of IE7 - which returns a 404 for the address requested and both executables appear to produce the same output except for line-ending issues) 2) Fixed up the spacing/tabbing issues in the file as per Seo's comments - everything is now 4 spaces and no tabs, and I also moved the opening curly braces up to match the style in the rest of the solution. I know this code isn't perfect - but I think it is a step in the right direction. I have some concerns about it which I've listed below - any comments or suggestions will be most welcome. Issues: - Can only peek 1 byte - there is no buffering of data off the socket - I don't know if this will have a performance / efficiency impact? - There is no error handling code around the socket calls - is this OK? If not, what should be done? - The third parameter passed to RubyIO's constructor - "r+" - what should this be? "r+" allows me to read and write to the socket through the stream interface so maybe it's OK? - None of the IO mode checking referred to in the TODO comment above the SocketStream class has been implemented - I presume this means checking whether the socket has been shutdown either for sending or receiving before actually trying to do the read/write - instead of letting it throw an exception. - How should I trigger a flush on write? At the moment it's done on seeing a newline (hard-coded) in the stream, but I don't think that's clean or correct (certainly ruby.exe seems to send my test request (which has 2 newlines at the end) in one go - not in two separate pieces - which is the minor difference I referred to above regarding "puts").. - Not sure if Flush is efficient - should I somehow use an array rather than a list of bytes? Thanks for your time Terence From jomes at microsoft.com Mon Jan 21 17:19:35 2008 From: jomes at microsoft.com (John Messerly) Date: Mon, 21 Jan 2008 14:19:35 -0800 Subject: [Ironruby-core] Linq etc. In-Reply-To: References: Message-ID: <918705E903F4714CB713D89AB5F1857D73B2A2E655@NA-EXMSG-C116.redmond.corp.microsoft.com> Ivan Porto Carrero: > What are the plans regarding Linq support for IronRuby. In the > presentations I've seen you were using vbx to perform linq stuff in > Silverlight. Is that only applicable to the from .. where ... select > syntax and we can still use the extension method syntax > collection.where ? Yup, you'll be able to use Linq methods using the normal method call syntax. There won't be special syntax. Translating this example: http://msdn2.microsoft.com/en-us/library/bb397947.aspx, it will look something like this: require 'System.Core' numbers = [5, 10, 8, 3, 6, 12] numbers.where { |num| num % 2 == 0 }.order_by { |n| n }.each { |i| write("#{i} ") } - John From Jimmy.Schementi at microsoft.com Mon Jan 21 17:23:46 2008 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Mon, 21 Jan 2008 14:23:46 -0800 Subject: [Ironruby-core] WPF etc Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A32844F212BF93@NA-EXMSG-C116.redmond.corp.microsoft.com> I think this got swallowed by the list when I replied on Saturday =( Sending again ... > Ivan Porto Carrero wrote: > > In the IronPython samples for Silverlight I can see a really nice way > of attaching a python file to the canvas. > which for ruby > becomes as soon as > there is a silverlight refresh I presume. The next version of Silverlight initialize the ruby/python file directly, and then you can load a XAML file from code if necessary. So, your above example will not be necessary. > Doesn't the current silverlight download not support Ruby yet ? Nope, the current SL version doesn't support Ruby, however then next release will. > Anyway my real question is, is such a construct available for WPF as > well. When i tried to put it in, it didn't want to work. How is this > done for silverlight? Is that because the silverlight host application > extends the code element? Would it be hard to make WPF work in the > same way? Actually, I think John Lam has a WPF Ruby app he's been working on, but I'm not sure of its current status. Silverlight currently defines the x:Code element, which WPF does not have a notion of. Also, WPF is essentially code-first, which is what Silverlight is aligning to > I would love to be able to test some of the samples I will have with > silverlight as well, does anybody have any idea as to when we would be > able to get something? Well, the Silverlight schedule isn't public yet, but this guy (http://blogs.zdnet.com/Stewart/?p=702) seems to have predictions =) The next release is a beta, and from then on we'll support Ruby. > Thanks > Ivan Hope that answers your questions! ~Jimmy From ivan at flanders.co.nz Mon Jan 21 17:35:31 2008 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Tue, 22 Jan 2008 11:35:31 +1300 Subject: [Ironruby-core] Linq etc. In-Reply-To: <918705E903F4714CB713D89AB5F1857D73B2A2E655@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <918705E903F4714CB713D89AB5F1857D73B2A2E655@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: sweet that was what I was thinking. Thanks for that. On Jan 22, 2008 11:19 AM, John Messerly wrote: > Ivan Porto Carrero: > > > What are the plans regarding Linq support for IronRuby. In the > > presentations I've seen you were using vbx to perform linq stuff in > > Silverlight. Is that only applicable to the from .. where ... select > > syntax and we can still use the extension method syntax > > collection.where ? > > Yup, you'll be able to use Linq methods using the normal method call > syntax. There won't be special syntax. > > Translating this example: > http://msdn2.microsoft.com/en-us/library/bb397947.aspx, it will look > something like this: > > require 'System.Core' > numbers = [5, 10, 8, 3, 6, 12] > numbers.where { |num| num % 2 == 0 }.order_by { |n| n }.each { |i| > write("#{i} ") } > > - John > > _______________________________________________ > 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/20080122/eba2c3a0/attachment.html From blowmage at gmail.com Mon Jan 21 18:26:35 2008 From: blowmage at gmail.com (Mike Moore) Date: Mon, 21 Jan 2008 16:26:35 -0700 Subject: [Ironruby-core] Linq etc. In-Reply-To: <918705E903F4714CB713D89AB5F1857D73B2A2E655@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <918705E903F4714CB713D89AB5F1857D73B2A2E655@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: John, my understanding is the Where() and OrderBy() methods are extension methods defined in System.Linq.Enumerable and only available in C# if you include a reference to the System.Linq namespace in your C# code. Are you saying that extension methods are available from IronRuby without having to require the namespace? If not, how do we make them available? Here is an example using an extension method with the signature "public bool IsGuid(this String str)" in the class MyString in the namespace MyAssembly.MyStuff. C# pseudo code: using MyAssembly.MyStuff; public class MyStupidApp() { public void DoStuff(string val) { if (val.IsGuid()) Console.WriteLine("Guid!) } } What is the equivalent Ruby code? Do we need to require the assembly? require 'MyAssembly.MyStuff' def do_stuff(val) puts 'Guid' if val.is_guid end Or are the Linq extension methods the only ones that will be available? Thanks! ~Mike On Jan 21, 2008 3:19 PM, John Messerly wrote: > Ivan Porto Carrero: > > > What are the plans regarding Linq support for IronRuby. In the > > presentations I've seen you were using vbx to perform linq stuff in > > Silverlight. Is that only applicable to the from .. where ... select > > syntax and we can still use the extension method syntax > > collection.where ? > > Yup, you'll be able to use Linq methods using the normal method call > syntax. There won't be special syntax. > > Translating this example: > http://msdn2.microsoft.com/en-us/library/bb397947.aspx, it will look > something like this: > > require 'System.Core' > numbers = [5, 10, 8, 3, 6, 12] > numbers.where { |num| num % 2 == 0 }.order_by { |n| n }.each { |i| > write("#{i} ") } > > - John > > _______________________________________________ > 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/20080121/229d7d93/attachment.html From jomes at microsoft.com Mon Jan 21 18:45:56 2008 From: jomes at microsoft.com (John Messerly) Date: Mon, 21 Jan 2008 15:45:56 -0800 Subject: [Ironruby-core] Linq etc. In-Reply-To: References: <918705E903F4714CB713D89AB5F1857D73B2A2E655@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <918705E903F4714CB713D89AB5F1857D73B2B58E01@NA-EXMSG-C116.redmond.corp.microsoft.com> Mike Moore: > John, my understanding is the Where() and OrderBy() methods are > extension methods defined in System.Linq.Enumerable and only available > in C# if you include a reference to the System.Linq namespace in your > C# code. Are you saying that extension methods are available from > IronRuby without having to require the namespace? If not, how do we > make them available? > > Here is an example using an extension method with the signature > "public bool IsGuid(this String str)" in the class MyString in the > namespace MyAssembly.MyStuff. > > C# pseudo code: > > using MyAssembly.MyStuff ; > > public class MyStupidApp() { > public void DoStuff(string val) { > if (val.IsGuid()) Console.WriteLine("Guid!) > } > } > > What is the equivalent Ruby code? Do we need to require the assembly? > > require 'MyAssembly.MyStuff' > > def do_stuff(val) > puts 'Guid' if val.is_guid > end > > Or are the Linq extension methods the only ones that will be available? Yup, you need to require the assembly. If you were writing Linq in Ruby, you'd have something like System.Core.rb: module Enumerable def order_by ... end def where ... end end ... so requiring System.Core just opens up Enumerable and sticks some methods on it. At least, that's been my thinking on it. Maybe we add an extra step like: require 'System.Core' include System::Linq I'm not sure how Ruby-ish that is, though. - John From blowmage at gmail.com Mon Jan 21 18:57:33 2008 From: blowmage at gmail.com (Mike Moore) Date: Mon, 21 Jan 2008 16:57:33 -0700 Subject: [Ironruby-core] Linq etc. In-Reply-To: <918705E903F4714CB713D89AB5F1857D73B2B58E01@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <918705E903F4714CB713D89AB5F1857D73B2A2E655@NA-EXMSG-C116.redmond.corp.microsoft.com> <918705E903F4714CB713D89AB5F1857D73B2B58E01@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: On Jan 21, 2008 4:45 PM, John Messerly wrote: > > Yup, you need to require the assembly. If you were writing Linq in Ruby, > you'd have something like System.Core.rb: > > module Enumerable > def order_by > ... > end > def where > ... > end > end > > ... so requiring System.Core just opens up Enumerable and sticks some > methods on it. > At least, that's been my thinking on it. I gotcha. So in your example System.Core.rb was monkey-patching Enumerable. You weren't actually resolving those method calls to the extension methods in the System.Linq.Enumerable class. > Maybe we add an extra step like: > > require 'System.Core' > include System::Linq > > I'm not sure how Ruby-ish that is, though. > I agree. In C# you add the namespace and those extension methods are only available in that source file. So you have to add the namespace to each file you want to use the extension methods. But in Ruby once they are added to the object they are available everywhere. So I wonder what a Ruby-ish solution would be. Does anyone on the list have any suggestions how enabling extension methods could/should look? > - John > > _______________________________________________ > 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/20080121/4e5c0de3/attachment.html From jomes at microsoft.com Mon Jan 21 21:31:43 2008 From: jomes at microsoft.com (John Messerly) Date: Mon, 21 Jan 2008 18:31:43 -0800 Subject: [Ironruby-core] SVN Revision 73 Message-ID: <918705E903F4714CB713D89AB5F1857D73B2B58ED5@NA-EXMSG-C116.redmond.corp.microsoft.com> I updated SVN to include Peter's numeric and Terence's socket patches. Please let me know if I missed any of your changes. Changes include: * Many improvements to numeric classes (Bignum, Fixnum, Float, Integer, Precision, Numeric) * More functionality in the socket library * Removed bool to int implicit conversion * Parser startup improvements, some tokenizer refactoring * Various DLR improvements (hosting work, AST improvements, and more) * Improved exception formatting (getting closer to MRI) - John -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/ironruby-core/attachments/20080121/def12e17/attachment-0001.html From bacondarwin at googlemail.com Tue Jan 22 05:55:59 2008 From: bacondarwin at googlemail.com (Peter Bacon Darwin) Date: Tue, 22 Jan 2008 10:55:59 -0000 Subject: [Ironruby-core] SVN Revision 73 In-Reply-To: <918705E903F4714CB713D89AB5F1857D73B2B58ED5@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <918705E903F4714CB713D89AB5F1857D73B2B58ED5@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <001d01c85ce5$607c6390$21752ab0$@com> Great stuff. Things are starting to come together. I appreciate that lots of work is going on behind the scenes in the DLR but it is also good to see bits of Ruby specific stuff getting sorted. Just a quick note. I appreciate that there is a TODO note in the Ruby.Compiler.Token.SetBigInteger(int sign, uint[]/*!*/ data) method but there is a bit of a problem here. The method does not take into account the base in which the number was written. E.g. >>> 9999987654321.to_s => "394020062147424681466075733027822041608996069303164925748546377975890558078 60137311331770134300566582203266107441161" The method currently just maps whatever digits were passed to the parser straight into the BigInteger's internal data structure. Pete From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of John Messerly Sent: Tuesday,22 January 22, 2008 02:32 To: ironruby-core at rubyforge.org Subject: [Ironruby-core] SVN Revision 73 I updated SVN to include Peter's numeric and Terence's socket patches. Please let me know if I missed any of your changes. Changes include: * Many improvements to numeric classes (Bignum, Fixnum, Float, Integer, Precision, Numeric) * More functionality in the socket library * Removed bool to int implicit conversion * Parser startup improvements, some tokenizer refactoring * Various DLR improvements (hosting work, AST improvements, and more) * Improved exception formatting (getting closer to MRI) - John -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/ironruby-core/attachments/20080122/be2cdab0/attachment.html From robert.brotherus at napa.fi Tue Jan 22 11:19:52 2008 From: robert.brotherus at napa.fi (Robert Brotherus) Date: Tue, 22 Jan 2008 18:19:52 +0200 Subject: [Ironruby-core] Accessing IronRuby method from C# Message-ID: <680FA370A36D83439E177BDC02F0E8B501E5BEEF@nw60.napa.fi> Greetings to the mighty IronRuby experts from a humble developer! :-) I am testing the latest CVS snapshot (v. 73, downloaded an hour ago) of IronRuby. We are evaluating IronRuby for possible usage in WPF project. First, I want to test a simple case of defining a method in Ruby and calling the method later from C#. Below I copy a test program that tries this in two ways (methods AccessMethod1 and AccessMethod2). Both attempts fail with exceptions that are written as comments in the code. I understand that the DLR and IronRuby are in a flux at the moment but I still suppose there must be some working way to perform such trivial interop task...? Thanks in advance! Robert Brotherus Software architect Napa Ltd --------------------- using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.Scripting; using Microsoft.Scripting.Hosting; using Ruby.Runtime; using Ruby.Builtins; namespace IronRubyTests { class Program { private IScriptEnvironment _scriptRuntime; public IScriptEnvironment ScriptRuntime { get { return this._scriptRuntime; } } public IScriptEngine RubyEngine { get { return ScriptRuntime.GetEngine(typeof(RubyContext)); } } public ObjectOperations Operations { get { return RubyEngine.Operations; } } public RubyExecutionContext ExecutionContext { get { return Ruby.IronRuby.GetExecutionContext(RubyEngine); } } public IAttributesCollection GlobalItems { get { return ExecutionContext.GlobalScope.Dict; } } delegate void TestDelegate(); static void Main(string[] args) { new Program().RunAllTests(); } public Program() { this._scriptRuntime = Ruby.IronRuby.CreateRuntime(); } public void RunAllTests() { List tests = new List { new TestDelegate(SimpleTests), new TestDelegate(AccessMethod1), new TestDelegate(AccessMethod2) }; foreach (TestDelegate test in tests) { Console.WriteLine("================== EXECUTING: {0} ====================", test.Method.Name); try { test(); } catch (Exception ex) { Console.WriteLine(ex); } } } public IScriptScope ExecuteString(string code) { return ScriptRuntime.ExecuteSourceUnit( RubyEngine.CreateScriptSourceFromString(code)); } public void SetGlobalVar(string varName, object value) { ExecutionContext.GlobalVariables[SymbolTable.StringToId(varName)] = value; } public object GetGlobalVar(string varName) { return ExecutionContext.GlobalVariables[SymbolTable.StringToId(varName)]; } public object GetGlobalConst(string name) { return GlobalItems.SymbolAttributes[SymbolTable.StringToId(name)]; } public void SimpleTests() { ExecuteString("puts 'RUBY SAYS HELLO'"); // OK SetGlobalVar("x", 666); // OK ExecuteString("$y=555"); // OK ExecuteString("puts \"ruby: $x = #{$x}\""); // OK } public void AccessMethod1() { // Following fails with System.MissingMethodException: undefined local variable or method 'method' for main:Object ExecuteString(@" def sayHello puts 'Hello from method!' end $m = method(:sayHello) "); // Get the method object: object m = GetGlobalVar("m"); // Here call the method, etc. } public void AccessMethod2() { ExecuteString(@" module MyMethods def sayHello puts 'Hello from method!' end end "); RubyModule myModule = (RubyModule) GetGlobalConst("MyMethods"); // OK object sayHello = Operations.GetMember(myModule, "sayHello"); // Fails at Assertion at ActionBinber.UpdateSiteAndExecute() // Here call the method, etc. } } // class } // namespace -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/ironruby-core/attachments/20080122/e6007d0b/attachment-0001.html From Tomas.Matousek at microsoft.com Tue Jan 22 12:18:24 2008 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Tue, 22 Jan 2008 09:18:24 -0800 Subject: [Ironruby-core] SVN Revision 73 In-Reply-To: <001d01c85ce5$607c6390$21752ab0$@com> References: <918705E903F4714CB713D89AB5F1857D73B2B58ED5@NA-EXMSG-C116.redmond.corp.microsoft.com> <001d01c85ce5$607c6390$21752ab0$@com> Message-ID: Yes, working on it. The current big-int parsing is a temporary hack that I needed for tokenization testing. Tomas From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Peter Bacon Darwin Sent: Tuesday, January 22, 2008 2:56 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] SVN Revision 73 Great stuff. Things are starting to come together. I appreciate that lots of work is going on behind the scenes in the DLR but it is also good to see bits of Ruby specific stuff getting sorted. Just a quick note. I appreciate that there is a TODO note in the Ruby.Compiler.Token.SetBigInteger(int sign, uint[]/*!*/ data) method but there is a bit of a problem here. The method does not take into account the base in which the number was written. E.g. >>> 9999987654321.to_s => "39402006214742468146607573302782204160899606930316492574854637797589055807860137311331770134300566582203266107441161" The method currently just maps whatever digits were passed to the parser straight into the BigInteger's internal data structure. Pete From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of John Messerly Sent: Tuesday,22 January 22, 2008 02:32 To: ironruby-core at rubyforge.org Subject: [Ironruby-core] SVN Revision 73 I updated SVN to include Peter's numeric and Terence's socket patches. Please let me know if I missed any of your changes. Changes include: * Many improvements to numeric classes (Bignum, Fixnum, Float, Integer, Precision, Numeric) * More functionality in the socket library * Removed bool to int implicit conversion * Parser startup improvements, some tokenizer refactoring * Various DLR improvements (hosting work, AST improvements, and more) * Improved exception formatting (getting closer to MRI) - John -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/ironruby-core/attachments/20080122/4f3a1557/attachment.html From brent.rowland at gmail.com Tue Jan 22 16:00:46 2008 From: brent.rowland at gmail.com (Brent Rowland) Date: Tue, 22 Jan 2008 14:00:46 -0700 Subject: [Ironruby-core] Linq etc. In-Reply-To: References: <918705E903F4714CB713D89AB5F1857D73B2A2E655@NA-EXMSG-C116.redmond.corp.microsoft.com> <918705E903F4714CB713D89AB5F1857D73B2B58E01@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: Rather than monkey patching Enumerable--thereby affecting (and possibly tromping over) every object of every class that includes it--how about extending objects on a case-by-case basis? I've made good use of patterns like the following: foobar = foo.map { |f| bar(f) }.extend(Statistics) avg = foobar.avg(:bam) (where Statistics is a mixin module that implements sum, avg, etc, which make use of the enumerable methods) This way any function--including 3rd-party code--that returns an array or other enumerable type can be extended on-the-fly and new functions can return "pre-enriched" collections when appropriate. numbers = [5, 10, 8, 3, 6, 12].extend(System::Linq) numbers.where { |num| num % 2 == 0 }.order_by { |n| n }.each { |i| write("#{i} ") } Brent On Jan 21, 2008 4:57 PM, Mike Moore wrote: > > > On Jan 21, 2008 4:45 PM, John Messerly wrote: > > > > > Yup, you need to require the assembly. If you were writing Linq in Ruby, > > you'd have something like System.Core.rb: > > > > module Enumerable > > def order_by > > ... > > end > > def where > > ... > > end > > end > > > > ... so requiring System.Core just opens up Enumerable and sticks some > > methods on it. > > At least, that's been my thinking on it. > > > I gotcha. So in your example System.Core.rb was monkey-patching > Enumerable. You weren't actually resolving those method calls to the > extension methods in the System.Linq.Enumerable class. > > > > Maybe we add an extra step like: > > > > require 'System.Core' > > include System::Linq > > > > I'm not sure how Ruby-ish that is, though. > > > > I agree. In C# you add the namespace and those extension methods are only > available in that source file. So you have to add the namespace to each > file you want to use the extension methods. But in Ruby once they are added > to the object they are available everywhere. So I wonder what a Ruby-ish > solution would be. Does anyone on the list have any suggestions how > enabling extension methods could/should look? > > > > - John > > > > _______________________________________________ > > 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/20080122/cf2d8c29/attachment.html From jomes at microsoft.com Tue Jan 22 16:54:53 2008 From: jomes at microsoft.com (John Messerly) Date: Tue, 22 Jan 2008 13:54:53 -0800 Subject: [Ironruby-core] Linq etc. In-Reply-To: References: <918705E903F4714CB713D89AB5F1857D73B2A2E655@NA-EXMSG-C116.redmond.corp.microsoft.com> <918705E903F4714CB713D89AB5F1857D73B2B58E01@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <918705E903F4714CB713D89AB5F1857D73B2B5924D@NA-EXMSG-C116.redmond.corp.microsoft.com> Brent Rowland: > Rather than monkey patching Enumerable--thereby affecting (and > possibly tromping over) every object of every class that includes > it--how about extending objects on a case-by-case basis? Hey, this is Ruby, we like to tromp over everything :) Keep in mind Enumerable would resolve its method after the class it's included in, so it typically wouldn't hide existing methods. > I've made good use of patterns like the following: > > foobar = foo.map { |f| bar(f) }.extend(Statistics) avg = foobar.avg > (:bam) > > (where Statistics is a mixin module that implements sum, avg, etc, > which make use of the enumerable methods) > > This way any function--including 3rd-party code--that returns an array > or other enumerable type can be extended on-the-fly and new functions > can return "pre-enriched" collections when appropriate. > > numbers = [5, 10, 8, 3, 6, 12].extend(System::Linq) numbers.where { > |num| num % 2 == 0 }.order_by { |n| n }.each { |i| write("#{i} ") } Would you really want to do it on a per-object basis though? That's even more finer grained than the C# model. Certainly gives you more control, but I imagine having to do "extend" everywhere could get tedious. (what we really need here is the Ruby feature "selector namespaces" ... :) ) Anyway, we could certainly show the names on a per file basis, e.g. "using System::Linq". That might be best. Of course, there's also the option to ignore this problem entirely, and just support the static call syntax: X = System::Linq::Enumerable.where(numbers) { |num| num % 2 == 0 } System::Linq::Enumerable.order_by(x) { |n| n }.each { |i| write("#{i} ") } That seems pretty bad, however. But maybe it could be hidden behind some SQL-like DSL magic. - John From jflam at microsoft.com Wed Jan 23 09:59:05 2008 From: jflam at microsoft.com (John Lam (DLR)) Date: Wed, 23 Jan 2008 06:59:05 -0800 Subject: [Ironruby-core] Accessing IronRuby method from C# In-Reply-To: <680FA370A36D83439E177BDC02F0E8B501E5BEEF@nw60.napa.fi> References: <680FA370A36D83439E177BDC02F0E8B501E5BEEF@nw60.napa.fi> Message-ID: <372109E149E8084D8E6C7D9CFD82E0632D8FA4059D@NA-EXMSG-C115.redmond.corp.microsoft.com> Today we don't support unbound methods yet (what you are trying to do via the call to the method function). If you want first class functions, Proc.new and lambda work just fine today. I'll let Tomas chime in on AccessMethod2(). Thanks, -John From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Robert Brotherus Sent: Tuesday, January 22, 2008 8:20 AM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] Accessing IronRuby method from C# Greetings to the mighty IronRuby experts from a humble developer! :-) I am testing the latest CVS snapshot (v. 73, downloaded an hour ago) of IronRuby. We are evaluating IronRuby for possible usage in WPF project. First, I want to test a simple case of defining a method in Ruby and calling the method later from C#. Below I copy a test program that tries this in two ways (methods AccessMethod1 and AccessMethod2). Both attempts fail with exceptions that are written as comments in the code. I understand that the DLR and IronRuby are in a flux at the moment but I still suppose there must be some working way to perform such trivial interop task...? Thanks in advance! Robert Brotherus Software architect Napa Ltd --------------------- using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.Scripting; using Microsoft.Scripting.Hosting; using Ruby.Runtime; using Ruby.Builtins; namespace IronRubyTests { class Program { private IScriptEnvironment _scriptRuntime; public IScriptEnvironment ScriptRuntime { get { return this._scriptRuntime; } } public IScriptEngine RubyEngine { get { return ScriptRuntime.GetEngine(typeof(RubyContext)); } } public ObjectOperations Operations { get { return RubyEngine.Operations; } } public RubyExecutionContext ExecutionContext { get { return Ruby.IronRuby.GetExecutionContext(RubyEngine); } } public IAttributesCollection GlobalItems { get { return ExecutionContext.GlobalScope.Dict; } } delegate void TestDelegate(); static void Main(string[] args) { new Program().RunAllTests(); } public Program() { this._scriptRuntime = Ruby.IronRuby.CreateRuntime(); } public void RunAllTests() { List tests = new List { new TestDelegate(SimpleTests), new TestDelegate(AccessMethod1), new TestDelegate(AccessMethod2) }; foreach (TestDelegate test in tests) { Console.WriteLine("================== EXECUTING: {0} ====================", test.Method.Name); try { test(); } catch (Exception ex) { Console.WriteLine(ex); } } } public IScriptScope ExecuteString(string code) { return ScriptRuntime.ExecuteSourceUnit( RubyEngine.CreateScriptSourceFromString(code)); } public void SetGlobalVar(string varName, object value) { ExecutionContext.GlobalVariables[SymbolTable.StringToId(varName)] = value; } public object GetGlobalVar(string varName) { return ExecutionContext.GlobalVariables[SymbolTable.StringToId(varName)]; } public object GetGlobalConst(string name) { return GlobalItems.SymbolAttributes[SymbolTable.StringToId(name)]; } public void SimpleTests() { ExecuteString("puts 'RUBY SAYS HELLO'"); // OK SetGlobalVar("x", 666); // OK ExecuteString("$y=555"); // OK ExecuteString("puts \"ruby: $x = #{$x}\""); // OK } public void AccessMethod1() { // Following fails with System.MissingMethodException: undefined local variable or method 'method' for main:Object ExecuteString(@" def sayHello puts 'Hello from method!' end $m = method(:sayHello) "); // Get the method object: object m = GetGlobalVar("m"); // Here call the method, etc. } public void AccessMethod2() { ExecuteString(@" module MyMethods def sayHello puts 'Hello from method!' end end "); RubyModule myModule = (RubyModule) GetGlobalConst("MyMethods"); // OK object sayHello = Operations.GetMember(myModule, "sayHello"); // Fails at Assertion at ActionBinber.UpdateSiteAndExecute() // Here call the method, etc. } } // class } // namespace -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/ironruby-core/attachments/20080123/84a9cc60/attachment-0001.html From robert.brotherus at napa.fi Thu Jan 24 03:47:14 2008 From: robert.brotherus at napa.fi (Robert Brotherus) Date: Thu, 24 Jan 2008 10:47:14 +0200 Subject: [Ironruby-core] Accessing IronRuby method from C# References: <680FA370A36D83439E177BDC02F0E8B501E5BEEF@nw60.napa.fi> <372109E149E8084D8E6C7D9CFD82E0632D8FA4059D@NA-EXMSG-C115.redmond.corp.microsoft.com> Message-ID: <680FA370A36D83439E177BDC02F0E8B501E5C137@nw60.napa.fi> Thanks John for your reply! Still not getting my method calls to work from C# with lambda either: [TestMethod] public void AccessMethod3() { ExecuteString(@" $m = lambda do |par| puts 'Hello from lambda: ' + par end "); Proc m = (Proc) GetGlobalVar("m"); // OK Operations.Call(m, "abc"); // InvalidCast: Cannot cast Proc to BlockParam Delegate1 d = Operations.ConvertTo(m); // OK d("abc"); // InvalidCast: Cannot cast Proc to BlockParam } Robert Brotherus Software architect Napa Ltd Tammasaarenkatu 3, Helsinki FI-00180 P.O.Box 470, Helsinki FI-00181 Tel. +358 9 22 813 1 Direct. +358 9 22 813 611 GSM +358 45 11 456 02 Fax. +358 9 22 813 800 Email: Robert.Brotherus at napa.fi www.napa.fi _____ From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of John Lam (DLR) Sent: 23. tammikuuta 2008 16:59 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Accessing IronRuby method from C# Today we don't support unbound methods yet (what you are trying to do via the call to the method function). If you want first class functions, Proc.new and lambda work just fine today. I'll let Tomas chime in on AccessMethod2(). Thanks, -John From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Robert Brotherus Sent: Tuesday, January 22, 2008 8:20 AM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] Accessing IronRuby method from C# Greetings to the mighty IronRuby experts from a humble developer! :-) I am testing the latest CVS snapshot (v. 73, downloaded an hour ago) of IronRuby. We are evaluating IronRuby for possible usage in WPF project. First, I want to test a simple case of defining a method in Ruby and calling the method later from C#. Below I copy a test program that tries this in two ways (methods AccessMethod1 and AccessMethod2). Both attempts fail with exceptions that are written as comments in the code. I understand that the DLR and IronRuby are in a flux at the moment but I still suppose there must be some working way to perform such trivial interop task...? Thanks in advance! Robert Brotherus Software architect Napa Ltd --------------------- using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.Scripting; using Microsoft.Scripting.Hosting; using Ruby.Runtime; using Ruby.Builtins; namespace IronRubyTests { class Program { private IScriptEnvironment _scriptRuntime; public IScriptEnvironment ScriptRuntime { get { return this._scriptRuntime; } } public IScriptEngine RubyEngine { get { return ScriptRuntime.GetEngine(typeof(RubyContext)); } } public ObjectOperations Operations { get { return RubyEngine.Operations; } } public RubyExecutionContext ExecutionContext { get { return Ruby.IronRuby.GetExecutionContext(RubyEngine); } } public IAttributesCollection GlobalItems { get { return ExecutionContext.GlobalScope.Dict; } } delegate void TestDelegate(); static void Main(string[] args) { new Program().RunAllTests(); } public Program() { this._scriptRuntime = Ruby.IronRuby.CreateRuntime(); } public void RunAllTests() { List tests = new List { new TestDelegate(SimpleTests), new TestDelegate(AccessMethod1), new TestDelegate(AccessMethod2) }; foreach (TestDelegate test in tests) { Console.WriteLine("================== EXECUTING: {0} ====================", test.Method.Name); try { test(); } catch (Exception ex) { Console.WriteLine(ex); } } } public IScriptScope ExecuteString(string code) { return ScriptRuntime.ExecuteSourceUnit( RubyEngine.CreateScriptSourceFromString(code)); } public void SetGlobalVar(string varName, object value) { ExecutionContext.GlobalVariables[SymbolTable.StringToId(varName)] = value; } public object GetGlobalVar(string varName) { return ExecutionContext.GlobalVariables[SymbolTable.StringToId(varName)]; } public object GetGlobalConst(string name) { return GlobalItems.SymbolAttributes[SymbolTable.StringToId(name)]; } public void SimpleTests() { ExecuteString("puts 'RUBY SAYS HELLO'"); // OK SetGlobalVar("x", 666); // OK ExecuteString("$y=555"); // OK ExecuteString("puts \"ruby: $x = #{$x}\""); // OK } public void AccessMethod1() { // Following fails with System.MissingMethodException: undefined local variable or method 'method' for main:Object ExecuteString(@" def sayHello puts 'Hello from method!' end $m = method(:sayHello) "); // Get the method object: object m = GetGlobalVar("m"); // Here call the method, etc. } public void AccessMethod2() { ExecuteString(@" module MyMethods def sayHello puts 'Hello from method!' end end "); RubyModule myModule = (RubyModule) GetGlobalConst("MyMethods"); // OK object sayHello = Operations.GetMember(myModule, "sayHello"); // Fails at Assertion at ActionBinber.UpdateSiteAndExecute() // Here call the method, etc. } } // class } // namespace -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/ironruby-core/attachments/20080124/da9f1249/attachment-0001.html From bacondarwin at googlemail.com Thu Jan 24 16:44:16 2008 From: bacondarwin at googlemail.com (Peter Bacon Darwin) Date: Thu, 24 Jan 2008 21:44:16 -0000 Subject: [Ironruby-core] Range Patch Message-ID: <002701c85ed2$45d83700$d188a500$@com> I have tidied up and completed the implementation of Range. Once Bignum tokenizing is working correctly and a bug #17448 , regarding Kernel#respond_to?, Is fixed then all the specs will pass. The relevant specs that fail in these cases have been excluded. . Range#step and Range#each have a lot of common functionality so this has been factored out; both have a number of specialized algorithms depending on what kind of objects Range#begin and Range#end are. I have modified the specs for these accordingly and I will see if I can pass them on to the guys in Rubinius. . I have added Protocols.TryCompare because it was needed for Range#===. . There were some problems between creating literal Ranges (i.e. 2...4) and explicitly creating them (i.e. Range.new(2,4,true)). This is now solved, even for derived classes (i.e. class Range2 < Range ... end). The patch is run against r74 at the trunk level. Hope this all works, Pete -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/ironruby-core/attachments/20080124/e1170da5/attachment-0001.html -------------- next part -------------- A non-text attachment was scrubbed... Name: RangePatch.patch Type: application/octet-stream Size: 40266 bytes Desc: not available Url : http://rubyforge.org/pipermail/ironruby-core/attachments/20080124/e1170da5/attachment-0001.obj From Tomas.Matousek at microsoft.com Thu Jan 24 17:11:58 2008 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Thu, 24 Jan 2008 14:11:58 -0800 Subject: [Ironruby-core] Accessing IronRuby method from C# In-Reply-To: <680FA370A36D83439E177BDC02F0E8B501E5C137@nw60.napa.fi> References: <680FA370A36D83439E177BDC02F0E8B501E5BEEF@nw60.napa.fi> <372109E149E8084D8E6C7D9CFD82E0632D8FA4059D@NA-EXMSG-C115.redmond.corp.microsoft.com> <680FA370A36D83439E177BDC02F0E8B501E5C137@nw60.napa.fi> Message-ID: This might be a bug - I've filed it (#17467). Tomas From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Robert Brotherus Sent: Thursday, January 24, 2008 12:47 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Accessing IronRuby method from C# Thanks John for your reply! Still not getting my method calls to work from C# with lambda either: [TestMethod] public void AccessMethod3() { ExecuteString(@" $m = lambda do |par| puts 'Hello from lambda: ' + par end "); Proc m = (Proc) GetGlobalVar("m"); // OK Operations.Call(m, "abc"); // InvalidCast: Cannot cast Proc to BlockParam Delegate1 d = Operations.ConvertTo(m); // OK d("abc"); // InvalidCast: Cannot cast Proc to BlockParam } Robert Brotherus Software architect Napa Ltd Tammasaarenkatu 3, Helsinki FI-00180 P.O.Box 470, Helsinki FI-00181 Tel. +358 9 22 813 1 Direct. +358 9 22 813 611 GSM +358 45 11 456 02 Fax. +358 9 22 813 800 Email: Robert.Brotherus at napa.fi www.napa.fi ________________________________ From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of John Lam (DLR) Sent: 23. tammikuuta 2008 16:59 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Accessing IronRuby method from C# Today we don't support unbound methods yet (what you are trying to do via the call to the method function). If you want first class functions, Proc.new and lambda work just fine today. I'll let Tomas chime in on AccessMethod2(). Thanks, -John From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Robert Brotherus Sent: Tuesday, January 22, 2008 8:20 AM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] Accessing IronRuby method from C# Greetings to the mighty IronRuby experts from a humble developer! :-) I am testing the latest CVS snapshot (v. 73, downloaded an hour ago) of IronRuby. We are evaluating IronRuby for possible usage in WPF project. First, I want to test a simple case of defining a method in Ruby and calling the method later from C#. Below I copy a test program that tries this in two ways (methods AccessMethod1 and AccessMethod2). Both attempts fail with exceptions that are written as comments in the code. I understand that the DLR and IronRuby are in a flux at the moment but I still suppose there must be some working way to perform such trivial interop task...? Thanks in advance! Robert Brotherus Software architect Napa Ltd --------------------- using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.Scripting; using Microsoft.Scripting.Hosting; using Ruby.Runtime; using Ruby.Builtins; namespace IronRubyTests { class Program { private IScriptEnvironment _scriptRuntime; public IScriptEnvironment ScriptRuntime { get { return this._scriptRuntime; } } public IScriptEngine RubyEngine { get { return ScriptRuntime.GetEngine(typeof(RubyContext)); } } public ObjectOperations Operations { get { return RubyEngine.Operations; } } public RubyExecutionContext ExecutionContext { get { return Ruby.IronRuby.GetExecutionContext(RubyEngine); } } public IAttributesCollection GlobalItems { get { return ExecutionContext.GlobalScope.Dict; } } delegate void TestDelegate(); static void Main(string[] args) { new Program().RunAllTests(); } public Program() { this._scriptRuntime = Ruby.IronRuby.CreateRuntime(); } public void RunAllTests() { List tests = new List { new TestDelegate(SimpleTests), new TestDelegate(AccessMethod1), new TestDelegate(AccessMethod2) }; foreach (TestDelegate test in tests) { Console.WriteLine("================== EXECUTING: {0} ====================", test.Method.Name); try { test(); } catch (Exception ex) { Console.WriteLine(ex); } } } public IScriptScope ExecuteString(string code) { return ScriptRuntime.ExecuteSourceUnit( RubyEngine.CreateScriptSourceFromString(code)); } public void SetGlobalVar(string varName, object value) { ExecutionContext.GlobalVariables[SymbolTable.StringToId(varName)] = value; } public object GetGlobalVar(string varName) { return ExecutionContext.GlobalVariables[SymbolTable.StringToId(varName)]; } public object GetGlobalConst(string name) { return GlobalItems.SymbolAttributes[SymbolTable.StringToId(name)]; } public void SimpleTests() { ExecuteString("puts 'RUBY SAYS HELLO'"); // OK SetGlobalVar("x", 666); // OK ExecuteString("$y=555"); // OK ExecuteString("puts \"ruby: $x = #{$x}\""); // OK } public void AccessMethod1() { // Following fails with System.MissingMethodException: undefined local variable or method 'method' for main:Object ExecuteString(@" def sayHello puts 'Hello from method!' end $m = method(:sayHello) "); // Get the method object: object m = GetGlobalVar("m"); // Here call the method, etc. } public void AccessMethod2() { ExecuteString(@" module MyMethods def sayHello puts 'Hello from method!' end end "); RubyModule myModule = (RubyModule) GetGlobalConst("MyMethods"); // OK object sayHello = Operations.GetMember(myModule, "sayHello"); // Fails at Assertion at ActionBinber.UpdateSiteAndExecute() // Here call the method, etc. } } // class } // namespace -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/ironruby-core/attachments/20080124/9e905555/attachment-0001.html From bacondarwin at googlemail.com Fri Jan 25 09:53:12 2008 From: bacondarwin at googlemail.com (Peter Bacon Darwin) Date: Fri, 25 Jan 2008 14:53:12 -0000 Subject: [Ironruby-core] Range patch Message-ID: <002001c85f62$03411610$09c34230$@com> Sorry, I introduced a small bug since I didn't check all the other specs were still working (tut tut). The String#upto spec picked up a quirk of MRI that I broke in rbx: # This is weird but MRI behaves like that it "upto calls block with self even if self is less than stop but stop length is less than self length" do a = [] "25".upto("5") { |s| a << s } a.should == ["25"] end it "upto doesn't call block if stop is less than self and stop length is less than self length" do a = [] "25".upto("1") { |s| a << s } a.should == [] end This behaviour is also true for Range#each and Range#step too. The fix is as follows. If it is a problem I can resubmit the whole patch with this fix incorporated. Inside the RangeOps.cs file, get rid of the CompareString method and change StepString to: private static Range StepString(CodeContext/*!*/ context, Range/*!*/ self, BlockParam block, MutableString begin, MutableString end, int step) { CheckStep(step); MutableString item = begin; int comp; while((comp = Protocols.Compare(context, item, end)) < 0) { if (block.BlockJumped(_BlockSite.Invoke(context, block, item))) { return self; } for (int i = 0; i < step; ++i) { item = (MutableString)RubySites.Successor(context, item); } if (item.Length > end.Length) { return self; } } if (comp == 0 && !self.ExcludeEnd) { _BlockSite.Invoke(context, block, item); } return self; } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/ironruby-core/attachments/20080125/48ff02f9/attachment.html From jflam at microsoft.com Fri Jan 25 10:16:45 2008 From: jflam at microsoft.com (John Lam (DLR)) Date: Fri, 25 Jan 2008 07:16:45 -0800 Subject: [Ironruby-core] Range patch In-Reply-To: <002001c85f62$03411610$09c34230$@com> References: <002001c85f62$03411610$09c34230$@com> Message-ID: <372109E149E8084D8E6C7D9CFD82E0632D8FA41205@NA-EXMSG-C115.redmond.corp.microsoft.com> Thanks for the catch. Will review and submit ASAP. Thanks! -John From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Peter Bacon Darwin Sent: Friday, January 25, 2008 6:53 AM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] Range patch Sorry, I introduced a small bug since I didn't check all the other specs were still working (tut tut). The String#upto spec picked up a quirk of MRI that I broke in rbx: # This is weird but MRI behaves like that it "upto calls block with self even if self is less than stop but stop length is less than self length" do a = [] "25".upto("5") { |s| a << s } a.should == ["25"] end it "upto doesn't call block if stop is less than self and stop length is less than self length" do a = [] "25".upto("1") { |s| a << s } a.should == [] end This behaviour is also true for Range#each and Range#step too. The fix is as follows. If it is a problem I can resubmit the whole patch with this fix incorporated. Inside the RangeOps.cs file, get rid of the CompareString method and change StepString to: private static Range StepString(CodeContext/*!*/ context, Range/*!*/ self, BlockParam block, MutableString begin, MutableString end, int step) { CheckStep(step); MutableString item = begin; int comp; while((comp = Protocols.Compare(context, item, end)) < 0) { if (block.BlockJumped(_BlockSite.Invoke(context, block, item))) { return self; } for (int i = 0; i < step; ++i) { item = (MutableString)RubySites.Successor(context, item); } if (item.Length > end.Length) { return self; } } if (comp == 0 && !self.ExcludeEnd) { _BlockSite.Invoke(context, block, item); } return self; } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/ironruby-core/attachments/20080125/e4663cb1/attachment-0001.html From angrygreg at gmail.com Sun Jan 27 11:02:26 2008 From: angrygreg at gmail.com (Greg Akins) Date: Sun, 27 Jan 2008 11:02:26 -0500 Subject: [Ironruby-core] Just starting with IronRuby; problem with rbx Message-ID: <8526685f0801270802v22a5dc47q2524123bbc0a6b5a@mail.gmail.com> First I appologize for posting with problems so quickly after joining the list. This might have been discussed, but I didn't see anything after a quick scan of the archives. Last night, I retrieved current source from SVN. I built the project and ran 'rbx'. The session output is listed below. Does anyone else have any idea what might have gone wrong here? Anyone else experiencing similar problems? Here is the transcript of the session C:\Projects\IronRuby\Bin\Debug>rbx 0.1 Copyright (c) Microsoft Corporation. All rights reserved. >>> a = [1,2,3] => [1, 2, 3] >>> b = a :0:in `main': undefined local variable or method `a' for main:Object (NoMethodEr ror) from :0:in `##6' >>> -- Greg Akins Software Development Manager SSI Services http://kc.vanadium.com http://www.pghcodingdojo.org http://www.insomnia-consulting.org/monologue From jflam at microsoft.com Sun Jan 27 11:13:08 2008 From: jflam at microsoft.com (John Lam (DLR)) Date: Sun, 27 Jan 2008 08:13:08 -0800 Subject: [Ironruby-core] Just starting with IronRuby; problem with rbx Message-ID: <372109E149E8084D8E6C7D9CFD82E0632D8FCB5A3B@NA-EXMSG-C115.redmond.corp.microsoft.com> We don't have local variables working in the console. Use instance or globals instead when running interactive mode. - John Sent from my phone -----Original Message----- From: Greg Akins Sent: Sunday, January 27, 2008 8:04 AM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] Just starting with IronRuby; problem with rbx First I appologize for posting with problems so quickly after joining the list. This might have been discussed, but I didn't see anything after a quick scan of the archives. Last night, I retrieved current source from SVN. I built the project and ran 'rbx'. The session output is listed below. Does anyone else have any idea what might have gone wrong here? Anyone else experiencing similar problems? Here is the transcript of the session C:\Projects\IronRuby\Bin\Debug>rbx 0.1 Copyright (c) Microsoft Corporation. All rights reserved. >>> a = [1,2,3] => [1, 2, 3] >>> b = a :0:in `main': undefined local variable or method `a' for main:Object (NoMethodEr ror) from :0:in `##6' >>> -- Greg Akins Software Development Manager SSI Services http://kc.vanadium.com http://www.pghcodingdojo.org http://www.insomnia-consulting.org/monologue _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core From bacondarwin at googlemail.com Sun Jan 27 12:22:17 2008 From: bacondarwin at googlemail.com (Peter Bacon Darwin) Date: Sun, 27 Jan 2008 17:22:17 -0000 Subject: [Ironruby-core] Just starting with IronRuby; problem with rbx In-Reply-To: <372109E149E8084D8E6C7D9CFD82E0632D8FCB5A3B@NA-EXMSG-C115.redmond.corp.microsoft.com> References: <372109E149E8084D8E6C7D9CFD82E0632D8FCB5A3B@NA-EXMSG-C115.redmond.corp.microsoft.com> Message-ID: <000001c86109$2b795130$826bf390$@com> Perhaps you should add a little message on the console when you run up rbx.exe till this is fixed? E.G. C:\Projects\IronRuby\Bin\Debug>rbx 0.1 Copyright (c) Microsoft Corporation. All rights reserved. ============================================================= = Local variables not yet working - use instance or globals = ============================================================= >>> From jflam at microsoft.com Sun Jan 27 13:02:41 2008 From: jflam at microsoft.com (John Lam (DLR)) Date: Sun, 27 Jan 2008 10:02:41 -0800 Subject: [Ironruby-core] Just starting with IronRuby; problem with rbx In-Reply-To: <000001c86109$2b795130$826bf390$@com> References: <372109E149E8084D8E6C7D9CFD82E0632D8FCB5A3B@NA-EXMSG-C115.redmond.corp.microsoft.com> <000001c86109$2b795130$826bf390$@com> Message-ID: <372109E149E8084D8E6C7D9CFD82E0632D8FD62F10@NA-EXMSG-C115.redmond.corp.microsoft.com> Peter Bacon Darwin: > 0.1 > Copyright (c) Microsoft Corporation. All rights reserved. > ============================================================= > = Local variables not yet working - use instance or globals = > ============================================================= > >>> Doh. Great idea! I'll add it the next time around. -John From angrygreg at gmail.com Sun Jan 27 13:46:15 2008 From: angrygreg at gmail.com (Greg Akins) Date: Sun, 27 Jan 2008 13:46:15 -0500 Subject: [Ironruby-core] Just starting with IronRuby; problem with rbx In-Reply-To: <000001c86109$2b795130$826bf390$@com> References: <372109E149E8084D8E6C7D9CFD82E0632D8FCB5A3B@NA-EXMSG-C115.redmond.corp.microsoft.com> <000001c86109$2b795130$826bf390$@com> Message-ID: <8526685f0801271046u5bfc3790o5f1c73b499659e63@mail.gmail.com> On Jan 27, 2008 12:22 PM, Peter Bacon Darwin wrote: > Perhaps you should add a little message on the console when you run up > rbx.exe till this is fixed? > E.G. > > C:\Projects\IronRuby\Bin\Debug>rbx > 0.1 > Copyright (c) Microsoft Corporation. All rights reserved. > ============================================================= > = Local variables not yet working - use instance or globals = > ============================================================= > > >>> This appeared to be working in the "Get/Build" screencast. Did it disappear -- Greg Akins Software Development Manager SSI Services http://kc.vanadium.com http://www.pghcodingdojo.org http://www.insomnia-consulting.org/monologue From jflam at microsoft.com Sun Jan 27 14:00:05 2008 From: jflam at microsoft.com (John Lam (DLR)) Date: Sun, 27 Jan 2008 11:00:05 -0800 Subject: [Ironruby-core] Just starting with IronRuby; problem with rbx In-Reply-To: <8526685f0801271046u5bfc3790o5f1c73b499659e63@mail.gmail.com> References: <372109E149E8084D8E6C7D9CFD82E0632D8FCB5A3B@NA-EXMSG-C115.redmond.corp.microsoft.com> <000001c86109$2b795130$826bf390$@com> <8526685f0801271046u5bfc3790o5f1c73b499659e63@mail.gmail.com> Message-ID: <372109E149E8084D8E6C7D9CFD82E0632D8FD62F16@NA-EXMSG-C115.redmond.corp.microsoft.com> Greg Akins: > This appeared to be working in the "Get/Build" screencast. Did it > disappear Yep. It was a hack that was removed at around the time of RubyConf. It has to do with how we compile the line of code and what context that code gets compiled into. You need to save your local context across compilations for your locals to show up the next time around. This problem doesn't exist when we compile files as opposed to lines. At some point we'll be able to just run irb instead of our own console. To run irb, we'll need the same set of features that we require for our own console. Shouldn't be much longer before that's working. -John From angrygreg at gmail.com Sun Jan 27 18:16:57 2008 From: angrygreg at gmail.com (Greg Akins) Date: Sun, 27 Jan 2008 18:16:57 -0500 Subject: [Ironruby-core] Busy Day with IronRuby Message-ID: <8526685f0801271516vd3eac5em3d44d608de42af79@mail.gmail.com> OK, so I couldn't get some of the simple examples of using RubyEngine to start calling Ruby from C#... So I spent a bit reading through the mailing list archives (realizing while doing that, that I'd asked a frequently asked question). Now, I hope I'm not asking another stupid question. I found another post ( http://rubyforge.org/pipermail/ironruby-core/2008-January/000616.html ) that suggests a method of running Ruby. However, I get an error on this line IScriptEngine engine = IronRuby.GetEngine(runtime); Which shows this stack trace at System.RuntimeMethodHandle._InvokeConstructor(Object[] args, SignatureStruct& signature, IntPtr declaringType) at System.RuntimeMethodHandle.InvokeConstructor(Object[] args, SignatureStruct signature, RuntimeTypeHandle declaringType) at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) at System.Activator.CreateInstance(Type type, Object[] args) at Microsoft.Scripting.Utils.ReflectionUtils.CreateInstance[T](Type actualType, Object[] args) in c:\Libraries\IronRuby\trunk\src\microsoft.scripting\Utils\ReflectionUtils.cs:line 127 -- Greg Akins Software Development Manager SSI Services http://kc.vanadium.com http://www.pghcodingdojo.org http://www.insomnia-consulting.org/monologue From ivan at flanders.co.nz Sun Jan 27 18:23:04 2008 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Mon, 28 Jan 2008 12:23:04 +1300 Subject: [Ironruby-core] Busy Day with IronRuby In-Reply-To: <8526685f0801271516vd3eac5em3d44d608de42af79@mail.gmail.com> References: <8526685f0801271516vd3eac5em3d44d608de42af79@mail.gmail.com> Message-ID: Hi Greg, This is what i used at some point, that should still work atm. class Program { static void Main(string[] args) { //TODO: review this when the hosting api changes. IScriptEnvironment runtime = ScriptEnvironment.GetEnvironment(); Console.WriteLine("Executing from file:"); runtime.ExecuteFile("..\\..\\hello_world.rb"); IScriptEngine engine = IronRuby.GetEngine(runtime); IScriptScope scope = engine.CreateScope(); List strings = new List(); strings.Add("Hello, "); strings.Add("World!!!"); IronRuby.GetExecutionContext(runtime).GlobalVariables[ SymbolTable.StringToId("strings")] = strings; SourceUnit script = engine.CreateScriptSourceFromString( @" puts ""Hello World! There are #{$strings.count.to_s} strings:"" $strings.each_with_index { |s,i| puts ""#{i}: #{s}"" } "); Console.WriteLine("Executing from string:"); engine.Execute(scope, script); } } On Jan 28, 2008 12:16 PM, Greg Akins wrote: > OK, so I couldn't get some of the simple examples of using RubyEngine > to start calling Ruby from C#... > > So I spent a bit reading through the mailing list archives (realizing > while doing that, that I'd asked a frequently asked question). > > Now, I hope I'm not asking another stupid question. > > I found another post ( > http://rubyforge.org/pipermail/ironruby-core/2008-January/000616.html > ) that suggests a method of running Ruby. > > However, I get an error on this line > > IScriptEngine engine = IronRuby.GetEngine(runtime); > > Which shows this stack trace > > at System.RuntimeMethodHandle._InvokeConstructor(Object[] args, > SignatureStruct& signature, IntPtr declaringType) > at System.RuntimeMethodHandle.InvokeConstructor(Object[] args, > SignatureStruct signature, RuntimeTypeHandle declaringType) > at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags > invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) > at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, > Binder binder, Object[] args, CultureInfo culture, Object[] > activationAttributes) > at System.Activator.CreateInstance(Type type, BindingFlags > bindingAttr, Binder binder, Object[] args, CultureInfo culture, > Object[] activationAttributes) > at System.Activator.CreateInstance(Type type, Object[] args) > at Microsoft.Scripting.Utils.ReflectionUtils.CreateInstance[T](Type > actualType, Object[] args) in > > c:\Libraries\IronRuby\trunk\src\microsoft.scripting\Utils\ReflectionUtils.cs:line > 127 > > -- > Greg Akins > Software Development Manager > SSI Services > > http://kc.vanadium.com > http://www.pghcodingdojo.org > http://www.insomnia-consulting.org/monologue > _______________________________________________ > 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/20080128/ca6268e5/attachment.html From ivan at flanders.co.nz Sun Jan 27 18:26:29 2008 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Mon, 28 Jan 2008 12:26:29 +1300 Subject: [Ironruby-core] Busy Day with IronRuby In-Reply-To: References: <8526685f0801271516vd3eac5em3d44d608de42af79@mail.gmail.com> Message-ID: hello_world.rb only contains: puts "Hello, World!!!" hth Ivan On Jan 28, 2008 12:23 PM, Ivan Porto Carrero wrote: > Hi Greg, > > This is what i used at some point, that should still work atm. > > class Program > { > static void Main(string[] args) > { > //TODO: review this when the hosting api changes. > IScriptEnvironment runtime = ScriptEnvironment.GetEnvironment > (); > > Console.WriteLine("Executing from file:"); > runtime.ExecuteFile("..\\..\\hello_world.rb"); > > IScriptEngine engine = IronRuby.GetEngine(runtime); > IScriptScope scope = engine.CreateScope(); > > List strings = new List(); > strings.Add("Hello, "); > strings.Add("World!!!"); > IronRuby.GetExecutionContext(runtime).GlobalVariables[ > SymbolTable.StringToId("strings")] = strings; > > SourceUnit script = engine.CreateScriptSourceFromString( > @" > puts ""Hello World! There are #{$strings.count.to_s} strings:"" > $strings.each_with_index { |s,i| puts ""#{i}: #{s}"" } > "); > > Console.WriteLine("Executing from string:"); > engine.Execute(scope, script); > > } > } > > > > On Jan 28, 2008 12:16 PM, Greg Akins wrote: > > > OK, so I couldn't get some of the simple examples of using RubyEngine > > to start calling Ruby from C#... > > > > So I spent a bit reading through the mailing list archives (realizing > > while doing that, that I'd asked a frequently asked question). > > > > Now, I hope I'm not asking another stupid question. > > > > I found another post ( > > http://rubyforge.org/pipermail/ironruby-core/2008-January/000616.html > > ) that suggests a method of running Ruby. > > > > However, I get an error on this line > > > > IScriptEngine engine = IronRuby.GetEngine(runtime); > > > > Which shows this stack trace > > > > at System.RuntimeMethodHandle._InvokeConstructor(Object[] args, > > SignatureStruct& signature, IntPtr declaringType) > > at System.RuntimeMethodHandle.InvokeConstructor(Object[] args, > > SignatureStruct signature, RuntimeTypeHandle declaringType) > > at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags > > invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) > > at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, > > Binder binder, Object[] args, CultureInfo culture, Object[] > > activationAttributes) > > at System.Activator.CreateInstance(Type type, BindingFlags > > bindingAttr, Binder binder, Object[] args, CultureInfo culture, > > Object[] activationAttributes) > > at System.Activator.CreateInstance(Type type, Object[] args) > > at Microsoft.Scripting.Utils.ReflectionUtils.CreateInstance[T](Type > > actualType, Object[] args) in > > > > c:\Libraries\IronRuby\trunk\src\microsoft.scripting\Utils\ReflectionUtils.cs:line > > 127 > > > > -- > > Greg Akins > > Software Development Manager > > SSI Services > > > > http://kc.vanadium.com > > http://www.pghcodingdojo.org > > http://www.insomnia-consulting.org/monologue > > _______________________________________________ > > 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/20080128/70f7e867/attachment-0001.html From michael.letterle at gmail.com Sun Jan 27 18:34:12 2008 From: michael.letterle at gmail.com (Michael Letterle) Date: Sun, 27 Jan 2008 18:34:12 -0500 Subject: [Ironruby-core] Busy Day with IronRuby In-Reply-To: <8526685f0801271516vd3eac5em3d44d608de42af79@mail.gmail.com> References: <8526685f0801271516vd3eac5em3d44d608de42af79@mail.gmail.com> Message-ID: I'm actually getting ready to work on an IronRuby quick start blog post, based on my experiences, but this is the simplest "hello world" using the hosting mechanism I could come up with: using System; using Ruby.Runtime; using Microsoft.Scripting.Hosting; namespace RubyExample { static class Program { /// /// The main entry point for the application. /// [STAThread] static void Main() { IScriptEnvironment scriptenvironment = ScriptEnvironment.GetEnvironment(); IScriptEngine rubyengine = scriptenvironment.GetEngine("ruby"); scriptenvironment.ExecuteSourceUnit(rubyengine.CreateScriptSourceFromString("puts 'Hello World!\nPress Any Key To Continue..'") ); Console.ReadKey(); } } } be sure to add references to Microsof.Scripting.dll and IronRuby.dll (and IronRuby.Libraries.dll if you're so inclined). You can also use scriptenvironment.ExecuteFile(pathtofile) if you have your ruby script inn a standalone file. On Jan 27, 2008 6:16 PM, Greg Akins wrote: > OK, so I couldn't get some of the simple examples of using RubyEngine > to start calling Ruby from C#... > > So I spent a bit reading through the mailing list archives (realizing > while doing that, that I'd asked a frequently asked question). > > Now, I hope I'm not asking another stupid question. > > I found another post ( > http://rubyforge.org/pipermail/ironruby-core/2008-January/000616.html > ) that suggests a method of running Ruby. > > However, I get an error on this line > > IScriptEngine engine = IronRuby.GetEngine(runtime); > > Which shows this stack trace > > at System.RuntimeMethodHandle._InvokeConstructor(Object[] args, > SignatureStruct& signature, IntPtr declaringType) > at System.RuntimeMethodHandle.InvokeConstructor(Object[] args, > SignatureStruct signature, RuntimeTypeHandle declaringType) > at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags > invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) > at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, > Binder binder, Object[] args, CultureInfo culture, Object[] > activationAttributes) > at System.Activator.CreateInstance(Type type, BindingFlags > bindingAttr, Binder binder, Object[] args, CultureInfo culture, > Object[] activationAttributes) > at System.Activator.CreateInstance(Type type, Object[] args) > at Microsoft.Scripting.Utils.ReflectionUtils.CreateInstance[T](Type > actualType, Object[] args) in > c:\Libraries\IronRuby\trunk\src\microsoft.scripting\Utils\ReflectionUtils.cs:line > 127 > > -- > Greg Akins > Software Development Manager > SSI Services > > http://kc.vanadium.com > http://www.pghcodingdojo.org > http://www.insomnia-consulting.org/monologue > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > -- Michael Letterle [Polymath Programmer] http://michaeldotnet.blogspot.com From ivan at flanders.co.nz Sun Jan 27 18:38:20 2008 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Mon, 28 Jan 2008 12:38:20 +1300 Subject: [Ironruby-core] Busy Day with IronRuby In-Reply-To: References: <8526685f0801271516vd3eac5em3d44d608de42af79@mail.gmail.com> Message-ID: Hi Michael I think we can work together for that, seen as I will have a bunch of samples I'm writing for the book I haven't gotten round to putting a website/blog up because most of the CMS/blog systems out there don't do exactly what I want (which is not much). I want it to be ruby of course. Email me off list if you like the idea? Cheers Ivan On Jan 28, 2008 12:34 PM, Michael Letterle wrote: > I'm actually getting ready to work on an IronRuby quick start blog > post, based on my experiences, but this is the simplest "hello world" > using the hosting mechanism I could come up with: > > using System; > using Ruby.Runtime; > using Microsoft.Scripting.Hosting; > namespace RubyExample > { > static class Program > { > /// > /// The main entry point for the application. > /// > [STAThread] > static void Main() > { > IScriptEnvironment scriptenvironment = > ScriptEnvironment.GetEnvironment(); > IScriptEngine rubyengine = scriptenvironment.GetEngine("ruby"); > scriptenvironment.ExecuteSourceUnit( > rubyengine.CreateScriptSourceFromString("puts > 'Hello World!\nPress Any Key To Continue..'") ); > Console.ReadKey(); > > } > } > } > > be sure to add references to Microsof.Scripting.dll and IronRuby.dll > (and IronRuby.Libraries.dll if you're so inclined). > > You can also use scriptenvironment.ExecuteFile(pathtofile) if you have > your ruby script inn a standalone file. > > On Jan 27, 2008 6:16 PM, Greg Akins wrote: > > OK, so I couldn't get some of the simple examples of using RubyEngine > > to start calling Ruby from C#... > > > > So I spent a bit reading through the mailing list archives (realizing > > while doing that, that I'd asked a frequently asked question). > > > > Now, I hope I'm not asking another stupid question. > > > > I found another post ( > > http://rubyforge.org/pipermail/ironruby-core/2008-January/000616.html > > ) that suggests a method of running Ruby. > > > > However, I get an error on this line > > > > IScriptEngine engine = IronRuby.GetEngine(runtime); > > > > Which shows this stack trace > > > > at System.RuntimeMethodHandle._InvokeConstructor(Object[] args, > > SignatureStruct& signature, IntPtr declaringType) > > at System.RuntimeMethodHandle.InvokeConstructor(Object[] args, > > SignatureStruct signature, RuntimeTypeHandle declaringType) > > at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags > > invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) > > at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, > > Binder binder, Object[] args, CultureInfo culture, Object[] > > activationAttributes) > > at System.Activator.CreateInstance(Type type, BindingFlags > > bindingAttr, Binder binder, Object[] args, CultureInfo culture, > > Object[] activationAttributes) > > at System.Activator.CreateInstance(Type type, Object[] args) > > at Microsoft.Scripting.Utils.ReflectionUtils.CreateInstance[T](Type > > actualType, Object[] args) in > > > c:\Libraries\IronRuby\trunk\src\microsoft.scripting\Utils\ReflectionUtils.cs:line > > 127 > > > > -- > > Greg Akins > > Software Development Manager > > SSI Services > > > > http://kc.vanadium.com > > http://www.pghcodingdojo.org > > http://www.insomnia-consulting.org/monologue > > _______________________________________________ > > Ironruby-core mailing list > > Ironruby-core at rubyforge.org > > http://rubyforge.org/mailman/listinfo/ironruby-core > > > > > > -- > Michael Letterle > [Polymath Programmer] > http://michaeldotnet.blogspot.com > _______________________________________________ > 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/20080128/3e7b8fdc/attachment.html From angrygreg at gmail.com Sun Jan 27 18:41:35 2008 From: angrygreg at gmail.com (Greg Akins) Date: Sun, 27 Jan 2008 18:41:35 -0500 Subject: [Ironruby-core] Busy Day with IronRuby In-Reply-To: References: <8526685f0801271516vd3eac5em3d44d608de42af79@mail.gmail.com> Message-ID: <8526685f0801271541k174b4af9s932fdaebb94e78ee@mail.gmail.com> Thanks to both of you. I'll try those approaches. Incidentally, the line which threw my error was in Microsoft.Scripting.Hosting.PlatformAdaptationLayer at line 90 #if !SILVERLIGHT return Assembly.Load(name); <== ERROR OCCURRED ON THIS LINE while "name" == "IronRuby.Libraries" #else return Assembly.Load(LookupFullName(name)); #endif On Jan 27, 2008 6:34 PM, Michael Letterle wrote: > I'm actually getting ready to work on an IronRuby quick start blog > post, based on my experiences, but this is the simplest "hello world" > using the hosting mechanism I could come up with: > > using System; > using Ruby.Runtime; > using Microsoft.Scripting.Hosting; > namespace RubyExample > { > static class Program > { > /// > /// The main entry point for the application. > /// > [STAThread] > static void Main() > { > IScriptEnvironment scriptenvironment = > ScriptEnvironment.GetEnvironment(); > IScriptEngine rubyengine = scriptenvironment.GetEngine("ruby"); > scriptenvironment.ExecuteSourceUnit(rubyengine.CreateScriptSourceFromString("puts > 'Hello World!\nPress Any Key To Continue..'") ); > Console.ReadKey(); > > } > } > } > > be sure to add references to Microsof.Scripting.dll and IronRuby.dll > (and IronRuby.Libraries.dll if you're so inclined). > > You can also use scriptenvironment.ExecuteFile(pathtofile) if you have > your ruby script inn a standalone file. > > > On Jan 27, 2008 6:16 PM, Greg Akins wrote: > > OK, so I couldn't get some of the simple examples of using RubyEngine > > to start calling Ruby from C#... > > > > So I spent a bit reading through the mailing list archives (realizing > > while doing that, that I'd asked a frequently asked question). > > > > Now, I hope I'm not asking another stupid question. > > > > I found another post ( > > http://rubyforge.org/pipermail/ironruby-core/2008-January/000616.html > > ) that suggests a method of running Ruby. > > > > However, I get an error on this line > > > > IScriptEngine engine = IronRuby.GetEngine(runtime); > > > > Which shows this stack trace > > > > at System.RuntimeMethodHandle._InvokeConstructor(Object[] args, > > SignatureStruct& signature, IntPtr declaringType) > > at System.RuntimeMethodHandle.InvokeConstructor(Object[] args, > > SignatureStruct signature, RuntimeTypeHandle declaringType) > > at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags > > invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) > > at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, > > Binder binder, Object[] args, CultureInfo culture, Object[] > > activationAttributes) > > at System.Activator.CreateInstance(Type type, BindingFlags > > bindingAttr, Binder binder, Object[] args, CultureInfo culture, > > Object[] activationAttributes) > > at System.Activator.CreateInstance(Type type, Object[] args) > > at Microsoft.Scripting.Utils.ReflectionUtils.CreateInstance[T](Type > > actualType, Object[] args) in > > c:\Libraries\IronRuby\trunk\src\microsoft.scripting\Utils\ReflectionUtils.cs:line > > 127 > > > > -- > > Greg Akins > > Software Development Manager > > SSI Services > > > > http://kc.vanadium.com > > http://www.pghcodingdojo.org > > http://www.insomnia-consulting.org/monologue > > > _______________________________________________ > > Ironruby-core mailing list > > Ironruby-core at rubyforge.org > > http://rubyforge.org/mailman/listinfo/ironruby-core > > > > > > -- > Michael Letterle > [Polymath Programmer] > http://michaeldotnet.blogspot.com > -- Greg Akins Software Development Manager SSI Services http://kc.vanadium.com http://www.pghcodingdojo.org http://www.insomnia-consulting.org/monologue From angrygreg at gmail.com Sun Jan 27 18:51:21 2008 From: angrygreg at gmail.com (Greg Akins) Date: Sun, 27 Jan 2008 18:51:21 -0500 Subject: [Ironruby-core] Busy Day with IronRuby In-Reply-To: <8526685f0801271541k174b4af9s932fdaebb94e78ee@mail.gmail.com> References: <8526685f0801271516vd3eac5em3d44d608de42af79@mail.gmail.com> <8526685f0801271541k174b4af9s932fdaebb94e78ee@mail.gmail.com> Message-ID: <8526685f0801271551v18ad81c9j1cdda7cf64dc4964@mail.gmail.com> Success!! I think a traumatic experience a few months ago has caused the part of my brain which deals with Assembly loading to stop working ;-) Obviously, from reading my message (below) there is a problem loading IronRuby.Libraries. When I glanced back over Michael's email, I realized that I HAVE to reference IronRuby.Libraries.dll Michael? Are you NOT referencing those? On Jan 27, 2008 6:41 PM, Greg Akins wrote: > Thanks to both of you. I'll try those approaches. > > Incidentally, the line which threw my error was in > Microsoft.Scripting.Hosting.PlatformAdaptationLayer at line 90 > > #if !SILVERLIGHT > return Assembly.Load(name); <== ERROR OCCURRED ON THIS > LINE while "name" == "IronRuby.Libraries" > #else > return Assembly.Load(LookupFullName(name)); > #endif > > > > > > On Jan 27, 2008 6:34 PM, Michael Letterle wrote: > > I'm actually getting ready to work on an IronRuby quick start blog > > post, based on my experiences, but this is the simplest "hello world" > > using the hosting mechanism I could come up with: > > > > using System; > > using Ruby.Runtime; > > using Microsoft.Scripting.Hosting; > > namespace RubyExample > > { > > static class Program > > { > > /// > > /// The main entry point for the application. > > /// > > [STAThread] > > static void Main() > > { > > IScriptEnvironment scriptenvironment = > > ScriptEnvironment.GetEnvironment(); > > IScriptEngine rubyengine = scriptenvironment.GetEngine("ruby"); > > scriptenvironment.ExecuteSourceUnit(rubyengine.CreateScriptSourceFromString("puts > > 'Hello World!\nPress Any Key To Continue..'") ); > > Console.ReadKey(); > > > > } > > } > > } > > > > be sure to add references to Microsof.Scripting.dll and IronRuby.dll > > (and IronRuby.Libraries.dll if you're so inclined). > > > > You can also use scriptenvironment.ExecuteFile(pathtofile) if you have > > your ruby script inn a standalone file. > > > > > > On Jan 27, 2008 6:16 PM, Greg Akins wrote: > > > OK, so I couldn't get some of the simple examples of using RubyEngine > > > to start calling Ruby from C#... > > > > > > So I spent a bit reading through the mailing list archives (realizing > > > while doing that, that I'd asked a frequently asked question). > > > > > > Now, I hope I'm not asking another stupid question. > > > > > > I found another post ( > > > http://rubyforge.org/pipermail/ironruby-core/2008-January/000616.html > > > ) that suggests a method of running Ruby. > > > > > > However, I get an error on this line > > > > > > IScriptEngine engine = IronRuby.GetEngine(runtime); > > > > > > Which shows this stack trace > > > > > > at System.RuntimeMethodHandle._InvokeConstructor(Object[] args, > > > SignatureStruct& signature, IntPtr declaringType) > > > at System.RuntimeMethodHandle.InvokeConstructor(Object[] args, > > > SignatureStruct signature, RuntimeTypeHandle declaringType) > > > at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags > > > invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) > > > at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, > > > Binder binder, Object[] args, CultureInfo culture, Object[] > > > activationAttributes) > > > at System.Activator.CreateInstance(Type type, BindingFlags > > > bindingAttr, Binder binder, Object[] args, CultureInfo culture, > > > Object[] activationAttributes) > > > at System.Activator.CreateInstance(Type type, Object[] args) > > > at Microsoft.Scripting.Utils.ReflectionUtils.CreateInstance[T](Type > > > actualType, Object[] args) in > > > c:\Libraries\IronRuby\trunk\src\microsoft.scripting\Utils\ReflectionUtils.cs:line > > > 127 > > > > > > -- > > > Greg Akins > > > Software Development Manager > > > SSI Services > > > > > > http://kc.vanadium.com > > > http://www.pghcodingdojo.org > > > http://www.insomnia-consulting.org/monologue > > > > > _______________________________________________ > > > Ironruby-core mailing list > > > Ironruby-core at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/ironruby-core > > > > > > > > > > > -- > > Michael Letterle > > [Polymath Programmer] > > http://michaeldotnet.blogspot.com > > > > > > -- > > Greg Akins > Software Development Manager > SSI Services > > http://kc.vanadium.com > http://www.pghcodingdojo.org > http://www.insomnia-consulting.org/monologue > -- Greg Akins Software Development Manager SSI Services http://kc.vanadium.com http://www.pghcodingdojo.org http://www.insomnia-consulting.org/monologue From angrygreg at gmail.com Sun Jan 27 20:30:06 2008 From: angrygreg at gmail.com (Greg Akins) Date: Sun, 27 Jan 2008 20:30:06 -0500 Subject: [Ironruby-core] Still plugging away at some simple IronRuby stuff Message-ID: <8526685f0801271730q4c6e9e26l38c37731af14502c@mail.gmail.com> OK, I'm making progress.. Though my wife just got home, so this might not last much longer ;-) I am following the example at http://ironruby.rubyforge.org/wiki/wiki.pl?ExecutingIronRubyFromCSharp NOTE: I tried to be helpful and update that page with the examples that were just posted to the list, but now the page includes this the IScriptModule().SetVariable code - which doesn't appear to be valid anymore) This is what I'm using instead and I get a MissingMethod error on widget. I'd try using this method ( scriptenvironment.ExecuteSourceUnit(rubyengine.CreateScriptSourceFromString(script) ); ) but CreateScriptSourceFromString doesn't appear to have a signature for IScriptModule, or IScriptScope. Thoughts? IScriptEnvironment scriptenvironment = ScriptEnvironment.GetEnvironment(); IScriptEngine rubyengine = scriptenvironment.GetEngine("ruby"); string script = "puts 'Ruby and ' + widget.to_s + ' together at last'"; IScriptScope scope = scriptenvironment.CreateScope(); scope.SetVariable("widget", ".Net"); rubyengine.Execute(scope, rubyengine.CreateScriptSourceFromString(script)); Console.ReadKey(); -- Greg Akins Software Development Manager SSI Services http://kc.vanadium.com http://www.pghcodingdojo.org http://www.insomnia-consulting.org/monologue From michael.letterle at gmail.com Mon Jan 28 08:26:51 2008 From: michael.letterle at gmail.com (Michael Letterle) Date: Mon, 28 Jan 2008 08:26:51 -0500 Subject: [Ironruby-core] Still plugging away at some simple IronRuby stuff In-Reply-To: <8526685f0801271730q4c6e9e26l38c37731af14502c@mail.gmail.com> References: <8526685f0801271730q4c6e9e26l38c37731af14502c@mail.gmail.com> Message-ID: IScriptModule is now IScriptScope from what I understand. I couldn't figure out how to create or access local or instance variables, but you can use a global. I got this: using System; using Ruby; using Ruby.Runtime; using Microsoft.Scripting; using Microsoft.Scripting.Hosting; namespace RubyExample { static class Program { /// /// The main entry point for the application. /// [STAThread] static void Main() { IScriptEngine rubyengine = IronRuby.GetEngine(IronRuby.CreateRuntime()); IronRuby.GetExecutionContext(rubyengine.Runtime).GlobalVariables[SymbolTable.StringToId("widget")] = ".NET"; rubyengine.Execute(rubyengine.CreateScope(), rubyengine.CreateScriptSourceFromString("puts 'Ruby and ' + $widget.to_s + ' together at last'")); Console.ReadKey(); } } } On Jan 27, 2008 8:30 PM, Greg Akins wrote: > OK, I'm making progress.. Though my wife just got home, so this might > not last much longer ;-) > > I am following the example at > http://ironruby.rubyforge.org/wiki/wiki.pl?ExecutingIronRubyFromCSharp > > NOTE: I tried to be helpful and update that page with the examples > that were just posted to the list, but now the page includes this the > IScriptModule().SetVariable code - which doesn't appear to be valid > anymore) > > This is what I'm using instead and I get a MissingMethod error on > widget. I'd try using this method ( > scriptenvironment.ExecuteSourceUnit(rubyengine.CreateScriptSourceFromString(script) > ); ) but CreateScriptSourceFromString doesn't appear to have a > signature for IScriptModule, or IScriptScope. > > Thoughts? > > IScriptEnvironment scriptenvironment = > ScriptEnvironment.GetEnvironment(); > IScriptEngine rubyengine = scriptenvironment.GetEngine("ruby"); > > string script = "puts 'Ruby and ' + widget.to_s + ' > together at last'"; > IScriptScope scope = scriptenvironment.CreateScope(); > scope.SetVariable("widget", ".Net"); > rubyengine.Execute(scope, > rubyengine.CreateScriptSourceFromString(script)); > Console.ReadKey(); > > > > -- > Greg Akins > Software Development Manager > SSI Services > > http://kc.vanadium.com > http://www.pghcodingdojo.org > http://www.insomnia-consulting.org/monologue > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > -- Michael Letterle [Polymath Programmer] http://michaeldotnet.blogspot.com From michael.letterle at gmail.com Mon Jan 28 13:10:57 2008 From: michael.letterle at gmail.com (Michael Letterle) Date: Mon, 28 Jan 2008 13:10:57 -0500 Subject: [Ironruby-core] Busy Day with IronRuby In-Reply-To: References: <8526685f0801271516vd3eac5em3d44d608de42af79@mail.gmail.com> Message-ID: In case anyone is interested: http://michaeldotnet.blogspot.com/2008/01/ironruby-quick-start.html As far as I know that's correct as of rev 75. Any mistakes or omissions please let me know. (I'm still not sure about that SIGNED symbol...) On Jan 27, 2008 6:34 PM, Michael Letterle wrote: > I'm actually getting ready to work on an IronRuby quick start blog > post, based on my experiences, but this is the simplest "hello world" > using the hosting mechanism I could come up with: > > using System; > using Ruby.Runtime; > using Microsoft.Scripting.Hosting; > namespace RubyExample > { > static class Program > { > /// > /// The main entry point for the application. > /// > [STAThread] > static void Main() > { > IScriptEnvironment scriptenvironment = > ScriptEnvironment.GetEnvironment(); > IScriptEngine rubyengine = scriptenvironment.GetEngine("ruby"); > scriptenvironment.ExecuteSourceUnit(rubyengine.CreateScriptSourceFromString("puts > 'Hello World!\nPress Any Key To Continue..'") ); > Console.ReadKey(); > > } > } > } > > be sure to add references to Microsof.Scripting.dll and IronRuby.dll > (and IronRuby.Libraries.dll if you're so inclined). > > You can also use scriptenvironment.ExecuteFile(pathtofile) if you have > your ruby script inn a standalone file. > > > On Jan 27, 2008 6:16 PM, Greg Akins wrote: > > OK, so I couldn't get some of the simple examples of using RubyEngine > > to start calling Ruby from C#... > > > > So I spent a bit reading through the mailing list archives (realizing > > while doing that, that I'd asked a frequently asked question). > > > > Now, I hope I'm not asking another stupid question. > > > > I found another post ( > > http://rubyforge.org/pipermail/ironruby-core/2008-January/000616.html > > ) that suggests a method of running Ruby. > > > > However, I get an error on this line > > > > IScriptEngine engine = IronRuby.GetEngine(runtime); > > > > Which shows this stack trace > > > > at System.RuntimeMethodHandle._InvokeConstructor(Object[] args, > > SignatureStruct& signature, IntPtr declaringType) > > at System.RuntimeMethodHandle.InvokeConstructor(Object[] args, > > SignatureStruct signature, RuntimeTypeHandle declaringType) > > at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags > > invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) > > at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, > > Binder binder, Object[] args, CultureInfo culture, Object[] > > activationAttributes) > > at System.Activator.CreateInstance(Type type, BindingFlags > > bindingAttr, Binder binder, Object[] args, CultureInfo culture, > > Object[] activationAttributes) > > at System.Activator.CreateInstance(Type type, Object[] args) > > at Microsoft.Scripting.Utils.ReflectionUtils.CreateInstance[T](Type > > actualType, Object[] args) in > > c:\Libraries\IronRuby\trunk\src\microsoft.scripting\Utils\ReflectionUtils.cs:line > > 127 > > > > -- > > Greg Akins > > Software Development Manager > > SSI Services > > > > http://kc.vanadium.com > > http://www.pghcodingdojo.org > > http://www.insomnia-consulting.org/monologue > > _______________________________________________ > > Ironruby-core mailing list > > Ironruby-core at rubyforge.org > > http://rubyforge.org/mailman/listinfo/ironruby-core > > > > > > -- > Michael Letterle > [Polymath Programmer] > http://michaeldotnet.blogspot.com > -- Michael Letterle [Polymath Programmer] http://michaeldotnet.blogspot.com From lists at ruby-forum.com Wed Jan 30 10:39:26 2008 From: lists at ruby-forum.com (Softmind Technology) Date: Wed, 30 Jan 2008 16:39:26 +0100 Subject: [Ironruby-core] IronRuby (Without MVC ) and ActiveRecord... Is it Possible Message-ID: <5b0c6acc1ee9a93b90e8c1d238280971@ruby-forum.com> Hi, I wa just reading a book called " Beginning Rails " and i found this information in it. Here it is.... --------------------------------------------------------------------------------- The fact is an Active Record subclass,isn?t much different from a regular Ruby class. Active Record models are regular Ruby objects that can be augmented, modified, played with, poked, and turned inside out with sufficient Ruby-fu. Knowing this will be extremely helpful in being able to pull back the curtain and understand the advanced features of Active Record. --------------------------------------------------------------------------------- Ok... This brings a question to my mind. Since IronRuby will offer Rails... So Active Record will be present in IronRuby Right...? Is it possible to use that Active Record ( ORM ) without Rails in IronRuby...? I mean if i am using Asp>net webforms with IronRuby as a language rather than C# or Vb.Net, will I be able to use Active Record. I am not talking about any MVC here. I am talking about plain IronRuby as a language and ActiveRecord as an ORM, rather than LINQ or NHibernate.. Thanks SoftMind -- Posted via http://www.ruby-forum.com/. From michael.letterle at gmail.com Wed Jan 30 10:57:22 2008 From: michael.letterle at gmail.com (Michael Letterle) Date: Wed, 30 Jan 2008 10:57:22 -0500 Subject: [Ironruby-core] IronRuby (Without MVC ) and ActiveRecord... Is it Possible In-Reply-To: <5b0c6acc1ee9a93b90e8c1d238280971@ruby-forum.com> References: <5b0c6acc1ee9a93b90e8c1d238280971@ruby-forum.com> Message-ID: Well, note that you can do this today with the Castle project: http://www.castleproject.org/activerecord/index.html And the fact that ActiveRecord is actually separate from Rails: https://rubyforge.org/projects/activerecord/ Would mean, yes. I should think. On Jan 30, 2008 10:39 AM, Softmind Technology wrote: > Hi, > > I wa just reading a book called " Beginning Rails " and i found this > information in it. > > Here it is.... > --------------------------------------------------------------------------------- > The fact is an Active Record subclass,isn't much different from a > regular Ruby class. Active Record models are regular Ruby objects that > can be augmented, modified, played with, poked, and turned inside out > with sufficient Ruby-fu. > > Knowing this will be extremely helpful in being able to pull back the > curtain and understand the advanced features of Active Record. > > --------------------------------------------------------------------------------- > Ok... This brings a question to my mind. > > Since IronRuby will offer Rails... So Active Record will be present in > IronRuby Right...? > > Is it possible to use that Active Record ( ORM ) without Rails in > IronRuby...? > > I mean if i am using Asp>net webforms with IronRuby as a language rather > than C# or Vb.Net, will I be able to use Active Record. > > I am not talking about any MVC here. I am talking about plain IronRuby > as a language and ActiveRecord as an ORM, rather than LINQ or > NHibernate.. > > Thanks > > SoftMind > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > -- Michael Letterle [Polymath Programmer] http://michaeldotnet.blogspot.com From Jimmy.Schementi at microsoft.com Wed Jan 30 12:40:27 2008 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Wed, 30 Jan 2008 09:40:27 -0800 Subject: [Ironruby-core] IronRuby (Without MVC ) and ActiveRecord... Is it Possible In-Reply-To: <5b0c6acc1ee9a93b90e8c1d238280971@ruby-forum.com> References: <5b0c6acc1ee9a93b90e8c1d238280971@ruby-forum.com> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A32844F34F7EFB@NA-EXMSG-C116.redmond.corp.microsoft.com> > Softmind Technology wrote: > > Since IronRuby will offer Rails... So Active Record will be present in > IronRuby Right...? That's the idea =) We don't run Rails today though, and therefore don't run ActiveRecord today. > Is it possible to use that Active Record ( ORM ) without Rails in > IronRuby...? Yep, you can use ActiveRecord in a standard (non-Rails) Ruby app. Here's the info on how to do that: http://wiki.rubyonrails.org/rails/pages/HowToUseActiveRecordOutsideRails From myles at madpilot.com.au Wed Jan 30 18:23:27 2008 From: myles at madpilot.com.au (Myles Eftos) Date: Thu, 31 Jan 2008 08:23:27 +0900 Subject: [Ironruby-core] IronRuby (Without MVC ) and ActiveRecord... Is it Possible In-Reply-To: References: <5b0c6acc1ee9a93b90e8c1d238280971@ruby-forum.com> Message-ID: <47A106EF.7080407@madpilot.com.au> Michael Letterle wrote: > Well, note that you can do this today with the Castle project: > http://www.castleproject.org/activerecord/index.html > > And the fact that ActiveRecord is actually separate from Rails: > https://rubyforge.org/projects/activerecord/ > > Would mean, yes. I should think. > > If Ironruby can fully implement Matz's ruby, then yes. Where it MAY trip up is the driver support. For example, the most commonly used driver for MySQL is actually C based (there is a pure Ruby one, but it is dead slow). This would mean porting the MySQL driver (which really should be doable). Upshot is if you can port the MySQL driver, you could implement a natvie MSQL driver too... -- ---------------------------------------------- Myles Eftos Mobile: +61-409-293-183 MadPilot Productions - Created to be Different URL: http://www.madpilot.com.au Phone: +618-6424-8234 From curt at hagenlocher.org Wed Jan 30 18:39:58 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Wed, 30 Jan 2008 15:39:58 -0800 Subject: [Ironruby-core] IronRuby (Without MVC ) and ActiveRecord... Is it Possible In-Reply-To: <47A106EF.7080407@madpilot.com.au> References: <5b0c6acc1ee9a93b90e8c1d238280971@ruby-forum.com> <47A106EF.7080407@madpilot.com.au> Message-ID: On Jan 30, 2008 3:23 PM, Myles Eftos wrote: > > If Ironruby can fully implement Matz's ruby, then yes. Where it MAY trip > up is the driver support. For example, the most commonly used driver for > MySQL is actually C based (there is a pure Ruby one, but it is dead > slow). This would mean porting the MySQL driver (which really should be > doable). Upshot is if you can port the MySQL driver, you could implement > a natvie MSQL driver too... Unless the driver semantics are horribly incompatible, wouldn't it make more sense to target a driver at ADO.NET? -- Curt Hagenlocher curt at hagenlocher.org From blowmage at gmail.com Wed Jan 30 19:16:11 2008 From: blowmage at gmail.com (Mike Moore) Date: Wed, 30 Jan 2008 17:16:11 -0700 Subject: [Ironruby-core] IronRuby (Without MVC ) and ActiveRecord... Is it Possible In-Reply-To: References: <5b0c6acc1ee9a93b90e8c1d238280971@ruby-forum.com> <47A106EF.7080407@madpilot.com.au> Message-ID: On Jan 30, 2008 4:39 PM, Curt Hagenlocher wrote: > On Jan 30, 2008 3:23 PM, Myles Eftos wrote: > > > > If Ironruby can fully implement Matz's ruby, then yes. Where it MAY trip > > up is the driver support. For example, the most commonly used driver for > > MySQL is actually C based (there is a pure Ruby one, but it is dead > > slow). This would mean porting the MySQL driver (which really should be > > doable). Upshot is if you can port the MySQL driver, you could implement > > a natvie MSQL driver too... > > Unless the driver semantics are horribly incompatible, wouldn't it > make more sense to target a driver at ADO.NET? > I think someone implemented a DBI driver for MS SQL using ADO.NET through RubyCLR. I suspect it is doable to implement DBI drivers in C# using and ADO.NET. Not sure if this was the one I remember or not: http://ca.utio.us/articles/2006/07/28/rails-rubyclr-sqlclientadapter -- > Curt Hagenlocher > curt at hagenlocher.org > _______________________________________________ > 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/20080130/55bde602/attachment-0001.html From ivan at flanders.co.nz Wed Jan 30 19:31:53 2008 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Thu, 31 Jan 2008 13:31:53 +1300 Subject: [Ironruby-core] IronRuby (Without MVC ) and ActiveRecord... Is it Possible In-Reply-To: References: <5b0c6acc1ee9a93b90e8c1d238280971@ruby-forum.com> <47A106EF.7080407@madpilot.com.au> Message-ID: It wouldn't take too long to create a DBI interface for ADO.NET. I looked at it this weekend and it didn't look that hard at all. didn't know about the rubyclr one thanks for the heads up. On Jan 31, 2008 1:16 PM, Mike Moore wrote: > On Jan 30, 2008 4:39 PM, Curt Hagenlocher wrote: > > > On Jan 30, 2008 3:23 PM, Myles Eftos wrote: > > > > > > If Ironruby can fully implement Matz's ruby, then yes. Where it MAY > > trip > > > up is the driver support. For example, the most commonly used driver > > for > > > MySQL is actually C based (there is a pure Ruby one, but it is dead > > > slow). This would mean porting the MySQL driver (which really should > > be > > > doable). Upshot is if you can port the MySQL driver, you could > > implement > > > a natvie MSQL driver too... > > > > Unless the driver semantics are horribly incompatible, wouldn't it > > make more sense to target a driver at ADO.NET? > > > > I think someone implemented a DBI driver for MS SQL using ADO.NET through > RubyCLR. I suspect it is doable to implement DBI drivers in C# using and > ADO.NET. > > Not sure if this was the one I remember or not: > > http://ca.utio.us/articles/2006/07/28/rails-rubyclr-sqlclientadapter > > -- > > Curt Hagenlocher > > curt at hagenlocher.org > > _______________________________________________ > > 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/20080131/b6506e80/attachment.html From myles at madpilot.com.au Wed Jan 30 20:29:01 2008 From: myles at madpilot.com.au (Myles Eftos) Date: Thu, 31 Jan 2008 10:29:01 +0900 Subject: [Ironruby-core] IronRuby (Without MVC ) and ActiveRecord... Isit Possible In-Reply-To: Message-ID: <20080131012926.0E69518585F2@rubyforge.org> > Unless the driver semantics are horribly incompatible, > wouldn't it make more sense to target a driver at ADO.NET? Yeah good point! ---------------------------------------------- Myles Eftos Mobile: +61-409-293-183 MadPilot Productions URL: http://www.madpilot.com.au Phone: +618-9467-7651 Fax: +618-9467-6289 Try our time tracking system: 88 Miles! http://www.88miles.net From michael.letterle at gmail.com Thu Jan 31 09:22:13 2008 From: michael.letterle at gmail.com (Michael Letterle) Date: Thu, 31 Jan 2008 09:22:13 -0500 Subject: [Ironruby-core] Graceful Console Handling? Message-ID: So I've created a project utilizing the DLR and IronRuby (http://www.codeplex.com/ironlogo) The Console classes seemed pretty tied to having an actual console open, and then there's no real way to shut them down gracefully. Am I just missing something, somewhere? Seems like there should be a RubyCommandLine.Exit method or somesuch... -- Michael Letterle [Polymath Programmer] http://michaeldotnet.blogspot.com From karl at powershell.com Thu Jan 31 14:18:33 2008 From: karl at powershell.com (Karl Prosser) Date: Thu, 31 Jan 2008 11:18:33 -0800 Subject: [Ironruby-core] Graceful Console Handling? In-Reply-To: References: Message-ID: <47A21F09.1020105@powershell.com> I don't know about the ironruby console features. But the dotnet console class only encapsulates a small part of the the surface area of the console related APIs. So to do more (like redirect a console programatically, or use a hidden console) you may need to do p/invoke to windows APIs Having said that, the console subsystem of windows is very aged and a dog to work with. Sincerely, Karl Prosser http:/www.powershell.com Michael Letterle wrote: > So I've created a project utilizing the DLR and IronRuby > (http://www.codeplex.com/ironlogo) The Console classes seemed pretty > tied to having an actual console open, and then there's no real way to > shut them down gracefully. Am I just missing something, somewhere? > Seems like there should be a RubyCommandLine.Exit method or > somesuch... > >