5 ms·
> that are then restricted to being exclusively used from one of the world's most awkward and obtuse programming languages: javascript. This is just flamebait.
by Raphael_Amiard 16y ago
> that are then restricted to being exclusively used from one of the world's most awkward and obtuse programming languages: javascript.
This is just flamebait. Javascript is just as capable as python, and these days, it's a lot faster too. Sure it has some boring idiosyncrasies, but so has python (one line lambdas are gonna be fun with heavily evented code such as DOM code).
There is room for everything in this world of technology, and i like the idea of this project, but please remove those corrosive and pointless statements from the main project page ..
EDIT : Well, downvoters ? Do you disagree with anything i said ? Because you are particularly silent at the moment, i can't see any of your replies. I stand by anything i said, calling javascript an awkward and obtuse language is flamebait, and implies a very shortsighted view of the technology the very individuals working on the project should know well. If you disagree with me, at least have the courtesy to explain why
- macco 16y agoYou are right, everybody should use the tool, he want's to use. The more interesting part of the article is having a alternative to Javascript in the DOM.
- endtime 16y ago>and these days, it's a lot faster too. I'd love to see some data on this point.
- Raphael_Amiard 16y agoIs this really that little known ? Well in this case, here you have it : http://shootout.alioth.debian.org/u32/benchmark.php?test=all&lang=python&lang2=v8 http://shootout.alioth.debian.org/u32/benchmark.php?test=all... You can see it's on average 7 times faster than CPython. You can check with pypy (which is the fastest python implementation at the moment), it's basically the same deal. Not only that, but the benchmark where CPython blows Javascript out of the water, uses gmpy, where Javascript uses a native javascript implementation. But python in the browser probably wouldn't have access to gmpy, unless javascript has access to a similar binding
- endtime 16y agoAh, thanks. Didn't know about that site. Interestingly, the memory usage is almost always much lower in Python...I wonder how Python would hold up with psyco.
- deleted 16y ago[deleted]
- juiceandjuice 16y agoImplement the algorithms in C/C++ and use ctypes with Python, then CPython wins :D I've been using Pyjamas a lot actually. It works out good because of caching, but it's pretty heavy handed otherwise. The nice thing is being able to program everything in Python, pyjamas on the client and python stuff with mod_wsgi or mod_python on the server side (or Django, or whatever)
- deleted 16y ago[deleted]
- shawndumas 16y agoPython + Javascript = CoffeeScript[1] ----- [1]: http://jashkenas.github.com/coffee-script/ http://jashkenas.github.com/coffee-script/
- Raphael_Amiard 16y agoI know coffeescript, and i use it for my main project, in parallel with Django. The project is particularly heavy on the client side. I like having most of the conveniences of python, like list comprehensions, and it has a better syntax than javascript (i hate javascript syntax). Also, coffeescript has some things that python hasn't, like a sane syntax for functions and lambdas, and some more (string interpolation is really neat when you're dealing with mostly text) It does make things harder for debugging though, but i consider it a fair tradeoff.
- pjscott 16y agoI like coffeescript, but it is definitely a very young language. When I installed it, I had to modify the emacs editing mode because the language syntax had changed recently. I still use it, though, because it's just so much nicer than JavaScript in every other way.
- swannodette 16y agoA counterpoint: I've programmed JavaScript long enough and on large enough codebases to know that JavaScript leaves much be desired. Problems: 1) It's a language that has stood still since November 2000 as far as standards go. 2) No sane package system (see #1) *everybody invents their own* 3) Expression problem, altering prototypes is ridiculously powerful, but it's monkey-patching (see #1) 4) Browser environment is a ball-and-chain for the language's evolution (see #1) 5) Lack of rich datatypes (no sets) (see #1) 6) Object identity based equality (see #1) 7) Little facility to define new rich datatypes (see #1) And on and on. The reasons JavaScript isn't totally crippled given these and more issues is that the language is wonderfully small, has first class functions, functions have variable arity, supports apply/call, its functions are modifiable objects, the context of a function call can be rebound, and it has prototypal inheritance. From these powerful bits people have created a many, many libraries that make JavaScript programming downright fun. But to say that JavaScript is an especially capable PL is, to me at least, a bit of joke- it was clearly designed to run in a very limited scope, in the browser. And remember, this is critique from someone that has used JavaScript in large UI projects day in and day out since 2005 (before jQuery!).
- Raphael_Amiard 16y agoI mostly agree with your critique of javascript. I do not actually agree with 7. You do have the possibility of defining any datatypes you'd ever need. You just don't have the possibility of defining literal support for them. All your other points are right on, but i feel that most are more the result of the history and constraints of javascript than anything else. #3 is a language problem but is also the most arguable of your points. Ruby allows monkey patches and is one of the most appreciated languages in existence today. Also viable approachs to give the power of monkey patching without the drawbacks are just being thought today. Protocols in clojure looks good but still need the appreciation of time i'd say. #6 is stupid i agree Every other point are more the result of the history, and most importantly of the use case of javascript: - No sane package system sucks but a package system is hard to get right in a file based browser environnement. - Browser environnement, well yes, but that's precisely what we are talking about, you can't really say it's a problem, it's the very reason we're using javascript in the first place - Lack of rich datatypes is really bad. The lack of sets, but also of propers hash maps sucks. But more generally javascript lacks a proper standard library. Something that python definitely has. But it's also definitely harder to get right in a browser environnement, when you have got to ensure support from every browser on every platform. But anyway, thanks for a proper critique of javascript.
- rdtsc 16y agoYour reply is just countfamebait and just as factually lacking as the article, that's probably why you are getting downvoted. Here are a couple I can think of : * no namespaces and no packaging system * conversion between types (1+"5"?) * object prototypes are unusual * ignoring extra function arguments EDIT: a couple more I thought of: * if ( a=b ) will assign a the value of b, in Python it's a syntax error * implicit semicolons inserted in place of linebreaks * inconsistent type conversion -- as in a switch statement * cannot use interger keys in dictionaries