dotgnu-general
[Top][All Lists]
Advanced

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

Re: [DotGNU]Doubts about C@


From: Peter Minten
Subject: Re: [DotGNU]Doubts about C@
Date: Fri, 16 Aug 2002 20:02:30 +0200

Gopal V wrote:

> Generics have been too complicated for me to understand properly ... But
> I guess having that kind of type safety is a good thing .. It might be
> complicated to do it using just IL.. But I think we could implement
> Generics in basic IL with an extra bit of hair pulling ... I used to
> think that the synthetic types for arrays comes very near what dynamic code
> could do ... ie generate the new code at the callsite .. like the
> generated '<T1>' and '<D1>' classes , which are generated as per the
> type of the array declared ... But it is beyond me to say whether such
> a model to implement templates is possible or not ..

I don't know generics, but if Gopal doubts that it can be done in standard IL
then it's certainly too complicated for me to write a compiler for :-).

I've been thinking of dynamic code too, it could be possible to create new 
classes during execution, but there is a little bit of a problem. To use code
in a program it must be compiled, but you can't compile code generated in 
execution.

For example, during execution of a program this class is created:
"class Foo {}". Foo needs to be compiled into IL instructions, but can't since
the compiler is a stand-alone application that can't be called from the runtime
engine. The only way to work around this is to have an IL compiler executable or
lib that can compile address@hidden We don't have such a compiler and it's too 
hard to
develop one.

As you can see dynamic code generation is impossible (unless somebody finds a
way to rig somethings with reflection).

> C@ will be going into the design phase right now ... It is Peter Minten's
> brain child.... So this is what I could glean from the irc meetings.

My headache tells me it has been in the design phase for a couple of days
already :-).

Greetings,

Peter



reply via email to

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