Javascript bytecode

Walter Bright newshound2 at digitalmars.com
Tue Dec 18 11:25:01 PST 2012


On 12/18/2012 10:29 AM, Peter Alexander wrote:
> On Tuesday, 18 December 2012 at 18:11:37 UTC, Walter Bright wrote:
>> Javascript proves that bytecode is not required for "write once, run
>> everywhere", which was one of the pitches for bytecode.
>>
>> What is required for w.o.r.e. is a specification for the source code that
>> precludes undefined and implementation defined behavior.
>
> Yes, bytecode isn't strictly required, but it's certainly desirable. Bytecode is
> much easier to interpret, much easier to compile to, and more compact.

Bytecode would have added nothing to js but complexity.

I think you're seriously overestimating the cost of compilation.


> The downside of bytecode is loss of high-level meaning... but that depends on
> the bytecode. There's nothing stopping the bytecode from being a serialised AST
> (actually, that would be ideal).

As I pointed out to Andrei, Java bytecode *is* a serialized AST.




More information about the Digitalmars-d mailing list