3 ms·
What exactly is the driving force behind the desire to do everything in Javascript? Is it just because we have a surplus of Javascript programmers? It doesn't s
by anonjon 17y ago
What exactly is the driving force behind the desire to do everything in Javascript? Is it just because we have a surplus of Javascript programmers? It doesn't seem to me that this task is particularly well suited to Javascript. (I think) Something like Erlang would be more applicable.
And to me it seems that learning a new programming language (even one using a relatively obscure syntax), is a much simpler task than designing an entire project (or piece of a project), around a language that doesn’t really fit the needs of a project.
To that extent, I think that the idea of a ‘lingua franca’ language is an inherently broken metaphor. Programming languages are closer to human-computer interaction tools than they are natural languages. ‘Lingua franca’ implies that every language can communicate approximately the same thing (it is just a matter of who has influence). I think this is a mistake, as different languages allow you to think in hugely different ways about programming. Different languages have different intrinsic concepts.
It may be that this argument boils down to ‘if all you have is a hammer, everything looks like a nail,’ but even that is an oversimplification, as I don’t even use the same hammer for all types of nails (tack hammer, framing hammer, etc).
I am not saying that node.js is necessarily a bad thing to have. It may turn out that Javascript is indeed particularly well suited to this type of application. Superficially, however, nothing convinces me that this is some sort of exciting home-run-win situation (or that it is any better than any other functional-style programming language).
Could you explain the excitement and appeal to me?
- Slashed 17y agoI agree. This language is not a general-purpose programming language, at least not at the moment. Although, I can see how I can use it to build a small(but customized to my needs) COMET server in a more simpler way.
- onewland 17y agoI think there is definitely a communicative advantage to the 'lingua franca' concept as it applies to programming languages. Think of programs as the semi-English (English is actually the true lingua franca of programming :)) representation of Turing machines. In this sense, every language can communicate approximately the same thing. I don't think JavaScript will cover every paradigm in the sense of obscure language concepts, in that it will likely never have Lisp's complicated macro system or Ruby's ability to make really fluid DSLs. I don't want it to; the appeal to me is that what's going on in JavaScript is almost always self-evident (if you avoid the bad parts). () means you're calling a function or forcing operator association. {} means you're defining a block, array, or dictionary. I do think, though, that it could establish the new minimum standards of the 'demo language' for an algorithm. For algorithm demonstration and sharing, I think it's absolutely awesome that there is a language that is now capable of doing anything you want with an interpreter (albeit DOM-confined) pre-installed on every single computer you use. I don't want to read Wikipedia algorithms in some hacked-up Pascal. Give me something I can run now, but that's universally understood: a strong common medium to explain programming languages in unobfuscated terms.
- simonw 17y ago"Could you explain the excitement and appeal to me?" There's not much I can say that I didn't already say in my blog entry. JavaScript is designed for event-driven programming in the browser, and my brief experience with node.js makes me believe that it also works well for event-driven programming on the server. And V8 is really fast. As for Erlang... when you're programming for the web, it's useful to have a programming language that treats strings as more than just an array of integers.
- anonjon 17y agoWith regard to Erlang, are you sure? Joe Armstrong seems to think its fine for string manipulation... http://www.erlang.org/cgi-bin/ezmlm-cgi?4:mss:47293:200911:dmkmepbchkebogigcnaf http://www.erlang.org/cgi-bin/ezmlm-cgi?4:mss:47293:200911:d... (You can either think that he is biased or that he would be an expert on it). I mean, it seems to me that javascripts main advantage in programming for the web would be DOM manipulation. And that is good, but a lot of languages can do it. (Honestly I've never really done (much) direct string manipulation for web programming). It doesn't seem to me that javascript really has a monopoly on event driven programming either. It is relatively easy to do that sort of thing in almost any other functional style language...
- Tichy 17y agoWhile not perfect, JS is actually pretty pleasant to use. Also I like not having to use different languages between client and server. What popular languages are cooler than JS? Maybe Ruby, but for my taste there is too much metaprogramming in Ruby which makes it very hard to master. I like the extreme simpleness of JS (basically everything is a hash, that's it). Though I must admit that now that it looks like it has a shot at being the language for everything, I am getting second thoughts. Those brackets can get ugly - something with a slightly cleaner syntax might have been preferable. But all current languages have their pros and cons, and JS doesn't fare badly in copmparison. For example I think Ruby takes it too far - you can get clean syntax, but the tendency to create something like a DSL for everything is also a burden for learning. Plus, Ruby is still too slow for a lot of tasks.
- flogic 17y agoI'm not sure about lingua franca but it does kinda want to be the language of the web. You're already running it on the browser. So there is a synergy in having it on the server also. GWT lets you do write sides in Java, but there really isn't any reason not to do both sides in Javascript.
- cturner 17y agoI loathe the javascript syntax but am sold on this lingua franca thing, although probably for reasons different to the person who coined the phrase. Could you explain the excitement and appeal to me? Yup. Javascript combines several elements that give it a reach for high power. * Javascript is a prototype-based language. I find this to be a better way to write software than other approaches. * There's a good ometa implementation for javascript. Ometa is a powerful ways of writing domain specific languages. * Modern JVMs support javascript, meaning that anything you do in javascript can be adapter to leverage existing Java codebases. * Combination of javascript on both the client and server will likely expose new possibilities. For example, I've been thinking about the possibility of a 'builder' app in javascript whereby you use a firebug console to dynamically build a form and attach business logic to it and then freeze it back to the server. Yes, you could do it at the moment, but it's less effort if you only have one codebase to think about. The thread of bloat in the client becomes less of a problem with new approaches to development like Google Gears, also. Node.js is an important foundation to javascript establishing itself as a viable server-side language. At a glance, it looks to be a good balance of what's needed, also.