Is it possible to execute server-side javascript from a *Python* Google App Engine instance?
Asked Answered
B

4

16

A lot of questions have been asked and answered about running server-side javascript on Google App Engine, but all of the answers deal with Java instances in order to make use of Java-based JS interpreters like Rhino, Rhino for Webapps, etc.

Is there any way to execute server-side javascript code on a Python GAE instance? I'm thinking something exactly along the lines of pyv8, but with support for App Engine (which I guess would mean a pure python implementation of the interpreter).

The only solution I can come up with at the moment is to use some sort of gross hack to run a Java and Python GAE instance side-by-side (via different versions) so they can both talk to the same datastore, let the Java instance host the JS code, and use an API to talk back'n'forth. Not very appealing.

No need to get into all the "this is unnecessary, you shouldn't be doing this" discussion -- I know this isn't ideal and I'm simply curious if it can be done.

Brockman answered 13/11, 2010 at 20:51 Comment(2)
You do not need any sort of a hack to run a Python and Java instance of the same app. Just upload them to different versions of the same application. Only one can be the default version, but that may not be a deal-breaker.Dawndawna
I added a clarification to my "gross hack" comment -- it's not that the two versions are a huge hack, it's just that having to run a Java and Python instance side-by-side to accomplish this feels gross.Brockman
S
3

As far as I can find: No

I've done a bit of searching, but it seems that nobody has tried to implement a pure Python Javascript engine, and I can't blame them: it would be a huge amount of work for very few use cases (unfortunately, yours is one of those). A couple of projects—Grailbrowser and Pybrowser—have Python code to render HTML, so might one day aim to run javascript, but it's not even started, and neither of them look in active development.

The most likely way it would ever happen is if Google were to offer the Parrot VM (which can run various dynamic languages) on Appengine. That's a cool idea, but I'm not holding my breath.

Schuller answered 13/11, 2010 at 22:28 Comment(0)
D
2

What might work is to run Jython (and Rhino) in a Java instance. Of course, then you'd have to get to any App services through the Java API, not the Python one, which would be ugly.

Donegan answered 8/1, 2011 at 15:29 Comment(0)
E
1

Actually, it can indeed be done, using either AppEngineJs or ESXX:

http://www.appenginejs.org/

http://esxx.blogspot.com/2009/06/esxx-on-google-app-engine.html

Encephalitis answered 20/3, 2011 at 20:45 Comment(1)
This is still a Rhino solution for the java AppEngine API.Densmore
N
0

I am currently trying to solvevthe same problem with PyJON

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

Seems to be a pure Python JavaScrit parser an interpreter.

Naldo answered 29/4, 2012 at 4:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.