Hacker News new | past | comments | ask | show | jobs | submit login
Python in the browser (schementi.com)
43 points by r11t on March 18, 2010 | hide | past | favorite | 14 comments



Silverlight... with "performance" stuff in C#? What kind of client-side scripting is going on that we need to push it down to C#?

Javascript does a great job manipulating the DOM, especially with Prototype and the like.

Having a stronger scripting language in the browser like python (even ruby?) would be great if it didn't come at a significant cost and increased performance. If you'd ask anyone who spends a significant amount of time writing js code, they'd want it faster. Not Python that is built on top of a proprietary engine (plugin based!), that uses... JAVASCRIPT to embed it.

On top of that, the python code looks semantically identical to DOM manipulation in Prototype. So really the only thing you've gained is "writing client code in python" while dumping proprietary formats and a huge initial download on your users. I'll excuse myself as sensationalist when I say that it seems a little selfish on the developer's part.


This was quite interesting, until, "This is because Silverlight is the Python execution engine."


And now, Python in the browser without Silverlight (i.e., on pure JS):

http://www.skulpt.org/


"Skulpt surely isn't done yet...I'd call it something like 0.12 alpha if it had a version..."


"Python in the browser" ... with Silverlight.


As much as I love .NET, I just can't get excited about Silverlight. When you require your users to install a new plugin, it raises the barrier to entry pretty significantly -- especially when you're talking about technical users.

Personally, I took a different route: I created a Python->Javascript compiler with a real macro system. Allows me to quickly hack damn near anything together and keeps me away from JS (which I can't stand, largely for aesthetic reasons), without imposing anything at all on my users.


So basically Silverlight loses out because Flash was first-to-market? They're essentially the same thing.

I mean, I don't do Silverlight either, but your reasoning seems suspect.


I find JavaScript and Python are more similar than they are different.

Coming from Python, learned JavaScript, felt right at home. (just have to remember the vars, {}s and ;s)


This is interesting in a very narrow niche. But even being a Python fanboy I'm more likely to bring JS into the server than Python into the browser. It just makes huge piles of sense.


1.5 MB, even if one-time only (assuming no cache-cleaning on client side), is quite heavy. Too heavy for vast majority of web applications.


Depends on your audience. For a lot of in-house applications, that wouldn't be much of a problem. But if you are trying to build a new social media web site, it might well be.


I mostly agree with you, but, just to play devil's advocate...

How exactly would you propose cramming a usable Python runtime into a download that was substantially less than 1.5 MB in size? On the OS X 10.5 box I'm sitting at right now, the 'libpython2.6.a' static library from my source build of Python 2.6 is over 6 MB. The actual 'python' binary is nearly 2 MB, and stripped of all debugging symbols, still comes in at about 1.4 MB.

If you had some really good compression, and included only a small part of the standard library, I can see getting a CPython package in around the 2-3 MB mark, but not much more.


Would you believe that some sites routinely dump 2MB on you, just for one page ?

E.g., for AlleyInsider, which occasionally shows up here: http://www.webpagetest.org/result/100318_6303/

(Nice tester from AOL - try your own cases)


What an ugly hack.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: