Secure Coding mailing list archives

Could I use Java or c#? [was: Re: re-writing college books]


From: crispin at novell.com (Crispin Cowan)
Date: Thu, 09 Nov 2006 14:48:39 -0800

ljknews wrote:
At 4:18 PM +0100 11/9/06, SZALAY Attila wrote:
  
Hi Al,

On Thu, 2006-11-09 at 08:47 -0500, ljknews wrote:
    
I think you are mixing the issue of Java vs. C* with the issue of
interpreters vs compiled languages.
      
I agree with LJ: language issues aside, I detest bytecode interpreters.
Prior to Java, resorting to compiling to byte code (e.g. P-code back in
the Pascal days) was considered a lame kludge because the language
developers couldn't be bothered to write a real compiler. The innovation
of Java was to describe this as a feature instead of a bug :)

Yes, you are totally right. Sorry.

But I have not seen java or c# compiler.
    
For Java, look at JGC <http://www.gnu.org/software/gcc/java/>. "It can
compile Java source code to Java bytecode (class files) or directly to
native machine code, and Java bytecode to native machine code."

For C#, the Mono compiler says
<http://www.mono-project.com/using/relnotes/1.0-features.html> that it
has "an advanced native optimizing compiler is available for x86, SPARC,
s390 and PowerPC available in both an ahead-of-time (AOT) compilation
mode to reduce startup time and take advantage of all available
optimizations and a Just-in-Time (JIT) compilation mode."

However, having native code generation is different from having good
support in GDB for you generated code :) Without GDB support, the
debugger will treat your binaries like they were written in hand
assembly, and not be able to relate core dumps to high level constructs
like variables and lines of source code. Current status:

    * For Java: From the JGC FAQ <http://gcc.gnu.org/java/faq.html#1_6>,
      "gdb 5.0 <ftp://ftp.gnu.org/pub/gnu/gdb/> includes support for
      debugging gcj-compiled Java programs. For more information please
      read Java Debugging with gdb <http://gcc.gnu.org/java/gdb.html>."
    * For C#: There is a Mono Debugger
      <http://www.mono-project.com/Debugging>, but it is not complete.

Crispin

-- 
Crispin Cowan, Ph.D.                      http://crispincowan.com/~crispin/
Director of Software Engineering, Novell  http://novell.com
     Hack: adroit engineering solution to an unanticipated problem
     Hacker: one who is adroit at pounding round pegs into square holes



Current thread: