question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Idea] Compile Python code with Brython statically

See original GitHub issue

It 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:closed
  • Created 3 years ago
  • Comments:12 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
lborgmancommented, Jan 3, 2021

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.

1reaction
PierreQuentelcommented, Jun 20, 2020

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 ?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found