Printer Friendly

Zaphod - Mozilla's new experiment, a JavaScript engine written in JavaScript!

India, Sept. 20 -- One might imagine, what is the point of having a JavaScript engine written in a traditionally slow language such as JavaScript itself? We don't want to delude you into thinking that everything done by the open source community has to have a reason, but this one does, and a good one at that.

While developing applications in any language of any kind, there is one thing which remains the same, the language syntax whether you like it or not. You cannot change how the interpreter / compiler itself works. What if you could?

Zaphod is just such an experiment. It is an add-on which bundles the Narcissus JavaScript engine with your browser, and lets you use it to run your JavaScript code instead of on the Firefox JaegerMonkey / TraceMonkey / SpiderMonkey engine directly.

While Narcissus is the JavaScript engine itself, it is not well integrated into the browser, and that is where Zaphod comes in. Zaphod integrates Narcissus into Firefox making it easier to use the alternative engine to run your code.

However, since your code will be running on a engine which itself is being interpreted as it runs, don't expect it to be blazing fast! Were you sacrifice on speed, you will gain in customizability. Narcissus allows you to develop modifications to the engine itself, and to test new features without needing to work with complicated low-level C / C++ code of Spidermonkey or some other JavaScript engine. You can in a sense "hack the language itself."

Another benefit Mozilla enlists is the ease with which you can share your ideas with others. Since the engine is now separate from the browser itself, you can modify it separately and share it separately.

Narcissus is simpler to down with that other JavaScript engine due to the fact that it is written in JavaScript itself, a language already familiar to any JavaScript programmers.

Since Narcissus isn't suitable for the JavaScript applications which a browser is likely to encounter on the web -such as GMail- it requires that developers make use of a special script tag for code which they want executed in the new engine. There is an option for having all the code run in the engine with a simple switch.

So if you're a JavaScript developer, who'd like to start playing with the language itself, Zaphod is the tool for you. To find out more about Zaphod head over to its page on Mozilla labs, and keep a towel handy.

For any query with respect to this article or any other content requirement, please contact Editor at

Copyright HT Media Ltd.

Provided by an company

COPYRIGHT 2010 SyndiGate Media Inc.
No portion of this article can be reproduced without the express written permission from the copyright holder.
Copyright 2010 Gale, Cengage Learning. All rights reserved.

Article Details
Printer friendly Cite/link Email Feedback
Date:Sep 20, 2010
Previous Article:7Stacks 1.5b1 [Download of the Day].
Next Article:Karbonn K1212 - dual-SIM, touchscreen, social networking phone hits the Indian market.

Terms of use | Privacy policy | Copyright © 2021 Farlex, Inc. | Feedback | For webmasters |