Java is interpreted, which means it's a scripting language, not a programming language. I don't see why people like to use it instead of a real programming language.
>>8
It's both, usually. It gets compiled to JVM bytecode¥. Depending on the JVM version and environment settings, this bytecode might then be interpreted, or it might be JIT compiled to native machine code to improve performance. In reasonably modern implementations, you'll typically see both happen within the same program.
.NET works the same way in theory, but Microsoft's compilers will just AOT compile everything by default.
¥This still counts as compilation even though the target isn't native machine code. Of course, JVM processors muddy this distinction, but we can ignore that for purely academic discussions like this one.
Name:
Anonymous2010-04-09 10:53
Java is both(JIT), but this discussion is pointless.
If you had read your SICP, you'd understand that a language which can be interpreted can also be compiled (Futamura's first projection), of course, this can also be done much more efficiently usually.
Any serious language should have a compiler, there can only be a few reasons why they don't have one:
1)Stupid or lazy language designer and/or coder. Too lazy to write a proper compiler (example: Python, Ruby, not counting 3rd party works, some of which are compilers now)
2)Language is rather complex(read: huge fucking mess) and making a compiler would be too much work(example: Perl, Ruby)
3)Language is so terribly designed from the core, that having it interpreted is more performant than having it compiled (example: newLISP and other Lisps using F-EXPRs, languages which abuse EVAL for everything - this is because they don't have macros, and instead emulate macros using EVAL and global or dynamic scope - this is a terrible way to design a language. Since the use of EVAL either means interpreting most things anyway, or calling the compiler each time, that effectively means an interpreter could be more efficient than a compiler, since a compiler would either waste a lot of time compiling code each time EVAL was called, or everything would run interpreted anyway).
There's also the middle ground, which is the JIT - things are compiled as needed and optimized at runtime, some things will run interpreted if that proves to be faster. JITs can be rather good and may in some cases be smarter than native compilation. .NET/JVM are such examples, however the VM's language is far from ideal, although it's nicely optimized by now.
So as you can see, if a language is interpreted-only, that means that either the language designers were lazy, didn't have coders, or the language is so terrible that it wouldn't benefit much from compilation.
>>12
No, I haven't, for I am not an Artist like you, thus I don't deserve fanmail, but I do get random thanks from random people all the time, even though I don't ask them for it.