News for hackers. Stuff that matters.
Re:Why node.js disappoints me by Locke1689 on Monday September 27, 2010 @12:43PM (#1732272)
I don't understand the applause for Javascript. Yeah, we've unified on one language for client-side and server-side, but I don't like programming in Javascript. Why would I move to Javascript for server-side when I could program in Python and minimize the amount of JS I actually have to write?

Does everyone just like Javascript?

Re:Why node.js disappoints me by 1337p337 on Monday September 27, 2010 @01:07PM (#1732356)
That was my reaction to Node.js. "So...I can use...Javascript?"

I have been sad for a long time that there is a language, just one, that you use for web browsers. And one that has an ad-hoc design like this. I've never really been a fan, and have been waiting for someone to expose a properly jailed VM to the web developer.

The JVM, incidentally, has Javascript support (Rhino), the choice of plenty of languages, and is relatively easy to restrict. Imagine a Webkit-based browser that handles Javascript and JVM bytecode. It would take some hacking, but you could have a safe, language-independent environment for client-side web scripting. Your One Application Language could be Javascript, Scheme, Python, Ruby, Scala, Clojure. I think devs would flock to this; I certainly would.

Re:Why node.js disappoints me by dasil003 on Monday September 27, 2010 @01:24PM (#1732420)
A big problem is that the largest source of frustration with javascript is DOM incompatibility rather than JS itself. At least the unified language allows projects like jQuery to partially clean up the mess for everyone. If you had multiple languages, imagine the mess.
Re:Why node.js disappoints me by 1337p337 on Tuesday September 28, 2010 @04:39PM (#1737216)
Incompatibility is certainly a headache, but having worked on a 10k-line, Firefox-only Javascript project, I can say with confidence that there are a number of pain-points in the language itself.

Scoping weirdness, the erratic semantics of the 'this' keyword, etc.

If you had multiple languages atop a VM, it would be simpler, in fact. The browser only needs to worry about bytecode, except in the case of Javascript, where the inclusion of Rhino (or its equivalent) would be needed for pragmatic reasons. Any hooks into the DOM would be exposed through the VM, and a sensible way to talk to the VM would be the language implementor's problem.

Re:Why node.js disappoints me by icey on Monday September 27, 2010 @01:01PM (#1732338)
Javascript is fun because it is flexible.

If you don't like the syntax, you could play around with Coffeescript. It may appeal to your Pythonic sensibilities: http://jashkenas.github.com/coffee-script/

Re:Why node.js disappoints me by silentbicycle on Tuesday September 28, 2010 @12:41AM (#1734583)
Flexible compared to what? Given the circumstances, that's definitely damning with faint praise.
Re:Why node.js disappoints me by icey on Tuesday September 28, 2010 @01:12AM (#1734652)
Flexible compared to languages that don't use prototypal inheritance. Metaprogramming is part of every-day use for js developers; and it's a frequently used (and yes, sometimes abused) tool. As a result, developers can significantly change the way the language itself functions.

While this is amazing for smaller groups of disciplined developers; it can certainly cause maintenance pain. So, I guess I'd flip it around and call it praise with faint damnation.

Re:Why node.js disappoints me by silentbicycle on Tuesday September 28, 2010 @01:27AM (#1734679)
Ok, just curious. I use Lua quite a bit, and I find its mix of prototype-based OO and clean functional programming to be very practical, as well.

It sounds like other people find the same pragmatism in Javascript, but after learning Lua, I find Javascript really depressing - it had so much potential, but...it's like Lua's little brother whose mind never had a chance to fully develop (due to the browser wars). It's sad. Lua's design has been refined for 17 years, and ... Javascript was frozen after 2. Just reading about thruth-y and false-y types in Javascript makes me cringe.

Granted, Lua doesn't have the strangehold on web development that Javascript does (it was designed for scripting C/C++ instead, like Tcl), but I'm working on that.

Re:Why node.js disappoints me by chipsy on Monday September 27, 2010 @01:49PM (#1732543)
I like JS for serving as an assembly language for the web - it's not theoretically ideal, but no assembly language really is.

You have an ever-increasing set of options for compiling non-JS code into JS. Just poke around a little - you could use haXe, CoffeeScript, ParenScript, Objective-J, Pyjamas, GWT, Fantom...

Any platform - browser, server, etc. - that supports JS can reap the benefits of these alternative languages - just get your APIs ported and you're most of the way there.

Re:Why node.js disappoints me by simonw on Monday September 27, 2010 @01:31PM (#1732450)
Have you ever taken the time to learn it? JavaScript is a pretty neat little language - the way it does functions and closures allows for a programming style that doesn't really work in Python (due to the lack of multi-line lambdas).

My eyes were first opened to JavaScript during my Computer Science degree, during a course on Programming Languages - the professor spent a full lecture on how interesting it is, and it completely changed my opinion of the language.

Re:Why node.js disappoints me by Locke1689 on Monday September 27, 2010 @05:00PM (#1733394)
<rant>

Have you ever taken the time to learn it? JavaScript is a pretty neat little language - the way it does functions and closures allows for a programming style that doesn't really work in Python (due to the lack of multi-line lambdas).

Yes, I have, that's why I said I don't like programming in Javascript, not that I don't know Javascript. Most of the design decisions serve to frustrate me more than empower me. The variable context I'm working in always seems always a bit mystical. Their method of FFF has a lisp air but they way it's written always makes it seem like more of a bastardization than an homage.

Python doesn't have multiline anonymous functions, but it does have inner functions. Given that I find the style of doSomething(function () { something; something; something; }); verbose and confusing, I prefer Python's implementation.

In Javascript there is More Than One Way To Do It(TM). Sometimes I don't mind this -- writing Haskell has never felt anything like writing Python. In fact, writing Haskell almost feels like writing a proof (and for good reason, look into the type system theoretics if you're interested) instead of a program. Therefore when writing Haskell I never feel like I need to make a comparison to languages like Python. They work differently and will be used by for different things.

Javascript, on the other hand, feels bland and conventional and begs for me to compare it to languages like Python. When I do I realize that the modularity, import system, and library of functions I've written in Python have disappeared into the wind, along with the ability to jump to C when necessary for performance.

In fact, when it comes to performance, Javascript is the worst! Not that Javascript performance itself is terrible as a scripting language, but that There Is More Than One Way To Do It but Only One Way Is Fast. The JQuery author is an expert at this, as well as some of my good friends at Google. There's always been a Book of Javascript, passed from developer to developer, that says what the Fast Way is. I hate that. I don't want to have to memorize idioms if I want my code to be performant. In summary, I guess, I want Python ;)

</rant>

Re:Why node.js disappoints me by silentbicycle on Monday September 27, 2010 @02:51PM (#1732866)
Have you ever looked into Lua? It's like a more mature version of Javascript. The overall design has a lot in common, but unlike JS, Lua didn't get frozen before its early design errors could be fixed (due to the browser wars) - instead it has had 15+ years of gradual refinement.

It's targeted at scripting C / C++ applications rather than web sites. It's great as a standalone scripting language, too.

Re:Why node.js disappoints me by jadedoto on Monday September 27, 2010 @12:43PM (#1732275)
To which I ask you to check out Objective-J.
Re:Why node.js disappoints me by Locke1689 on Monday September 27, 2010 @05:06PM (#1733417)
I actually have something in mind for a Master's thesis that may solve my problems permanently, but I'm afraid I have to keep it quiet for now. :)