Bridging Worlds

Let's say you have massive amounts of Javascript.

Let's say you want to make the logic contained therein available to another language.

How would you go about that?

What we chose was compiling Omar Kilani's php-js extension which makes Mozilla's Javascript engine available as PHP extension.

This was totally sufficient in our case to extend existing testing procedures around the Javascript code. Developers can now run "make test" on the development server which will cause Javascript code to be tested. Thus we have incorporated something which was originally manual client-side testing into a completely automated test system.

Additionally, we will be able to avoid writing the same business logic in two languages. Instead, common parts can be written in JS and executed from another scripting language.

There are also modules for Perl and Python which embed the SpiderMonkey JS engine. Feel free to post links to other bindings.

Trackbacks

    No Trackbacks

Comments

Display comments as (Linear | Threaded)

  1. The artist formerly known as Arzt says:

    Awesome Sascha, thanks for that hint!


Add Comment


Standard emoticons like :-) and ;-) are converted to images.

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
CAPTCHA 1CAPTCHA 2CAPTCHA 3CAPTCHA 4CAPTCHA 5