Hacker News new | past | comments | ask | show | jobs | submit login
Pyjamas: build AJAX apps in Python (like Google did for Java) (pyjs.org)
69 points by soundsop on Nov 28, 2008 | hide | past | favorite | 10 comments



I'd also suggest checking out pyjamas-desktop (http://pyjd.org/), which allows you to deploy pyjamas apps to the desktop


yeah it looks great. I think its a great idea to use more of the web for the desktop - there is so much work going on in browsers/javascript it makes sense to use it for offline work as well.


well, the point of pyjamas-desktop is that you can, if you choose, run an "online" app that happens to be a stand-alone dedicated app that runs on the user's desktop.

let me rephrase that :)

pyjamas-desktop can be used for "online" apps just as much as it can for "offline" ones. in fact, you _still_ need a web server, even if it's running on localhost, because applications that conform to the pyjamas API will _still_ have to use XMLHttpRequest to interact with the rest of the world.

that interaction is done behind a neat abstraction module, HTTPRequest.py, but it's still necessary.

so - offline / online, there's no difference.

what you _do_ get with pyjamas-desktop is a speed-increase in your application, thanks to no longer being forced to utilise javascript. in cases where your application morphs into something that requires 10,000 on-screen widgets (not inconceivable for complex business apps) the speed-up of direct access to the blindingly-quick WebKit (http://webkit.org) underlying library is absolutely essential.

not even GWT can offer this, because google haven't bothered to port GWT to the desktop: they believe that the "hosting" mode - running from the Eclipse Development Environment - a whopping 150mb download on its own - is perfectly sufficient.


But GWT doesn't require eclipse to run? that 150Meg I assume must mean the 10 tonne eclipse IDE? Not GWT.


if you want to run "hosted" mode, where the javascript and java is executed by eclipse, then yes, GWT requires eclipse.

GWT itself does not have a "desktop" mode, it does not have a "desktop" version, and so GWT apps cannot themselves be run as a "desktop" app unless you use the GWT Eclipse-basesd "hosted" mode - or you run the GWT-compiled javascript under Adobe AIR, Mozilla's Gecko / Spidermonkey, etc. etc. etc.


Right yes I don't think GWT is really interested in desktop - unless like you say you compile it, but then its quite different.

I have run it hosted just fine with no eclipse components (only for dev of course) - just the JVM and about 10 meg of jars (or 9 meg dev jar) - I am not sure where you get the 150 meg from though?


This is really cool. But wouldn't it be better to generate docs from comments than refering to GWT docs?

Anyway, they also have an online demo which you won't find on the site. Their BookReader http://pyjs.org/book/output/Bookreader.html (ongoing documentation) is itself a demo.

EDIT: Oh! just noticed that the Bookreader docs is very linux oriented.


There are several bits of documentation auto-generated from the docstrings - here's one: http://lkcl.net/pyjamas-desktop/docs/output/docui.html

this is one i made by hacking the standard python 2.5 pydoc.py to auto-generated pyjamas code, which you then either run with pyjamas-desktop - http://pyjd.org - or you run through the pyjamas compiler - http://pyjs.org and you get the documentation.

so it can and has been done.

re the docs being linux-orientated: yep, i'm a linux baby :) and i haven't encountered too many windows people who use pyjamas, surprisingly. it's self-contained and OS-independent, so works perfectly.


Hmm, can this be used for only javascript? As in, I write my own html but use pyjamas to generate my js (which can manipulate the dom of my html).

I'm down with abstracting javascript (good riddance), but I like to be picky about html.


yep, that's right. pyjamas has three components:

* a stand-alone javascript compiler

* a DOM-model library that can be used to do things like getElementById

* a UI-widget library that has things like HTMLPanel, Label, Tree, Image

pyjamas-desktop rips out the first of these, rips out all javascript in 2) and 3) and replaces the javascript with Webkit/Glib, thus providing the exact same functionality. it's blindingly quick.




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: