dotgnu-pnet
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Pnet-developers] Dynamic Typing in IL for scripting languages?


From: Fergus Henderson
Subject: Re: [Pnet-developers] Dynamic Typing in IL for scripting languages?
Date: Fri, 28 Mar 2003 15:10:56 +1100
User-agent: Mutt/1.3.28i

On 28-Mar-2003, Rhys Weatherley <address@hidden> wrote:
> On Friday 28 March 2003 04:24 am, minddog wrote:
> > Hey,
> >     I'm going through my old code(pretty much useless) for ghp thinking I 
> > can
> > revive it.  I remember the whole thing about dynamic typing was causing my
> > a headache.  Wouldn't it be a lot less code to write for ghp if we worked
> > on an addition to IL for dynamically typed languages?
> 
> IL already works with dynamically typed languages to a degree (e.g. JScript, 
> Mercury).

Describing Mercury as a dynamically typed language is rather misleading:
although Mercury does have some support for dynamic typing, it is
predominantly a statically typed language.  I guess features like
parametric polymorphism and existentially quantified types blur the
issue a bit -- they are statically type-safe, but the types involved
do vary dynamically at run-time.  So we do have to address some of the
same issues.

If it's just ease of implementation that you're worried about, then IL
already has what is needed for dynamically typed languages.  Just
declare everything to have type "Object", as Rhys suggested.

What IL is lacking for dynamically typed languages is efficient support
for the kind of discriminated union types that dynamically typed languages
use for their main data type.  "castclass" is quite expensive and the
data representation for e.g. System.Integer is not compact -- it's much
bigger than the representations used in typical optimized implementations
of dynamically typed languages.  But those are just efficiency issues,
not ease-of-front-end-implementation issues.

-- 
Fergus Henderson <address@hidden>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]