Javascript bytecode

Walter Bright newshound2 at digitalmars.com
Fri Dec 21 12:32:02 PST 2012


On 12/21/2012 3:52 AM, Rainer Schuetze wrote:
> I think you don't need to care. The CPU can execute it as well without type
> information.
> If the data layout of the interpreter values is the same as for the interpreted
> architecture, all you need to know is the calling convention and the types of
> the arguments to the function to be executed and the return type.

CPU instructions are as unportable as you can get. All type information is lost, 
as well as all information as to where the values for things come from. Hence, 
such a format has dependencies on every module and switch it was compiled with, 
dependencies that cannot be accounted for if they change.

It cannot be inlined, no inferences can be made as to purity, and it's hard to 
see how CTFE could determine if a particular path through that code is supported 
or not by the CTFE.

In fact, it is useless as a means of importing module information - you might as 
well just link to that object code at link time.


More information about the Digitalmars-d mailing list