Re: Shouldn't timers be specified?

2012-01-22 Thread Jorge
On 23/01/2012, at 04:57, Mikeal Rogers wrote: > On Jan 22, 2012, at January 22, 20121:35 PM, Jorge wrote: >> . Not at all. Not only it doesn't clamp to 4ms (which happens to be a good >> thing, IMO), but its timers often fire out of order ! > > node.js does not conform to the 4ms clamp because th

Re: Shouldn't timers be specified?

2012-01-22 Thread Andrea Giammarchi
var d = new Date, i = setInterval(function () {console.log(new Date - d); d = new Date;}, 1); most likely gonna fire a sequence of 10 0 11 0 12 0 10 0 11 0 10 0 ... not really reliable, even if delay is specified to 10 o 20, does not look that consistent with setTimeout, I have tried delay 3 an

Re: Shouldn't timers be specified?

2012-01-22 Thread Mikeal Rogers
On Jan 22, 2012, at January 22, 20121:35 PM, Jorge wrote: > . Not at all. Not only it doesn't clamp to 4ms (which happens to be a good > thing, IMO), but its timers often fire out of order ! node.js does not conform to the 4ms clamp because that would be silly. It does not fire timers out of or

Re: Shouldn't timers be specified?

2012-01-22 Thread Rick Waldron
> > Node.js does *not* conform. Not at all. Not only it doesn't clamp to 4ms > (which happens to be a good thing, IMO), but its timers often fire out of > order ! > Is there a reference or test case you can cite for this? Thanks! Rick ___ es-discuss ma

Re: Shouldn't timers be specified?

2012-01-22 Thread Rick Waldron
On Sun, Jan 22, 2012 at 10:29 PM, Brendan Eich wrote: > Rick Waldron >> January 22, 2012 12:50 PM >> >> This is a perfect use case for the forth-coming module system (similar to >> the way Globalization is being developed). Dave Herman and I had a brief >> "over

Re: Shouldn't timers be specified?

2012-01-22 Thread Brendan Eich
Jorge January 22, 2012 1:35 PM Now isn't that ~ the opposite of what you said on 2011-03-18 in David Bruants' "Bringing setTimeout to ECMAScript" thread ? Is this a "gotcha" game? Notice the date. Our cutoff for ES6 features was 2011-05. That's one thing that

Re: Shouldn't timers be specified?

2012-01-22 Thread Brendan Eich
Rick Waldron January 22, 2012 12:50 PM This is a perfect use case for the forth-coming module system (similar to the way Globalization is being developed). Dave Herman and I had a brief "over Twitter" exchange that began with my desire for a migration of parseInt

Re: Shouldn't timers be specified?

2012-01-22 Thread Jorge
On 22/01/2012, at 21:00, Brendan Eich wrote: >> Brandon Benvie >> January 21, 2012 9:59 PM >> Sorry to spam this thread but I wanted to get the relevent points in up >> front: >> >> 'Actually, wait a minute -- I think I disagree with you here. > > On what? Bein

Re: Shouldn't timers be specified?

2012-01-22 Thread Rick Waldron
This is a perfect use case for the forth-coming module system (similar to the way Globalization is being developed). Dave Herman and I had a brief "over Twitter" exchange that began with my desire for a migration of parseInt and parseFloat to Math, which I followed with a suggestion to do the same

Re: Shouldn't timers be specified?

2012-01-22 Thread Brendan Eich
Brandon Benvie January 21, 2012 9:59 PM Sorry to spam this thread but I wanted to get the relevent points in up front: 'Actually, wait a minute -- I think I disagree with you here. On what? Being past the deadline? Not rushing a de-jure standard before we h

Re: Shouldn't timers be specified?

2012-01-22 Thread David Bruant
Le 22/01/2012 06:36, Brandon Benvie a écrit : > For reference, here's the start of an es-discuss thread on the topic > from March > 2011: https://mail.mozilla.org/pipermail/es-discuss/2011-March/013129.html Indeed. Two notable answers by Mark Miller [1] [2] indicate an intention to bring setTimeout

Re: Shouldn't timers be specified?

2012-01-22 Thread Brandon Benvie
Essentially: there's definitely a lot of things that will and do exist in JS that are platform specific implementations and even platform specific in existence. Timers aren't something that are platform specific in existence. A JS implementation that lacks timer functions is considered deficient, a

Re: Shouldn't timers be specified?

2012-01-22 Thread Andrea Giammarchi
process.nextTick already landed in browsers, as concept, it's called setImmediate http://msdn.microsoft.com/en-us/library/ie/hh673556(v=vs.85).aspx#setimmediate About Rhino, that implementation is not the equivalent of what we have in browsers, where the most useful thing ever is rarely used out

Re: Shouldn't timers be specified?

2012-01-21 Thread Brandon Benvie
Sorry to spam this thread but I wanted to get the relevent points in up front: 'Actually, wait a minute -- I think I disagree with you here. WHATWG specifies the specific event queue of the browser. Node.js has its own event queue. Others may as well. The unofficial agreement of JS has always been

Re: Shouldn't timers be specified?

2012-01-21 Thread Brandon Benvie
Absolutely agree. I don't see a place for Node's 1ms resolution in browsers, which was the impetus for raising the issue. I see a place for Node (and other non-browser platforms) to implement their own host timers that provide higher resolution (In fact Node's process.nextTick(callback) is a good e

Re: Shouldn't timers be specified?

2012-01-21 Thread Brendan Eich
Brandon Benvie January 21, 2012 7:37 PM Correction: it is specified in HTML5 here http://www.whatwg.org/specs/web-apps/current-work/multipage/timers.html#timers. Suffice to say that a DOM specification isn't sufficient for something so central to JavaScript,

Re: Shouldn't timers be specified?

2012-01-21 Thread Brandon Benvie
Correction: it is specified in HTML5 here http://www.whatwg.org/specs/web-apps/current-work/multipage/timers.html#timers . Suffice to say that a DOM specification isn't sufficient for something so central to JavaScript, nor is it the specification currently followed by browsers anyway. ___

Shouldn't timers be specified?

2012-01-21 Thread Brandon Benvie
I just finished answering this question on StackOverflow and it got me thinking about the obvious: timers are not specified yet are central to a vast swath of JavaScript code. Timers in Node.js have a significantly higher resolution than what is found in browsers: `setTimeout(fn, 1)` will, in fact,