Both Java and C# (as well as many other JVM & CLR based languages) can be compiled directly to machine code . There have been attempts to do so since the early days of Java.
However, there is a *reason* why these approaches are rarely used in production anymore. The assumed speed gains don't usually pan out, except in narrow cases that are often better dealt with using native libs / JNI. (ex: you need Intel's MMX instructions for SIMD processing). A modern VM with advanced JITting can exceed the speed of real C/C++ code in many cases, and do far better than generated C code in most cases. Managed code running on a virtual machine is the future of software, plain and simple. *Everything* is moving in this direction. Even Apple's stack. (see the Ars Technica article on Snow Leopard). The benefits of compiling a higher level language like Java (much less something like Ruby) down to native machine code at compile time (vs runtime JIT compiling), are simply evaporating. Then you gain all of the headaches of having to recompile all of your jars, becoming more platform specific, etc. The *only* reason to use this approach for general application development is when there is something preventing you from using a virtual machine. ex: an Arduino board that doesn't have enough on memory for a VM, or lack of DRAM (ROM only storage + tiny heap), or for some legal reason (which is how we got here in the first place :). - Josh On Sep 14, 2009, at 10:10 AM, Fabrizio Giudici wrote: > > Massimo wrote: >> "C# was designed to always be compiled, Java was not." >> >> Wow, you have no idea what you are talking about. You are junking up >> this discussion group with nonsense. >> >> Maybe you should limit your posting to technologies that you've >> actually tried using. >> > I find rather annoying this kind of reply. :-) Especially people like > me, who hasn't got a deep knowledge of C#, would like to have some > proofing points: "you're wrong BECAUSE ...". > > The few things that I know about the topic are that Microsoft itself > released an experimental native compiler for C#, named Bartok: > > http://en.wikipedia.org/wiki/Bartok_%28compiler%29 > > OTOH in Java we have GCJ > > http://gcc.gnu.org/java/ > > but it's not a project from Sun. From what I remember, GCJ has always > been of poor quality, while Bartok was able to compile an operating > system (Singularity). Thus, it seems Microsoft has always had a deeper > attitude at getting compiled, native code than Sun. Since I've > professed > my ignorance about C#, this basic knowledge isn't enough to proof that > Josh is right - that's why I'd like to see a more objective discussion > on the topic, rather than some sentence at the personal level. > > > > -- > Fabrizio Giudici - Java Architect, Project Manager > Tidalwave s.a.s. - "We make Java work. Everywhere." > weblogs.java.net/blog/fabriziogiudici - www.tidalwave.it/blog > fabrizio.giud...@tidalwave.it - mobile: +39 348.150.6941 > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "The Java Posse" group. To post to this group, send email to javaposse@googlegroups.com To unsubscribe from this group, send email to javaposse+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/javaposse?hl=en -~----------~----~----~----~------~----~------~--~---