Pyjamas (software)
This article includes a list of references or external links, but its sources remain unclear because it has insufficient inline citations. Please help to improve this article by introducing more precise citations where appropriate. (April 2009) |
Original author(s) | James Tauber, Luke Leighton, Google |
---|---|
Developer(s) | Luke Leighton |
Initial release | March, 2007 |
Stable release | 0.6 / August 18, 2009 |
Written in | Python, JavaScript |
Operating system | Windows, Mac OS X, Linux |
Available in | Python |
Type | Ajax framework, Compiler, Widget set |
License | Apache License 2.0 |
Website | http://pyjs.org |
Pyjamas is a tool and framework for developing AJAX applications in Python. It contains a stand-alone Python-to-JavaScript compiler, an AJAX Framework and Widget set, and through use of these components, developers can write comprehensive applications, to run in all major web browsers, without writing a single line of JavaScript. Pyjamas is a port of Google Web Toolkit [1] from Java to Python as the input language.
Development
Using Pyjamas, developers can easily write web applications in Python instead of Javascript, so to [2]. The application is compiled to Javascript. Also included is an AJAX library and widget set [3] that provides access to the DOM model 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 GWT, "Pyjamas is not its libraries", and neither is it "yet another AJAX framework". AJAX Frameworks are strictly limited to providing pre-prepared specific functionality, written almost exclusively in tailor-made Javascript. Both GWT and Pyjamas, 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 browers. So, far from presenting web developers with a fait-accompli AJAX Framework, Pyjamas gives you the freedom to develop your own.
Design
The pyjamas compiler is written in Python, and uses the Python programming language 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 pyjamas is for web development, so there is additional infrastructure for building web applications.
The DOM.py [4] 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[5], 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 Pyjamas components include:
- pyjs Python-to-JavaScript Compiler
- Translates the Python programming language to the JavaScript programming language.
- 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).
- Pyjamas DOM library [4]
- Modules for manipulating the browser DOM Model.
- Pyjamas Web UI module [5]
- A module for creating widgets as if the web browser was a Desktop Widget Engine.
- Pyjamas Desktop ports
- Support for running Pyjamas apps as pure Python, under MSHTML, XULRunner or Webkit. Pyjamas Desktop is conceptually close to GWT "Hosted" mode, except that the applications can be deployed live, under Pyjamas Desktop, rather than be used exclusively as a debugging tool.
Pyjamas Desktop
The widget set library [6] that comes with Pyjamas is so similar to PyQt and PyGTK that a port of Pyjamas was made to run Pyjamas applications on the desktop, called Pyjamas-Desktop. The project uses Webkit, XULRunner or MSHTML as the underlying technology, and it is through these browser engines that Pyjamas manipulates the DOM model of the application. Pyjamas and Pyjamas Desktop allow writing cross-platform, cross-desktop, cross-browser and cross-widget applications that run on the web and on the desktop[7] [8].
Sites using Pyjamas
References
- ↑ Pyjamas project home at google
- ↑ Why write in Python instead of in the native Javascript? Please enhance this article explaining, especially the motivation for Pyjamas.
- ↑ Widget Set diagram at Pyjamas Home Page
- ↑ 4.0 4.1 DOM module at Pyjamas Home Page
- ↑ 5.0 5.1 ui module at Pyjamas Home Page
- ↑ Widget set showcase at PyJS.org
- ↑ http://advogato.org/article/981.html Pyjamas - Python Applications for Desktop and Web
- ↑ Coding in Pyjamas: Apps for Desktop and the Web
External links
|
|
If you like SEOmastering Site, you can support it by - BTC: bc1qppjcl3c2cyjazy6lepmrv3fh6ke9mxs7zpfky0 , TRC20 and more...
- Pages where expansion depth is exceeded
- Pages using duplicate arguments in template calls
- Pages with broken file links
- Articles lacking in-text citations from April 2009
- Articles with invalid date parameter in template
- All articles lacking in-text citations
- Free software programmed in Python
- Web development software
- Rich Internet application frameworks
- JavaScript libraries