Irc.rb

Hi, I’ve created an irc.rb (attached) which mimics IronPython’s pyc.py.
It
is failing on this line:

Microsoft::Scripting::ScriptCode.save_to_assembly(outfile,
codes.to_array())

With the following exception… Any help would be greatly appreciated.
The
test file I’m trying to compile is also attached. I am building on
revision
140. I have also tried with the Microsoft.Scripting and
Microsoft.Scripting.Core dlls from IronPython with the same result.

C:\work\ironruby\co\svn\trunk\build\release>.\ir.exe irc.rb -target:dll
-verbose test.rb
Compiling C:\work\ironruby\co\svn\trunk\build\release\test.rb…
Creating output file
C:\work\ironruby\co\svn\trunk\build\release\test.dll…
C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\NewExpression
.cs:88:in New': Value cannot be null. Parameter name: constructor (System::ArgumentNullException) from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\NewExpression .cs:83:inNew’
from
C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre
eVisitor.Generated.cs:294:in DefaultVisitDynamicExpression' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:191:inVisitNode’
from
C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre
eVisitor.cs:40:in VisitNodes' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:108:inVisit’
from
C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre
eVisitor.Generated.cs:264:in DefaultVisitBlock' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:176:inVisitNode’
from
C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre
eVisitor.cs:40:in VisitNodes' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:108:inVisit’
from
C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre
eVisitor.Generated.cs:264:in DefaultVisitBlock' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:176:inVisitNode’
from
C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre
eVisitor.cs:40:in VisitNodes' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:108:inVisit’
from
C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre
eVisitor.Generated.cs:264:in DefaultVisitBlock' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:176:inVisitNode’
from
C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre
eVisitor.cs:40:in VisitNodes' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:108:inVisit’
from
C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre
eVisitor.Generated.cs:264:in DefaultVisitBlock' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:176:inVisitNode’
from
C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre
eVisitor.cs:272:in Visit' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.Generated.cs:374:inDefaultVisitScopeExpression’
from
C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre
eVisitor.Generated.cs:218:in VisitNode' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Ast\ExpressionTre eVisitor.cs:189:inVisit’
from
C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Actions\MatchCall
er.Generated.cs:40:in Call4' from C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Actions\CallSite. cs:275:inUpdateAndExecute’
from
C:\work\ironruby\co\svn\trunk\src\Microsoft.Scripting.Core\Actions\UpdateDel
egates.Generated.cs:52:in `Update4’
from :0

Right. This is the error Dino overheard me talking about :slight_smile: As you can
see from the stack trac, something seems to be broken in DLR. I’ll look
at it and see whether I can come with a simple fix. Precompilation is
currently P2 on our task list though, so I’m afraid any more complex
work would need to wait until P1’s are done.

Tomas

Thanks! I’ve also created a bug report:

http://rubyforge.org/tracker/index.php?func=detail&aid=21839&group_id=4359&a
tid=16798

This includes the irc.rb which I think IronRuby will be interested in
including in the IronRuby distribution as well…

I’ll try to step through into this bug and understand what’s going on,
although I have no clue what I’m looking at :slight_smile:
Thanks,