News for hackers. Stuff that matters.
Re:More information on Google's new web language, Dash by peterhunt on Friday September 09, 2011 @09:37PM (#2980484)
I really wish that we would see a concerted effort to get Python in the browser (or anything reasonable, really) rather than creating yet another new dynamic language that needs half a decade to grow a decent ecosystem. JavaScript has been around for years and only in the past few years have we seen a legitimate developer ecosystem emerge around it.
Re:More information on Google's new web language, Dash by zmmmmm on Saturday September 10, 2011 @10:43PM (#2983041)
I think that going from a language with real genuine closures to one with the half measure that Python has (lambdas) would actually be a backwards step.

Plus I agree with the other (downvoted) commenter that whitespace would be a huge annoyance. A language for the web has to be something robust to copying and pasting to / from web pages.

Re:More information on Google's new web language, Dash by andybak on Sunday September 11, 2011 @05:20AM (#2983526)
Closures and lambda (anonymous functions) are orthogonal features. Python has closures (and one last limitation related to scope and rebinding was fixed in Python 3)

Furthermore although I agree Python's limited lambda's make it slightly uglier to do some constructs, it's merely syntactic sugar.

First-order functions are the critical feature. Whether you are compelled to give them a name or not isn't critical.

Re:More information on Google's new web language, Dash by ma2rten on Friday September 09, 2011 @10:12PM (#2980574)
That's because heavyweight clientside applications are only a more recent thing and JavaScript engines have improved alot.

JavaScript is great for event based programmming because of it's scoping rules. Python can't offer that.

That's why a few langang

Re:More information on Google's new web language, Dash by riffraff on Saturday September 10, 2011 @01:57AM (#2980958)
what scoping rules make javascript better than python for evented programming? I am not a big JS writer, but I can't seem to see anything important (nested functions, globals).

Maybe you are referring to the fact that JS has an arguably better syntax for anonymous functions?

Re:More information on Google's new web language, Dash by sid0 on Saturday September 10, 2011 @04:17AM (#2981143)
Python has implicit declarations, which lead to a world of hurt because you can't directly modify variables in arbitrary scopes. Python 3 has nonlocal, but that only extends the number of function scopes you can refer to to three.

I think having implicit declarations is probably the worst mistake Python made. It just makes things so much more confusing.

Re:More information on Google's new web language, Dash by sid0 on Saturday September 10, 2011 @09:02AM (#2981503)
Sorry, I made a mistake: nonlocal gives you as much power as usual closures. I still stand by my statement that implicit declarations make things very confusing.
Re:More information on Google's new web language, Dash by crizCraig on Saturday September 10, 2011 @02:17AM (#2980993)
In python nested functions must be declared before calling them. Also stuff like this seems to crop up on me when I ry using closures: http://stackoverflow.com/questions/2516652/scoping-problem-i...
Re:More information on Google's new web language, Dash by riffraff on Saturday September 10, 2011 @09:23AM (#2981530)
that is what I meant as having a better syntax for anonymous functions. I agree it's bad (even with nonlocal in python 3) but that is not a matter of different scoping rules, it's only syntax.
Re:More information on Google's new web language, Dash by tzs on Saturday September 10, 2011 @04:03PM (#2982341)
Wouldn't Python's use of whitespace to indicate nesting be annoying? JavaScript sometimes gets into pages embedded in script tags (as opposed to be being loaded from external files by script tags), and this is sometimes done by being echoed by server-side PHP or something similar.

Having to deal with getting the whitespace right while doing that could be annoying, and would also make the code much harder to read on the server side.

I think for this application, the more forgiving a language is about layout the better.

Re:More information on Google's new web language, Dash by fuzzythinker on Friday September 09, 2011 @09:45PM (#2980513)
coffeescript is probably the next closest thing. I think I remember firefox and/or chrome will enable it soon.