As people have commented, I'm suggesting writing a javascript function which takes pre-compiled bytecode; like so;
function interpret(bytecode) {
// stack machine implementation goes here
}
And called like so;
var bytecode = load("http://my.domain.com/myscript.bytecode");
interpret(bytecode);
I'm not suggesting that bytecode is inherently slow -- just that I could take a great stab at writing a slow bytecode interpreter in JavaScript. ;)
So under this scheme, you could do a server-side compilation of any language -- let's imagine Pascal as an example -- and deliver it back to the client as bytecode. Now you've broken the browser dependence on Javascript. At the cost of a VM written in JavaScript.
I'm suggesting writing a javascript function which takes pre-compiled bytecode
Sorry, I misunderstood.
Now you've broken the browser dependence on Javascript. At the cost of a VM written in JavaScript.
I keep looking at these two sentences again. On one hand I know what you mean. On the other hand, this doesn't make any sense because it contradicts itself. (Which is why I misunderstood the original comment, I think.)
So under this scheme, you could do a server-side compilation of any language -- let's imagine Pascal as an example -- and deliver it back to the client as bytecode. Now you've broken the browser dependence on Javascript. At the cost of a VM written in JavaScript.