Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[RFC] Need to be able to compile only rustpython's virtual machine to wasm #1760

Copy link
Copy link
Open
@Joetib

Description

@Joetib
Issue body actions

Summary

RustPython in the web can be one of it's best use cases

The python community have been pushing to have python run in the browser.
Many such implementations have been brython, skulpt, Batavia etc.
Likened with batavia's approach to run python bytecode in the browser, I have been wondering if rustpytgon can ship only it's virtual machine to do similar task

Detailed Explanation

Rustpython's wasm module currently is about 4.5mb. thus size is too big to be inculcated in most projects.
However I believe if we could remove the parser, lexer and other compiler related stuff and compile only the virtual machine, the size will drastically reduce.
This approach will also require that apps get compiled on their maybe machines before the bytecode is shipped.

Drawbacks, Rationale, and Alternative

Rationale:

It will take a long time for RustPython to get to compete with cpython natively(where cpython works well already) but the web is one place where competition is less. If this works, we can have web apps fully written in python(little to no javascript)
Be able to run already existing software on the web.
This can also lead to the revolution of building front end livraries. Like implementing python alternatives to react, angular, Vue etc.
Currently, the beeware team have been working hard to have the Toga(beewae's gui library) working in browsers but are limited by the size of Batavia.
I may certain everyone loved Anvil.works for their idea of creating web apps completely in python.

Possible Drawback:

Since apps will need to be compiled before shipped and most people use cpython, rustpython's vm must be able to run cpython generated bytecode
This may not even be an issue but I raise this because I'm unaware of the bytecode implementation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    O-wasmRFCRequest for commentsRequest for comments

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.