3 ms·
I'm genuinely shocked that this made it to the top of hackernews. I would expect better. While the idea of having the Python interpreter in the browser is very
by fijal 14y ago
I'm genuinely shocked that this made it to the top of hackernews. I would expect better. While the idea of having the Python interpreter in the browser is very likely better than having a compiler Python -> JS (if we care about Python), the implementation here is both half assed and really bad. It takes quite a bit of effort to create a python interpreter that can be called python. This is nowhere near there. On top of it double-interpretation in dynamic languages is very slow and I doubt someone is willing to pay that price here. A good example of low quality is here:
http://code.google.com/p/brython/source/browse/trunk/py_classes.js#140 http://code.google.com/p/brython/source/browse/trunk/py_clas...
this is both incorrect (exceptions are propagated, http://paste.pound-python.org/show/28457/ http://paste.pound-python.org/show/28457/) and has wrong complexity. It's not even a dict at all!
- why-el 14y agoI will be more shocked if I discovered that people dive this deep into code before upvoting, because it is generally not the case. If you think of it, we would have missed your valuable input if people didnt upvote this for you to see. :)
- tinco 14y agoIt is an indication that we just want to get a python for the web really bad. If someone makes a good looking website for his project it kind of gives the impression that he is seriously going for it, perhaps it is not good now, but maybe it will become a serious contender later.
- daemon13 14y agoAll people are different... There are many OPs that assert that JS syntax/lang are beautiful once you get handle of it, and may be it is... However, there may be enough people like myself for whom the JS syntax/lang just do not fit into the brain. Since at my last job of CFO of $200+m pharma country org I have architected multidimensional db for an OLAP cube for SAP Business Objects, I do not think that I am that dumb. But this JS stuff just does not fit in. Also, I do value my time. So although I could persist in learning JS, as a general rule when things do not flow - the learning time multiplies. I do not have time. Hence, personally I would love to be able to write/maintain code in Python [even subset of Python would be fine], knowing that it cleanly compiles to JS. It will be then my choice whether I want it client-side or server-side [smth like what css pre-processors SASS/Less are doing].
- hosay123 14y ago> has wrong complexity Python doesn't specify the complexity of dicts, that they're "efficient" is a CPython implementation detail other runtimes happen to copy. Even a worse-than-linear time mapping that satisfies the protocol is still a 'dict'. Surprised you don't know this given your relationship to PyPy. As for whether I'd prefer a 100kb "not quite Python" or sending a few MB of JS (that takes 10 minutes to translate for each change) to the browser just to handle a few functions in a cross-platform manner, I'm glad to see more options when making this choice. I'm in the midst of evaluating a solution to running simple mathematical functions on a Python backend or in-browser (for graphing). In a case like this, a handful of crappy guarantees about the lowest common denominator arithmetic is all I need in a solution. It's easy to get wrapped up in correctness, but ease and practicality trumps it almost every time.
- fijal 14y agoindeed, python does not specify the complexity, it's just what everyone expects. Anyway, my problem is not with "not quite Python", my problem is with calling it "Python". As long as you call it "a language with Python inspired syntax", it's seriously left to the reader whether he likes it or not. If you call it Python, it's fine to have something incomplete, however provide a way forward at least. This seems to be incredibly far from supporting full Python, which might or might not be a goal.
- asimjalis 14y agoI’d rather have a partial and easy-to-use implementation of Python in the browser that exists right now than a perfect implementation that doesn’t exist.
- briancurtin 14y agoPlease get over yourself.