Re: [IronPython] Writing a Compiler framework: Static typing use of the DLR
Hello Tomas, Ideally I want the base functionality, for now, to mimic that of C#. There is other functionality extensions I plan on implementing (static duck-typing through explicitly defined type-parameter meta-data), but let's start with the basics: given each functional variation of a potential call, as an example, expression coercion through N-ary operators, implicit type conversions, and so on, are there different call site constructs to represent each in an intent based manner? An example being things that look like method invocations but could be properties that return a delegate, the real question is where does the DLR's functionality end and the language's specific use of the DLR begin? Further, your call sight Func, I'm guessing that encodes the types of the parameters as they exist at compile time, where object in the type-parameters has special meaning, and others represent points where further evaluation isn't necessary? Thanks, -Allen Copeland Jr. I'm not sure I understand what you want to achieve. Could you describe > functionality your framework provides? > > Every language that integrates with DLR might use a different way of > expressing late bound calls. C#'s dynamic type is one way of doing that. The > code that actually performs the dynamic dispatch via DLR call sites usually > looks like: > > // Lazy-initialize a dynamic call-site object; provide a language specific > binder that performs the runtime binding > if (site == null) { site = CallSite TResult>>>.Create(runtime_binder); } > > // call the Target delegate of the site. > result = Site.Target(Site, args); > > The runtime_binder for the site carries information about the dynamic > operation available at compile-time. This includes e.g. a method name, the > current accessibility context, etc. > ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
[IronPython] Writing a Compiler framework: Static typing use of the DLR
Hello, I'm not really sure where to ask this question, so I figured I'd ask on the mailing list of the project that largely started the DLR (assuming memory serves correctly.) I'm writing a compiler framework, and I was wondering what kind of work, in AST rewrites I would need to perform, or classes from the DLR object model I would need to use, in order to support, what C# calls, a static type dynamic? From what I can tell of C#, it uses its own model to wrap some of the concepts provided by the DLR, so I'm not exactly sure how to handle the late-bound dispatch so that it's marshaled by the appropriate language binder for a given object instance. I could go deeper into how C# does it, but I don't really like the idea of looking at the code that was written by someone else (since the only way I can look at it is through a disassembler), my own code rewritten by C#'s compiler is fine, but the innards of what that code uses: no. I understand the basic concept behind the DLR, but it's too complex to go over with a fine tooth comb. Search algorithms aren't sophisticated enough to ask questions like this through google or bing (especially on, largely intangible, intent in code), which is why I ask here. I originally asked Jeff Hardy (http://jdhardy.blogspot.com/) for insight, and he suggested I look here. Any insight anyone here can provide into this is appreciated. Thanks, -Allen [Alexander Morou] Copeland Jr. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com