[Idea] Compile Python code with Brython statically
See original GitHub issueIt would be nice to compile Python
code with Brython
statically as TypeScript
did
By doing so it expand Brython
also to Node.js
and Deno
run-times as platform for writing application instead of JavaScript
It is also cool because Node.js
and Deno
have JIT
execution mechanism that is much faster then original Python
implementation and also those run-times have Worker
-s (Active Object Pattern) that allow to have real Multi-Threading
execution
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (11 by maintainers)
Top Results From Across the Web
Brython: Python in Your Browser - Real Python
Brython is both a Python compiler and an interpreter written in JavaScript. As a result, you can compile and run Python code in...
Read more >An Introductory Guide to Brython - Stack Abuse
In this introduction to Brython, we'll take a look at what it is, how to install it, and how to initialize a Brython...
Read more >How to Use Brython: A Guide to Writing Python for the Front End
Brython works by running a JavaScript translator on Python and executing it in the browser. This is done through brython.js and brython_stdlib.
Read more >Run Python Code on Websites: Exploring Brython
It allows you to directly use Python Scripts on a webpage to handle DOM (Document Object Model) elements and events, all using our...
Read more >Executing a small piece of brython code on demand
The brython() function looks for script tags with type "text/python" and execute all of them. The workflow is something as follows:.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I would suggest being able to compile Python to JavaScript with Node.js would be very nice. The translated code code should (at least in my case) be used in the web browser. (I do not know Python, but I need the functionality in some code written by others. And the code I am interested in will change quite often so I need to auto-generate the JavaScript files.)
Using Brython in the web browser will not work in my case since the number of imports is huge.
I have merged the PR, thanks @redradist
But I am getting dizzy with all these frameworks : only in the last 2 months there have been requests for Brython to be adapted to work with Webpack, Opal, jinja2, node.js, Deno, Travis, BeautifulSoup, Electron and Browserify…
I have nothing against these requests, but if they are included in the project, Brython users will expect that it works for months or years, support new versions of these programs, and if the author of the initial Pull Request loses interest in the mean time, I don’t want to have to maintain it myself, or explain to users that I remove the feature.
An option would be to open a Wiki page pointing to forks of Brython that work with these frameworks. Would that be ok ?