Is java,j2me and j2se are written in C++

Can any one please tell me if java .j2se and j2me are written in C++
[75 byte] By [kauhsik_purohita] at [2007-11-27 2:25:18]
# 1
> Can any one please tell me if java .j2se and j2me are> written in C++ Does it matter?
notivagoa at 2007-7-12 2:33:27 > top of Java-index,Java Essentials,New To Java...
# 2
> Can any one please tell me if java .j2se and j2me are> written in C++The JVM is written in C++. So most Java programs rely on C++ to be run. I think this is quite funny especially when Java zealots claim Java will replace C++ anytime soon now.
notivagoa at 2007-7-12 2:33:27 > top of Java-index,Java Essentials,New To Java...
# 3
It might or might not, has or has not replaced it one domains, and not in others. KIDDING MODE onSome OS kernels are written in plain C. It ts funny especially when some C++ zealots claim that C++ will replace C anytime soon then or now. KIDDING MODE off
BIJ001a at 2007-7-12 2:33:27 > top of Java-index,Java Essentials,New To Java...
# 4
gh
forum4ua at 2007-7-12 2:33:27 > top of Java-index,Java Essentials,New To Java...
# 5

<kidding mode>

Many device drivers are written in assembler ...

Many bootstraps are written in FORTH ...

Almost all of FORTH is written in FORTH ... is written in FORTH ... is written in FORTH ... is written in FORTH ... is written in FORTH ... is written in FORTH ... is written in FORTH ... is written in FORTH ... is written in FORTH ... is written in FORTH ... is written in FORTH ... is written in FORTH ... is written in FORTH ... is written in FORTH ... is written in FORTH ... is written in FORTH ... is written in FORTH ... is written in FORTH

Stack overflow

</kidding mode>

ejpa at 2007-7-12 2:33:27 > top of Java-index,Java Essentials,New To Java...
# 6

> Some OS kernels are written in plain C. It ts funny

> especially when some C++ zealots claim that C++ will

> replace C anytime soon then or now.

C++ doesn't have to replace C because it swallowed it.

C is a subset of C++ so you can compile these OS kernels with a C++ compiler anytime you like.

ejpa at 2007-7-12 2:33:27 > top of Java-index,Java Essentials,New To Java...
# 7

> C is a subset of C++

Nope. C is not and was never intended to be a proper subset of C++. There are many syntax constructs in C that aren't supported in C++, and the semantics of C++ are much more restrictive.

> so you can compile these OS kernels with a C++ compiler anytime you like.

only because most C++ compilers can also be switched to 'C' mode.

Message was edited by:

ejp

ejpa at 2007-7-12 2:33:27 > top of Java-index,Java Essentials,New To Java...
# 8

> Can any one please tell me if java .j2se and j2me are

> written in C++

neither. they are written on paper. certain implementations of the JVMs and compilers may be written in C++, yes, but not all of them, ECJ - eclipse's compiler - is written entirely in java, for example. Suns reference compiler, javac, is also implemented partially in java. the point is, the specifications for VMs and compilers does not mandate a language to be used in implementing those specs

georgemca at 2007-7-12 2:33:27 > top of Java-index,Java Essentials,New To Java...
# 9

> > C is a subset of C++

>

> Nope. C is not and was never intended to be a proper

> subset of C++.

Well, how could it. C++ didn't even exist when C was conceived.

But the opposite is true. C++ is actually defined to be superset of C89 (with minor exceptions).

georgemca at 2007-7-12 2:33:27 > top of Java-index,Java Essentials,New To Java...
# 10

>> Nope. C is not and was never intended to be a proper

>> subset of C++.

> Well, how could it. C++ didn't even exist when C was conceived.

Sorry, I mis-spoke. C++ was never intended to contain C as a proper subset. Any of Stroustrup's writings will bear this out.

> But the opposite is true. C++ is actually defined to be superset of C89 (with

> minor exceptions).

Again I'm sorry, and we are getting very off-topic. but this is just not true either. The exceptions are far from minor. The ARM #18.2 lists at least sixteen, and some of them are major. For example, in C++ (a) the typechecking rules are far more restrictive, (b) prototype-less function declarations are not allowed, (c) there are significant differences in the scoping rules, and (d) there are no fewer than sixteen words which are reserved in C++ and not in C. (a) alone would eliminate practically every C++ program ever written from passing through a C++ compiler.

