[Top][All Lists]

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

[DotGNU]Generic IL support in Portable.NET

From: Rhys Weatherley
Subject: [DotGNU]Generic IL support in Portable.NET
Date: Tue, 18 Feb 2003 15:25:20 +1000
User-agent: KMail/1.4.3

Hi all!

Well, I've been having some fun over the last few days which I'm now ready to 
share with DotGNU folks ...  I've begun implementing support for Generic IL 
in Portable.NET.  Yay!

The current status is this:

- metadata reading/writing routines in "pnet/image" have been updated
  to recognise the Generic IL extensions.
- ilasm and ildasm can assemble and dump Generic IL constructs.
- the C# parser has had most of the necessary syntactic extensions added
  (right now, it parses the syntax and then promptly ignores the generic
  parameters, so it can't compile generics just yet).

What remains to be done:

- reduce/reduce conflicts that arise from generic-qualified identifiers.
- semantic analysis and code generation for the C# compiler.
- dynamic class instantiation in ilrun.
- support for the extended instruction semantics in ilrun.

I pulled the information on metadata out of the Gyro tarball, because there 
doesn't seem to be any other documentation available as yet:

For compiler hackers who want to help out, the main changes of note are to the 
type system.  There are three new kinds of complex type:

- "with" types that represent a particular instantiation of a generic type.
  e.g. "Stack<int32>" is a "with" instantiation of the type "Stack<T>".
- "var" types that reference a class generic parameter.  e.g. a "var" type
  with an argument of 1 indicates the second parameter in the enclosing
  class's generic parameter list (0 indicates the first parameter).
- "mvar" types that reference a method generic parameter in a similar way.

These may make a little more sense if you read the Gyro documentation first.

We'll have to go through the compiler and find everywhere where casts, 
coercions, and other type handling is performed, and see if we need to add 
new cases.  Lots of fun for all the family! :-)

In summary, Portable.NET is the first Free Software implementation of the CLI 
to release real support for Generic IL.  Now, to test and debug it ...



reply via email to

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