Programming Languages for the Java Virtual Machine

J

jrefactors

When we talk about Programming Languages for the Java Virtual Machine,
does it mean the programming language runs on top of JVM? In other
words, it will generate .class.

Please advise. thanks!!
 
B

ByteCoder

When we talk about Programming Languages for the Java Virtual Machine,
does it mean the programming language runs on top of JVM? In other
words, it will generate .class.

Please advise. thanks!!

Please elaborate, what do you mean?
 
S

Starshine Moonbeam

(e-mail address removed) ([email protected]) dropped a +5 bundle of
words...
When we talk about Programming Languages for the Java Virtual Machine,
does it mean the programming language runs on top of JVM? In other
words, it will generate .class.

Please advise. thanks!!

Your programming language for the JAVA Virtual Machine would be the Java
programming language.
 
I

Ian A. Mason

Try googling for these:

SKIJ
JScheme
SISC
Kawa
JLambda
SILK

They should lead you to examples, and papers.
 
T

Tony Morris


They are programming languages that produce Java bytecode (refer to the JVM
Specification).
The Java Programming Language (refer to the Java Language Specification)
compiles .java source files to Java .class files that contain Java bytecode.
Other programming languages compile to Java .class files that contain Java
bytecode too.
 
A

Ann

Tony Morris said:
They are programming languages that produce Java bytecode (refer to the JVM
Specification).
The Java Programming Language (refer to the Java Language Specification)
compiles .java source files to Java .class files that contain Java bytecode.
Other programming languages compile to Java .class files that contain Java
bytecode too.
Is it not true that of the Java byte codes produced
some are general purpose, but many are Java specific?
For example the byte codes generated to instantiate
a new Java class object probably would not work for
another language like C++?
 
T

Tony Morris

Ann said:
Is it not true that of the Java byte codes produced
some are general purpose, but many are Java specific?
For example the byte codes generated to instantiate
a new Java class object probably would not work for
another language like C++?

That question appears to be way out of context.
I can only suggest having a look at the VM spec.
 
C

Chris Uppal

Ann said:
Is it not true that of the Java byte codes produced
some are general purpose, but many are Java specific?

I've said this before, but I'm just about to say it again ;-)

The bytecodes understood by the JVM constitute a high-level OO programming
language. In fact the language (except for it's machine-oriented "syntax" --
binary bytecodes) is fairly similar to Java, although in several ways rather
more rather higher-level. The language features objects, classes, interfaces,
methods, static members and primitive types. It also features strong static
and dynamic typing (with rather more emphasis on dynamic typing than
Java-the-language, which is one reason I characterise it as rather higher
level).

All in all, the resemblance to Java is strong enough that (if you ignore the
new fluff that has been added to Java-the-language) the job of javac is better
thought of as mostly just /translation/ than compilation as it's usually
understood.

Any compiler for another language that is producing bytecode for JVM will be
doing much the same kind of work as it would if it were intended to produce
Java code as output. The difficulty of that will depend on how naturally the
concepts of the language map into "normal" Java OO programming (and on how
badly the type checking gets in the way, but that's another story).

-- chris
 
C

Chris Uppal

When we talk about Programming Languages for the Java Virtual Machine,
does it mean the programming language runs on top of JVM? In other
words, it will generate .class.

Yes, at least in the sense that it /must/ always generate data in the format of
a .class file, although there is no requirement that an actual physical file is
ever created -- it could just be binary data in memory.

-- chris
 
K

kt

Yes, it means that the language compiler will compile the program into
a .class file. So for example, if you were to design a language and a
compiler for say, BASIC, then the output of your compiler would be a
..class file.

If you're thinking of 'rolling your own' language for the JVM it is an
immensely rewarding experience. A few years back, I wrote a simple JVM
Basic compiler in Java. I'll never forget seeing the words 'Hello
World' output to the terminal for my first program. :)

These days, I think if I were to create another language, I would have
the compiler spit out a JAR file, rather than a .class.

--Kt
 
J

johndoe

Ian A. Mason said:
Try googling for these:

SKIJ
JScheme
SISC
Kawa
JLambda
SILK

They should lead you to examples, and papers.

For those who like Python, also check out "Jython".
 
O

opalpa

In regards to original poster's phrasing: "When we talk about
Programming Languages for the Java Virtual Machine" we are talking
about what you describe: languages that when compiled will run when
executed with the java command as that command is part of JRE -- Java
Runtime Environment. I am going to take a deeper look at Jython as
I've heard it produces .class files.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top