Archives
 
 
 
  Special
 
 
 
  About Us
 
 
 

Newsletter
Free E-mail Newsletter from BYTE.com

 
    
           
Visit the home page Browse the four-year online archive Download platform-neutral CPU/FPU benchmarks Find information for advertisers, authors, vendors, subscribers Request free information on products written about or advertised in BYTE Submit a press release, or scan recent announcements Talk with BYTE's staff and readers about products and technologies

ArticlesJava for C++


May 1997 / Inbox / Java for C++

I agree with your point that though Java may be the largest installed software platform in the world, it still can't displace the OS that supports its run-time environment ("Today the Web, Tomorrow the World," January). Why isn't the industry trying to develop a Java-like run-time environment for C or C++? This would offer the stability of an established language along with the portability that is the hallmark of Java. A substantial portion of the huge installed base of C/C++ software could become availabl e across a range of platforms -- provided it isn't tied to OS-specific features. Of course, C/C++ compilers would have to be modified to generate something analogous to Java bytecode that can run in their own run-time environment or a C++ virtual machine.

Balaji Raghunathan
braghuna@stratacom.com

C/C++ programs, as you point out, often use OS- or CPU-specific features. Existing C/C++ software written to APIs and GUIs such as Win16, Win32, the Mac Toolbox, OS/2 Presentation Manager, or Unix Motif would have to be extensively rewritten. C/C++ by nature is a statically linked and compiled language. References to methods, for example, are resolved at link and compile time by a C/C++ compiler-linker. With Java, those references are not resolved until run time because Java programs load classes dynamically. It would take major reengineering to make C/C++ work like Java. Someone would have to write C/C++ virtual machines to run on all the major platforms, as well as develop a standard set of class libraries to abstract the OS-specific features of those platforms -- as Sun did for Java. Imagine the infighting over this evolution among the major vendors. Sun had the luxury of defining a new language from scratch.

There is an alternative: Other languages can target Java bytecode when they compile. Think of bytecode as the native instruction set of the Java virtual machine. It's already been done for Ada, and there have been experiments with a Smalltalk compiler. James Gosling, the father of Java, says that even Visual Basic could target bytecode. This opens up exciting possibilities.-- Tom R. Halfhill, senior editor


Up to the Inbox section contentsGo to previous article: Bus No BottleneckGo to next article: Platform AgnosticsSearchSend a comment on this articleSubscribe to BYTE or BYTE on CD-ROM  
Flexible C++
Matthew Wilson
My approach to software engineering is far more pragmatic than it is theoretical--and no language better exemplifies this than C++.

more...

BYTE Digest

BYTE Digest editors every month analyze and evaluate the best articles from Information Week, EE Times, Dr. Dobb's Journal, Network Computing, Sys Admin, and dozens of other CMP publications—bringing you critical news and information about wireless communication, computer security, software development, embedded systems, and more!

Find out more

BYTE.com Store

BYTE CD-ROM
NOW, on one CD-ROM, you can instantly access more than 8 years of BYTE.
 
The Best of BYTE Volume 1: Programming Languages
The Best of BYTE
Volume 1: Programming Languages
In this issue of Best of BYTE, we bring together some of the leading programming language designers and implementors...

Copyright © 2005 CMP Media LLC, Privacy Policy, Your California Privacy rights, Terms of Service
Site comments: webmaster@byte.com
SDMG Web Sites: BYTE.com, C/C++ Users Journal, Dr. Dobb's Journal, MSDN Magazine, New Architect, SD Expo, SD Magazine, Sys Admin, The Perl Journal, UnixReview.com, Windows Developer Network