denosaurs / denosaurs/deno_python

Synchronous Python & async JavaScript?

Open
#36 1 comment 0 reactions 0 assignees View on GitHub
question
Dominant language
TypeScript
Stars
762
Forks
26
PR merge metrics
No merged PRs in 30d

Description

In contrast to most JavaScript code, Python libraries often work synchronously and may even expect one's callback function to resolve synchronously, even if that doesn't make sense in JavaScript environment. One example might be the [`audible`](https://audible.readthedocs.io/en/latest/index.html) Python package that performs all HTTP requests synchronously and expects a [synchronous callback to show an image to the user and get their response](https://audible.readthedocs.io/en/latest/auth/authorization.html#authorization).

I have no experience with Deno's FFI yet, but it seems to me that calling synchronous Python functions asynchronously should be possible, as the Python interpreter runs in a different thread. Similarly, I would expect "converting" asynchronous JS functions to synchronous Python callbacks should be possible, if one blocks the Python interpreter until the JS promise is settled.

Is this something that sounds viable to you? And if so, is this something you'd be interested in adding to this library?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.