<?xml version="1.0"?>
<rss version="2.0">
<channel>
  <title>Weiqi Gao&#039;s Observations - swig tag</title>
  <link>http://www.weiqigao.com/blog/tags/swig/</link>
  <description>Sharing My Experience...</description>
  <language>en</language>
  <copyright>Weiqi Gao</copyright>
  <lastBuildDate>Fri, 11 May 2012 12:48:36 GMT</lastBuildDate>
  <generator>Pebble (http://pebble.sourceforge.net)</generator>
  <docs>http://backend.userland.com/rss</docs>
  
  <image>
    <url>http://pebble.sourceforge.net/common/images/powered-by-pebble.gif</url>
    <title>Weiqi Gao&#039;s Observations</title>
    <link>http://www.weiqigao.com/blog/</link>
  </image>
  
  
  <item>
    <title>Java News Brief (JNB): SWIG</title>
    <link>http://www.weiqigao.com/blog/2006/01/02/java_news_brief_jnb_swig.html</link>
    
      
        <description>
          &lt;blockquote&gt;
&lt;p&gt;&lt;a href= &#034;http://www.ociweb.com/jnb/jnbJan2006.html&#034; &gt;Mark Volkmann&lt;/a&gt;:  Using SWIG reduces the amount of manual coding required to invoke C/C++ functions from other programming languages. In the case Java, JNI can be used directly, but this requires a large amount of tedious coding. Another benefit of using SWIG is that it is less error prone than manual coding. Correct use of JNI is complicated, especially for passing non-primitive types.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I think &lt;a href= &#034;http://www.swig.org/&#034; &gt;SWIG&lt;/a&gt; is something that is underreported and underutilized in the Java community.  And it is a very useful thing.  It promotes reuse and cuts down on the number of wheels that you have to reinvent.&lt;/p&gt;

&lt;p&gt;Aside from a couple of minor problems caused by smart dashes and location differences between i386 and x86_64, the sample run fine, both the Java and the Ruby version, on my newly built Fedora Core 4 AMD64 box:&lt;/p&gt;

&lt;pre style=&#034;margin-left:3em&#034;&gt;[weiqi@gao] $ &lt;b&gt;./running-swig-for-java&lt;/b&gt;
[weiqi@gao] $ &lt;b&gt;./running-the-java-application&lt;/b&gt;
Mark Volkmann is 44 years old.
Amanda Volkmann is 20 years old.
Mark Volkmann is older than Amanda Volkmann? true&lt;/pre&gt;

&lt;p&gt;And I haven&#039;t even installed the Sun JDK yet. ( Fedora Core 4 users are advised &lt;a href= &#034;http://fedora.redhat.com/docs/release-notes/fc4/#id2503931&#034; &gt;not to use&lt;/a&gt; the Java RPM provided by Sun.)  I&#039;m running with the Free Java (a mix of &lt;a href= &#034;http://gcc.gnu.org/java/&#034; &gt;gcj&lt;/a&gt;, &lt;a href= &#034;http://www.gnu.org/software/classpath/&#034; &gt;GNU Classpath&lt;/a&gt;, and &lt;a href= &#034;http://www.eclipse.org/&#034; &gt;Eclipse&lt;/a&gt;) that comes on the Fedora Core 4 CDs.&lt;/p&gt;
        </description>
      
      
    
    
    
    <comments>http://www.weiqigao.com/blog/2006/01/02/java_news_brief_jnb_swig.html#comments</comments>
    <guid isPermaLink="true">http://www.weiqigao.com/blog/2006/01/02/java_news_brief_jnb_swig.html</guid>
    <pubDate>Mon, 02 Jan 2006 15:17:11 GMT</pubDate>
  </item>
  
  </channel>
</rss>

