Live data from Hacker News

Why we need Python in the Browser

archlinux.me

131–132 of 132 posts

Re: Why we need Python in the Browser

#131
post #54

I like Python, but JavaScript is sort of good at what it does: evented programming. In javascript it's really easy write a closure. I have not worked with asynchronous frameworks like twisted, but I'd image it's a little more awkward. Am I wrong?

Python also has lambda syntax, therefore closures are quite easy to do. Example: items.select {|e| e.isFoo} It's arguably more terse and superior to javascript in that particular feature as well.

Yup, you're all right, I copied the wrong snippet it seems. I don't know how that happened. And it's also true that that lambda doesn't have a closure (double fail) but in my experience a lambda usually implies the possibility of a closure. Is that a bad assumption? Thanks for the corrections.

Re: Why we need Python in the Browser

#132
JavaScript is the bytecode that you can compile your python or whatever code too. Just make the standards committee implement some nice features that are useful for bytecodes and you are all set.
Post reply on HN