Lambda the Ultimate

inactiveTopic python - spidermonkey
started 12/28/2003; 8:32:07 AM - last post 12/29/2003; 8:57:31 AM
Ehud Lamm - python - spidermonkey  blueArrow
12/28/2003; 8:32:07 AM (reads: 9677, responses: 6)
python - spidermonkey
(via Daily Python-URL)

Python/JavaScript bridge module, making use of Mozilla's spidermonkey JavaScript implementation. Allows implementation of JavaScript classes, objects and functions in Python, and evaluation and calling of JavaScript scripts and functions respectively. Borrows heavily from Claes Jacobssen's Javascript Perl module, in turn based on Mozilla's 'PerlConnect' Perl binding.

Cross-language hacks are always worth a look.

Might even get our Javascript gurus excited... (You know, BeyondPython kind of thing...)


Posted to Python by Ehud Lamm on 12/28/03; 8:33:37 AM

Dan Shappir - Re: python - spidermonkey  blueArrow
12/28/2003; 1:29:17 PM (reads: 342, responses: 2)
> You know, BeyondPython kind of thing

Still need to finish the beyondRhino module. Unfortunately life keeps getting in the way ...

I wonder what the motivation here is. I can see the benefits of providing scripting functionality on top of a static compiled language like C++, even Java. But what is the point of putting one scripting language on top of another? Seems to me that if doing JavaScript on top of Python is somehow better than doing Python on top of Python, then Python has problems.

Ehud Lamm - Re: python - spidermonkey  blueArrow
12/28/2003; 1:59:06 PM (reads: 338, responses: 0)
To quote from the web page:

I wanted a way to interpret JavaScript with minimal dependencies, and to easily expose a Python DOM to JavaScript. This is used by DOMForm.

Patrick Logan - Re: python - spidermonkey  blueArrow
12/28/2003; 5:07:18 PM (reads: 317, responses: 0)
But what is the point of putting one scripting language on top of another? Seems to me that if doing JavaScript on top of Python is somehow better than doing Python on top of Python, then Python has problems.

One purpose might be to implement a system in Python but integrate other scripting languages for those who prefer them. This could especially be true of JS since it is the de facto standard web browser language, there are a lot of JS knowledgeable developers.

andrew cooke - Re: python - spidermonkey  blueArrow
12/28/2003; 6:26:59 PM (reads: 323, responses: 0)
I wonder what the motivation here is.

it means you can script xul in more than one language, i think. i know when i looked at xul some time ago i was disappointed to find that i needed to learn javascript to tie things together (i should add that this was before i realised that it was actually a cool little language - my only experience with it had been hacking html dynamically in pretty minor ways). at the time they were planning python support - i'm guessing this is it?

Dan Shappir - Re: python - spidermonkey  blueArrow
12/29/2003; 8:11:56 AM (reads: 261, responses: 1)
The author's stated reason for supporting JavaScript is very domain specific (evaluating JavaScript embedded in scrapped web pages). Thus, while the technology is cool, it doesn't merit the effort of constructing a general purpose tool like beyondPython.

The reason stated by Patrick is general enough, but in that case you wouldn't want to scare the "plain Joe javascripter" with Beyond functionality.

Bottom line, in this case you would probably want something like BeyondPython for Python rather than for JavaScript on top of Python.

Ehud Lamm - Re: python - spidermonkey  blueArrow
12/29/2003; 8:57:31 AM (reads: 268, responses: 0)
But that wouldn't be cool enough...