Re: A 21st Century Apple II?
- From: Jason <jasonb19xx@xxxxxxxxx>
- Date: Wed, 11 Mar 2009 10:59:02 +0700
On 2009-03-10 23:51:15 +0700, Raymond Wiker <raw@xxxxxxxxxxxx> said:
Jason <jasonb19xx@xxxxxxxxx> writes:
Languages do have domains of applicability. For example, C++ is a
systems programming language. Among other things, you can implement
an operating system in it (for example Windows). Java is not a
systems programming language and is unsuitable for this type of use
because it must run on a JRE. In Java's defence, C++ is not really
suitable for writting web applets.
This is not a well-chosen example. The run-time requirements
of C++ are not that much different from Java - both need substantial
run-time support just to carry their own weight :-)
I think this statement is based at least partly on a misunderstanding of the difference between a programming language and a programming platform.
C++ is a programming language, Java is a programming platform.
C++ needs no run-time support to run. You can write C++ code which will live in an ROM without linking to any start up code or libraries (-nostartfiles, -nodefaultlibs g++ options). Furthermore, the code can be linked statically (-static g++ option) so that there is no dependence on any dynamically loaded libraries.
Java, by definition, runs on a Java Runtime Environment (JRE). Java programs are compiled into a bytecode which is interpreted by a virtual machine implemented on the host system. Some of these virtual machines support just-in-time (JIT) compilation which compiles the bytecode into native code when it is first loaded but they still require the presence of the JRE to function.
Several things should be apparent from the above:
First, because C++ does not require any external libraries or other support in order to execute code written in it, C++ programs can be many times smaller than their Java counterparts. This advantage becomes less significant with large programs that make heavy use of external libraries.
Second, Java is not a suitable systems programming language not only because it must run on top of a JRE, but also because the language deliberately avoids constructs which allow its users to access memory directly. The latter can certainly be addressed with native methods for direct access to memory/hardware although this would be considered poor design by most OS engineers and it still leaves the larger problem of the JRE remaining.
On one hand, I cannot think of any OS implemented in
either of these. That doesn't mean that they don't exist, but it's
hardly widespread. On the other hand, you have a language like Lisp,
which is "known" to be inefficient and a resource hog. This is
factually incorrect; Lisp has been used to implement the OSs of AI
workstations and there is even a story about a machine running an
interrupt handler in interpreted mode.
Were you aware that Microsoft Windows is implemented in C++? I can't think of an OS more widespread than it.
Being inefficient or a resource hog does not preclude a language from being used to implement an operating system.
Jason
.
- Follow-Ups:
- Re: A 21st Century Apple II?
- From: Raymond Wiker
- Re: A 21st Century Apple II?
- From: mdj
- Re: A 21st Century Apple II?
- References:
- A 21st Century Apple II?
- From: apple2freak
- Re: A 21st Century Apple II?
- From: apple2freak
- Re: A 21st Century Apple II?
- From: sicklittlemonkey
- Re: A 21st Century Apple II?
- From: apple2freak
- Re: A 21st Century Apple II?
- From: mdj
- Re: A 21st Century Apple II?
- From: apple2freak
- Re: A 21st Century Apple II?
- From: mdj
- Re: A 21st Century Apple II?
- From: apple2freak
- Re: A 21st Century Apple II?
- From: mdj
- Re: A 21st Century Apple II?
- From: apple2freak
- Re: A 21st Century Apple II?
- From: mdj
- Re: A 21st Century Apple II?
- From: JB
- Re: A 21st Century Apple II?
- From: John B. Matthews
- Re: A 21st Century Apple II?
- From: Michael J. Mahon
- Re: A 21st Century Apple II?
- From: Jason
- Re: A 21st Century Apple II?
- From: Raymond Wiker
- A 21st Century Apple II?
- Prev by Date: Re: IIgs slot 7 not responding
- Next by Date: Re: A 21st Century Apple II?
- Previous by thread: Re: A 21st Century Apple II?
- Next by thread: Re: A 21st Century Apple II?
- Index(es):
Relevant Pages
|