66PythonMonkey is a Mozilla [ SpiderMonkey] ( https://firefox-source-docs.mozilla.org/js/index.html ) JavaScript engine embedded into the Python VM,
77using the Python engine to provide the JS host environment.
88
9- This product is in an early stage, approximately 65 % to MVP as of March 2023. It is under active development by Distributive Corp.,
9+ This product is in an early stage, approximately 80 % to MVP as of May 2023. It is under active development by Distributive Corp.,
1010https://distributive.network/ . External contributions and feedback are welcome and encouraged.
1111
1212The goal is to make writing code in either JS or Python a developer preference, with libraries commonly used in either language
@@ -30,15 +30,15 @@ this package to execute our complex `dcp-client` library, which is written in JS
3030- [ done] JS functions coerce to Python function wrappers
3131- [ done] JS exceptions propagate to Python
3232- [ done] Implement ` eval() ` function in Python which accepts JS code and returns JS->Python coerced values
33- - [ underway ] NodeJS+NPM-compatible CommonJS module system
33+ - [ done ] NodeJS+NPM-compatible CommonJS module system
3434- [ done] Python strings coerce to JS strings
3535- [ done] Python intrinsics coerce to JS intrinsics
36- - Python dicts coerce to JS objects
37- - Python ` require ` function, returns a coerced dict of module exports
36+ - [ done ] Python dicts coerce to JS objects
37+ - [ done ] Python ` require ` function, returns a coerced dict of module exports
3838- [ done] Python functions coerce to JS function wrappers
39- - CommonJS module system .py loader, loads Python modules for use by JS
39+ - [ done ] CommonJS module system .py loader, loads Python modules for use by JS
4040- JS object->Python dict coercion supports inherited-property lookup (via __ getattribute__ ?)
41- - Python host environment supplies event loop, including EventEmitter, setTimeout, etc.
41+ - [ done ] Python host environment supplies event loop, including EventEmitter, setTimeout, etc.
4242- Python host environment supplies XMLHttpRequest (other project?)
4343- Python host environment supplies basic subsets of NodeJS's fs, path, process, etc, modules; as-needed by dcp-client (other project?)
4444- Python TypedArrays coerce to JS TypeArrays
@@ -53,6 +53,7 @@ this package to execute our complex `dcp-client` library, which is written in JS
5353 - rust
5454 - python3.8 or later with header files (python3-dev)
5555 - spidermonkey 102.2.0 or later
56+ - npm (nodejs)
5657 - [ Poetry] ( https://python-poetry.org/docs/#installation )
5758 - [ poetry-dynamic-versioning] ( https://github.com/mtkennerly/poetry-dynamic-versioning )
5859
@@ -95,3 +96,23 @@ Type "help", "copyright", "credits" or "license" for more information.
9596```
9697
9798Alternatively, you can build a `wheel` package by running `poetry build -- format =wheel` , and install it by `pip install dist/* .whl` .
99+
100+ # # Examples
101+
102+ * [examples/ ](examples/ )
103+ * https:// github.com/ Distributive- Network/ PythonMonkey- examples
104+ * https:// github.com/ Distributive- Network/ PythonMonkey- Crypto- JS - Fullstack- Example
105+
106+ # Troubleshooting Tips
107+
108+ # # REPL - pmjs
109+ A basic JavaScript shell, `pmjs` , ships with PythonMonkey.
110+
111+ # # CommonJS (require)
112+ 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.
113+
114+ # ## Extra Symbols
115+ Loading the CommonJS subsystem declares some extra symbols which may be helpful in debugging -
116+ - `python.print` - the Python print function
117+ - `python.getenv` - the Python getenv function
118+
0 commit comments