[IronPython] Writing a Compiler framework: Static typing use of the DLR

Alexander Morou alexander.morou at gmail.com
Wed Jan 5 20:06:28 CET 2011


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<CallSite, T1,
... Tn, TResult>, 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<Func<CallSite, T1, .. Tn,
> 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.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20110105/bce15890/attachment.html>


More information about the Ironpython-users mailing list