• Post Reply Bookmark Topic Watch Topic
  • New Topic

Java question  RSS feed

 
Terry Rickson
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

Can anyone tell me what programming language Java was written in? and also how did they program the first programming language without a programming language?

Thanks alot in a advance!
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Terry,

Welcome to JavaRanch!

First, a bit of business: you may not have read our naming policy on the way in. It requires that you use a full, real (sounding) first and last name for your display name. "Handles" don't work here. You can change your display name
here.
Thanks!

Furthermore, please don't post the same question to multiple forums -- it just wastes people's time answering questions that have already been answered. I deleted the other copy of this you posted.

Now, on to your question: Sun's JVMs are written in C with a little assembly language. The compiler "javac" and many other tools are actually written in Java! This is actually rather common; it's called "bootstrapping." You write a small compiler (the "stage 1 compiler") for a subset of a language A in whatever other language B you can. You then write a compiler (the "stage 2 compiler") in that same subset of language A, and compile it with the stage 1 compiler. Then you can compile the stage 2 compiler with itself! The next step is to write a compiler (the "stage 3 compiler") for the full language A using the subset that the stage 2 compiler understands. Now you've got a compiler for language A written in language A!

How was the very first high-level-language compiler written? In assembly language. How was the very first assembler written? In machine language, by putting together the raw machine instructions by hand.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!