State of IronRuby 10/5/07

These are the IronRuby related check-ins that have happened the week of
10/5/07. Note that most of the work done this week is in DLR, since the
team is heavily engaged in a refactoring pass across that codebase.

283358:

(dinov) This change adds a fast invocation path to avoid doing
methodInfo.Invoke. But while it does offer speed improvements this
change is largely motivated by a limitation in Silverlight that prevents
us from calling methods like System.Type.MakeArrayType or
System.Type.IsAssignableFrom from reflection - there are various types
that are locked down and until now that hasn’t really been an issue.
That will enable my next check-in to remove the infinite recursion
possibility when dealing w/ mutating types & new rules. Enough about
that future check-in though…

ReflectedCaller is a class which encapsulates how to call a method as
fast as it can. If it can’t call a method quickly it’ll just fallback
to MethodInfo.Invoke. It attempts to be fast in two areas: The creation
of the calling helper object and the invocation of the method.

It accomplishes the speed of the creation through a series of static
generic methods which look at the type code and call the next in the
series, ultimately using their type parameters to create the new
instance. If the type is an unrecognized type it’ll fallback to the slow
path of using MakeGenericType and Activator.CreateInstance

generate_reflected_calls.py add
$/Merlin/Main/Languages/IronPython/Scripts
test_cPickle.py edit $/Merlin/Main/Languages/IronPython/Tests
MethodCallExpression.cs edit
$/Merlin/Main/Runtime/Microsoft.Scripting/Ast
ReflectedCaller.cs add $/Merlin/Main/Runtime/Microsoft.Scripting/Utils
Microsoft.Scripting.csproj edit
$/Merlin/Main/Runtime/Microsoft.Scripting
ReflectedCaller.Generated.cs add
$/Merlin/Main/Runtime/Microsoft.Scripting/Utils

283390:

(mmaly) AstWriter overhaul

  • expressions are preferably written in one line
  • more nodes implemented
  • more consistent output

AstWriter.cs edit $/Merlin/Main/Runtime/Microsoft.Scripting/Ast
CatchBlock.cs edit $/Merlin/Main/Runtime/Microsoft.Scripting/Ast
DeleteUnboundExpression.cs edit
$/Merlin/Main/Runtime/Microsoft.Scripting/Ast
DynamicConversionExpression.cs edit
$/Merlin/Main/Runtime/Microsoft.Scripting/Ast
UnboundAssignment.cs edit $/Merlin/Main/Runtime/Microsoft.Scripting/Ast

284474:

(tomat) “Fixes” tons of FxCop warnings. My strategy is as follows: in
the first phase (this shelveset), enable some groups of rules and “fix”
all violations to get zero number of warnings. The next checkin will
enable these groups in SNAP tests and dev test suite so that it won’t be
possible to check in any violation. The last phase will gradually enable
and “fix” the rest of the rules. Eventually, all rules should be enabled
except for the rules we will consider bogus - I’ll make up an Excel
sheet listing those that I think are bogus and we can discuss them.

Now, what “fix” does actually mean. It means

a) the warning is relevant and it is simple to fix it -> fix the
code.
b) the warning is relevant but it would be more work to fix it ->
suppress it and add comment “//TODO: fix” right after the suppression
attribute (so we can search for such suppressions easily). These
suppressions makes up the “baseline”.
c) the warning is bogus (yet the rule is not) -> suppress the
warning.

All suppressions are inlined in the code - no global suppression file is
necessary.

284812:

(mmaly) Making Ast.Call stricter.

This is next step toward bringing the AST closer to LINQ. LINQ’s method
call expression is much simpler than ours. Parameter types must match,
LINQ doesn’t deal with default parameter values or “params” arrays. I am
changing the Ast.Call methods to behave in the LINQ way. However, since
there are some 250 references to the originally behaving methods, most
of which depend on the loose behavior of the MethodCallExpression node,
I am keeping the old semantic around (for now - will be going away in
the future checkins) as WeakCall method. The intent is that no new uses
of WeakCall should be introduced and the method will go away. The reason
for having it around is that the variety of binders depend heavily on it
and it would be too big of a change to do it all at once, so I’d rather
take it step by step.

