views:

136

answers:

2

Hi all,

When javascript is run in a browser

alert('Hello World');

What environment executes it and manages it in memory?

I know this is vaugue! But thats the best place to start!

+3  A: 

This depends on the browser, The JavaScript engine, and what you mean by 'executes it'

There is not much of an answer to give.

Look at some JavaScript engine's architectures ...

http://www.mozilla.org/js/spidermonkey/

http://code.google.com/p/v8/

If you want to explore deeper, maybe read the first few chapters of the Dragon Book to learn a bit about how programs are interpreted and/or compiled to some intermediate or bytecode form.

Good Luck

Aiden Bell
+4  A: 

The browser's javascript engine.

Here's a page that compares the performance of a bunch

Peter Bailey
thankyou! can you exeucute javascript from c#
divinci
Link to an engine's c# bindings http://stackoverflow.com/questions/172753/embedding-javascript-engine-into-net-c
Aiden Bell