Live data from Hacker News

Why we need Python in the Browser

archlinux.me

1–10 of 132 posts

Re: Why we need Python in the Browser

#2
An ideal situation would be installable interpreters that still allowed you to use a system-wide rendering engine. I actually think Windows had something similar with ActiveScripting.

I assume something like QT allows you to script the webview with whatever language you have bindings for? Unfortunately QT+bindings is a pretty long way from 'zero install'

Re: Why we need Python in the Browser

#3
Source mapping (part of ES6) gives proper error messages for other languages compiled into JS, I believe this would include Pyjamas etc.

But do Python programmers who haven't programmed for the browser before realize how important async is?

Tornado and Twisted users are used to passing around functions, but they're very small subsets of the Python community, who, if asked to fetch something and do something with it, would generally wait until it's fetched.

Re: Why we need Python in the Browser

#4
post #2

An ideal situation would be installable interpreters that still allowed you to use a system-wide rendering engine. I actually think Windows had something similar with ActiveScripting. I assume something like QT allows you to script the webview with whatever language you have bindings for? Unfortunately QT+bindings is a pretty long way from 'zero install'

Sounds more like plugin hell to me. I think it's becoming increasingly harder to convince users to install browser plugins (for good reasons), and it's not even possible on most mobile browsers.

Re: Why we need Python in the Browser

#6
Can the rpython translator support js as a target? Could you compile pypy to js that way, to provide a python environment in existing browsers?

To be honest though, JS is a perfectly OK language for web browsers, and if you really want to reuse python code it probably makes more sense to translate it before it gets to the browser, using automated tools or otherwise. Supporting everybody's favourite language natively in every browser would be horrible.

Re: Why we need Python in the Browser

#7
For some time now I've been wondering why the primary scripting format consumed by browsers is JavaScript (a language intended for humans) and not some sort of standard bytecode that would be executed in a browser's virtual machine.

What we need is the JSVM! In other words, something like the JVM but adapted for the browser. That probably means it would have a more dynamic typing focus since it makes sense for JavaScript to be the primary language targeted by the system (though there's no reason this couldn't evolve over time just like the JVM has).

All of a sudden you don't need to build in Python support, or Ruby support or LISP support or whatever else you fancy into the browser. The browser no longer cares what you compiled the script from, it just gets the standard bytecode and everyone's happy.

Re: Why we need Python in the Browser

#9
post #3

Source mapping (part of ES6) gives proper error messages for other languages compiled into JS, I believe this would include Pyjamas etc. But do Python programmers who haven't programmed for the browser before realize how important async is? Tornado and Twisted users are used to passing around functions, but they're very small subsets of the Python community, who, if asked to fetch something and do something with it,…

The subsets of people that do UI work right (Qt, Gtk, etc.) and people that do networking right (Twisted) are relatively large. I wouldn't worry about it too much.

Re: Why we need Python in the Browser

#10
Sorry if this is a bit off-topic, but its mentioned that there is work being done on an event loop in python, Can anyone give me some sources on this?

Are they talking about async frameworks such as twisted/tornado? or is there more core work that I don't know about?

Post reply on HN