Pyjs: Difference between revisions
Link to specific version Tags: Mobile edit Mobile web edit |
m Replace hyphens with em-dashes. |
||
(21 intermediate revisions by 16 users not shown) | |||
Line 1: | Line 1: | ||
{{Short description|Rich Internet application framework}} |
|||
{{Multiple issues| |
|||
{{More footnotes|date=April 2009}} |
{{More footnotes|date=April 2009}} |
||
{{Notability|1=Products|date=January 2021}} |
|||
{{Primary sources|date=January 2021}} |
|||
}} |
|||
{{Infobox software |
{{Infobox software |
||
| name = Pyjs |
| name = Pyjs |
||
| logo = Pyjs-logo. |
| logo = Pyjs-logo.svg |
||
| logo size = 192px |
| logo size = 192px |
||
| logo alt = |
| logo alt = Logo of the Pyjs project (aka Pyjamas), after forking off in 2012. |
||
| screenshot = |
| screenshot = |
||
| caption = |
| caption = |
||
Line 10: | Line 15: | ||
| developer = Luke Leighton, Anthony C Risinger, Kees Bos |
| developer = Luke Leighton, Anthony C Risinger, Kees Bos |
||
| released = {{Start date and age|2007|03}} |
| released = {{Start date and age|2007|03}} |
||
| latest release version = |
| latest release version = {{wikidata|property|reference|edit|P348}} |
||
| latest release date = {{ |
| latest release date = {{start date and age|{{wikidata|qualifier|P348|P577}}}} |
||
| latest preview version = |
| latest preview version = |
||
| latest preview date = |
| latest preview date = |
||
Line 18: | Line 23: | ||
| platform = |
| platform = |
||
| language = [[Python (programming language)|Python]] |
| language = [[Python (programming language)|Python]] |
||
| status = Stalled |
|||
| genre = [[Ajax framework]], Desktop and Web [[Widget toolkit]], [[Compiler]], [[Widget set]] |
| genre = [[Ajax framework]], Desktop and Web [[Widget toolkit]], [[Compiler]], [[Widget set]] |
||
| license = [[Apache License 2.0]] |
| license = [[Apache License 2.0]] |
||
| website = {{URL|pyjs.org}} |
| website = {{URL|pyjs.org}} |
||
}} |
}} |
||
'''Pyjs''' (formerly '''Pyjamas''' before May 2012<ref>[https://groups.google.com/d/msg/pyjamas-dev/3NZ0No2hLUw/EoiTk6fK-O8J Infrastructure, endpoint, process changes], clarification by Lex on pyjamas-dev mailing list (May 03, 2012)</ref>), is a [[rich |
'''Pyjs''' (formerly '''Pyjamas''' before May 2012<ref>[https://groups.google.com/d/msg/pyjamas-dev/3NZ0No2hLUw/EoiTk6fK-O8J Infrastructure, endpoint, process changes], clarification by Lex on pyjamas-dev mailing list (May 03, 2012)</ref>), is a [[rich web application]] framework for developing client-side web and desktop applications in [[Python (programming language)|Python]]. The resulting applications can be run in a [[web browser]] or as standalone [[desktop application]]s. |
||
It contains a stand-alone [[Python (programming language)|Python]]-to-[[JavaScript]] compiler, an [[Ajax framework]] and [[widget toolkit]], and through use of these components, developers can write comprehensive applications, to run in all major web browsers, without writing any JavaScript. Pyjs is a port of [[Google Web Toolkit]] (GWT) from [[Java (programming language)|Java]] to [[Python (programming language)|Python]].<ref name=AtGoogle>[https://github.com/pyjs/pyjs/blob/master/README.rst pyjs README]</ref> |
It contains a stand-alone [[Python (programming language)|Python]]-to-[[JavaScript]] compiler, an [[Ajax framework]] and [[widget toolkit]], and through use of these components, developers can write comprehensive applications, to run in all major web browsers, without writing any JavaScript. Pyjs is a port of [[Google Web Toolkit]] (GWT) from [[Java (programming language)|Java]] to [[Python (programming language)|Python]].<ref name=AtGoogle>[https://github.com/pyjs/pyjs/blob/master/README.rst pyjs README]</ref> |
||
==Development== |
==Development== |
||
Using pyjs, developers can write [[web application]]s in [[Python (programming language)|Python]] instead of [[JavaScript]]. The application is compiled to JavaScript. Also included is an Ajax library and widget set<ref name="widgetset">[http://pyjs.org/UIHierarchy.html The ui Module Class Hierarchy]</ref> that provides access to the [[Document Object Model|Document Object Model (DOM)]] of modern JavaScript-capable web browsers. The Ajax library and the widget set library are a hybrid mix of Python and JavaScript. Just as with Google Web Toolkit, pyjs is not its libraries, and neither is it just another Ajax framework. [[Ajax framework]]s are strictly limited to providing pre-prepared specific functionality, written almost exclusively in tailor-made JavaScript. Both GWT and pyjs, being JavaScript compilers, allow the developer to work in the language with which they are familiar (Java or Python, respectively), to write their own custom widgets, either entirely from scratch or based on the existing available widgets, yet still target the full range of modern browsers. So, far from presenting web developers with a |
Using pyjs, developers can write [[web application]]s in [[Python (programming language)|Python]] instead of [[JavaScript]]. The application is compiled to JavaScript. Also included is an Ajax library and widget set<ref name="widgetset">[http://pyjs.org/UIHierarchy.html The ui Module Class Hierarchy]</ref> that provides access to the [[Document Object Model|Document Object Model (DOM)]] of modern JavaScript-capable web browsers. The Ajax library and the widget set library are a hybrid mix of Python and JavaScript. Just as with Google Web Toolkit, pyjs is not its libraries, and neither is it just another Ajax framework. [[Ajax framework]]s are strictly limited to providing pre-prepared specific functionality, written almost exclusively in tailor-made JavaScript. Both GWT and pyjs, being JavaScript compilers, allow the developer to work in the language with which they are familiar (Java or Python, respectively), to write their own custom widgets, either entirely from scratch or based on the existing available widgets, yet still target the full range of modern browsers. So, far from presenting web developers with a ready-made Ajax framework, pyjs gives you the freedom to create your own. |
||
==Design== |
==Design== |
||
The pyjs compiler is written in the programming language Python, and uses it to compile its input into JavaScript, walking the [[abstract syntax tree]] of the program being compiled. Although the compiler is stand-alone, the primary use of pyjs is for web development, so there is additional infrastructure for building web applications. |
The pyjs compiler is written in the programming language Python, and uses it to compile its input into JavaScript, walking the [[abstract syntax tree]] of the program being compiled. Although the compiler is stand-alone, the primary use of pyjs is for web development, so there is additional infrastructure for building web applications. |
||
The DOM.py<ref name="dommodule" /> model library is an abstraction layer |
The DOM.py<ref name="dommodule" /> model library is an abstraction layer — a thin layer of Python on top of JavaScript code snippets — use of which provides access to the full [[Document Object Model]] of the target browser platform. As with any compiler, the JavaScript snippets are treated as [[inline assembler]]. |
||
Furthermore, on top of the DOM.py model library is an additional abstraction layer, ui.py,<ref name="uimodule" /> which provides the most useful layer to web developers: a full suite of [[GUI widget|widgets]] with which desktop application developers will be familiar. At present, the list of available widgets is a mixture of the complete set of widgets that were available in Google Web Toolkit 1.2, along with a few more that have been forward-ported from GWT 1.5. |
Furthermore, on top of the DOM.py model library is an additional abstraction layer, ui.py,<ref name="uimodule" /> which provides the most useful layer to web developers: a full suite of [[GUI widget|widgets]] with which desktop application developers will be familiar. At present, the list of available widgets is a mixture of the complete set of widgets that were available in Google Web Toolkit 1.2, along with a few more that have been forward-ported from GWT 1.5. |
||
Line 48: | Line 52: | ||
:A module for creating [[GUI widget|widget]]s as if the web browser was a desktop [[widget engine]]. |
:A module for creating [[GUI widget|widget]]s as if the web browser was a desktop [[widget engine]]. |
||
;pyjs Desktop ports |
;pyjs Desktop ports |
||
:Support for running pyjs apps as pure Python, under [[ |
:Support for running pyjs apps as pure Python, under [[MSHTML]] (Trident), [[Gecko (software)|Gecko]] ([[XULRunner]]) or [[WebKit]]. Pyjs Desktop is conceptually close to GWT "Hosted" mode, except that the applications can be deployed live, under pyjs Desktop, rather than be used exclusively as a debugging tool. |
||
==''pyjs Desktop''== |
==''pyjs Desktop''== |
||
The widget set library<ref name="widgetset"/> that comes with pyjs is so similar to [[PyQt]] and [[PyGTK]] that a port of pyjs was made to run pyjs applications on the desktop, called ''pyjs Desktop'' (formerly ''PyjamasDesktop''<ref>[https://wiki.python.org/moin/PyjamasDesktop PyjamasDesktop history], Python Wiki</ref> before May 2012 and originally hosted separately prior to version 0.6<ref>{{cite web |title=Pyjamas Desktop |url=http://pyjd.sourceforge.net/}}</ref>). The project uses [[Webkit]], [[XULRunner]] or [[MSHTML]] as the underlying technology, and it is through these browser engines that pyjs manipulates the DOM model of the application. Together pyjs and pyjs Desktop allow writing cross-platform, cross-desktop, cross-browser and cross-widget applications that run on the web and on the desktop.<ref>[http://advogato.org/article/981.html Pyjamas - Python Applications for Desktop and Web], Luke Kenneth Casson Leighton (August 30, 2008)</ref><ref name=Linux2008Pyjamas1>[http://www.ukuug.org/events/linux2008/programme/abstract-LKCLeighton-1.shtml Coding in Pyjamas: Apps for Desktop and the Web] Luke Kenneth Casson Leighton (November 7, 2008)</ref> |
The widget set library<ref name="widgetset"/> that comes with pyjs is so similar to [[PyQt]] and [[PyGTK]] that a port of pyjs was made to run pyjs applications on the desktop, called ''pyjs Desktop'' (formerly ''PyjamasDesktop''<ref>[https://wiki.python.org/moin/PyjamasDesktop PyjamasDesktop history], Python Wiki</ref> before May 2012 and originally hosted separately prior to version 0.6<ref>{{cite web |title=Pyjamas Desktop |url=http://pyjd.sourceforge.net/}}</ref>). The project uses [[Webkit]], [[XULRunner]] or [[MSHTML]] as the underlying technology, and it is through these browser engines that pyjs manipulates the DOM model of the application. Together pyjs and pyjs Desktop allow writing cross-platform, cross-desktop, cross-browser and cross-widget applications that run on the web and on the desktop.<ref>[http://advogato.org/article/981.html Pyjamas - Python Applications for Desktop and Web], Luke Kenneth Casson Leighton (August 30, 2008)</ref><ref name=Linux2008Pyjamas1>[http://www.ukuug.org/events/linux2008/programme/abstract-LKCLeighton-1.shtml Coding in Pyjamas: Apps for Desktop and the Web] Luke Kenneth Casson Leighton (November 7, 2008)</ref> |
||
==History== |
|||
{{essay-like|section|date=February 2014}} |
|||
Pyjamas was started by James Tauber as a port of the UI Widget Set and the DOM support libraries from Google Web Toolkit to the [[Python (programming language)|Python language]]. Tauber then wrote the original pyjs compiler. |
|||
In 2008, Luke Leighton took over the project, updated the UI Widget Set, improved the compiler and created the three pyjs Desktop runtimes. |
|||
Bernd Dorn and his colleagues from Lovely Systems did some dramatic compiler improvements released in version 0.5. Kees Bos is responsible for the majority of improvements and the enhanced Python interoperability in the compiler, such as the ''yield'' keyword support and long data types. C Anthony Risinger also joined as lead and administrator of the project. |
|||
In 2012, the project was driven by an extensive community, but on May 2, due to disagreements between project leaders, some members created a pyjamas fork. This new team created pyjs.org, led by Anthony Risinger and including the person who owned the domain. Meanwhile, Luke Leighton continued his work on his own fork through a new domain pyj.be and continues to develop and maintain pyjamas on this branch. |
|||
There was controversy over the copying of the mailing list data from the old server to create the new mailing list of Google Groups. This was raised as a violation of the [[UK Data Protection Act]] by Luke Leighton. Whether this was actually a legal violation is not really clear and is open to interpretation. This was a community driven open source project. According to many in the community{{weasel inline|date=February 2014}}, both Luke and Anthony were co-administrators of the project and co-leads to it. It was being forked by a team including Anthony, one of the administrators who had privileges for the server, which Luke Leighton owned. The mailing list was part of the domain. So the ownership of the mailing list data itself isn't very clear. Though Luke claims he personally owned the mailing list and that using it to create a new mailing list for the new pyjs.org fork of the project constituted stealing, many in the community{{weasel inline|date=February 2014}} feel differently. Many feel{{weasel inline|date=February 2014}} that this was an open source community project and Luke Leighton was a co-lead and co-administrator. Hence the mailing list was actually a community property of the pyjs.org community and not the personal property of Luke. |
|||
Even though the ownership of the mailing list data is not entirely clear, when some members complained about being subscribed to the new google groups mailing list, immediate action was taken by the maintainers of the new pyjs.org fork to remove everyone from the new google groups and invited all the members to voluntarily join the new google groups. This being exactly the same approach that Leighton took when he decided to move the pyjamas mailing list from google groups where it was originally created before Leighton took over leadership of the project. |
|||
The current membership of the Google Groups owned and maintained by both forks of the original pyjs.org is now voluntary, created through invitation, and does not violate any privacy and data protection laws. There are no unresolved legal issues at this time nor any pending lawsuits with either forks of the pyjamas project. |
|||
Both forks were actively developed and had formed their own community following.{{update-inline|date=July 2017}} |
|||
==Forks== |
|||
There were two forks of the Pyjamas/Pyjs project: one maintained by the new Pyjs team and another maintained by Luke Leighton. |
|||
===Pyjs.org=== |
|||
The Pyjs.org fork, has gone through active development. |
|||
* New [[GitHub]] based infrastructure |
|||
* [[Travis CI]] based continuous integration for both build, install and automated testing |
|||
* [[pip (package manager)|pip]] install and VirtualEnv based development environment |
|||
* Separation of pyjs tools from pyjs GWT widgets to allow other widgets sets to be developed |
|||
* Built-in Closure compiler integration |
|||
* GI Introspection/WebKit-GTK based pyjs-desktop runner |
|||
===Pyj.be=== |
|||
Pyj.be, continued to be maintained by Luke Leighton and was still active with bug fixes and new development. As of early 2015, however, the website is not available anymore. |
|||
==Critics== |
|||
Pyjamas has been criticized by heavy users for several aspects:<ref>[http://blog.pyjeon.com/2012/07/29/why-pyjamas-isnt-a-good-framework-for-web-apps/ Why Pyjamas Isn't a Good Framework for Web Apps], Alexander Tsepkov (July 29, 2012)</ref> |
|||
* Browser detection instead of feature detection |
|||
* Bloat and boilerplate hell (Python feature coverage is favored over speed and size) |
|||
* Debugging (perfect with Pyjs Desktop, but that is broken for more than 3 years) |
|||
* Python is not Java, DOM is not a Desktop (the underlying GWT unnecessarily fakes a desktop GUI) |
|||
On the other hand, as a dynamically typed language Python is a specifically good fit for compiling code to JavaScript, actually a more natural fit than GWT's original Java-to-JavaScript approach.<ref>[http://www.advogato.org/article/985.html Thinking alike], comment by user cananian (Nov 5, 2008)</ref> |
|||
==Alternatives== |
|||
Most alternatives to Pyjamas are translators rather than frameworks.<ref>[http://blog.pyjeon.com/2012/09/17/301/ Pyjamas Alternatives for Web Development], Alexander Tsepkov (September 17, 2012)</ref> |
|||
* Brython |
|||
* GlowScript |
|||
* py2js |
|||
* PyCow |
|||
* Pyjaco |
|||
* PyvaScript |
|||
* RapydScript |
|||
* Transcrypt |
|||
==References== |
==References== |
||
Line 119: | Line 70: | ||
[[Category:Free software programmed in Python]] |
[[Category:Free software programmed in Python]] |
||
[[Category:JavaScript libraries]] |
[[Category:JavaScript libraries]] |
||
[[Category:Rich |
[[Category:Rich web application frameworks]] |
||
[[Category:Software using the Apache license]] |
[[Category:Software using the Apache license]] |
||
[[Category:Web development software]] |
[[Category:Web development software]] |
Latest revision as of 22:49, 30 April 2024
This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these messages)
|
Original author(s) | James Tauber, Google |
---|---|
Developer(s) | Luke Leighton, Anthony C Risinger, Kees Bos |
Initial release | March 2007 |
Stable release | 0.8.1a[1]
/ 9 May 2012 |
Repository | |
Written in | Python, JavaScript |
Operating system | Windows, OS X, Linux |
Available in | Python |
Type | Ajax framework, Desktop and Web Widget toolkit, Compiler, Widget set |
License | Apache License 2.0 |
Website | pyjs |
Pyjs (formerly Pyjamas before May 2012[2]), is a rich web application framework for developing client-side web and desktop applications in Python. The resulting applications can be run in a web browser or as standalone desktop applications.
It contains a stand-alone Python-to-JavaScript compiler, an Ajax framework and widget toolkit, and through use of these components, developers can write comprehensive applications, to run in all major web browsers, without writing any JavaScript. Pyjs is a port of Google Web Toolkit (GWT) from Java to Python.[3]
Development
[edit]Using pyjs, developers can write web applications in Python instead of JavaScript. The application is compiled to JavaScript. Also included is an Ajax library and widget set[4] that provides access to the Document Object Model (DOM) of modern JavaScript-capable web browsers. The Ajax library and the widget set library are a hybrid mix of Python and JavaScript. Just as with Google Web Toolkit, pyjs is not its libraries, and neither is it just another Ajax framework. Ajax frameworks are strictly limited to providing pre-prepared specific functionality, written almost exclusively in tailor-made JavaScript. Both GWT and pyjs, being JavaScript compilers, allow the developer to work in the language with which they are familiar (Java or Python, respectively), to write their own custom widgets, either entirely from scratch or based on the existing available widgets, yet still target the full range of modern browsers. So, far from presenting web developers with a ready-made Ajax framework, pyjs gives you the freedom to create your own.
Design
[edit]The pyjs compiler is written in the programming language Python, and uses it to compile its input into JavaScript, walking the abstract syntax tree of the program being compiled. Although the compiler is stand-alone, the primary use of pyjs is for web development, so there is additional infrastructure for building web applications.
The DOM.py[5] model library is an abstraction layer — a thin layer of Python on top of JavaScript code snippets — use of which provides access to the full Document Object Model of the target browser platform. As with any compiler, the JavaScript snippets are treated as inline assembler.
Furthermore, on top of the DOM.py model library is an additional abstraction layer, ui.py,[6] which provides the most useful layer to web developers: a full suite of widgets with which desktop application developers will be familiar. At present, the list of available widgets is a mixture of the complete set of widgets that were available in Google Web Toolkit 1.2, along with a few more that have been forward-ported from GWT 1.5.
Components
[edit]The major Pyjs components include:
- pyjs Python-to-JavaScript Compiler
- Translates the programming language Python into JavaScript.
- Python builtin and standard emulation library
- JavaScript implementations of the commonly used modules, builtins and classes in the Python standard runtime library (such as strings, lists, dictionaries, tuples, sets, getattr, map, filter, range, etc.; basic exception handling, a basic datetime and a basic math module).
- pyjs DOM library[5]
- Modules for manipulating the browser DOM.
- pyjs Web UI module[6]
- A module for creating widgets as if the web browser was a desktop widget engine.
- pyjs Desktop ports
- Support for running pyjs apps as pure Python, under MSHTML (Trident), Gecko (XULRunner) or WebKit. Pyjs Desktop is conceptually close to GWT "Hosted" mode, except that the applications can be deployed live, under pyjs Desktop, rather than be used exclusively as a debugging tool.
pyjs Desktop
[edit]The widget set library[4] that comes with pyjs is so similar to PyQt and PyGTK that a port of pyjs was made to run pyjs applications on the desktop, called pyjs Desktop (formerly PyjamasDesktop[7] before May 2012 and originally hosted separately prior to version 0.6[8]). The project uses Webkit, XULRunner or MSHTML as the underlying technology, and it is through these browser engines that pyjs manipulates the DOM model of the application. Together pyjs and pyjs Desktop allow writing cross-platform, cross-desktop, cross-browser and cross-widget applications that run on the web and on the desktop.[9][10]
References
[edit]- ^ "Release 0.8.1a". 9 May 2012. Retrieved 22 July 2018.
- ^ Infrastructure, endpoint, process changes, clarification by Lex on pyjamas-dev mailing list (May 03, 2012)
- ^ pyjs README
- ^ a b The ui Module Class Hierarchy
- ^ a b DOM module
- ^ a b ui module
- ^ PyjamasDesktop history, Python Wiki
- ^ "Pyjamas Desktop".
- ^ Pyjamas - Python Applications for Desktop and Web, Luke Kenneth Casson Leighton (August 30, 2008)
- ^ Coding in Pyjamas: Apps for Desktop and the Web Luke Kenneth Casson Leighton (November 7, 2008)