Skip to content

Navigation Menu

Sign in
Appearance settings

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

Embedding a wasm interpreter #5229

mocenigo started this conversation in General
Apr 16, 2024 · 2 comments · 2 replies
Discussion options

I understand that the intepreter is used if RustPython is embedded in an application, like an editor. Would it be possible to use also, say, wasmtime instead? So the editor would be scripted by RustPython but the code would be compiled to WASM (and maybe from that to native) rather than interpreted?

You must be logged in to vote

Replies: 2 comments · 2 replies

Comment options

If you mean running python scripts using RustPython in wasm, it is possible. Please try wasm or wasi target.

You must be logged in to vote
2 replies
@mocenigo
Comment options

So, for instance, a text editor that is scripted with RustPython would be able to use RustPython as an interpreter AND also compile the program to WASM with WASI and have the same functionality (but potentially better speed). Cool.

@youknowone
Comment options

rustpython doesnt compile python code to wasm, if you meant that. It will not improve performance.

Comment options

rustpython doesnt compile python code to wasm, if you meant that. It will not improve performance.

The project description states “ RustPython is a Python interpreter written in Rust. RustPython can be embedded into Rust programs to use Python as a scripting language for your application, or it can be compiled to WebAssembly in order to run Python in the browser.

So that’s where my confusion arose. It is not immediately clear.

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.