From Orion.Edwards at gallagher.co Tue Jan 3 17:01:58 2012 From: Orion.Edwards at gallagher.co (Orion Edwards) Date: Wed, 4 Jan 2012 11:01:58 +1300 Subject: [Ironruby-core] IronRuby internals - How can I get the full path to the current file? Message-ID: I thought I'd be a good samaritan and implement require_relative in IronRuby, but I'm having real trouble figuring out what the current file's path actually is. The closest I've got is something like this: * Pull apart the the caller/backtrace to get the file name * File.expand_path(file, File.dirname(dir)) * require that file This is equivalent to the existing ruby idiom of "require File.join(File.dirname(__FILE__), 'lib/file1')", but this doesn't work reliably because __FILE__ is already relative, so File.dirname(__FILE__) often just returns "." Without the full path to the current file however, this is as good as we can get. I've looked through various parts of the IronRuby source code... - as far as I can tell the Parser/Syntax tree code (which has access to the file path) doesn't keep the information around - and even if it did, I'm not sure how regular ruby code could access the parser/AST?? If anyone could help at all, even with a small bit of detail, it'd be much appreciated. Thanks, Orion PS: Here's my test program, which works correctly in MRI 1.92, but I cannot get it to work in IronRuby require_relative 'lib/file1' Dir.chdir 'c:/windows/system32' require_relative 'lib/file2' Other things I tried - eval("__FILE__") - is hard-coded to return "(eval)" - I thought about poking around in RubyContext.Loader.LoadedFiles, but the Loader doesn't know about the entry-point file (is this a bug??), which is a big stumbling block -------------- next part -------------- An HTML attachment was scrubbed... URL: From Orion.Edwards at gallagher.co Tue Jan 3 23:07:08 2012 From: Orion.Edwards at gallagher.co (Orion Edwards) Date: Wed, 4 Jan 2012 17:07:08 +1300 Subject: [Ironruby-core] Cannot build IronRuby or IronPython MSI's Message-ID: I did a git pull today of IronLanguages\main, and noticed a giant stack of changes on December 30, 31 and Jan 1 - which look like they're related to Win8 and Mango, amongst other things. I'm trying to build the IronRuby installer - the process also builds the IronPython installer along with it. It ( msbuild /p:Configuration=Release Installer.proj ) now fails with several errors: 1 - IronRubyTools.dll fails to build. It complains about "A reference was created to embedded interop assembly '..........\VSLangProj.dll' - I fixed this by setting Embed Interop Types = false on that reference (what happened to break this??) 2 - The build now fails because it couldn't find silverlight 4 dll's, whereas it used to work (did it used to reference silverlight 3 which ships with VS2010??). - I fixed the error by installing the silverlight 4 SDK 3 - Two proj files have gone missing: c:\Dev\ironlanguages-main\Msi\Installer.proj(23,9): error MSB3202: The project file "Python\Chm\IronPython.Chm.proj" was not found. c:\Dev\ironlanguages-main\Msi\Installer.proj(23,9): error MSB3202: The project file "Python\Msi\IronPython.Msi.wproj" was not found. It seems these have vanished?? I tried to work around this by manually building only Ruby\Msi\IronRuby.Msi.wproj 4 - This now fails with c:\Dev\ironlanguages-main\Msi\Ruby\Msi\Silverlight.wxi(14): error CNDL0150: Undefined preprocessor variable '$(var.OutputPath)'. [c:\Dev\ironlanguages-main\Msi\Ruby\Msi\IronRuby.Msi.wproj] It looks like that Wxi file hasn't changed recently, so presumably something else is ruining the outpath? - I fixed this by editing IronRuby.wxs and removing all mention of silverlight... This is fine for me, as I don't want to go near silverlight, but others may require a better solution :-) 5 - Now there's a bunch of errors all like this: c:\Dev\ironlanguages-main\Msi\Ruby\Msi\IronRuby.wxs(92): error LGHT1055: The InstallExecuteSequence table contains an action 'NetFxScheduleNativeImage' which cannot be merged from the merge module 'c:\Dev\ironlanguages-main\bin\Release\ \IrbRedist.msm'. This action is likely colliding with an action in the database that is being created. The colliding action may have been authored in the database or merged in from another merge module. If this is a standard action, it is likely colliding due to a difference in the condition for the action in the database and merge module. If this is a custom action, it should only be declared in the database or one merge module. [c:\Dev\ironlanguages-main\Msi\Ruby\Ms i\IronRuby.Msi.wproj] This is where I give up.. The giant stack of changes mostly came from Tomas Matousek / JDHardy / couple of other IronPython devs... Would one of those people mind please having a look at this? Thanks, Orion -------------- next part -------------- An HTML attachment was scrubbed... URL: From Tomas.Matousek at microsoft.com Tue Jan 3 22:53:12 2012 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Wed, 4 Jan 2012 03:53:12 +0000 Subject: [Ironruby-core] WP7 limitations In-Reply-To: <9de2ed327de678314ceb697f437ba154@ruby-forum.com> References: <9de2ed327de678314ceb697f437ba154@ruby-forum.com> Message-ID: <9597F4A19BFDB342B6E90963100C33082EECA5F6@CH1PRD0302MB132.namprd03.prod.outlook.com> I changed Silverlight 3 configuration to build against Mango reference assemblies a couple of days ago. I'll rename Silverlight3 configuration to WP75 soon :) Haven't tested if it works (at runtime) but it at least builds :) IronRuby now also builds against Silverlight 5 and MonoAndroid. Nothing is tested though, help with testing on all these platforms is very welcome. Support for Windows 8 might also be available soon - perhaps with the next public preview release of Windows 8. Tomas -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Andrei N. Sent: Tuesday, December 20, 2011 1:11 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] WP7 limitations Hi James! System.Reflection.Emit is available in Mango, partially http://blogs.telerik.com/blogs/posts/11-09-13/mango-and-system-reflection-emit-new-optimizations-in-radcontrols-for-windows-phone.aspx http://msdn.microsoft.com/en-us/library/system.reflection.emit.ilgenerator(VS.96).aspx DynamicMethod, ILGenerator and OpCodes looks like they are fully supported. What do you think? Jurassic for example has made his way on WP7. -- Posted via http://www.ruby-forum.com/. _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core From Tomas.Matousek at microsoft.com Tue Jan 3 23:11:20 2012 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Wed, 4 Jan 2012 04:11:20 +0000 Subject: [Ironruby-core] IronRuby internals - How can I get the full path to the current file? In-Reply-To: References: Message-ID: <9597F4A19BFDB342B6E90963100C33082EECA63D@CH1PRD0302MB132.namprd03.prod.outlook.com> I'd recommend to start with some simpler features than this one. This seems to be quite non-trivial to implement efficiently and correctly. Note that getting the current stack trace is very expensive, so you'd probably want to encode the path into Ruby call-sites (RubyCallAction) or something like that. But also adding more information to all call-sites consumes more memory so maybe we need a special call-site for methods called "require_relative" and fall back to the slow stack trace capture only when the method is called via an alias. Tomas From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Orion Edwards Sent: Tuesday, January 03, 2012 2:02 PM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] IronRuby internals - How can I get the full path to the current file? I thought I'd be a good samaritan and implement require_relative in IronRuby, but I'm having real trouble figuring out what the current file's path actually is. The closest I've got is something like this: * Pull apart the the caller/backtrace to get the file name * File.expand_path(file, File.dirname(dir)) * require that file This is equivalent to the existing ruby idiom of "require File.join(File.dirname(__FILE__), 'lib/file1')", but this doesn't work reliably because __FILE__ is already relative, so File.dirname(__FILE__) often just returns "." Without the full path to the current file however, this is as good as we can get. I've looked through various parts of the IronRuby source code... - as far as I can tell the Parser/Syntax tree code (which has access to the file path) doesn't keep the information around - and even if it did, I'm not sure how regular ruby code could access the parser/AST?? If anyone could help at all, even with a small bit of detail, it'd be much appreciated. Thanks, Orion PS: Here's my test program, which works correctly in MRI 1.92, but I cannot get it to work in IronRuby require_relative 'lib/file1' Dir.chdir 'c:/windows/system32' require_relative 'lib/file2' Other things I tried - eval("__FILE__") - is hard-coded to return "(eval)" - I thought about poking around in RubyContext.Loader.LoadedFiles, but the Loader doesn't know about the entry-point file (is this a bug??), which is a big stumbling block -------------- next part -------------- An HTML attachment was scrubbed... URL: From Tomas.Matousek at microsoft.com Tue Jan 3 23:14:36 2012 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Wed, 4 Jan 2012 04:14:36 +0000 Subject: [Ironruby-core] Cannot build IronRuby or IronPython MSI's In-Reply-To: References: Message-ID: <9597F4A19BFDB342B6E90963100C33082EECA662@CH1PRD0302MB132.namprd03.prod.outlook.com> Yes, the installer is broken. Jeff is working on some better installer building scripts. I'm not sure what the status is atm. Tomas From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Orion Edwards Sent: Tuesday, January 03, 2012 8:07 PM To: ironruby-core at rubyforge.org Cc: ironpython-users at python.org Subject: [Ironruby-core] Cannot build IronRuby or IronPython MSI's I did a git pull today of IronLanguages\main, and noticed a giant stack of changes on December 30, 31 and Jan 1 - which look like they're related to Win8 and Mango, amongst other things. I'm trying to build the IronRuby installer - the process also builds the IronPython installer along with it. It ( msbuild /p:Configuration=Release Installer.proj ) now fails with several errors: 1 - IronRubyTools.dll fails to build. It complains about "A reference was created to embedded interop assembly '..........\VSLangProj.dll' - I fixed this by setting Embed Interop Types = false on that reference (what happened to break this??) 2 - The build now fails because it couldn't find silverlight 4 dll's, whereas it used to work (did it used to reference silverlight 3 which ships with VS2010??). - I fixed the error by installing the silverlight 4 SDK 3 - Two proj files have gone missing: c:\Dev\ironlanguages-main\Msi\Installer.proj(23,9): error MSB3202: The project file "Python\Chm\IronPython.Chm.proj" was not found. c:\Dev\ironlanguages-main\Msi\Installer.proj(23,9): error MSB3202: The project file "Python\Msi\IronPython.Msi.wproj" was not found. It seems these have vanished?? I tried to work around this by manually building only Ruby\Msi\IronRuby.Msi.wproj 4 - This now fails with c:\Dev\ironlanguages-main\Msi\Ruby\Msi\Silverlight.wxi(14): error CNDL0150: Undefined preprocessor variable '$(var.OutputPath)'. [c:\Dev\ironlanguages-main\Msi\Ruby\Msi\IronRuby.Msi.wproj] It looks like that Wxi file hasn't changed recently, so presumably something else is ruining the outpath? - I fixed this by editing IronRuby.wxs and removing all mention of silverlight... This is fine for me, as I don't want to go near silverlight, but others may require a better solution :-) 5 - Now there's a bunch of errors all like this: c:\Dev\ironlanguages-main\Msi\Ruby\Msi\IronRuby.wxs(92): error LGHT1055: The InstallExecuteSequence table contains an action 'NetFxScheduleNativeImage' which cannot be merged from the merge module 'c:\Dev\ironlanguages-main\bin\Release\ \IrbRedist.msm'. This action is likely colliding with an action in the database that is being created. The colliding action may have been authored in the database or merged in from another merge module. If this is a standard action, it is likely colliding due to a difference in the condition for the action in the database and merge module. If this is a custom action, it should only be declared in the database or one merge module. [c:\Dev\ironlanguages-main\Msi\Ruby\Ms i\IronRuby.Msi.wproj] This is where I give up.. The giant stack of changes mostly came from Tomas Matousek / JDHardy / couple of other IronPython devs... Would one of those people mind please having a look at this? Thanks, Orion -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdhardy at gmail.com Wed Jan 4 00:19:12 2012 From: jdhardy at gmail.com (Jeff Hardy) Date: Tue, 3 Jan 2012 21:19:12 -0800 Subject: [Ironruby-core] Cannot build IronRuby or IronPython MSI's In-Reply-To: <9597F4A19BFDB342B6E90963100C33082EECA662@CH1PRD0302MB132.namprd03.prod.outlook.com> References: <9597F4A19BFDB342B6E90963100C33082EECA662@CH1PRD0302MB132.namprd03.prod.outlook.com> Message-ID: The IronPython ones should be working, and nothing I did should change IronRuby's installer builds. However, the old build script may reference IronPython installers that no longer exist. - Jeff On Tue, Jan 3, 2012 at 8:14 PM, Tomas Matousek wrote: > Yes, the installer is broken. Jeff is working on some better installer > building scripts. I?m not sure what the status is atm. > > > > Tomas > > > > From: ironruby-core-bounces at rubyforge.org > [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Orion Edwards > Sent: Tuesday, January 03, 2012 8:07 PM > To: ironruby-core at rubyforge.org > Cc: ironpython-users at python.org > Subject: [Ironruby-core] Cannot build IronRuby or IronPython MSI's > > > > I did a git pull today of IronLanguages\main, and noticed a giant stack of > changes on December 30, 31 and Jan 1 - which look like they're related to > Win8 and Mango, amongst other things. > > I'm trying to build the IronRuby installer - the process also builds the > IronPython installer along with it. > > It ( msbuild /p:Configuration=Release Installer.proj ) now fails with > several errors: > > 1 - IronRubyTools.dll fails to build. It complains about "A reference was > created to embedded interop assembly '..........\VSLangProj.dll' > ?- I fixed this by setting Embed Interop Types = false on that reference > (what happened to break this??) > > 2 - The build now fails because it couldn't find silverlight 4 dll's, > whereas it used to work (did it used to reference silverlight 3 which ships > with VS2010??). > ?- I fixed the error by installing the silverlight 4 SDK > > 3 - ? Two proj files have gone missing: > > c:\Dev\ironlanguages-main\Msi\Installer.proj(23,9): error MSB3202: The > project file "Python\Chm\IronPython.Chm.proj" was not found. > c:\Dev\ironlanguages-main\Msi\Installer.proj(23,9): error MSB3202: The > project file "Python\Msi\IronPython.Msi.wproj" ?was not found. > > It seems these have vanished?? > I tried to work around this by manually building only > Ruby\Msi\IronRuby.Msi.wproj > > 4 - This now fails with > ? c:\Dev\ironlanguages-main\Msi\Ruby\Msi\Silverlight.wxi(14): error > CNDL0150: Undefined preprocessor variable '$(var.OutputPath)'. > [c:\Dev\ironlanguages-main\Msi\Ruby\Msi\IronRuby.Msi.wproj] > > It looks like that Wxi file hasn't changed recently, so presumably something > else is ruining the outpath? > - I fixed this by editing IronRuby.wxs and removing all mention of > silverlight... This is fine for me, as I don't want to go near silverlight, > but others may require a better solution :-) > > 5 - Now there's a bunch of errors all like this: > > ? c:\Dev\ironlanguages-main\Msi\Ruby\Msi\IronRuby.wxs(92): error LGHT1055: > The InstallExecuteSequence table contains an > ?action 'NetFxScheduleNativeImage' which cannot be merged from the merge > module 'c:\Dev\ironlanguages-main\bin\Release\ > \IrbRedist.msm'. ?This action is likely colliding with an action in the > database that is being created. ?The colliding > action may have been authored in the database or merged in from another > merge module. ?If this is a standard action, it > ?is likely colliding due to a difference in the condition for the action in > the database and merge module. ?If this is > a custom action, it should only be declared in the database or one merge > module. [c:\Dev\ironlanguages-main\Msi\Ruby\Ms > i\IronRuby.Msi.wproj] > > This is where I give up.. > > The giant stack of changes mostly came from Tomas Matousek / JDHardy / > couple of other IronPython devs... Would one of those people mind please > having a look at this? > > Thanks, Orion From Orion.Edwards at gallagher.co Wed Jan 4 16:54:05 2012 From: Orion.Edwards at gallagher.co (Orion Edwards) Date: Thu, 5 Jan 2012 10:54:05 +1300 Subject: [Ironruby-core] Array Specs Message-ID: I've been working on bringing IronRuby up to speed with rubyspec, and picked the core\array folder as a start: My pull request is here: https://github.com/IronLanguages/main/pull/52 I'd like to fix them all, but I'm not sure if I'll have the time to do so - Here is a summary of the rubyspec\core\array folder as of right now: ---------------------------------------- ok means the spec was already passing fixed means the spec was failing, and I have fixed it FAILS means the specs fail, and I have not fixed them yet ok allocate_spec.rb ok append_spec.rb ok array_spec.rb ok assoc_spec.rb ok at_spec.rb ok choice_spec.rb ok clear_spec.rb ok clone_spec.rb ok collect_spec.rb ok combination_spec.rb ok compact_spec.rb ok comparison_spec.rb ok concat_spec.rb ok constructor_spec.rb ok count_spec.rb ok cycle_spec.rb ok delete_at_spec.rb ok delete_if_spec.rb ok delete_spec.rb ok drop_spec.rb ok drop_while_spec.rb ok dup_spec.rb ok each_index_spec.rb ok each_spec.rb ok element_reference_spec.rb fixed element_set_spec.rb ok empty_spec.rb ok eql_spec.rb ok equal_value_spec.rb ok fetch_spec.rb fixed fill_spec.rb ok find_index_spec.rb ok first_spec.rb FAILS flatten_spec.rb ok frozen_spec.rb FAILS hash_spec.rb ok include_spec.rb ok indexes_spec.rb ok index_spec.rb ok indices_spec.rb ok initialize_copy_spec.rb ok initialize_spec.rb ok insert_spec.rb FAILS inspect_spec.rb ok intersection_spec.rb FAILS join_spec.rb FAILS keep_if_spec.rb ok last_spec.rb ok length_spec.rb ok map_spec.rb ok minus_spec.rb FAILS multiply_spec.rb ok new_spec.rb ok nitems_spec.rb FAILS in MRI also pack_spec.rb ok partition_spec.rb ok permutation_spec.rb ok plus_spec.rb FAILS pop_spec.rb !! HANGS product_spec.rb ok push_spec.rb ok rassoc_spec.rb ok reject_spec.rb FAILS repeated_combination_spec.rb FAILS repeated_permutation_spec.rb ok replace_spec.rb ok reverse_each_spec.rb ok reverse_spec.rb FAILS rindex_spec.rb FAILS rotate_spec.rb fixed sample_spec.rb fixed select_spec.rb fixed shift_spec.rb fixed shuffle_spec.rb ok size_spec.rb FAILS slice_spec.rb FAILS hard to fix sort_by_spec.rb FAILS hard to fix sort_spec.rb ok take_spec.rb ok take_while_spec.rb ok to_ary_spec.rb ok to_a_spec.rb ok to_s_spec.rb ok transpose_spec.rb ok try_convert_spec.rb ok union_spec.rb fixed uniq_spec.rb ok unshift_spec.rb ok values_at_spec.rb fixed zip_spec.rb -------------- next part -------------- An HTML attachment was scrubbed... URL: From Tomas.Matousek at microsoft.com Wed Jan 4 23:44:00 2012 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Thu, 5 Jan 2012 04:44:00 +0000 Subject: [Ironruby-core] Array Specs In-Reply-To: References: Message-ID: <9597F4A19BFDB342B6E90963100C33082EEDE301@SN2PRD0302MB121.namprd03.prod.outlook.com> Cool! I'll take a look asap. Tomas From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Orion Edwards Sent: Wednesday, January 04, 2012 1:54 PM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] Array Specs I've been working on bringing IronRuby up to speed with rubyspec, and picked the core\array folder as a start: My pull request is here: https://github.com/IronLanguages/main/pull/52 I'd like to fix them all, but I'm not sure if I'll have the time to do so - Here is a summary of the rubyspec\core\array folder as of right now: ---------------------------------------- ok means the spec was already passing fixed means the spec was failing, and I have fixed it FAILS means the specs fail, and I have not fixed them yet ok allocate_spec.rb ok append_spec.rb ok array_spec.rb ok assoc_spec.rb ok at_spec.rb ok choice_spec.rb ok clear_spec.rb ok clone_spec.rb ok collect_spec.rb ok combination_spec.rb ok compact_spec.rb ok comparison_spec.rb ok concat_spec.rb ok constructor_spec.rb ok count_spec.rb ok cycle_spec.rb ok delete_at_spec.rb ok delete_if_spec.rb ok delete_spec.rb ok drop_spec.rb ok drop_while_spec.rb ok dup_spec.rb ok each_index_spec.rb ok each_spec.rb ok element_reference_spec.rb fixed element_set_spec.rb ok empty_spec.rb ok eql_spec.rb ok equal_value_spec.rb ok fetch_spec.rb fixed fill_spec.rb ok find_index_spec.rb ok first_spec.rb FAILS flatten_spec.rb ok frozen_spec.rb FAILS hash_spec.rb ok include_spec.rb ok indexes_spec.rb ok index_spec.rb ok indices_spec.rb ok initialize_copy_spec.rb ok initialize_spec.rb ok insert_spec.rb FAILS inspect_spec.rb ok intersection_spec.rb FAILS join_spec.rb FAILS keep_if_spec.rb ok last_spec.rb ok length_spec.rb ok map_spec.rb ok minus_spec.rb FAILS multiply_spec.rb ok new_spec.rb ok nitems_spec.rb FAILS in MRI also pack_spec.rb ok partition_spec.rb ok permutation_spec.rb ok plus_spec.rb FAILS pop_spec.rb !! HANGS product_spec.rb ok push_spec.rb ok rassoc_spec.rb ok reject_spec.rb FAILS repeated_combination_spec.rb FAILS repeated_permutation_spec.rb ok replace_spec.rb ok reverse_each_spec.rb ok reverse_spec.rb FAILS rindex_spec.rb FAILS rotate_spec.rb fixed sample_spec.rb fixed select_spec.rb fixed shift_spec.rb fixed shuffle_spec.rb ok size_spec.rb FAILS slice_spec.rb FAILS hard to fix sort_by_spec.rb FAILS hard to fix sort_spec.rb ok take_spec.rb ok take_while_spec.rb ok to_ary_spec.rb ok to_a_spec.rb ok to_s_spec.rb ok transpose_spec.rb ok try_convert_spec.rb ok union_spec.rb fixed uniq_spec.rb ok unshift_spec.rb ok values_at_spec.rb fixed zip_spec.rb -------------- next part -------------- An HTML attachment was scrubbed... URL: From Orion.Edwards at gallagher.co Thu Jan 5 16:45:08 2012 From: Orion.Edwards at gallagher.co (Orion Edwards) Date: Fri, 6 Jan 2012 10:45:08 +1300 Subject: [Ironruby-core] Array Specs In-Reply-To: <9597F4A19BFDB342B6E90963100C33082EEDE301@SN2PRD0302MB121.namprd03.prod.outlook.com> References: <9597F4A19BFDB342B6E90963100C33082EEDE301@SN2PRD0302MB121.namprd03.prod.outlook.com> Message-ID: I've pushed some more changes to that branch: fixed pop_spec.rb fixed rindex_spec.rb fixed rotate_spec.rb fixed flatten_spec.rb I also had a look at a couple of others but didn't fix them: hash_spec.rb This requires changing implementation of RubyArray#GetHashCode which I wasn't confident enough to do In ruby, a recursive array equals itself, and therefore the hashcodes should match. IronRuby's implementation of hash doesn't support this. Furthermore, the following code should pass, which seemed quite a bit harder: a = [1] a << a [1,a] == a # both MRI and IR report true for this [1,a].hash == a.hash # Because objects are equal, hash should be too. MRI supports this, IR does not. product_spec.rb This was causing the tests to hang/crash because IR wasn't sanity checking lengths. Rubyspec has a test which tries to create a stupdendously large product array, and so IR would run out of memory. I added range checking so the tests no longer hang/crash, but there is some additional behaviour (you can pass a block to Array#product in 1.9) that I haven't implemented. Here's the output for mspec of the array folder: IR Finished in 18.282046 seconds 112 files, 2393 examples, 4819 expectations, 191 failures, 72 errors MRI 1.9.2 p290 Finished in 2.189125 seconds 112 files, 2393 examples, 4922 expectations, 162 failures, 0 errors Thanks, Orion From: Tomas Matousek To: "ironruby-core at rubyforge.org" Date: 05/01/2012 05:59 p.m. Subject: Re: [Ironruby-core] Array Specs Sent by: ironruby-core-bounces at rubyforge.org Cool! I?ll take a look asap. Tomas From: ironruby-core-bounces at rubyforge.org [ mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Orion Edwards Sent: Wednesday, January 04, 2012 1:54 PM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] Array Specs I've been working on bringing IronRuby up to speed with rubyspec, and picked the core\array folder as a start: My pull request is here: https://github.com/IronLanguages/main/pull/52 I'd like to fix them all, but I'm not sure if I'll have the time to do so - Here is a summary of the rubyspec\core\array folder as of right now: ---------------------------------------- ok means the spec was already passing fixed means the spec was failing, and I have fixed it FAILS means the specs fail, and I have not fixed them yet ok allocate_spec.rb ok append_spec.rb ok array_spec.rb ok assoc_spec.rb ok at_spec.rb ok choice_spec.rb ok clear_spec.rb ok clone_spec.rb ok collect_spec.rb ok combination_spec.rb ok compact_spec.rb ok comparison_spec.rb ok concat_spec.rb ok constructor_spec.rb ok count_spec.rb ok cycle_spec.rb ok delete_at_spec.rb ok delete_if_spec.rb ok delete_spec.rb ok drop_spec.rb ok drop_while_spec.rb ok dup_spec.rb ok each_index_spec.rb ok each_spec.rb ok element_reference_spec.rb fixed element_set_spec.rb ok empty_spec.rb ok eql_spec.rb ok equal_value_spec.rb ok fetch_spec.rb fixed fill_spec.rb ok find_index_spec.rb ok first_spec.rb FAILS flatten_spec.rb ok frozen_spec.rb FAILS hash_spec.rb ok include_spec.rb ok indexes_spec.rb ok index_spec.rb ok indices_spec.rb ok initialize_copy_spec.rb ok initialize_spec.rb ok insert_spec.rb FAILS inspect_spec.rb ok intersection_spec.rb FAILS join_spec.rb FAILS keep_if_spec.rb ok last_spec.rb ok length_spec.rb ok map_spec.rb ok minus_spec.rb FAILS multiply_spec.rb ok new_spec.rb ok nitems_spec.rb FAILS in MRI also pack_spec.rb ok partition_spec.rb ok permutation_spec.rb ok plus_spec.rb FAILS pop_spec.rb !! HANGS product_spec.rb ok push_spec.rb ok rassoc_spec.rb ok reject_spec.rb FAILS repeated_combination_spec.rb FAILS repeated_permutation_spec.rb ok replace_spec.rb ok reverse_each_spec.rb ok reverse_spec.rb FAILS rindex_spec.rb FAILS rotate_spec.rb fixed sample_spec.rb fixed select_spec.rb fixed shift_spec.rb fixed shuffle_spec.rb ok size_spec.rb FAILS slice_spec.rb FAILS hard to fix sort_by_spec.rb FAILS hard to fix sort_spec.rb ok take_spec.rb ok take_while_spec.rb ok to_ary_spec.rb ok to_a_spec.rb ok to_s_spec.rb ok transpose_spec.rb ok try_convert_spec.rb ok union_spec.rb fixed uniq_spec.rb ok unshift_spec.rb ok values_at_spec.rb fixed zip_spec.rb _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core -------------- next part -------------- An HTML attachment was scrubbed... URL: From mr.andreas.beck at gmail.com Sun Jan 29 15:29:16 2012 From: mr.andreas.beck at gmail.com (Andreas Beck) Date: Sun, 29 Jan 2012 21:29:16 +0100 Subject: [Ironruby-core] ironruby in VB.net and rubygems Message-ID: Hi, I've just encountered the following problem: I've installed the gem "builder" in version 2.0 via igem and it works fine. When using it in a script first the first 2 lines are: require 'rubygems' require 'builder' In VB.net I execute ruby code in the following way: I linked: IronRuby.dll IronRuby.Libraries.dll IronRuby.Lbraries.Yaml.dll from InstallationDirectory\Silverlight\bin\ my code which works fine with "regular" ruby code: Sub Main(ByVal Args As String()) Dim rubyRuntime As Microsoft.Scripting.Hosting.ScriptRuntime Dim rubyEngine As Microsoft.Scripting.Hosting.ScriptEngine rubyRuntime = IronRuby.Ruby.CreateRuntime rubyEngine = rubyRuntime.GetEngine("rb") Dim strRuby As String Dim fileReader As StreamReader fileReader = New StreamReader(System.Environment.CurrentDirectory & "\" & Args(0)) strRuby = fileReader.ReadToEnd fileReader.Close() fileReader = Nothing rubyEngine.Execute(strRuby) End Sub Now, when I compile the code the libraries I linked are copied in my output directory as usual. And here the problem starts. When this library IronRuby.Libraries.dll is in the directory where my programm is running, executing the "require 'rubygems'" throws an error. It's the same when I start ir on the command line and type it in. When I delete this library the ruby code runs without any problem, but the VB.net program won't execute any more. Here's the error message: C:/Program Files/IronRuby 1.1/Lib/ironruby/thread.rb:16:in `load_assembly': Specified type IronRuby.StandardLibrary.Threading.ThreadingLibraryInitializer is not a subclass of IronRuby.Builtins.LibraryInitializer (LoadError) from C:/Program Files/IronRuby 1.1/Lib/ironruby/thread.rb:16 from C:/Program Files/IronRuby 1.1/Lib/ruby/1.9.1/rubygems.rb:16:in `require' from C:/Program Files/IronRuby 1.1/Lib/ruby/1.9.1/rubygems.rb:16 from (ir):1:in `require' from (ir):1 The versions I use: IronRuby 1.1.3.0 on .NET 4.0.30319.239 MS Visual Studio 2010 I desperately hope for help as I couldn't any helping post in the archives! thanks in advance Andreas -------------- next part -------------- An HTML attachment was scrubbed... URL: From orion.edwards at gmail.com Sun Jan 29 17:55:49 2012 From: orion.edwards at gmail.com (Orion Edwards) Date: Mon, 30 Jan 2012 11:55:49 +1300 Subject: [Ironruby-core] ironruby in VB.net and rubygems In-Reply-To: References: Message-ID: <3F30805A-58B6-4172-B311-4570D77CB3F5@gmail.com> Not sure if this is your problem, but off the top of my head I'll try help. IronRuby needs to know the path to it's standard library directory. This is stored in the ir.exe.config file that ships along with IronRuby. When you host IronRuby from inside another application, this config file isn't present. Rubygems isn't one of the core libraries (those are implemented in IronRuby.Libraries.dll), and so when you try and require rubygems, it goes looking for the standard library, and fails. Try open ir.exe.config from the IronRuby directory, and copy the parts which reference file paths over to your own app.exe.config (and remember to update the paths, etc). It should look kind of like this (NOTE: this is an old config file and so it won't be correct for the latest version of ir): http://code.google.com/p/efficientlylazycrypto/source/browse/trunk/ThirdParty/Gallio/DLR/libs/ir.exe.config?r=46 Orion On 30/01/2012, at 9:29 AM, Andreas Beck wrote: > Hi, > I've just encountered the following problem: > I've installed the gem "builder" in version 2.0 via igem and it works fine. When using it in a script first the first 2 lines are: > > require 'rubygems' > require 'builder' > > In VB.net I execute ruby code in the following way: > > I linked: > > IronRuby.dll > IronRuby.Libraries.dll > IronRuby.Lbraries.Yaml.dll > > from InstallationDirectory\Silverlight\bin\ > > my code which works fine with "regular" ruby code: > > Sub Main(ByVal Args As String()) > Dim rubyRuntime As Microsoft.Scripting.Hosting.ScriptRuntime > Dim rubyEngine As Microsoft.Scripting.Hosting.ScriptEngine > > rubyRuntime = IronRuby.Ruby.CreateRuntime > rubyEngine = rubyRuntime.GetEngine("rb") > > Dim strRuby As String > > Dim fileReader As StreamReader > fileReader = New StreamReader(System.Environment.CurrentDirectory & "\" & Args(0)) > strRuby = fileReader.ReadToEnd > fileReader.Close() > fileReader = Nothing > rubyEngine.Execute(strRuby) > End Sub > > Now, when I compile the code the libraries I linked are copied in my output directory as usual. And here the problem starts. When this library IronRuby.Libraries.dll is in the directory where my programm is running, executing the "require 'rubygems'" throws an error. It's the same when I start ir on the command line and type it in. When I delete this library the ruby code runs without any problem, but the VB.net program won't execute any more. Here's the error message: > > C:/Program Files/IronRuby 1.1/Lib/ironruby/thread.rb:16:in `load_assembly': Specified type IronRuby.StandardLibrary.Threading.ThreadingLibraryInitializer is not a subclass of IronRuby.Builtins.LibraryInitializer (LoadError) > from C:/Program Files/IronRuby 1.1/Lib/ironruby/thread.rb:16 > from C:/Program Files/IronRuby 1.1/Lib/ruby/1.9.1/rubygems.rb:16:in `require' > from C:/Program Files/IronRuby 1.1/Lib/ruby/1.9.1/rubygems.rb:16 > from (ir):1:in `require' > from (ir):1 > > The versions I use: > IronRuby 1.1.3.0 on .NET 4.0.30319.239 > MS Visual Studio 2010 > > I desperately hope for help as I couldn't any helping post in the archives! > thanks in advance > Andreas > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core From Orion.Edwards at gallagher.co Tue Jan 31 20:59:37 2012 From: Orion.Edwards at gallagher.co (Orion Edwards) Date: Wed, 1 Feb 2012 14:59:37 +1300 Subject: [Ironruby-core] Array Specs In-Reply-To: <9597F4A19BFDB342B6E90963100C33082EEDE301@SN2PRD0302MB121.namprd03.prod.outlook.com> References: <9597F4A19BFDB342B6E90963100C33082EEDE301@SN2PRD0302MB121.namprd03.prod.outlook.com> Message-ID: More updates: * Fixes implementation of Array#sample to not use CLR ArrayList internally (it's not available on silverlight) * Fixes Array#slice to deal with out-of-range parameters * Fixes Array#inspect to taint correctly * Implements Array#keep_if * Fixes Array#product to deal with blocks correctly The only things left unfixed in that folder are as follows: hash_spec.rb - requires changing implementation of RubyArray#hash which seems dangerous join_spec.rb, multiply_spec.rb - Both of these fail because the specs expect ruby to call .to_str on objects inside arrays. The problem is that the mock objects in the spec implement to_str using method missing, but they don't implement respond_to?. IronRuby's Protocols.CastToStr always checks respond_to? before invoking to_str and thus it fails... sort_by_spec.rb - seems to require full reimplementation of sorting to not use the CLR QuickSort algorithm sort_spec.rb - seems to require full reimplementation of sorting to not use the CLR QuickSort algorithm repeated_combination_spec.rb - didn't get to it, it seems like a really obscure method repeated_permutation_spec.rb - didn't get to it, it seems like a really obscure method I'm not sure that I have the ability to fix the above issues without some help, so I'd like to say my work on the array specs is done for now, and hopefully it can be merged into IronRuby main. The pull request is here: https://github.com/IronLanguages/main/pull/52 Regards Orion ______________________________________________________ Orion Edwards | Technical Leader PHONE +64 7 838 9800 | FAX +64 7 838 9801 | EMAIL orion.edwards at gallagher.co | WEB www.gallagher.co From: Tomas Matousek To: "ironruby-core at rubyforge.org" Date: 05/01/2012 05:59 p.m. Subject: Re: [Ironruby-core] Array Specs Sent by: ironruby-core-bounces at rubyforge.org Cool! I?ll take a look asap. Tomas From: ironruby-core-bounces at rubyforge.org [ mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Orion Edwards Sent: Wednesday, January 04, 2012 1:54 PM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] Array Specs I've been working on bringing IronRuby up to speed with rubyspec, and picked the core\array folder as a start: My pull request is here: https://github.com/IronLanguages/main/pull/52 I'd like to fix them all, but I'm not sure if I'll have the time to do so - Here is a summary of the rubyspec\core\array folder as of right now: ---------------------------------------- ok means the spec was already passing fixed means the spec was failing, and I have fixed it FAILS means the specs fail, and I have not fixed them yet ok allocate_spec.rb ok append_spec.rb ok array_spec.rb ok assoc_spec.rb ok at_spec.rb ok choice_spec.rb ok clear_spec.rb ok clone_spec.rb ok collect_spec.rb ok combination_spec.rb ok compact_spec.rb ok comparison_spec.rb ok concat_spec.rb ok constructor_spec.rb ok count_spec.rb ok cycle_spec.rb ok delete_at_spec.rb ok delete_if_spec.rb ok delete_spec.rb ok drop_spec.rb ok drop_while_spec.rb ok dup_spec.rb ok each_index_spec.rb ok each_spec.rb ok element_reference_spec.rb fixed element_set_spec.rb ok empty_spec.rb ok eql_spec.rb ok equal_value_spec.rb ok fetch_spec.rb fixed fill_spec.rb ok find_index_spec.rb ok first_spec.rb FAILS flatten_spec.rb ok frozen_spec.rb FAILS hash_spec.rb ok include_spec.rb ok indexes_spec.rb ok index_spec.rb ok indices_spec.rb ok initialize_copy_spec.rb ok initialize_spec.rb ok insert_spec.rb FAILS inspect_spec.rb ok intersection_spec.rb FAILS join_spec.rb FAILS keep_if_spec.rb ok last_spec.rb ok length_spec.rb ok map_spec.rb ok minus_spec.rb FAILS multiply_spec.rb ok new_spec.rb ok nitems_spec.rb FAILS in MRI also pack_spec.rb ok partition_spec.rb ok permutation_spec.rb ok plus_spec.rb FAILS pop_spec.rb !! HANGS product_spec.rb ok push_spec.rb ok rassoc_spec.rb ok reject_spec.rb FAILS repeated_combination_spec.rb FAILS repeated_permutation_spec.rb ok replace_spec.rb ok reverse_each_spec.rb ok reverse_spec.rb FAILS rindex_spec.rb FAILS rotate_spec.rb fixed sample_spec.rb fixed select_spec.rb fixed shift_spec.rb fixed shuffle_spec.rb ok size_spec.rb FAILS slice_spec.rb FAILS hard to fix sort_by_spec.rb FAILS hard to fix sort_spec.rb ok take_spec.rb ok take_while_spec.rb ok to_ary_spec.rb ok to_a_spec.rb ok to_s_spec.rb ok transpose_spec.rb ok try_convert_spec.rb ok union_spec.rb fixed uniq_spec.rb ok unshift_spec.rb ok values_at_spec.rb fixed zip_spec.rb _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 3465 bytes Desc: not available URL: From Orion.Edwards at gallagher.co Tue Jan 31 22:20:28 2012 From: Orion.Edwards at gallagher.co (Orion Edwards) Date: Wed, 1 Feb 2012 16:20:28 +1300 Subject: [Ironruby-core] Float specs Message-ID: Added the following pull request https://github.com/IronLanguages/main/pull/54 This has the following fixes, which are all pretty minor: * Update Float#<=> to handle overflowed values correctly as per rubyspec * Update Float#divmod as per rubyspec * Implement Float#fdiv, which is just an alias for / * Update Float#modulo and Float#% to raise ZeroDivisionError (as per rubyspec) * Implement Float#round(decimalPlaces) The last one isn't actually in rubyspec, but MRI has had it for ages and it's very useful. The only things left for float_specs all involve converting it to Rational, so I'd suggest leaving them until IronRuby's implementation of Rational gets sorted out. Thanks, Orion ______________________________________________________ Orion Edwards | Technical Leader PHONE +64 7 838 9800 | FAX +64 7 838 9801 | EMAIL orion.edwards at gallagher.co | WEB www.gallagher.co -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 3465 bytes Desc: not available URL: