dotgnu-general
[Top][All Lists]
Advanced

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

Re: [DotGNU]Fwd: Idea for Inline::Csharp::pnet


From: James Michael DuPont
Subject: Re: [DotGNU]Fwd: Idea for Inline::Csharp::pnet
Date: Mon, 14 Oct 2002 05:42:29 -0700 (PDT)

> I'm now embedding it within a VRS module as a proof of concept.  This
> is 
> something that may be of use for SEE.
Great. If you need any testers.... let me know.

> > > Also via Inline::Csharp::cscc, we can embed the C# compiler and
> use
> > > that for generation of APIs based on the C# syntax. The attribute
> > > mechanism from C# will allow for the precompiling of the function
> > > bodies and the reflection mechanism allows access to that
> structure.
> > > Then we can wrap a mini-perl inside of assembly and allow it to
> be
> > > called back by the CLI system
> 
> This is interesting.  I don't understand a word of it mind :o)
> I think the coolness of attributes is currently lost on me.  Need to
> do some 
> reading me thinks.

The idea is that first you use C# that is embedded into an inline block
in perl to spec out an interface. That means the C# is the idl.

Then you run the through the proposed inline::csharp::cscc module and
that invokes the compiler on that snippet and produces code.

This code can then be used to generate a perl wrapper for invoking
functions in the vm and being invoked back again.

the generation needs to know all about the IDL, so you can use 
1. csdoc to dump the description to XML and parse that out.
2. reflection to query it.

the attributes bit are modules that allow for code to be generated 
or at least genericly programmed. The code generation could be done in
perl after parsing the metainformation from the xml, or from inside of
c# from the reflection module called inside the custom attribute code.

see :
http://www.codeguru.com/cs_syntax/AttributesInCSharp.html
-----------------------------------------------------------------
QUOTE
-----------------------------------------------------------------
An attribute is a powerful .NET language feature that is attached to a
target programming element (a class, method, assembly, interface, and
so forth) to customize behaviors or extract organizational information
of the target at design-, compile-, or runtime. The paradigm of
attributed programming first appeared in the Interface Definition
Language (IDL) of COM interfaces. Microsoft extended the concept to
Transaction Server (MTS) and used it heavily in COM+. It is a clean
approach to associate metadata with program elements and later use the
metadata at design-, compile-, or runtime to accomplish some common
objectives. In .NET, Microsoft went a step further by allowing the
implementation of attributes in the source code, unlike the
implementation in MTS and COM+ where attributes were defined in a
separate repository. 
-----------------------------------------------------------------

=====
James Michael DuPont
http://introspector.sourceforge.net/

__________________________________________________
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos & More
http://faith.yahoo.com


reply via email to

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