Live data from Hacker News

JavaScript: It’s Not Just for Browsers Any More

pragprog.com

81–90 of 93 posts

Re: JavaScript: It’s Not Just for Browsers Any More

#81
post #58

Earlier quoted context omitted.

The people who claim JavaScript is fast because of V8 have probably never used a fast language and platform in a situation where speed is important. V8 is fast compared to other JavaScript engines. It's very slow compared to most other languages. PLT Scheme, a non-fast Scheme platform, averages half the time of V8 in the flawed benchmarks game (single core, JavaScript cannot multithread.) Lua, a fast non-broken dynam…

I think you're reading the shootout wrong. V8 is faster in most cases than Lua in those benchmarks. Often by a fairly large margin. The gap between V8 and Ruby and Python is even larger.

Compare LuaJIT, PLT, V8, Lua, JRuby, Python 3, Ruby 1.8, Perl, PHP -

http://shootout.alioth.debian.org/u32/which-programming-lang...

Re: JavaScript: It’s Not Just for Browsers Any More

#82
post #36

Earlier quoted context omitted.

Here's Yegge on the topic: http://steve-yegge.blogspot.com/2007/02/next-big-language.ht... ... though he doesn't explicitly say he's talking about Javascript, it's pretty likely that he's talking about Javascript. 1) It's got C-like syntax. 2) It's got the dynamic- and functional-language features that make people happy. 3) We're stuck with it no matter what. Changing the world's installed base of web browsers takes…

ActionScript may be based on ECMAScript, but they look very different: package com.example { import flash.text.TextField; import flash.display.Sprite; public class Greeter extends Sprite { public function Greeter() { var txtHello:TextField = new TextField(); txtHello.text = "Hello World"; addChild(txtHello); } } } Also, Flash is more than ActionScript.

The difference in appearence is because it's based on what was going to be ES4, you can actually write it like Javascript for the most part if you want to.

Re: JavaScript: It’s Not Just for Browsers Any More

#83
post #72
post #42

Earlier quoted context omitted.

Something that's different, at least from POE, EventMachine, Twisted is that it is attempting non-blocking purity. You can snub your nose at this but it turns out to be very important. It ends up abstracting away a problem in a way that EventMachine or Twisted will never be able to do simply because of the existence of massive amounts of blocking Ruby and Python libraries. The programmer simply doesn't have to know w…

"There is no forking or IPC - it's just synchronous events and callbacks. In Erlang you have to think about about IPC on the first connection. The Erlang-model might turn out to be the wrong level of process granularity. Maybe the right level of process granularity is how computers are already designed: 10,000-1,000,000 connections per process, use one per core." Also false. An Erlang "process" is not an OS process.…

You should read my reply again (or maybe for the first time) and comprehend. I did not say nor imply that I think Erlang's processes are OS processes. Sorry for not using quotes ('process') if that's what has confused you so deeply.

Re: JavaScript: It’s Not Just for Browsers Any More

#84

How do you break Node.js? And if you break it how much it is broken? With mod_php even if you kill or freeze single apache process your app is still up and running for other users. What happens if Node.js crashes or hoards resources?

Off the top of my head: run several Node instances (one per core would maximise potential performance) and load balance between them. Have the load balancer / some other monitoring script periodically check each instance to see if it's hung and remove from load balancer, kill and restart it when that happens.

Re: JavaScript: It’s Not Just for Browsers Any More

#85
post #41

Earlier quoted context omitted.

I have to completely disagree with IE 6 being the model for future browser upgrade timelines. That's a very limited data sample and the willingness to upgrade your browser is going to be significantly faster as time goes on. IE6 continues to be a pain for sure, but the mindset behind this is changing as the web and it's users evolve.

the willingness to upgrade your browser is going to be significantly faster as time goes on. You may be right. And then again maybe not. It's going to be fun to find out! I would note that IE6 persisted until now not because anyone wanted it to -- Microsoft hates IE6 more than anyone, since every IE6 user is both a support timesink and a potential paid upgrade that hasn't happened yet -- but because it sits in a nich…

Everything you say makes sense. Let me rephrase my statement into 2 separate statements then, as I should have initially.

1. Future browser upgrade timelines should not be based on the IE6 fiasco. It's too small a sample size to use as corroborating evidence in these predictions. It may end up being an anomaly.

2. In my own opinion I think the upgrade timeline will grow shorter. I don't have any hard evidence I can cite, it's just my impression as someone who's been involved in web development for the last 12 years or so. The points you mention are all valid, and I'm not saying there won't be new and different pains we'll enjoy ;)

Re: JavaScript: It’s Not Just for Browsers Any More

#86
post #6
post #3

Strangely enough, Netscape Corporation once marketed javascript as a lightweight server-side language. IIRC the browser-side javascript thing was an afterthought.

You are right that Netscape used JavaScript as a lightweight server-side language. However my memory from the times is that JavaScript was invented for the browser and then ported to the server.

I think it was called LiveScript. I'm pretty sure it came along after JavaScript as part of Netscape enterprise server or something (kind of like a coldfusion)

Re: JavaScript: It’s Not Just for Browsers Any More

#87

Earlier quoted context omitted.

Yeah, but it is the first point that matters, and when matched with two and three the real power comes.

1. People are forced to use javascript. 2. There are a lot of people who use erlang.

1. Good point. I was definitely forced to use it. Nowadays it's probably more like a first taste language for most new developers though.

Re: JavaScript: It’s Not Just for Browsers Any More

#88
post #86
post #6

Earlier quoted context omitted.

You are right that Netscape used JavaScript as a lightweight server-side language. However my memory from the times is that JavaScript was invented for the browser and then ported to the server.

I think it was called LiveScript. I'm pretty sure it came along after JavaScript as part of Netscape enterprise server or something (kind of like a coldfusion)

LiveScript is what they called JavaScript before the Sun deal involving Java. See http://en.wikipedia.org/wiki/JavaScript#History for more.

Re: JavaScript: It’s Not Just for Browsers Any More

#89
post #39

Earlier quoted context omitted.

Well Python's lambda's kinna suck for one. As far as I know, Python, Ruby, and PHP all suffer from the fact that all functions are not first class. Also Javascript's prototypal inheritance is pretty neat. I'm not saying js is a "great" language, it's not with out it's crufty bits, but it's a nicer language than most people give it credit for.

"Well Python's lambda's kinna suck for one." Not really relevant in this context, as naming things isn't that big a deal. Lambdas are only needed for one-liners and they serve that purpose fine. "As far as I know, Python, Ruby, and PHP all suffer from the fact that all functions are not first class." Definitely false for Python, Ruby actually has multiple kinds of first-class functions (for better or for worse, I am…

Erm. Yeah I know for a fact that not ALL PHP functions are first class. Which was all I was saying. PHP does have lambda, but not EVERY function is a lambda.

Re: JavaScript: It’s Not Just for Browsers Any More

#90
post #77
post #45

Earlier quoted context omitted.

JS has three epic wins going for it, that cannot be matched together by another language: * A shitton of people are already using it on the daily * All of the existing code written in it is event-driven * It's got prototypical inheritance, and some people actually use it instead of bludgeoning in classicism

* A shitton of people are already using it on the daily This is actually a problem. Majority of that shitton use js without knowing what they are doing. It's a copy-pasted code for some client-side validation. Even the so-called framework-users (jQuery and Prototype) depend blindly on plugins for their job.

You aren't wrong, and I find Protoype.js incredibly depressing (see my third point).

But the point is that you're not going to get fired for choosing JS on the server. It has curly braces! Your boss isn't so worried about hiring.

Post reply on HN