On May 4, 7:37 pm, Terry Reedy <tjre...@udel.edu> wrote:
> On 5/4/2011 10:06 AM, Luke Kenneth Casson Leighton wrote:
>
> > after a long delay thepyjamasproject -http://pyjs.org- has begun the
> > 0.8 series of releases, beginning with alpha1:
>
> >https://sourceforge.net/projects/pyjamas/files/pyjamas/0.8/
>
> >pyjamasis a suite of projects, including a python-to-javascript
> > compiler
>
> As you well know, there is no such thing as 'python' when it comes to
> compiling actual code. So please specify both in announcements here and
> on the project homepagehttp://sourceforge.net/projects/pyjamas/
> which versions are supported. I do not really want to have to download
> and experiment to determine whether to bother downloading.
>
> If you do not yet support 3.x, I request and recommend that you do so,

 with the situation as it is, there is not a snowball in hell's chance
that's going to happen.

 allow me to explain.

 the python translator in pyjamas is heavily dependent on the
"compiler" module (which is written in c) and is in turn, as you are
no doubt aware, specifically dependent on the grammar file.  the
python translator for pyjamas 0.3 was 1,200 lines of code.  thanks to
some brilliant and dedicated work by kees bos, over something like a 6
month virtually full-time period, it's now somewhere around 5,000
lines of heavily-dense code in which very specific javascript
optimisations have been encoded.

 then, on top of that, it is necessary to implement the data types
that are supported in python 3.x, along with several built-ins
(exceptions etc.).  the basic implementation - pyjslib.py - is 6,700
lines of python code with in-built hand-optimised javascript, and it
would be necessary to reimplement / re-work... and then support...
that reimplementation.

 then, on top of that, there are a number of python-based
reimplementations of various python modules, such as md5.py, re.py,
string.py and so on, each of which would have to be double-checked for
compatibility with their python 3.x counterparts.  do they exist, have
they been rewritten, modified etc.`

 then, on top of that, it is necessary to run the pyjamas UI code,
which is some 15,000 lines of code, along with the other libraries
such as GChart, through lib2to3, and then to double-check them.

 then, on top of that, it is necessary to run the examples - of which
there are 70 - again through lib2to3.  i've just done a "wc" on the
examples source code: it comes to a whopping total of 60,000 lines of
code.

 so you have to do all this work, and really it's impossible to begin
realistically checking that it works until you get to the LibTest
example (which is the main test suite, comprising some 3,000 or so
regression tests), and once you've done all that work you now need a
userbase and also some maintainers.

 and, when it comes to doing a release, you need to test all 70
examples in a matrix of 14 browsers plus 4 desktop runtime engines,
and the browsers you need to recompile three times - with -O
(optimised), --strict (python-compliant) and there's one more, i
forget its name, it's designed to minimise the amount of javascript
generated.

 to support 3.x therefore requires a complete and utter rewrite, and
then a hell of a lot of work on top of that.  it's basically
supporting a totally separate language, and so is basically a
completely new project.  i know you mean well, but... you've
drastically underestimated quite how much effort has gone into the
pyjamas project - just look at the ohloh statistics for goodness sake!
it's listed as having had 31 man-years gone into it! 
http://www.ohloh.net/p/pyjamas

 so if you can find the money to get people paid to create a python
3.x to javascript compiler, which will require approximately twelve to
fifteen man-months of full-time dedicated programming effort, please
do speak up!

 otherwise please - really: just saying "give me support for python
3.x or else" is ... honestly - it's a free software project, _not_ a
paid-up corporate google/nokia/ibm/redhat/etc. funded project: you
know the score, and you know the drill.

 now.

 leaving _that_ aside, there happens to be absolutely no really good
compelling reason to support python 3.x in the first place.  "python 3
is the future of python" gimme a break!! [so why is archlinux the only
linux distribution that's converted over to run everything off of
python 3.x?]

 the thing is: there aren't really any major dependencies to "get in
the way" in pyjs.  as in: it's entirely self-sufficient [it has to
be].  even the installation has its own sandbox system.  the only
dependency *is* python 2.N, and when daniel kluev completes his
GSoC2011 project, that'll be a "bootstrap" into javascript, including
the translator itself being compiled into javascript, and then not
even python 2.N will be a dependency!

 the bottom line is this: somewhere in the next 8 to 10 years, python
2.N will be deprecated in all but the most die-hard places.  at *that*
time, it will have been worthwhile to convert pyjamas over to python
3.N - and probably not even then would it be strictly necessary.

 the only really compelling reason would be if it became difficult for
the pyjamas-desktop engines to be compiled for python 2.  that's
MSHTML (python-comtypes for python 2 disappearing or being hard to
get) - i'm the maintainer of the pyjd/mshtml.py engine so that'll be
around for a long time; pythonwebkit (again, i'm the maintainer, so
that'll be around for a long time) and xulrunner / python-xpcom and
python-hulahop (python-xpcom is maintained by activestate.com).

 so - if it becomes "difficult" to get hold of all the pyjd engines,
*then* and *only* then does it make sense to look at converting to
python 3.  i seriously, seriously doubt that pythonwebkit, python-
comtypes or python-xpcom for python 2 are going to disappear within
the next 5 years, don't you?

l.

p.s. if you _really_ want to use python 3 with pyjs, then run the pyjs
translator code through lib2to3, and then make damn sure that you use
the "--internal-ast" option when compiling [this is what is
recommended for people who use python 2.4, or 2.7 and above.  one
minor change and we might even be able to support python 2.3 or
below].  you will then use the (duh) internal AST code in pyjs, and
will *still* need to write pyjamas applications that are in python 2.N
syntax, because that's what the pyjs translator supports.  but you
will at least not require an http://python.org version 2.N
interpreter.

p.p.s for anyone who might be interested, the --internal-ast code sort-
of came from the lib2to3 project, and was used to create a module
which is entirely compatible with the standard http://python.org
version 2.0 "compile" module and the ast module.  except that it
supports the features of lib2to3 which include line and character
numbers.

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to