If you don't believe me, believe Andrew Koening: 'C++: As close as possible to C but no closer' (1989) and Stroustrup : 'The C subset of C++ is easier to learn for C/C++ novices and easier to use than C itself' (1994). In other words the C subset of C++ is significantly different from C.

ejpa at 2007-7-12 2:33:28 > top of Java-index,Java Essentials,New To Java...
# 11

> If you don't believe me, believe Andrew Koening:

> 'C++: As close as possible to C but no closer' (1989)

> and Stroustrup : 'The C subset of C++ is easier to

> learn for C/C++ novices and easier to use than C

> itself' (1994). In other words the C subset of C++ is

> significantly different from C.

You're wrong. According to the current C++ standard, C++ is comptible with C in the following way,

"With minor exceptions, C++ is a superset of C (meaning C89, defined by ISO/IEC 9899:1990)".

But C++ is not compatible with C standards deviating from C89 of course.

Message was edited by:

ronda

ejpa at 2007-7-12 2:33:28 > top of Java-index,Java Essentials,New To Java...
# 12

You need to go and read the 'minor exceptions' again like I did. Annex 'C' of the C++ standard, which describes them, goes on for twelve pages.

The claim that a kernel or even a non-trivial application written in C would get through a C++ compiler is ludicrous. C->C++ migrations are projects, not recompilations. Ever done one?

ejpa at 2007-7-12 2:33:28 > top of Java-index,Java Essentials,New To Java...
# 13

> You need to go and read the minor exceptions again

> like I just did. The claim that a kernel written in C

> would get through a C++ compiler is just not

> plausible. C->C++ migrations are projects, not

> recompilations.

Wrong again. A C++ compiler can compile C89 code (with minor exceptions) and the compiler can "diagnose every difference between C++ and C".

We're not talking about a C->C++ migration here. We're talking about a C->C89 migration because a C++ compiler is also a C89 compiler. If the C code doesn't follow the C89 standard then there's a problem of course.

ejpa at 2007-7-12 2:33:28 > top of Java-index,Java Essentials,New To Java...
# 14
Depends on the JVM. You can get versions written in C#, Java (1) and Lisp.1) Requires a JVM to run on, rather silly, but also quite cool.
mlka at 2007-7-12 2:33:28 > top of Java-index,Java Essentials,New To Java...
# 15

> Wrong again. A C++ compiler can compile C89 code

> (with minor exceptions) and the compiler can

> "diagnose every difference between C++ and C".

Those 'minor exceptions' take a dozen pages or so to explain. You

are wrong Ulrika and ejp is right. This is not a point of discussion;

it's a fact: ANSI/ISO C is not a strict subset of C++.

Even if a C program is compiled by a C++ compiler, chances are that

the outcome of the program won't be the same as if it were compiled

by a proper C compiler.

kind regards,

Jos

JosAHa at 2007-7-21 20:26:35 > top of Java-index,Java Essentials,New To Java...
# 16

> Wrong again

There was nothing for me to be wrong about in the first place, so I can't be 'wrong again'. An assertion that 'X is possible' requires some proof and/or some supporting arguments, and when counter-facts and counter-arguments are offered you need to address them.

If you want to address the substantive issues I raised please do so, but don't just keep repeating yourself, and don't just keep ignoring the twelve pages of differences, and the sixteen extra reserved words, and the different execution semantics, and the different scoping rules, ...

You also haven't considered the kind of code found inside C operating systems, where types are treated with considerable non-C++ abandon. Ever had a look at the Unix kernel?

Your new sidestep into a C->C89 migration is irrelevant. The original discussion and my comments concern the C and C++ languages.

And of course a 'proper subset with minor exceptions' is a contradiction in terms.

C programs without prototypes, or which contain any of the 16 reserved words, or ... etc etc etc are not part of the subset and are not C++ programs. If you had ever tried to compile any C, any dialect, no matter how well-written, into C++ you wouldn't keep repeating this claim. Have you ever done it? I asked that before - no reply.

And finally the phrase you quoted 'from the C++ standard' doesn't appear in ISO/IEC 14882:1998(E) Programming Languages - C++. Is it in the 2003 revision? Can you give a page and section reference?

ejpa at 2007-7-21 20:26:35 > top of Java-index,Java Essentials,New To Java...