![]() |
BrythonA Python 3 implementation for client-side web programming |
Brython is designed to replace Javascript as the scripting language for the Web. As such, it is a Python 3 implementation, adapted to the HTML5 environment, that is to say with an interface to the DOM objects and events.
Brython is not "Python-like", but tries to be as close as possible to the Python language ; in other words, the features that work in CPython but not Brython are considered bugs. The only limitations are the features that can't be implemented in Javascript (eg. blocking funcions) or those related to the browser environment (eg. or writing to disk). But it is close enough to Python 3 to support online courses such as Carnegie Mellon University's Computer Science Academy. Despite this stress on compliance, execution time is sometimes faster, sometimes slower, rarely much slower than CPython. With Firefox, the table below shows how Brython performs compared to CPython (taking 100 as base for CPython)
The modules in the standard library are translated only once for each new Brython version ; they are then stored in an indexedDB database on the client side. The first run of a program that uses many stdlib modules might take a few seconds, but the next runs will be much faster. The size of the core Brython script is 134 kB once minified and compressed. The standard library can be loaded as a single script, its size is 699 kB. All popular Javascript frameworks (jQuery, vue.js, Highcharts, etc.) can be easily used from inside Brython scripts. You can take a look at applications developed with Brython, and watch videos and talks. Documentation and online resources are available on this site. The development site is on Github. Contributors are welcome ! |
BrythonUne impl�mentation de Python 3 pour la programmation web c�t� client |
L'objectif de Brython est de remplacer Javascript comme langage de script c�t� client. Il s'agit d'une impl�mentation de Python3, adapt�e � l'environnement HTML5, avec une interface vers les objets et les �v�nements DOM.
Brython n'est pas "ressemblant � Python", mais essaie d'�tre aussi proche que possible du langage Python. En d'autres termes, tout ce qui fonctionne en CPython mais pas en Brython est consid�r� comme un bug. La seule limite sont les fonctionnalit�s qui ne peuvent pas �tre impl�ment�es en Javascript (par exemple les fonctions bloquantes) ou celle qui sont li�es � l'environnement s�curis� du navigateur (�criture sur disque par exemple). Mais il est suffisamment proche de Python 3 pour servir de support � des cours de programmation en ligne comme celui de la Carnegie Mellon University's Computer Science Academy. Malgr� cet accent mis sur la conformit�, les temps d'ex�cution sont parfois plus rapides, parfois plus lents, rarement beaucoup plus lents qu'en CPython. Avec Firefox, la table ci-dessous montre les performances sur un certain nombre d'op�rations �l�mentaires, en prenant CPython comme base 100:
Les modules de la librairie standard sont traduits une seule fois pour chaque nouvelle version de Brython; elles sont ensuite cach�es dans une base de donn�es indexedDB c�t� client. La premi�re ex�cution d'un programme qui utilise beaucoup de modules de la librairie standard peut prendre plusieurs secondes, mais les ex�cutions suivantes seront beaucoup plus rapides. La taille du script principal de Brython est de 134 kO une fois minifi� et compress�. La librairie standard peut �tre charg�e comme un seul fichier, sa taille est de 699 kO. Tous les frameworks Javascript (jQuery, vue.js, Highcharts, etc.) peuvent �tre utilis�s simplement depuis les scripts Brython. Pour vous faire une id�e, vous pouvez utiliser la console interactive, regarder quelques applications d�velopp�es en Brython, and voir des vid�os et des conf�rences. La documentation et des ressources sont disponibles sur ce site. Le site de d�veloppement est sur Github. Les contributeurs sont bienvenus ! |
BrythonUna implementaci�n de Python para la programaci�n web del lado del cliente |
Brython is designed to replace Javascript as the scripting language for the Web. As such, it is a Python 3 implementation, adapted to the HTML5 environment, that is to say with an interface to the DOM objects and events.
Brython is not "Python-like", but tries to be as close as possible to the Python language ; in other words, the features that work in CPython but not Brython are considered bugs. The only limitations are the features that can't be implemented in Javascript (eg. blocking funcions) or those related to the browser environment (eg. or writing to disk). But it is close enough to Python 3 to support online courses such as Carnegie Mellon University's Computer Science Academy. Despite this stress on compliance, execution time is sometimes faster, sometimes slower, rarely much slower than CPython. With Firefox, the table below shows how Brython performs compared to CPython (taking 100 as base for CPython)
The modules in the standard library are translated only once for each new Brython version ; they are then stored in an indexedDB database on the client side. The first run of a program that uses many stdlib modules might take a few seconds, but the next runs will be much faster. The size of the core Brython script is 134 kB once minified and compressed. The standard library can be loaded as a single script, its size is 699 kB. All popular Javascript frameworks (jQuery, vue.js, Highcharts, etc.) can be easily used from inside Brython scripts. For more information, you can use the interactive console, take a look at applications developed with Brython, and watch videos and talks. Documentation and online resources are available on this site. The development site is on Github. Contributors are welcome ! |