You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- 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.
31
-
- TypedArrays to share mutable backing stores; if this is not possible we will implement a copy-on-write (CoW) solution.
31
+
- TypedArrays share mutable backing stores.
32
32
- JS objects are represented by Python dicts
33
33
- JS Date objects are represented by Python datetime.datetime objects
34
34
- Intrinsics (boolean, number, null, undefined) are passed by value
@@ -86,9 +86,9 @@ For VSCode users, similar to the Build Task, we have a Test Task ready to use.
86
86
87
87
## Using the library
88
88
89
-
### Install from [PyPI](https://pypi.org/project/pythonmonkey/)
89
+
> npm (Node.js) is required **during installation only** to populate the JS dependencies.
90
90
91
-
> PythonMonkey is not release-ready yet. Our first public release is scheduled for mid-June 2023.
91
+
### Install from [PyPI](https://pypi.org/project/pythonmonkey/)
92
92
93
93
```bash
94
94
$ pip install pythonmonkey
@@ -116,7 +116,12 @@ Type "help", "copyright", "credits" or "license" for more information.
116
116
'Hello from Spidermonkey!'
117
117
```
118
118
119
-
Alternatively, you can build a `wheel` package by running `poetry build --format=wheel`, and install it by `pip install dist/*.whl`.
119
+
Alternatively, you can build installable packages by running
120
+
```bash
121
+
$ cd python/pminit && poetry build --format=sdist && cd -&& mv -v python/pminit/dist/* ./dist/
122
+
$ poetry build --format=wheel
123
+
```
124
+
and install them by `pip install ./dist/*`.
120
125
121
126
## Debugging Steps
122
127
@@ -135,6 +140,16 @@ If you are using VSCode, it's more convenient to debug in [VSCode's built-in deb
135
140
## API
136
141
These methods are exported from the pythonmonkey module.
137
142
143
+
### eval(code, evalOpts)
144
+
### isCompilableUnit(code)
145
+
### collect()
146
+
### bigint(int)
147
+
### `SpiderMonkeyError`
148
+
### `JSObjectProxy`
149
+
### `null`
150
+
151
+
See definitions in [python/pythonmonkey/pythonmonkey.pyi](python/pythonmonkey/pythonmonkey.pyi).
152
+
138
153
### require(moduleIdentifier)
139
154
Return the exports of a CommonJS module identified by `moduleIdentifier`, using standard CommonJS
If you are having trouble with the CommonJS require function, set environment variable DEBUG='ctx-module*'and you can see the filenames it tries to laod.
351
+
If you are having trouble with the CommonJS require function, set environment variable `DEBUG='ctx-module*'`and you can see the filenames it tries to laod.
313
352
314
353
## pmjs
315
354
- there is a `.help` menu in the REPL
316
355
- there is a `--help` command-line option
317
356
- the `-r` option can be used to load a module before your program or the REPL runs
318
357
- the `-e` option can be used evaluate code -- e.g. define global variables -- before your program or the REPL runs
319
-
- The REPL can evaluate Python expressions, storing them in variables named `$1`, `$2`, etc. ```
320
-
# pmjs
358
+
- The REPL can evaluate Python expressions, storing them in variables named `$1`, `$2`, etc.
0 commit comments