Live data from Hacker News

Why we need Python in the Browser

archlinux.me

31–40 of 132 posts

Re: Why we need Python in the Browser

#31
post #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…

Actually, Javascript was originally a target for PyPy, and there was a working implementation before it was dropped since the developers thought that PyPy was being spread too thin; at that time PyPy was already was targeting the JVM, .net, llvm, and C.

Note that there is also a working implementation of Javascript that runs on PyPy. This project was actually an implementation of Python that compiled to Javascript as a target.

Re: Why we need Python in the Browser

#32
post #28

Earlier quoted context omitted.

Browsers supporting JavaScript and some other bytecode format would bring web innovation to a crawl. I think once browsers are able to debug in the originating languages people will stop complaining about this.

Arrogant people preemptively declaring failure and trying to enforce their baseless declarations on others is what brings innovation to a crawl.

Come on now, that's a bit harsh. There are really smart people who have been trying this exact thing for years without success. Microsoft tried harder than anyone to make "JScript" part of .NET but finally gave up and Windows 8 has 2 first-class VMs.

Re: Why we need Python in the Browser

#33
post #20

As a user of Real Programming Languages (Common Lisp, Java, C) I'm indifferent to scripting languges, but if I had to choose ONE to see in the browser, it would be Lua. It has sane, symmetric minimal design that gets closures. It also looks like a programming language. I can type Lua into the Firebug repl and not worry about indentation.

I like how you capitalized the Real Programming Languages, as if it is some official definition. The notion that python isn't real, is just silly.

Of course Python is a Real Language, it exists, etc, yes. But it's not a Real Programming Language.

You see, everyone using python, ruby, perl, php, and other similar platforms - we're not programming, we're just scripting. The difference is so extreme, that, well... if you don't understand, I'm not going to bother explaining.

Re: Why we need Python in the Browser

#34
post #23

Python in the browser would ultimately lead to all the same problems as Javascript in the browser. In a few years, we'll be hearing: Clojure in the browser, Scala in the browser, Haskell in the browser. I've been programming in Python full-time for the past 6 months, and it's main deficiency are the same as JavaScript's: no (optional) static typing - I'm really sick of writing checks whether my function got values of…

Someone has already achieved Clojure. https://github.com/clojure/clojurescript

Re: Why we need Python in the Browser

#35

Earlier quoted context omitted.

I like how you capitalized the Real Programming Languages, as if it is some official definition. The notion that python isn't real, is just silly.

Of course Python is a Real Language, it exists, etc, yes. But it's not a Real Programming Language. You see, everyone using python, ruby, perl, php, and other similar platforms - we're not programming , we're just scripting . The difference is so extreme, that, well... if you don't understand, I'm not going to bother explaining.

Sorry, Poe's law kicked-in and I mistakingly downvoted you. I'm very sorry:|

Re: Why we need Python in the Browser

#36
post #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 JavaSc…

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.

Because that's how it was initially. And initially - before github and minifiers - that was very important as a way of helping people learn by being able to study the code of other websites.

Re: Why we need Python in the Browser

#37
post #23

Python in the browser would ultimately lead to all the same problems as Javascript in the browser. In a few years, we'll be hearing: Clojure in the browser, Scala in the browser, Haskell in the browser. I've been programming in Python full-time for the past 6 months, and it's main deficiency are the same as JavaScript's: no (optional) static typing - I'm really sick of writing checks whether my function got values of…

Someone has already achieved Clojure. https://github.com/clojure/clojurescript

When they mean "X in the browser", it's being natively supported. Python-to-JS exists too: http://pyjs.org/

Re: Why we need Python in the Browser

#39
post #23

Python in the browser would ultimately lead to all the same problems as Javascript in the browser. In a few years, we'll be hearing: Clojure in the browser, Scala in the browser, Haskell in the browser. I've been programming in Python full-time for the past 6 months, and it's main deficiency are the same as JavaScript's: no (optional) static typing - I'm really sick of writing checks whether my function got values of…

I do agree that we need a language with static typing so that one can have some level of confidence before releasing the code to production. Having said that python definitely is much better than javascript.
Post reply on HN