RubyClass.cs edit $/Merlin/Main/Languages/Ruby/Ruby/Builtins
AstGenerator.cs edit $/Merlin/Main/Languages/Ruby/Ruby/Compiler
AstFactory.cs edit $/Merlin/Main/Languages/Ruby/Ruby/Compiler/AST
YieldCall.cs edit
$/Merlin/Main/Languages/Ruby/Ruby/Compiler/AST/Expressions
CompoundLeftValue.cs edit
$/Merlin/Main/Languages/Ruby/Ruby/Compiler/AST/LeftValues
RubyTests.cs edit $/Merlin/Main/Languages/Ruby/RubyTestHost
BinderHelper.cs edit $/Merlin/Main/Runtime/Microsoft.Scripting
DeleteMemberBinderHelper.cs edit
$/Merlin/Main/Runtime/Microsoft.Scripting/Actions
Generator.vb edit
RubyActionBinder.cs edit $/Merlin/Main/Languages/Ruby/Ruby/Runtime
RubyMethodGroupInfo.cs edit $/Merlin/Main/Languages/Ruby/Ruby/Runtime
RubyMethodInfo.cs edit $/Merlin/Main/Languages/Ruby/Ruby/Runtime
ActionBinder.cs edit $/Merlin/Main/Runtime/Microsoft.Scripting/Actions
CallBinderHelper.cs edit
$/Merlin/Main/Runtime/Microsoft.Scripting/Actions
CreateInstanceBinderHelper.cs edit
$/Merlin/Main/Runtime/Microsoft.Scripting/Actions
DoOperationBinderHelper.cs edit
$/Merlin/Main/Runtime/Microsoft.Scripting/Actions
FieldTracker.cs edit $/Merlin/Main/Runtime/Microsoft.Scripting/Actions
GetMemberBinderHelper.cs edit
$/Merlin/Main/Runtime/Microsoft.Scripting/Actions
MemberBinderHelper.cs edit
$/Merlin/Main/Runtime/Microsoft.Scripting/Actions
SetMemberBinderHelper.cs edit
$/Merlin/Main/Runtime/Microsoft.Scripting/Actions
MethodCallExpression.cs edit
$/Merlin/Main/Runtime/Microsoft.Scripting/Ast
TypeUtils.cs edit $/Merlin/Main/Runtime/Microsoft.Scripting/Ast
ParamsDictArgBuilder.cs edit
$/Merlin/Main/Runtime/Microsoft.Scripting/Generation
MethodTarget.cs edit
$/Merlin/Main/Runtime/Microsoft.Scripting/Generation
ReferenceArgBuilder.cs edit
$/Merlin/Main/Runtime/Microsoft.Scripting/Generation
DefaultActionBinder.cs edit
$/Merlin/Main/Runtime/Tests/TestAst/Microsoft.Scripting.Helpers.Actions
StandardRule.cs edit $/Merlin/Main/Runtime/Microsoft.Scripting/Actions
BinaryExpression.cs edit $/Merlin/Main/Runtime/Microsoft.Scripting/Ast
ByRefReturnBuilder.cs edit
$/Merlin/Main/Runtime/Microsoft.Scripting/Generation
DynamicType.cs edit $/Merlin/Main/Runtime/Microsoft.Scripting/Types

284891:

(haiboluo) make the test script externally-run friendly

common.rb edit $/Merlin/Main/Languages/Ruby/Tests
run.rb edit $/Merlin/Main/Languages/Ruby/Tests
run_syntax.rb edit $/Merlin/Main/Languages/Ruby/Tests/Syntax

284926:

