|
3 | 3 |  |
4 | 4 |
|
5 | 5 | ## About |
6 | | -PythonMonkey is a Mozilla [SpiderMonkey](https://firefox-source-docs.mozilla.org/js/index.html) JavaScript engine embedded into the Python VM, |
| 6 | +[PythonMonkey](https://pythonmonkey.io) is a Mozilla [SpiderMonkey](https://firefox-source-docs.mozilla.org/js/index.html) JavaScript engine embedded into the Python VM, |
7 | 7 | using the Python engine to provide the JS host environment. |
8 | 8 |
|
9 | | -This product is in an early stage, approximately 80% to MVP as of July 2023. It is under active development by Distributive Corp., |
10 | | -https://distributive.network/. External contributions and feedback are welcome and encouraged. |
| 9 | +This product is in an early stage, approximately 80% to MVP as of July 2023. It is under active development by [Distributive](https://distributive.network/). |
| 10 | +External contributions and feedback are welcome and encouraged. |
11 | 11 |
|
12 | | -The goal is to make writing code in either JS or Python a developer preference, with libraries commonly used in either language |
13 | | -available eveywhere, with no significant data exchange or transformation penalties. For example, it should be possible to use NumPy |
14 | | -methods from a JS library, or to refactor a slow "hot loop" written in Python to execute in JS instead, taking advantage of |
15 | | -SpiderMonkey's JIT for near-native speed, rather than writing a C-language module for Python. At Distributive, we intend to use |
16 | | -this package to execute our complex `dcp-client` library, which is written in JS and enables distributed computing on the web stack. |
| 12 | +### tl;dr |
| 13 | +```bash |
| 14 | +$ pip install pythonmonkey |
| 15 | +``` |
| 16 | +```python |
| 17 | +from pythonmonkey import eval as js_eval |
| 18 | + |
| 19 | +js_eval("console.log")('hello, world') |
| 20 | +``` |
| 21 | + |
| 22 | +### Goals |
| 23 | +- **Fast** and memory-efficient |
| 24 | +- Make writing code in either JS or Python a developer preference |
| 25 | +- Use JavaScript libraries from Python |
| 26 | +- Use Python libraries from JavaScript |
| 27 | +- Same process runs both JS and Python VMs - no serialization, pipes, etc |
17 | 28 |
|
18 | 29 | ### Data Interchange |
19 | 30 | - Strings share immutable backing stores whenever possible (when allocating engine choses UCS-2 or Latin-1 internal string representation) to keep memory consumption under control, and to make it possible to move very large strings between JS and Python library code without memory-copy overhead. |
|
0 commit comments