Re: C to EU Translator

new topic     » goto parent     » topic index » view thread      » older message » newer message

Chris Bensler wrote:
> 
> c.k.lester wrote:
> > 
> > What about the library from Daniel Kluss?
> > 
> >     http://www.rapideuphoria.com/h_to_e.zip
> > 
> > I think Matt has something like that in wxEuphoria, too.
> 
> h_to_e does not produce a 100% translation. Ideally a 1:1 translation.
> Namely it only generates constants and minimal function wrappers.
> It doesn't handle structures or macros, etc... IIRC.
> I haven't seen Matt's. Maybe he can comment.

In the wxEuphoria code, there's a program called wrap.exw, which reads my
wxEuphoria C++ code, and generates the define_c statements as well as the
euphoria wrappers.  It's not very flexible, and relies on the fact that
my C++ wrappers follow a pretty strict pattern.
 
> What I would like to see is a tool that will allow us to generate Euphoria 
> wrappers for C API's with which we can directly use the original
> documentation and not have to port _anything_ by hand.
> The translations should be as accurate to the original as possible.

The place to start is probably SWIG, which is a tool for doing just this,
albeit for other languages.  For instance, I believe that this is a big
part of how wxPython is built.

http://www.swig.org

One of the problems with having a C API available is that they're not
terribly easy to work with (especially for someone with a Euphoria
background).  IMHO, a major reason for the success of win32lib is that it
hides that, and gives a very euphorian interface.  Obviously, the automated
wrapping would be a help to the author of a more comprehensive wrapper
library.

Matt

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu