Javascript bytecode

H. S. Teoh hsteoh at quickfur.ath.cx
Tue Dec 18 11:41:16 PST 2012


On Tue, Dec 18, 2012 at 10:11:37AM -0800, Walter Bright wrote:
> An interesting datapoint in regards to bytecode is Javascript. Note
> that Javascript is not distributed in bytecode form. There is no
> Javascript VM. It is distributed as source code. Sometimes, that
> source code is compressed and obfuscated, nevertheless it is still
> source code.
> 
> How the end system chooses to execute the js is up to that end
> system, and indeed there are a great variety of methods in use.
> 
> Javascript proves that bytecode is not required for "write once, run
> everywhere", which was one of the pitches for bytecode.

I never liked that motto of Java's. It's one of those things that are
too good to be true, and papers over very real, complex cross-platform
compatibility issues. I prefer "write once, debug everywhere". :-P


> What is required for w.o.r.e. is a specification for the source code
> that precludes undefined and implementation defined behavior.
[...]

What would you do with system-specific things like filesystem
manipulation, though? That has to be implementation-defined by
definition. And IME, any abstraction that's both (1) completely-defined
without any implementation differences and (2) covers every possible
platform that ever existed and will exist, is either totally useless
from being over-complex and over-engineered, or completely fails to
capture the complexity of real-world systems and the details required to
work with them efficiently.


T

-- 
WINDOWS = Will Install Needless Data On Whole System -- CompuMan


More information about the Digitalmars-d mailing list