
Python Webkit DOM Bindings - macco
http://www.gnu.org/software/pythonwebkit/
======
Raphael_Amiard
> that are then restricted to being exclusively used from one of the world's
> most awkward and obtuse programming languages: javascript.

This is just flamebait. Javascript is just as capable as python, and these
days, it's a lot faster too. Sure it has some boring idiosyncrasies, but so
has python (one line lambdas are gonna be fun with heavily evented code such
as DOM code).

There is room for everything in this world of technology, and i like the idea
of this project, but please remove those corrosive and pointless statements
from the main project page ..

EDIT : Well, downvoters ? Do you disagree with anything i said ? Because you
are particularly silent at the moment, i can't see any of your replies. I
stand by anything i said, calling javascript an awkward and obtuse language is
flamebait, and implies a very shortsighted view of the technology the very
individuals working on the project should know well. If you disagree with me,
at least have the courtesy to explain why

~~~
swannodette
A counterpoint:

I've programmed JavaScript long enough and on large enough codebases to know
that JavaScript leaves _much_ be desired.

Problems:

    
    
      1) It's a language that has stood still since November 2000 as far as 
         standards go. 
      2) No sane package system (see #1) *everybody invents their own*
      3) Expression problem, altering prototypes is ridiculously powerful, 
         but it's monkey-patching (see #1)
      4) Browser environment is a ball-and-chain for the language's evolution (see #1)
      5) Lack of rich datatypes (no sets) (see #1)
      6) Object identity based equality (see #1)
      7) Little facility to define new rich datatypes (see #1)
    

And on and on. The reasons JavaScript isn't totally crippled given these and
more issues is that the language is wonderfully small, has first class
functions, functions have variable arity, supports apply/call, its functions
are modifiable objects, the context of a function call can be rebound, and it
has prototypal inheritance. From these powerful bits people have created a
many, many libraries that make JavaScript programming downright fun.

But to say that JavaScript is an especially capable PL is, to me at least, a
bit of joke- it was clearly designed to run in a very limited scope, _in the
browser_. And remember, this is critique from someone that has used JavaScript
in large UI projects day in and day out since 2005 (before jQuery!).

~~~
Raphael_Amiard
I mostly agree with your critique of javascript. I do not actually agree with
7. You do have the possibility of defining any datatypes you'd ever need. You
just don't have the possibility of defining literal support for them.

All your other points are right on, but i feel that most are more the result
of the history and constraints of javascript than anything else.

#3 is a language problem but is also the most arguable of your points. Ruby
allows monkey patches and is one of the most appreciated languages in
existence today. Also viable approachs to give the power of monkey patching
without the drawbacks are just being thought today. Protocols in clojure looks
good but still need the appreciation of time i'd say.

#6 is stupid i agree

Every other point are more the result of the history, and most importantly of
the use case of javascript: \- No sane package system sucks but a package
system is hard to get right in a file based browser environnement. \- Browser
environnement, well yes, but that's precisely what we are talking about, you
can't really say it's a problem, it's the very reason we're using javascript
in the first place \- Lack of rich datatypes is really bad. The lack of sets,
but also of propers hash maps sucks. But more generally javascript lacks a
__proper standard library __. Something that python definitely has. But it's
also definitely harder to get right in a browser environnement, when you have
got to ensure support from every browser on every platform.

But anyway, thanks for a proper critique of javascript.

~~~
pjscott
The lack of sets as a data type at the language level is a serious problem
with JS. Most languages which implement sets as a library make some assumption
about the elements: they're ordered, for example, or they all have a unique
string serialization. If you want to make a set data type in JavaScript, the
language doesn't give you any of those assumptions. You might end up just
using linear search of unordered arrays. (This is actually very fast for small
sets, but still.)

I wrote some more about this here:

[http://finger-tree.blogspot.com/2010/09/sets-in-
javascript.h...](http://finger-tree.blogspot.com/2010/09/sets-in-
javascript.html)

And here is a library that offers sets in JS:

<http://github.com/PeterScott/simplesets-nodejs>

If you're using Node.js, you can get it with npm. It could be adapted to the
browser pretty easily. This is what I use, and it makes my life so much
easier.

------
apl
I'm willing to bet that a solid 90% of all people desperately yearning for JVM
(or similar) "in the browser" as well as stuff like these DOM bindings don't
realize that JS is a powerful, decent, fast language. These days, at least.
Instead of adding semi-functional alternatives, the web development community
should focus on providing reasonable JS teaching and learning opportunities.

Mozilla's JS Guide is surprisingly well hidden, a majority of JavaScript
tutorials are shockingly inadequate: there's a lot of potential there.

JS is neither awkward nor obtuse. Its shortcomings are exaggerated while its
beauty is still a secret to many; that sucks.

~~~
zokier
JS might be great language, but still it's only one language, and it doesn't
fit everybody. Allowing more languages in client-side web code enables more
people to create great web apps.

~~~
aarongough
These days Javascript is plenty fast enough to achieve this goal by simply
writing other languages over the top of it...

There are some examples of this happening already, HotRuby for instance.

------
jorangreef
It's interesting that the author is motivated by WebKit being "restricted to
being exclusively used from one of the world's most awkward and obtuse
programming languages: javascript."

I would hope that the leadership of such a project would at least demonstrate
some kind of understanding of the language binding they wish to replace,
objectively recognizing its contributions and shortcomings, with the
professionalism to resist resorting to phrases like "world's most awkward or
obtuse language".

------
davidbalbert
I'm a big fan of alternative client side languages (would love to see a ruby
version of this project). The problem is wide spread adoption will take
forever. You wouldn't be able to use another language in the browser until all
vendors ship it and those browser versions become baseline.

What would be cool is if browser vendors implemented client side VMs with a
standard bytecode. Then new languages could be developed and delivered over
time.

~~~
zoomzoom
This is the most critical point in the thread, it seems to me!

------
TimothyFitz
This would be more of a "Big Deal" if it hadn't been available for many years
in Mozilla via PyXPCOM: <https://developer.mozilla.org/en/PyDOM>

That being said, there's definitely room for competition. PyXPCOM is far from
a joy to work with.

------
PostOnce
To me, a page of Python is supremely readable. It's concise and perfectly
understandable.

A page of javascript looks like someone dropped a box of scrabble tiles.

This is just me, a bad programmer who hasn't gone to college yet, who only
knows one language well enough to make anything useful, and who has resisted
learning javascript all this time. I knew someone would do something like this
eventually, and now they have. And now I shall make something truly beautiful.

------
barnaby
Javascript is a great, powerful and awesome language.

Python is a great, powerful and awesome language.

Birds of a feather flock together. I hope EVERY rendering engine gets Python
support.

------
jeffesp
I have often thought that lua would make the perfect addition for client side
scripting. There are some annoying bits of lua, but it seems like a compelling
alternative to me.

------
robwgibbons
This article lost me when it called JavaScript awkward and obtuse. Sounds to
me like they have little experience with JavaScript.

~~~
macco
The author is the project lead of the pyjamas web framework
(<http://pyjs.org>). He knows some Javascript :). But he hates programming
with html, css and Javascript.

