cloudflare / python-worker-hello-world

Python hello world for Cloudflare Workers
Apache License 2.0
276 stars 48 forks source link

Python Libraries supported? #3

Closed cyberboysumanjay closed 4 years ago

cyberboysumanjay commented 4 years ago

Hey, I just explored this and the first impressions reflect that this thing uses Transcrypt to change python code to JavaScript and run it's equivalent code on workers. If I'm not wrong, In this way adding support of all python libraries is somewhat impossible.

Is there any way to support them as of now?

koeninger commented 4 years ago

The readme for the this project, our blog post describing support for compile to JS languages at https://blog.cloudflare.com/cloudflare-workers-announces-broad-language-support/ and the transcrypt docs at http://transcrypt.org/documentation#faq are pretty up front about what this and what the benefits and limitations are.

Python libraries that are purely python are likely to work, as long as you stay under the 1mb workers limit. Python libraries that depend on native code (eg. C or Fortran wrappers) won't work. Transcrypt does have an implementation of significant portions of the Numpy interface.