1. C to EU Translator

I beleive it is essential for the Euphoria community to have a tool that is
capable of
automatically converting C library headers to Euphoria libraries.

The Eu community spends vast amounts of effort to manually translate various
API's to Euphoria.
The results often do not conform to the original API, are incomplete and/or
non-stnadardized.

The Windows API is an excellent example of a task that is so mammoth to
translate by hand, that
it's virtually impossible for us to even keep up with current versions of the
API let alone supporting
each variation.

Do you think it's possible and practical to create a fully automated C to Eu
translator?

Chris Bensler
Code is Alchemy

new topic     » topic index » view message » categorize

2. Re: C to EU Translator

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.

new topic     » goto parent     » topic index » view message » categorize

3. Re: C to EU Translator

c.k.lester wrote:
> 
> What about the library from Daniel Kluss?
> 
>     <a
>     href="http://www.rapideuphoria.com/h_to_e.zip">http://www.rapideuphoria.com/h_to_e.zip</a>
> 
> 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.

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.

Chris Bensler
Code is Alchemy

new topic     » goto parent     » topic index » view message » categorize

4. Re: C to EU Translator

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 message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu