vmware-labs / webassembly-language-runtimes

Wasm Language Runtimes provides popular language runtimes (Ruby, Python, …) precompiled to WebAssembly that are tested for compatibility and kept up to date when new versions of upstream languages are released
Apache License 2.0
337 stars 29 forks source link

Publish Python outbound HTTP support #124

Closed ereslibre closed 11 months ago

ereslibre commented 1 year ago

Is your feature request related to a problem? Please describe.

Wasm Workers Server has an interface for allowing WebAssembly modules to make outbound HTTP requests.

Provide a Python interpreter based on our Python assets that has support for Python scripts to make HTTP requests by using the explicit HTTP wws interface.

This is the most straightforward solution in the sense that the python script needs to import wws_http (or some module name similar to this), and use this interface to make outbound HTTP requests.

A next step would be to integrate the Python standard library with this system, but this is a feature outside of the scope of this issue.

Describe the solution you'd like

A python script like the following:

import wws_http

_, _, status_code, success = wws_http.send_http_request(
  "https://google.com,
  "GET",
  [],
  [],
  ""
)

Will make a GET HTTP request to "https://google.com". This issue does not provide a suggestion on how the API should look like: a more idiomatic Python API is perfectly fine and desired.

New Python interpreters with WWS HTTP support are provided in the asset list of releases.

Describe alternatives you've considered

No response

Additional context

No response

ereslibre commented 1 year ago

Related: https://github.com/vmware-labs/wasm-workers-server/issues/176

ereslibre commented 11 months ago

This Python runtime will be provided in the wws repository.