Mixed-Language Programming Examples

See also my mixed-programming links.

C ↔ Python with SWIG

Files used:

After saving those files, I did this to get everything running:

swig -python example.i
gcc -c example.c example_wrap.c -I/usr/include/python2.7 # -fPIC required on some systems
ld -shared example.o example_wrap.o -o _example.so
python test.py
python mandel.py

Java ↔ Ruby with JRuby

Files used:

… and to run this:

javac Mandel.java
jruby jruby.rb

.NET library with IronPython

Files used:

This uses the .NET ArrayList to store and manipulate some data. To run this:

ipy net.py

Copyright © , last modified 2012-03-30.