CSC/ECE 517 Fall 2010/ch3 3i IC
Mixing Static and Dynamic Language Code
Introduction
Many middleware solutions have been developed to combine static and dynamic languages to take advantage of both types of code. Previous wiki chapters have discussed JRuby, a Java implementation Ruby. These solutions allow programmers the productivity luxuries of newer dynamic languages with the speed, low-level functionality, and pre-existing code base of older static languages. Below, we will give even more examples of mixing several widely used dynamic languages with C, C++, and Java.
Mixing Dynamic Code and C/C++
Ruby
Ruby has an inherent relationship with the C language since the current Ruby implementation is written in C. Cplus2Ruby is a gem that allows programmers to call Ruby code within C++ and vice versa. Assuming an installation of Ruby, the Cplus2Ruby can be installed with the following command [2]:
gem install cplus2ruby
Python
Lua
Mixing Dynamic Code and Java
Perl
References
[1] Steve Vinoski. Ruby Extensions. Internet Computing, IEEE, Vol. 10, Issue 5. 2006. pp. 85-87.
[2] Michael Neumann. Cplus2Ruby - Gluing C++ and Ruby together in an OO manner. http://rubydoc.info/gems/cplus2ruby/1.2.0/frames