I wonder: Why is javac not written in Java...?

This is not a cry for help. Rather, it is something that my coworker and I have been debating with no sane result.

The question is: Why did Sun not code the javac-compiler as a pure Java-program (using bootstrap methods, of course - need to start somewhere)? After all, my coworker argues, this only shows that Sun does not trust the speed (and sanity) of the language enough to code the compiler itself in the language.

When I protest and say something like "does it matter" or "somebody alread did it", my coworker returns with "it matters, because this is a weak spot in Sun's argumentation of Java being an all-purpose programming language, since they themnselves does not want to release a critical tool written in the language itself".

But how come?

[788 byte] By [naansofta] at [2007-11-26 15:36:33]
# 1
Why do you think javac is not written in the Java programming language?You can look at the source code at https://openjdk.dev.java.net/compiler/The program javac.exe is a small program which starts the JVM and runs com.sun.tools.javac.Main which it finds in tools.jar.
PeterAhea at 2007-7-8 21:54:16 > top of Java-index,Developer Tools,Java Compiler...
# 2
Well, none of us was aware of this - has this always been the case?Thank you for the answer (and link), this opens quite some new perspectives!
naansofta at 2007-7-8 21:54:16 > top of Java-index,Developer Tools,Java Compiler...
# 3

Peter, as far as I can see, your draft uses facillities from ver. 1.5 and 1.6 of Java. In a narrow sense, that is OK, but if I look into the API descriptions, the API's are stamped with the word Since 1.6.

So:

- did javac always called the JVM with a compiler class ?

- and was that documented before version 1.5 ?

I guess I have to look around in the old Times :-/

naansofta at 2007-7-8 21:54:16 > top of Java-index,Developer Tools,Java Compiler...
# 4
> Well, none of us was aware of thisSpeak for yourself. I've been aware of it since 1997 when I first used Java.
ejpa at 2007-7-8 21:54:16 > top of Java-index,Developer Tools,Java Compiler...
# 5
> > Well, none of us was aware of this> > Speak for yourself. I've been aware of it since 1997> when I first used Java.I think he meant "us" as him and his friend.
jwentinga at 2007-7-8 21:54:16 > top of Java-index,Developer Tools,Java Compiler...
# 6
his invisible friend?
ejpa at 2007-7-8 21:54:16 > top of Java-index,Developer Tools,Java Compiler...
# 7
> his invisible friend?Sound like you are talking down to me. Could be that you have had a bad hair day today? If you read my first part in this conversation, you could have found out that I am referring to myself and a coworker.
naansofta at 2007-7-8 21:54:16 > top of Java-index,Developer Tools,Java Compiler...
# 8
That's right, ignore the content.The Sun Java compiler has been written in Java since at least 1997, probably several years longer, subsequent to the initial bootstrap.
ejpa at 2007-7-8 21:54:16 > top of Java-index,Developer Tools,Java Compiler...
# 9

I understand that now. And I think that this is a little important information that teachers / salepersons / magazines forgot to point out. If anything, it demonstrates that Java is (and obviously has been) self-contained and fast enough to be usd as its own tool.

Thanx for the input, guys - and back to code.

naansofta at 2007-7-8 21:54:16 > top of Java-index,Developer Tools,Java Compiler...
# 10

no, it's not important.

Most people working with Java couldn't care less what the compiler is written in, and people not working with Java usually don't care either.

They just want their software to work, whatever tools are used to create it and whatever language those tools are written in.

jwentinga at 2007-7-8 21:54:16 > top of Java-index,Developer Tools,Java Compiler...
# 11

jwenting, please allow me to quote from my original:

When I protest and say something like "does it matter" or "somebody alread did it", my coworker returns with "it matters, because this is a weak spot in Sun's argumentation of Java being an all-purpose programming language, since they themnselves does not want to release a critical tool written in the language itself".

If anything, it would help if you read what I wrote.

EOD - unless you really want to add some last not-inspiring words.

naansofta at 2007-7-8 21:54:16 > top of Java-index,Developer Tools,Java Compiler...
# 12

> jwenting, please allow me to quote from my original:

>

> When I protest and say something like "does it

> matter" or "somebody alread did it", my coworker

> returns with "it matters, because this is a weak

> spot in Sun's argumentation of Java being an

> all-purpose programming language, since they

> themnselves does not want to release a critical tool

> written in the language itself".

Anyway, I think jwenting's response was not to your original post but instead to your last reply:

"I think that this is a little important information that teachers / salepersons / magazines forgot to point out. ".

He was just pointing out that it doesn't matter what language a compiler is written in. When I am looking at what language to use, whether or not the compiler was written in the same language is not a factor to me.

zadoka at 2007-7-8 21:54:16 > top of Java-index,Developer Tools,Java Compiler...
# 13
And as you've just proven, it's generally rather difficult to tell what language a compiler is implemented in ;-) so how could it be a factor?
ejpa at 2007-7-8 21:54:16 > top of Java-index,Developer Tools,Java Compiler...
# 14
> After all, my coworker argues, this only> shows that Sun does not trust the speed (and sanity)> of the language enough to code the compiler itself in> the language.Your co-worker obviously made a poor assumption
CarrieHunta at 2007-7-8 21:54:16 > top of Java-index,Developer Tools,Java Compiler...