是否有用 Python 编写的 JavaScript (ECMAScript) 实现?
是否有任何用纯 Python 编写的 JavaScript (ECMAScript) 实现?即使它的实施很慢也没关系。
Are there any JavaScript (ECMAScript) implementations written in pure Python? It is okay even if its implementation is very slow.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
您听说过 PyV8 吗?它是 Google V8 JavaScript 引擎的 Python 包装器。这可能就是您正在寻找的。
Have you heard of PyV8? It's a Python wrapper of Google's V8 JavaScript engine. It may be what you're looking for.
似乎不再处于积极开发状态,但您可以查看
pynarcissus
、http://code.google.com/p/pynarcissus/source/browse/trunk/jsparser.py似乎是到 V8 的绑定(JavaScript 解释器Google Chromium)也可用,http://www.advogato.org/article/985.html< /a>
Doesn't seem to be under active development anymore but you could check out
pynarcissus
, http://code.google.com/p/pynarcissus/source/browse/trunk/jsparser.pySeems like a binding to V8 (JavaScript interpreter in Google Chromium) is available also, http://www.advogato.org/article/985.html
有一个用 RPython(Python 的子集,也就是说,它像普通 Python 一样运行)编写的,完整性级别未知: https://bitbucket.org/pypy/lang-js/overview
There is one, of an unknown level of completeness, written in RPython (a subset of Python, that is to say, it runs as normal Python): https://bitbucket.org/pypy/lang-js/overview
您可能需要查看 pydermonkey 或 python-spidermonkey,我相信,这两个都是 Mozilla javascript 解释器的 python 实现。
You may want to take a look at pydermonkey or python-spidermonkey, both of which, I believe, are python implementations of the Mozilla javascript interpreter.
我建议您在本地开发盒上坚持使用 Node.js,将 CoffeeScript 文件转换为 JavaScript,然后将翻译后的脚本部署到您的应用程序中。
我知道您希望避免在服务器上安装 Node.js,这很公平而且很好。在我看来,使用 Python 调用 JavaScript 来翻译 CoffeeScript 似乎比其价值更麻烦。
I would recommend that you just stick to node.js on your local development box, translate your CoffeeScript files over to JavaScript, and deploy the translated scripts with your apps.
I get that you want to avoid having node.js on your servers, that's all fair and good. Jumping through hoops with Python invoking JavaScript to translate CoffeeScript seems more hassle to me than it's worth.
我创建了 Jispy 将 JS 嵌入到 Python 中。
来自文档:
它配备了交互式控制台,因此您可以立即启动并运行。
希望这有帮助。
I created Jispy to embed JS in Python.
From the docs:
It comes with an interactive console, so you can get up and running in no time.
Hope this helps.