dlr

Which Dynamic .NET language makes more sense to learn, Iron Ruby or Iron Python?

I'd like to take some time to learn more about dynamic languages built on top of the DLR and I'm not sure which language would be better to learn. Having limited time, I really only have time to look learn one of them. Any opinions on which of the two (Iron Ruby or Iron Python) would be more useful in the long run? Thanks! ...Ed ...

Using the DLR for (primarily) static language compilation...

I'm building a compiler that targets .NET and I've previously generated CIL directly, but generating DLR trees will make my life a fair amount easier. I'm supporting a few dynamic features, namely runtime function creation and ducktyping, but the vast majority of the code is completely static. So now that that's been explained, I have ...

Will .Net 4.0 include a new CLR or keep with version 2.0

Will .Net 4.0 use a new version of the CLR (v2.1, 3.0) or will it stick with the existing v2.0? Supplementary: Is it possibly going to keep with CLR v2.0 and add DLR v1.0? Update: Whilst this might look like a speculative question which cannot be answered, the VS team appear to be releasing more and more info on VS10 and .Net 4.0 so th...

Is the DLR going to be capable of compiling client-side code?

Is the DLR intended to be used to compile code exclusively prior to distribution or will it potentially be used to compile client-side Javascript in a JIT fashion? ...

What's the best way to embed IronPython inside my C# App?

I have an application used by pretty tech-savey people and they want small island of programmability so I've used embedded Iron Python. However, since IronPython 2.0 Eval() doesn't work any more. Specifically I can't both load modules and inject local variables. There is a work around where I can still call Execute(), print out my answ...

How do you implement C#4's IDynamicObject interface?

To implement "method-missing"-semantics and such in C# 4.0, you have to implement IDynamicObject: public interface IDynamicObject { MetaObject GetMetaObject(Expression parameter); } As far as I can figure out IDynamicObject is actually part of the DLR, so it is not new. But I have not been able to find much documentation on it. The...

Are LINQ expression trees Turing complete?

As they are in .Net 3.5. I know they are in 4.0, as that's what the DLR works with, but I'm interested in the version we have now. ...

Can I implement method_missing in C# 4 and have it actually return a value?

I was trying to figure out how to implement method_missing in C# 4, based on all of 2 blog posts floating around on IDynamicObject. What I want to do is have a Business Logic Layer that has a Repository, and if the method is missing from the Business Logic Layer, just call the Repository and pass through its result. So i have a class ...

IDynamicObject implementation ignores multiple property invocations

I've implemented IDynamicObject in C# 4, return a custom MetaObject subclass that does simple property getter/setter dispatch to a Dictionary. Not rocket science. If I do this: dynamic foo = new DynamicFoo(); foo.Name = "Joe"; foo.Name = "Fred"; Console.WriteLine(foo.Name); Then 'Joe' is printed to the console... the second call t...

VBx language hosting via DLR?

There are various samples available for how to host Python or Ruby running on the DLR, inside your own AppDomain. Are you able to do this yet with VB? There have been mentions of this since the DLR was announced 18 months ago, but I can't find a code sample for it. Maybe with the PDC VS10 CTP? If so, what assembly contains the appropri...

Documentation for the Dynamic Language Runtime?

Google has failed me. I want to read actual documentation for the DLR, not news articles, as I'd like to attempt to create my own language upon the DLR's framework. Is there any downloadable, online, or even paper-based documentation for the DLR that I'd be able to use, instead of having to go code spelunking to understand what everythin...

Purpose of Restrictions parameter in MetaObject constructor?

I currently have an issue in my DLR language implementation where subsequent calls to a method defined in the language occur with the same input parameters used by the first call to that method. So... if I do this in my language: PrintType( 34 ); PrintType( 34.1 ); ... the output is: Integer Integer Where I would expect: Integer ...

Calling .NET code from IronPython, getting error loading the log4net assembly

I've got an IronPython script that configures log4net, then calls .NET code that uses log4net. log4net is properly configured, as I log a message to indicate that it is initialized. But when I try to use my .NET class, it reports "could not load file or assembly 'log4net, ...'. Some useful facts: log4net is not installed to the GAC ...

Expression.Dynamic and Operators.Assign?

I'm trying to use Expression.Dynamic() to build an assignment operation... I want to use this to selectively offer value type semantics to certain custom type instances in my language. I can't do this with a "static" (?) Expression because I don't know what the actual type is (I need the MetaObject instance and its LimitType... hence Exp...

Real time scripting language + MS DLR?

For starters I should let you guys know what I'm trying to do. The project I'm working on has a requirement that requires a custom scripting system to be built. This will be used by non-programmers who are using the application and should be as close to natural language as possible. An example would be if the user needs to run a custo...

How does the DLR work?

.Net 4 will have the a DLR (Dynamic Language Runtime). I know that it will be used for things like Iron Python and Iron Ruby. But is that all it's good for? How is the DLR useful? How does the DLR work? ...

Can I ship an open source dll that is built using iron ruby?

Yes .... Technically ... what is involved in ILMerging the DLR and Iron Ruby into a single DLL? What should I be careful about? Legally (MS-PL) ... am I allowed to ship an open source dll that had iron ruby and the DLR embedded into it? (Looks like the answer to this question is, usually yes, what OSI licenses is ms-pl compatible wit...

Print out Linq Expression Tree Hierarchy

The DLR has some pretty cool code for Expression's, including some very nice code to print out Expression trees which I want to use so that: int a = 1; int b = 2; Expression<Func<int, int>> expression = (c) => a + (b * c) expression.Evaluate(5, stringBuilder) Outputs: (5) => a + (b * c) = 11 Where a = 1 b * c = 10 Where ...

Querying IronPython scripts for interfaces in a hosted environment

I'm developing an application written in C# which hosts IronPython. What I'm planning is that the users will write python scripts, which contain classes implementing a pre-defined interface. Something like: Define interface in C# code: public interface IPlugin { void DoSomething(); } Implement the interface in python code. class ...

Business rules for calculating prices

The business I work for is an on-line retailer, I'm currently working on a project that among other things involves calculating the customer prices for products. We will probably create a service that looks something like... public interface IPriceService { decimal CalculateCustomerPrice(ISupplierPriceProvider product); } public inte...