Misplaced Pages

Pyjs

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
Rich Internet application framework
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)
This article includes a list of general references, but it lacks sufficient corresponding inline citations. Please help to improve this article by introducing more precise citations. (April 2009) (Learn how and when to remove this message)
The topic of this article may not meet Misplaced Pages's notability guidelines for products and services. Please help to demonstrate the notability of the topic by citing reliable secondary sources that are independent of the topic and provide significant coverage of it beyond a mere trivial mention. If notability cannot be shown, the article is likely to be merged, redirected, or deleted.
Find sources: "Pyjs" – news · newspapers · books · scholar · JSTOR (January 2021) (Learn how and when to remove this message)
This article relies excessively on references to primary sources. Please improve this article by adding secondary or tertiary sources.
Find sources: "Pyjs" – news · newspapers · books · scholar · JSTOR (January 2021) (Learn how and when to remove this message)
(Learn how and when to remove this message)
Pyjs
Logo of the Pyjs project (aka Pyjamas), after forking off in 2012.
Original author(s)James Tauber, Google
Developer(s)Luke Leighton, Anthony C Risinger, Kees Bos
Initial releaseMarch 2007; 17 years ago (2007-03)
Stable release0.8.1a Edit this on Wikidata / 9 May 2012; 12 years ago (9 May 2012)
Repository
Written inPython, JavaScript
Operating systemWindows, OS X, Linux
Available inPython
TypeAjax framework, Desktop and Web Widget toolkit, Compiler, Widget set
LicenseApache License 2.0
Websitepyjs.org

Pyjs (formerly Pyjamas before May 2012), 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.

Development

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

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

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
Modules for manipulating the browser DOM.
pyjs Web UI module
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

The widget set library 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 before May 2012 and originally hosted separately prior to version 0.6). 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.

References

  1. "Release 0.8.1a". 9 May 2012. Retrieved 22 July 2018.
  2. Infrastructure, endpoint, process changes, clarification by Lex on pyjamas-dev mailing list (May 03, 2012)
  3. pyjs README
  4. ^ The ui Module Class Hierarchy
  5. ^ DOM module
  6. ^ ui module
  7. PyjamasDesktop history, Python Wiki
  8. "Pyjamas Desktop".
  9. Pyjamas - Python Applications for Desktop and Web, Luke Kenneth Casson Leighton (August 30, 2008)
  10. Coding in Pyjamas: Apps for Desktop and the Web Luke Kenneth Casson Leighton (November 7, 2008)

External links

ECMAScript
Dialects
Engines
(comparison)
Frameworks
Client-side
Server-side
Multiple
  • Cappuccino
Libraries
People
Other
Lists
JavaScript libraries
Ajax frameworks
Comparisons
JavaScript frameworks
server-side JavaScript
Web frameworks
.NET
C++
ColdFusion
Common Lisp
Haskell
Java
JavaScript
Perl
PHP
Python
Ruby
Rust
Scala
Smalltalk
Other languages
List of widget toolkits
Low-level platform-specific
On AmigaOS
On Classic Mac OS, macOS
On Windows
On Unix,
under X11
On BeOS, Haiku
On Android
CLI
Low Level Cross-platform
CLI
C
Java
High-level, platform-specific
On AmigaOS
On Classic Mac OS, macOS
Object Pascal
Objective-C, Swift
C++
CLI
On Windows
CLI
C++
Object Pascal
On Unix,
under X11
On Android
High-level, cross-platform
C
C++
Objective-C
CLI
Adobe Flash
Go
Haskell
Java
JavaScript
Common Lisp
Lua
Pascal
Object Pascal
Perl
PHP
Python
Ruby
Tcl
XML
shell
Dart
Categories: