http://qs321.pair.com?node_id=266624


in reply to Re: Re: Re: Re: Re: New JAVA Specification
in thread New JAVA Specification

So because perl has a speedy compiler and can invoke it during execution it is a scripting language while Java has a slow compiler and can't invoke it during execution and it isn't? I'd say that both cases are scripting languages - they both run on a VM and are interpreted. There's no fundamental distinction here that I can see.

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Re: Re: New JAVA Specification
by djantzen (Priest) on Jun 17, 2003 at 20:28 UTC

    I agree it's mushy territory, and will become more so with Perl 6 and its distinction between compiler and VM. But the difference between the languages is not just that Java keeps the two steps entirely separate, but also that the Java language is designed to achieve dynamic runtime behavior not through reliance upon a ready-to-hand compiler but on mechanisms like typecasting and classloading.

    One might view Java (and Perl 6 when people start releasing bytecode versions of their software (and you know they will :) ) as residing in an intermediate category between C et al and Perl 5 et al. That's the argument made in this article.


    "The dead do not recognize context" -- Kai, Lexx

      All of the languages C, C++, Java, Perl, BASIC are compiled. their source code is read by a lexer/parser and transformed into another form. BASIC (ok some forms of BASIC that I've been told do this) would be an interpreted language because it uses an iterative approach to the source - each line is individually read, parsed and executed. C and C++ are both compiled to another source code format - assembler which is itself compiled to serialized machine code targetting a particular processor. When I look at Java, Perl and emacs I see a similarity in that each compiles to an internal abstract form which is then executed by a virtual machine.

      I don't privilege the implementation of the virtual machine so that having an intermediate serialization of the compiler output separates one implementation from being scripted and the other not.

        Well okay, but then why privilege the distinction between VM and hardware? They're both targeted architectures after all. I think a critical distinquishing characteristic of an interpreted language is that the stages of lexing/parsing/emitting VM specific code/runtime are not strictly separate from one another, but the program can move between them at will via the likes of eval. In Java the separation of those steps is enforced not just in the de facto separation of tools, but in the way the language is intended to work. You compile, and only then do you run.


        "The dead do not recognize context" -- Kai, Lexx