Re: Swig for Euphoria

new topic     » goto parent     » topic index » view thread      » older message » newer message
jeremy said...

I was looking at Swig for Euphoria by David Cunny.

What is the reason for creating the .c and .dll file? I could see if this was a project written in C for the sole purpose of providing functionality to Euphoria, but most of the time we are wrapping other libraries, such as sqlite, iup, gtk, etc...

Jeremy

Swig is designed to wrap C. One issue with wrapping C directly in Eu is because C symbols are mangled into funny looking symbols (in what may be an operating system dependant way, I'm not clear on this bit) in order to maintain compatibility with C and binary formats that expect C naming conventions. It gets worse when you try to access members, instantiate classes, etc.

Its very difficult to handle all of this directly from eu code (not impossible - just a lot of peeking and poking and similiar low level interfacing (e.g. vtable handling)) so the easier route is taken here: Let the native C/C compiler handle the details for us and just let the eu code see the nice little C functions that it is used to dealing with.

Swig is not the only one to have done this, btw: wxEuphoria used to interface to the wxWidgets library directly using a low level C interface written in eu but now it uses a C wrapper library.

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

Search



Quick Links

User menu

Not signed in.

Misc Menu