Search: 
 

Home
Overview
Search
Mailing lists
Forum
FAQ
 

Languages

Java is the preferred language for GSRC Software, though C++ is acceptable.

Java

Software written in Java should run under the most recent released version of the Sun JDK.

Rationale:

  • Java software is somewhat more portable between platforms than C/C++ software, though 'write once, test everywhere' applies.
  • Java includes useful features that are not found in a portable fashion in C++: garbage collection, packages, array bounds checking
  • Java includes off the shelf packages for things like database access, user interfaces, graphics, sound, CORBA
  • We encourage Java developers to create high quality applet demonstrations of their work. Applets provide an easy way to let web visitors browse software packages without downloading and compiling packages.
    Ideally, Java applets should run in a vanilla JDK1.1 compliant browser. However, Java applets may also use the JDK1.2 plugin
  • C++

    The preferred C++ compiler is the most recent version of the GNU g++ compiler. Java is the preferred language, C++ should only be used when
    1. The performance of Java can be demonstrated with benchmarks as not being sufficient when compared with C++ benchmarks.
    2. There is already a large body of legacy C++ code. C++ authors are encouraged to look at the Java Native Interface (JNI) as a way of combining C++ and Java
    3. To make up for deficiencies in C++, authors should consider using assertions, memory access checkers such a Purify and providing high coverage test suites.
    4. Joe Buck's G++ FAQ is a great resource: http://www.cygnus.com/misc/g++FAQ_toc.html

    binutils

    The issue of whether GSRC C++ software requires binutils is unresolved at this time.

    Sharing libraries between GNU and Sun C++ compilers

    Igor Markov points out that it is nearly impossible to share code between GNU and Sun C++ compilers if templates are involved. Sharing libraries between GNU and Sun C compilers can be tricky enough.

    Scripting languages

    Perl

    Perl certainly has the most vocal community of all the scripting languages. Well documented and easily read Perl scripts are permitted. Hyperoptimized Perl scripts should be avoided.

    Bourne Shell

    Bourne shell is the preferred language for small scripts, since it is likely to be on most platforms, and can easily be use inside makefiles

    Tcl

    The Ptolemy project has shown good results using Tcl as a glue language for writing regression tests. The use of Tcl for regression tests is not mandated, but it is encouraged. Tcl should probably not be used for other scripting tasks, try using Bourne shell instead.

    C Shell

    C Shell scripts should be avoided, /bin/csh is not everywhere. Cygwin comes with bash, which is basically a superset of csh. Bourne shell can do basically everything that C Shell can do, though sometimes Bourne shell is not as clean.

    If you really want C Shell, and Bourne shell will not work for you, then consider using Perl.2

    For more details about csh issues, see http://gonzo.tamu.edu/csh.whynot.html which basically says, use Bourne shell or Perl.

    Other Languages

    Other Languages, such as C, Common Lisp or what have you are considered legacy languages, and using them for new projects is not encouraged. However, individual projects may find their use appropriate.
     
    You are not logged in
    ©1998-2008 GSRC