(tomat) Adds FxCop to build scripts. Changes ToolsVersion in *.*proj to
3.5, so if built from Visual Studio, Orcas FxCop is used (and C# 3.0 as
well). However, all other build scripts (bdc, bsc, Run.bat, …) forces
msbuild to use C# 2.0 (command line argument /ToolsVersion:2.0, the help
explains: “This version will override the versions specified by
individual projects”). Without this trick Whidbey msbuild picks Whidbey
FxCop msbuild task that calls Orcas (!) FxCop backend. As these two are
incompatible, bad things happen. I think using Orcas C# within Visual
Studio is fine as long as any other build script will use Whidbey. Also
newer version of FxCop has more features (e.g. auto-suppress warnings
for code marked by GeneratedCodeAttribute).

Adds BuildRowan/BuildNession/BuildVBX.cmd scripts, which should be the
only ones that are directly calling msbuild. They pass /ToolsVersion:2.0
to it.
Also adds Check.cmd which runs FxCop on Microsoft.Scripting.csproj.
Enables FxCop check in Run 0 by inserting call to Check.cmd.

284928:

(mmaly) Making the Ast.Condition stricter.

Future checkins will address all WeakCondition instances to replace them
with correct code.Same idea as the WeakCall. There are several complex
cases which use the conditional expression’s lax design. Introducing
WeakCondition which will go away, and changing the Condition to check
types LINQ-style (condition must be bool, both operands identically
typed. Definitely no optional upcast that sneaked in while I was gone

RubyClass.cs edit $/Merlin/Main/Languages/Ruby/Ruby/Builtins
ConditionalExpression.cs edit
$/Merlin/Main/Languages/Ruby/Ruby/Compiler/AST/Expressions
UnlessExpression.cs edit
$/Merlin/Main/Languages/Ruby/Ruby/Compiler/AST/Expressions
IfExpression.cs edit
$/Merlin/Main/Languages/Ruby/Ruby/Compiler/AST/Expressions
ConditionalExpression.cs edit
$/Merlin/Main/Runtime/Microsoft.Scripting/Ast
BinaryExpression.cs edit $/Merlin/Main/Runtime/Microsoft.Scripting/Ast
MethodTarget.cs edit
$/Merlin/Main/Runtime/Microsoft.Scripting/Generation
ReferenceArgBuilder.cs edit
$/Merlin/Main/Runtime/Microsoft.Scripting/Generation

285886:

(mmaly) Making throw a statement again.

Body.cs edit $/Merlin/Main/Languages/Ruby/Ruby/Compiler/AST
Microsoft.Scripting.csproj edit
$/Merlin/Main/Runtime/Microsoft.Scripting
SmallRuleSet.cs edit $/Merlin/Main/Runtime/Microsoft.Scripting/Actions
StandardRule.cs edit $/Merlin/Main/Runtime/Microsoft.Scripting/Actions
TryStatementBuilder.cs edit
$/Merlin/Main/Runtime/Microsoft.Scripting/Ast
AstWriter.cs edit $/Merlin/Main/Runtime/Microsoft.Scripting/Ast
ThrowStatement.cs rename, edit
$/Merlin/Main/Runtime/Microsoft.Scripting/Ast
Walker.Generated.cs edit $/Merlin/Main/Runtime/Microsoft.Scripting/Ast

286041:

(mmaly) Call helpers.

Introducing 3 useful helpers to the DLR. They are pure helpers which
create AST sub-trees so no magic here, but here they are:

  •   ConvertHelper - generate convert node if types don't match
    
  •   SimpleCallHelper - generates convert nodes around instance and 
    

arguments of the call. Doesn’t deal with param arrays or default
arguments. It tries to be smart so as to not allocate extra array if not
required

  •   ComplexCallHelper - the big gun. This will deal with param 
    

arrays and default parameter values. Is also smart to not allocate
unnecessary array, unless things don’t match quite well.

All of the instances of WeakCall are converted to either Call, or one of
the two new call helpers.

RubyMethodGroupInfo.cs edit $/Merlin/Main/Languages/Ruby/Ruby/Runtime
RubyMethodInfo.cs edit $/Merlin/Main/Languages/Ruby/Ruby/Runtime
RubyTests.cs edit $/Merlin/Main/Languages/Ruby/RubyTestHost
RubyClass.cs edit $/Merlin/Main/Languages/Ruby/Ruby/Builtins
AstGenerator.cs edit $/Merlin/Main/Languages/Ruby/Ruby/Compiler
AstFactory.cs edit $/Merlin/Main/Languages/Ruby/Ruby/Compiler/AST
YieldCall.cs edit
$/Merlin/Main/Languages/Ruby/Ruby/Compiler/AST/Expressions
CompoundLeftValue.cs edit
$/Merlin/Main/Languages/Ruby/Ruby/Compiler/AST/LeftValues
RubyActionBinder.cs edit $/Merlin/Main/Languages/Ruby/Ruby/Runtime
ActionBinder.cs edit $/Merlin/Main/Runtime/Microsoft.Scripting/Actions
MemberBinderHelper.cs edit
$/Merlin/Main/Runtime/Microsoft.Scripting/Actions
BinaryExpression.cs edit $/Merlin/Main/Runtime/Microsoft.Scripting/Ast
ByRefReturnBuilder.cs edit
$/Merlin/Main/Runtime/Microsoft.Scripting/Generation
MethodTarget.cs edit
$/Merlin/Main/Runtime/Microsoft.Scripting/Generation
ParamsDictArgBuilder.cs edit
$/Merlin/Main/Runtime/Microsoft.Scripting/Generation
ReferenceArgBuilder.cs edit
$/Merlin/Main/Runtime/Microsoft.Scripting/Generation
DefaultActionBinder.cs edit
$/Merlin/Main/Runtime/Tests/TestAst/Microsoft.Scripting.Helpers.Actions
BinderHelper.cs edit $/Merlin/Main/Runtime/Microsoft.Scripting
UnaryExpression.cs edit $/Merlin/Main/Runtime/Microsoft.Scripting/Ast
CreateInstanceBinderHelper.cs edit
$/Merlin/Main/Runtime/Microsoft.Scripting/Actions
DeleteMemberBinderHelper.cs edit
$/Merlin/Main/Runtime/Microsoft.Scripting/Actions
DoOperationBinderHelper.cs edit
$/Merlin/Main/Runtime/Microsoft.Scripting/Actions
FieldTracker.cs edit $/Merlin/Main/Runtime/Microsoft.Scripting/Actions
GetMemberBinderHelper.cs edit
$/Merlin/Main/Runtime/Microsoft.Scripting/Actions
SetMemberBinderHelper.cs edit
$/Merlin/Main/Runtime/Microsoft.Scripting/Actions
MemberExpression.cs edit $/Merlin/Main/Runtime/Microsoft.Scripting/Ast
DynamicType.cs edit $/Merlin/Main/Runtime/Microsoft.Scripting/Types
MethodCallExpression.cs edit
$/Merlin/Main/Runtime/Microsoft.Scripting/Ast
CallBinderHelper.cs edit
$/Merlin/Main/Runtime/Microsoft.Scripting/Actions
StandardRule.cs edit $/Merlin/Main/Runtime/Microsoft.Scripting/Actions

Nice! Thanks John!

2007/10/6, John L. (DLR) [email protected]:

284812:
(mmaly) Making Ast.Call stricter.
This is next step toward bringing the AST closer to LINQ.

This is a very interesting statement indeed.

Thanks! This is great info. Much appreciated.

John L. (DLR) wrote:

These are the IronRuby related check-ins that have happened the week of 10/5/07. Note that most of the work done this week is in DLR, since the team is heavily engaged in a refactoring pass across that codebase.

Will there continue to be updates? It’s been a couple weeks.

  • Charlie

Going out today.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs