[Top][All Lists]

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

Re: [DotGNU]Using pnet as an extension language

From: Gopal V
Subject: Re: [DotGNU]Using pnet as an extension language
Date: Sun, 22 Dec 2002 08:40:05 +0530
User-agent: Mutt/1.2.5i

If memory serves me right, Andy Tai wrote:
> Hi, can dotgnu (C#) be used as extension
> language, in the sense of guile?  

Yes ... It can be used as a plugin language ...

> I mean can pnet be embedded in a C or C++ program as a high 
> level interpreter to drive low level C code?  

As long as you write your own ilrun.c (driver program) . Typically
that will allow you to plugin your own internal calls into the System.

Like for example the mod_pnet I wrote a loong time ago allowed me to
run programs which did an apache_req.Write() method to wrap over the 
ap_rputs() . [this was in early this year and I can't find the code now].

> Is there any documentation on this kind of use?  

None except as comments in code ... :-( ... If you could elaborate on
the idea, I could do something that might be of help .... 

Everybody else: just please don't ask for dotgnu emacs yet ;)

> Also, are there standards governing the interface between C and C#
> code in dotgnu, like Java's JNI?  

We support PInvoke which allows us to call methods off existing .so's
which has the advantage of not requiring seperate JNI wrapper like things.
See the pnetcurses application hosted on Rhys's site for a demo wrapper
over ncurses or the X# hosted in Savannah's DotGNU-libs project for a 
more serious wrapper ... (they were built to test the System rather than
as end products, so be kind)..

On the other hand we have our "dynamic internalcall" system that allows
the driver program to add new internal calls . The internal calls are well
standardized and the internal call table can be generated from the compiled
.dll (like javah did), with the ilinternal tool found in pnet/ilnative/.
Take a look at pnet/engine/ to see how the main engine uses 
ilinternal. This looks more like the typical JNI but still does not have
any stub generation or anything.

The difference between insanity and genius is measured by success

reply via email to

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