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
327 stars 27 forks source link

Publish Python outbound HTTP support #124

Closed ereslibre closed 8 months ago

ereslibre commented 9 months 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 9 months ago

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

ereslibre commented 8 months ago

This Python runtime will be provided in the wws repository.