Friday, January 8, 2010

SWIG (Simplified Wrapper and Interface Generator) demystified(not really)

One of my friends asked a forum question last week about Python and its growing adoption in big companies like Google. When you think about a scripting language being used at enterprise level then obvious question is raised that how do these power users manage to use a scripting language alongside with mainstream programming language such as C/C++ and Java. No one can ignore the benefits of scripting language; John Ousterhout Prof. of Computer Sciences at Stanford and creator of scripting language Tcl calles scripting languages, a higher level programming language of 21st century. SWIG makes it easy to connect scripting languages to C/C++ code. So, what's magic behind SWIG? David M. Beazley creator of SWIG explains in his tutorial SWIG Master Class
How did I get interested in SWIG?
  • I was looking at ways to put C/C++ programs in scripting environment to be able to test and debug. Can I use python interpreter as an interface to test/debug C++ code? 
  • If I can create python extension modules out of C++ libraries components, then system integration can be done in scripting language environment
I followed the tutorial on creating python extension module out of C functions and get to know SWIG a little bit. I will be playing more with C++ and SWIG with this tutorial. I will be posting specific comments/tips on testing and debugging once I am comfortable SWIG  way :)

No comments:

Post a Comment

How we use GenAI at IBM Software Support

Please share your comments or suggestions on the LinkedIn post. thx  Empowering Software Support: The Transformative Role of Generative AI