https://github.com/ubolonton/denopy
Deno binding for Python
https://github.com/ubolonton/denopy
binding deno javascript pyo3 python rust
Last synced: 5 months ago
JSON representation
Deno binding for Python
- Host: GitHub
- URL: https://github.com/ubolonton/denopy
- Owner: ubolonton
- License: bsd-3-clause
- Created: 2024-01-07T04:23:55.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-19T02:06:33.000Z (almost 2 years ago)
- Last Synced: 2025-03-16T21:51:15.858Z (over 1 year ago)
- Topics: binding, deno, javascript, pyo3, python, rust
- Language: Rust
- Homepage:
- Size: 56.6 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# DenoPy (WIP)
Bare-minimum binding of `deno_core`, for embedding JavaScript in Python.
Example:
```python
import denopy
r = denopy.Runtime()
r.eval("['1', '2', '3'].map(parseInt)")
```
## Notes
- This supports only blocking JavaScript, not `async/await`.
- Most JavaScript embedding use cases I've seen so far involve pure logic, not I/O.
- Juggling `async/await` across 3 languages is a lot of work.
- Deno has multiple layers, in decreasing order of functionalities: `cli` -> `deno_runtime` -> `deno_core` -> `v8`. The first 2 are not stable, so we bind the 3rd one. This means:
- No TypeScript.
- No [npm module import](https://docs.deno.com/runtime/manual/node).