← Back to team overview

kicad-developers team mailing list archive

Re: Kicad + V8/NodeJS/Swig [split from kicad ideas mail]


Awesome, this is good news. In case you wanna dig more into this, I'll be happy to test any patch or early code development.

It's also worth noting that SWIG isn't the only way to access C/C++ libraries from within Python.. these are some of the other ways:
Cython http://cython.org/
Pyrex http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/


On 02/27/2012 09:14 AM, Miguel Angel Ajo Pelayo wrote:
Sorry, I ignore the "xxxx_wrapper.cxx + yyy_wrapper.cxx + etc cannot
be linked together"... swig define them as static functions, so they
can be linked together and will work. The path is not that dark ;-)

2012/2/27 Miguel Angel Ajo Pelayo <miguelangel@xxxxxxx

    I've been doing some experiments about that during the weekend,
    with python as a first target, and using SWIG (which should be
    highly desired, as it's something easier to mantain).

    And by now, what I found is that swig is quite mature, but mainly
    ready for this:
         Python--->[extension]/extension_wrap.o ---->library.so

    This is one of our intended usages, but,  for usage inside kicad:


    It may require some hacking. They had an embed.i that can be a
    start point. The problem is that SWIG build wrapper modules that
    are ready to be loaded from python, but they include all the swig
    logic. So then, if we linked kicad + python lib +
    wrapper_kicad.cxx + wrapper_eeschema.cxx + wrapper_pcbnew.cxx then
    the swig code would be x3 times.

    So I'll keep playing until I find a good way, and then we could
    really estimate the man/hours needed :-)

    2012/2/25 Fabio Varesano <fabio.varesano@xxxxxxxxx

        +1 on choosing Python over LUA or JS. Blender is using Python
        as scripting language and also internally.. and I guess
        Blender's requirements are pretty similar to those of KiCad.

        On 02/24/2012 09:22 PM, Miguel Angel Ajo Pelayo wrote:

            About python, yes, I think it fits the same way lua does,
            and I'm my
            opinion, it has more libraries
            that can be useful for the scripts (like image
            manipulation, etc...).
            There wasn't a branch already
            trying this, how good or bad did it go?

        Mailing list: https://launchpad.net/~kicad-__developers
        Post to     : kicad-developers@lists.__launchpad.net
        Unsubscribe : https://launchpad.net/~kicad-__developers
        More help   : https://help.launchpad.net/__ListHelp


    Miguel Angel Ajo Pelayo
    +34 636 52 25 69 <tel:%2B34%20636%2052%2025%2069>
    skype: ajoajoajo


Miguel Angel Ajo Pelayo
+34 636 52 25 69
skype: ajoajoajo