SWIG support for tinypy

65 views
Skip to first unread message

Denis Kasak

unread,
Apr 2, 2009, 8:51:14 AM4/2/09
to tinypy
Hey everyone,

I'm applying for GSOC this year again and one of my proposals is to
implement a SWIG backend for tinypy so it could emit wrapped code for
tinypy. If some of you don't know (doubtful, but then again) SWIG is
short for Simplified Wrapper and Interface Generator and it's a
specialising C and C++ compiler able to transform it automatically
into wrappers suitable by various scripting languages (PHP, Ruby, Tcl,
etc). You can find more about it here: http://www.swig.org/

I think this would be a really cool project because it could
potentially make porting some of the C/C++ libraries/functionality to
tinypy really fast. In most cases, SWIG only needs you to write small
interface (*.i) files which you can feed to it and it spits out the
same functions wrapped inside a wrapper suitable to being imported by
the target language. Currently, the wrapping code it emits for Python
is huge, but the Lua ones not so much. I'm confident I could make the
tinypy backend emit much smaller wrapping code, tinypy being much less
complex than CPython and all.

Done right, this could enable us to port some of the popular C
libraries nearly on the flick of a switch and bring their
functionality to tinypy. It could also enable porting homebrewed code
and making it usable from tinypy. One obstacle is that tinypy doesn't
have dynamic loading of modules but this doesn't look like something
that should be difficult to add and the backend could also be used
statically (as in, emit code that is compilable and integrable with
tinypy statically).

The SWIG people have asked me to muster support for this from the
tinypy community and to hear your opinion. So here I am. :-)

Thoughts?

fruch

unread,
May 28, 2012, 11:55:35 AM5/28/12
to tin...@googlegroups.com
I think it's a great idea
did you started anythoing ? or this idea died years ago ?
Reply all
Reply to author
Forward
0 new messages