5

Does anyone know of a JavaScript interpreter that has bindings to PHP or Python?

sorin
  • 161,544
  • 178
  • 535
  • 806
Seva Alekseyev
  • 59,826
  • 25
  • 160
  • 281

4 Answers4

2

You can try pyv8 - Google's v8 engine with Python bindings.

NG.
  • 22,560
  • 5
  • 55
  • 61
2

Try QtScript, from the Qt library:

from PyQt4 import QtScript
Edgar Bonet
  • 3,416
  • 15
  • 18
2

There's a previous discussion on embedding various languages into PHP.

re: Javascript in particular, Pecl Spidermonkey is mentioned; otherwise, not much to choose from.

Community
  • 1
  • 1
ianmclaury
  • 1,156
  • 6
  • 5
1

At now there is v8js-0.1.3 (beta) pecl package for PHP5.3.3+ You can easily install it like that (debian/ubuntu):

sudo apt-get install libv8-dev
sudo pecl install v8js-beta
sudo bash -c 'echo "extension=v8js.so" > /etc/php5/mods-available/_pecl.v8js.ini'
sudo ln -s ../mods-available/_pecl.v8js.ini /etc/php5/conf.d/30-v8js.ini

I've using _pecl prefix for pecl packages. Of course you can remove or change it as you wish.

Alex Yaroshevich
  • 710
  • 8
  • 19