Skip to content
This repository has been archived by the owner on May 31, 2020. It is now read-only.

Compiling a module to bytecode in the build process #759

Open
lielfr opened this issue Oct 19, 2018 · 1 comment
Open

Compiling a module to bytecode in the build process #759

lielfr opened this issue Oct 19, 2018 · 1 comment

Comments

@lielfr
Copy link
Contributor

lielfr commented Oct 19, 2018

Hi.
So, I'm trying to implement the exec builtin. As you may know, it requires the ability to execute python code directly from batavia, which AFAIK is not possible because CPython is required for compiling into bytecode.
The two possibilites I though about are implementing a compiler in javascript and making a bridge module and compiling it when building batavia.
Which one is better for that purpose?
Thanks.

@freakboy3742
Copy link
Member

A self-hosting Python compiler will the better long term solution; but exposing the server-side implementation of exec() as something that can be invoked over a HTTP call will be the easier approach to implement.

The server-side version will be a lot slower to run, and obviously won't work if the webpage is offline, but will probably be sufficient for many purposes.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants