Mochabot log - CommonJS IRC channel: #commonjs on irc.freenode.net

2010-01-19:

[13:06] <JohnnyL> any of you use js (maybe v8) for OpenGL as as a scripting language under c++?
[13:16] <oberhamsi> JohnnyL: used rhino js with java opengl bindings
[13:20] <JohnnyL> oberhamsi ok
[19:06] <Wes-> dan friesen just offered an interesting insight in the Binary/E thread
[19:07] <Dantman> ^_^ That reminds me... I want collections modules... Namely something like WeekHashMap in JS
[19:07] <Dantman> Lack of Set() is always annoying in some cases.
[19:08] <Dantman> I can only abuse Array and Object so far.
[19:08] <Wes-> Dantman: sounds like you might need to write a native type
[19:08] <Wes-> OR a pre-processor
[19:09] <Dantman> Aye, collections would be written in native code.
[19:09] <ashb> what does WeakHashMap do?
[19:10] <Dantman> Though, it wouldn't be impossible to write any collection type besides WeakHashMap in less efficient JS.
[19:11] <ashb> the "Weak" there implies to me it might not be possible
[19:11] <Dantman> Aye, only native code can implement it, that's why "module"
[19:12] <Dantman> ashb, It's a HashMap (key/value pairs) in which values do not count as references. So when the value has no other references than in a WeakHashMap it will be GCed and disappear from the WeakHashMap.
[19:12] <ashb> i dont think that is possible in spidermonkey
[19:13] <Dantman> ashb, http://github.com/dantman/mongo-rhino/blob/master/mongo.js#L26-34
[19:13] <Dantman> ashb, I believe I managed to do something like it using JSLibs
[19:13] <Dantman> Which uses SpiderMonkey
[19:14] <Wes-> ashb: I think it is
[19:14] <ashb> Wes-: for any value at all?
[19:14] <Dantman> Also I think there is a ES-Harmony strawman about it.
[19:14] <Dantman> Well, something like it
[19:14] <ashb> Dantman: yeah there is a weakref thing
[19:14] <Wes-> ashb: I think so. The key is that the container does not have those things as properties
[19:14] <ashb> Wes-: but how does it not just return a rubish property?
[19:15] <ashb> i'm not aware of anyway to ask 'is this jsval still valid'
[19:15] <Wes-> ashb: You have to implement your own crap in the back to keep track of it
[19:15] <Wes-> ashb: gpsee has weakly-referenced modules, and their code seems to run okay. ;)
[19:15] <ashb> Wes-: sure - i have weak refs in places to, but not only for native modules i control
[19:15] <Wes-> ashb: And you can't ask "is it still valid"
[19:15] <ashb> not for ariobtrary objs
[19:15] <Wes-> ashb: you have to hook the garbage collector
[19:16] <ashb> i wasn't aware you could
[19:16] <Wes-> oh yeah, there's a couple of different ways
[19:16] <Wes-> globally and per-JSClass
[19:16] <ashb> Dantman: what interface have you copied for that mongo module?
[19:17] <ashb> Dantman: fwiw that weak hash map for ObjectIds is exactly what i did for document nodes
[19:17] <Wes-> also, we use weak references in ByteSTring
[19:17] <Dantman> ashb, The shell's API... ie: The existing JS Api.
[19:17] <ashb> Dantman: cool. thats waht i'm working towards
[19:17] <Wes-> so that bs[2] doesn't call malloc()
[19:17] <ashb> Dantman: btw - nice trick you might not know. the first 4 bytes of ObjectId are a epoch 4 byte time stamp
[19:17] <Wes-> weak references are also needed for BLOB COW
[19:18] <Dantman> The only thing different is Mongo (which doesn't exist in the shell), and I have a preloadCollections or something since there is no catchall
[19:18] <ashb> Wes-: yeah - i know how to do it for a native class that i can change - just wasn't aware of how to do it for any object at all
[19:18] <Dantman> Aye, I know the components of an ObjectId
[19:19] <Dantman> I still prefer to save my own Date objects though.
[19:37] <Dantman> Wes-, Here's another thing to keep in mind... You can't overload <>, but you can make valueOf return a number when doing <> comparisons.
[19:37] <ashb> have to be careful when doing that, as it behaves odly under == comparisons
[19:37] <Wes-> Dantman: But you cannot make comparison call valueOf() unless the left-hand-side is a number type
[19:38] <Wes-> ashb: wait, is the coercsion different for <> and == ?
[19:38] <Dantman> Worked fine when I was testing.
[19:38] <ashb> Wes-: i think it might be
[19:38] <Dantman> iirc valueOf was not called when == was.
[19:38] <ashb> i just know it was odd
[19:38] <Dantman> I was part of a discussion in the jQuery-dev mailing list on it awhile back
[19:39] <ashb> what ever the case is, the returned value needs to work naturally in all situatiopns where a raw number would
[19:39] <ashb> or where what ever the type you are emulating would
[19:41] <Wes-> Dantman: wierd shit - http://pastebin.mozilla.org/698260
[19:41] <Wes-> Dantman: that is why your suggestion of interned Bytes is interesting
[19:41] <Wes-> == and === work
[19:41] <Dantman> Nope, no matter what the left hand type is, even if it's the same object or a string when I use > or < valueOf is always called with a hint of "number"
[19:42] <Wes-> Dantman: try when you have an object on each side
[19:42] <Dantman> Already did... b > b, b < b both printed "number" twice.
[19:42] <Wes-> Dantman: observation - < and > behave this way, but == does not
[19:43] <Wes-> you REALLY want this to be true:
[19:43] <Wes-> var a = new ByteString([0]);
[19:43] <Wes-> var b = new ByteString([0]);
[19:43] <Dantman> That;s what the interning is for
[19:43] <Wes-> a[0] == b[0]
[19:43] <Wes-> Dantman: exactly, that's why I said it's a good idea~
[19:43] <Dantman> I even did earlier test with a f1 and f2 that had a 2 and a 5 in a n property and would return that number when the hint was "number"
[19:43] <Dantman> ^_^ Heh
[19:44] <Dantman> Wes-, another thing to thing about... Let's see how this works when we return a string instead of a number ;)
[19:44] <Wes-> ashb: any objection to [] returning a Byte which supports: Byte(10), Byte("\n"), comparison, and range?
[19:44] <ashb> let me think
[19:45] <Wes-> Dantman: I don't think WHAT gets returned is actually relevant, except to insure that Bytes can be compared against each other
[19:45] <ashb> yeah - and being able to do Byte(10) == "\n" would be neat too
[19:45] <Wes-> That is to say, I think if (Byte(10) == 10) is meaningless
[19:45] <ashb> which you can't do with a number
[19:46] <Wes-> So, you think that it IS meaningful?
[19:46] <Wes-> I would be happier with
[19:46] <Dantman> Wes-, the reason I say that is if strings work well enough it could potentially be possible for ByteString([1,2]) > ByteString([0,3]) to work.
[19:46] <ashb> for (byte ... ) { if byte == "\n" )
[19:46] <ashb> sure i think thats useful
[19:46] <Wes-> if (Byte(10) == Byte("\n"))
[19:46] <ashb> yeah but if you could avoid the second byte that would be nice
[19:46] <Wes-> ashb: How do you implement that without losing > and < ?
[19:46] <Dantman> So far comparisons between a number and a string seam to work fine if they are both 1 digit
[19:47] <Dantman> Haven't tested more
[19:47] <ashb> Wes-: not sure, but i really want to be able to compare to literals if i can
[19:47] <Wes-> Dantman: that's a red herring, you can pick a different repn for ranges
[19:47] <ashb> since well, otherwise why not just use bs.get(idx)
[19:47] <Wes-> ashb: Hmm
[19:49] <Wes-> Looks like strings can work too, FWIW
[19:49] <Wes-> so basically, something like
[19:49] <Wes-> function Byte(i) { return bytes[i]; }
[19:50] <Wes-> and
[19:50] <Wes-> bytes[65] = { toString: function() { return "a" } };
[19:51] <Wes-> this gives us range, range and equality comparison against string, and self-equality comparison (due to interned bytes)
[19:58] <Dantman> Sure it won't work with ByteString?
[19:58] <Dantman> *twitch* Now I'm using that term...
[20:01] <Dantman> Personally I wouldn't compare text to bytes that way...
[20:02] <Dantman> var b = theString.toBlob(theCharset); if ( buf.startsWith(b) ) ...
[20:08] <Wes-> Dantman: I don't see any compelling argument for using ByteString
[20:09] <Wes-> dantman: Imagine the case where you have a file and you need to trim off all the newlines. should it REALLY be necessary to decode to a string and back just to do that? YOu're talking about quadrupling the memory use so that you can remove a single byte!
[20:10] <Dantman> Nope, not necessary.
[20:10] <Dantman> var b = "\n".toBlob(theCharset); theData.indexOf(b);
[20:10] <Dantman> You only to the conversion once
[20:10] <Wes-> Yes, I see how much clearer that is than
[20:10] <Wes-> if (ba[ba.length] == Byte("\n")
[20:11] <Wes-> And what do you do if you want to manipulate jpeg files?
[20:11] <Wes-> insist that they are composed of text strings?
[20:11] <Dantman> Eh?
[20:12] <Wes-> I just don't understand why you want to convert into strings before working on your binary data
[20:12] <Wes-> you'd might as well just using String()
[20:12] <Dantman> I'm not converting to a string...
[20:14] <Wes-> wait,
[20:14] <Wes-> you're saying that you prefer
[20:15] <Wes-> "\n".toBlob(theCharset)
[20:15] <Wes-> over
[20:15] <Wes-> Byte("\n")
[20:15] <Wes-> ?
[20:15] <Dantman> Pretty much...
[20:15] <Wes-> what charset?
[20:15] <Dantman> You can't not have a charset if you're comparing text you have to binary data.
[20:15] <Dantman> var newline = "\n".toBlob(theFilesEncoding); if ( theFileData.endsWith(newline) ) theFileData.length -= newline.length;
[20:15] <Wes-> Who said anything about text?
[20:16] <Dantman> A newline is text...
[20:16] <Wes-> no, it's a series of bits
[20:16] <deanlandolt> Dantman: charset? that string is just 0-255
[20:16] <Wes-> 00001010 to be precise
[20:17] <deanlandolt> or am i missing something...would you call that a base256 encoding?
[20:17] <Wes-> hehehe
[20:21] <deanlandolt> Wes-: am i understanding correctly in assuming the Byte you (Dantman originally) proposed would contruct 256 unique objects and the Byte function would always return the right Byte object for int or string <= 0xff...right?
[20:21] <Wes-> deanlandolt: exactly
[20:21] <deanlandolt> that sounds pretty awesome
[20:21] <Wes-> deanlandolt: we are also debating whether those objects should have valueOf()
[20:21] <Wes-> deanlandolt: if they do, < and > can be made to work as well as ==
[20:21] <Dantman> Pretty much, though my original proposal was to leave that a ByteString
[20:21] <deanlandolt> yeah, i caught that...just don't grep the implications quite yet
[20:22] <Wes-> Dantman: it seems wierd to return a ByteString from a byte array
[20:22] <deanlandolt> Wes-: didn't you or ashb say something about valueOf requiring a number on the lhs?
[20:22] <Wes-> deanlandolt: I did and was wrong
[20:22] <deanlandolt> oh...cool...that's pretty spectacular
[20:23] <Dantman> Wes-, really? I consider [idx] to be non-mutable... You mutate the parent.
[20:23] <Dantman> For example...
[20:23] <Wes-> Dantman: Right, but why would ByteArrays be made up of ByteStrings? They should be made up of Bytes.
[20:24] <deanlandolt> to me both ByteStrings and ByteArrays are made up of bytes
[20:24] <Dantman> var strArray = ["a", "b", "c"]; For strArray[2] you can't shorten it, you have to shorten the strArray.
[20:24] <Wes-> ??
[20:25] <Wes-> In order to justify use of ByteString, you need to justify individual entities from ByteArray[x] having the methods on ByteString.prototype
[20:26] <deanlandolt> can't you make the 256 Byte objects immutable (or non-configurable)?
[20:26] <Wes-> I can actually thinking of one REALLY good reason why NOT: it makes deep copying of objects with ByteStrings in them a royal pain in the ass!
[20:26] <Wes-> deanlandolt: That's *eaxctly* what you do
[20:27] <deanlandolt> perhaps i'm misunderstanding your concern, Dantman: are you arguing that the objects returned from [idx] should be immutable?
[20:28] <Dantman> No, symmetry... I consider ByteString/Blob to be symmetrical with String, and likewise some cases in ByteArray to be symmetrical with ByteString.
[20:29] <Dantman> ie: string[idx] returns a string, thus I expect bytestring[idx] to return a bytestring. At that point it feels strange if bytearray returns something completely different.
[20:29] <deanlandolt> well, if i have my geometry right, you're asking for everything to be symmetrical with everything
[20:29] <deanlandolt> String ~ ByteString ~ ByteArray ~ String...that doesn't seem right
[20:30] <Wes-> Dantman: a) symmetry is not the /most/ compelling case, usability trumps IMO. That said, your symmetry case falls apart, because instanceof String do yield instancesof String with[]. They yield atoms (instrinsics)
[20:30] <deanlandolt> Dantman: string[idx] doesn't return a new String boxed object, does it?
[20:30] <Wes-> js> var a = new String("asldkjf");
[20:30] <gbot2> Wes-: undefined
[20:30] <Wes-> js> a[0] instanceof String
[20:30] <deanlandolt> it returns an immutable primitive
[20:30] <gbot2> Wes-: Error: ReferenceError: a is not defined
[20:30] <Wes-> false
[20:30] <Wes-> gbot2: while(1) { 1 } ;
[20:31] * Wes- whistles
[20:31] <Dantman> Tch, I think to much about what I write... messages go on before I'm finished.
[20:33] * Dantman thinks he's going to have to make that coluor coded table after all...
[20:34] <Dantman> But before that... I have to find the proper way to disable services on the server from starting up without removing them.
[20:36] <Dantman> I should save the specs so I can make the table on the train.
[20:44] <deanlandolt> Wes-: the Byte type would also imply a Bit type with the same shape...perhaps all of kriskowal's Bit* operations wouldn't be necessary but it would be nice to have a sensible way to represent a Byte with Bits
[20:46] <Dantman> Heh, to bad we can't borrow Ruby's binary literal
[20:47] * Dantman wishes 0xFF was actually 16xFF so it would be logical for 2x11111111 to work.
[20:51] <Wes-> deanlandolt: The problem with Kris' bit operations, I think, is that they can't go "deep enough" in the language to offer any real benefit. IME anybody using bit-types (with bits > 32 bits) is going to be disappointed that they can't do any bitwise operations!
[20:51] <Wes-> and, or, not, shift, roll, etc
[20:52] <deanlandolt> i'll buy that, but is there value to having Byte(10) === Byte("\n") === Byte(Bit(0),Bit(0),Bit(0),Bit(0),Bit(1),Bit(0),Bit(1)) === Byte(Bit(false),Bit(false),Bit(false),Bit(false),Bit(true),Bit(false),Bit(true))?
[20:52] <Wes-> But I also submit that they don't belong in the same spec as ByteArray and ByteString -- the use cases are just way too different
[20:53] <Wes-> deanlandolt: That's an interesting question
[20:53] <deanlandolt> i'm just thinking in terms of laying the groundwork for them...it wouldn't exactly be burdensome to implement Bit
[20:53] <Wes-> I *suspect* the answer is -- in the real world, no, because |, &, ~, <<, <<<, etc a so much faster than running through objects
[20:54] <Dantman> Array of arrays to ByteString to represent bytes made of bits?
[20:54] <Wes-> Dantman: No, the representation is irrelevant
[20:55] <deanlandolt> Dantman: i'm just thinking that if you have arrays of bits (for whatever reason) you should be able to get a handle on the representative Byte object...but that's not really something that would need to be spec'd
[20:56] <Wes-> if (arguments[0] == 0 && arguments[1] == 0 && arguments[2] == 0 && arguments[3] == 0 && arguments[4] == 1 && arguments[6] == 0 && arguments[7] == 1) return _internal_bytes[5]
[20:57] <ashb> Symetry be damned.
[20:57] <deanlandolt> it's fairly academic i guess...as you said, Wes-, without the bitwise operators it wouldn't see any use
[20:57] <ashb> Binary data is *not* strings
[20:57] <ashb> if you want symetry with string, use a stirng and suffer the bugs/edge cases it gives you
[20:58] <deanlandolt> ashb: Binary data can be represented /as/ strings (or we weouldn't have all the radix encodings :)
[20:58] <ashb> sure, but storing binary data in Strings is asking for some issues
[20:58] <deanlandolt> ashb: that's not what's being suggested
[20:58] <ashb> it at least makes me very ver very uneasy
[20:59] <ashb> no, but i'm saying "symerty be damned"
[20:59] <deanlandolt> ah...fair enough :)
[20:59] <deanlandolt> i think there are some compelling arguments that string[idx]->string is not symmetrical with bytestring[idx]->bytestring anyway
[21:00] <deanlandolt> ashb: what do you think about the Dantman/Wes- suggestion of creating 256 unique non-configurable Byte objects?
[21:01] <ashb> if the behaviour is sane and preticable, sure
[21:02] <deanlandolt> hell, it's almost a primitive...pretty cute idea
[21:02] <Wes-> the next questions are: do we support range comparison (I say yes), and do we support valueOf yielding an intrinsic, and if so, which one?
[21:03] <ashb> range comp?
[21:03] <Wes-> ashb: if (ba[0] > ba[1])
[21:03] <ashb> sure - why not? bytes have an order
[21:03] <inimino> what's the benefit of introducing a type that's basically just an unsigned char when we already have Number?
[21:03] <Wes-> We can actually support range comparison without defining that the valueOf yields an intrinsic
[21:04] <Wes-> inimino: if (ba[0] == 10) is less descriptive than if (ba[0] == Byte("\n"))
[21:04] <Wes-> But that's a good point
[21:04] <deanlandolt> inimino: a byte isn't quite a number
[21:04] <deanlandolt> and we can hang functions on it
[21:04] <Wes-> deanlandolt: what functions would you hang on it?
[21:05] <deanlandolt> .valueOf for one :)
[21:05] <Wes-> deanlandolt: That's superflous if we use number, though
[21:05] <inimino> heh
[21:05] <deanlandolt> true
[21:05] <ashb> basically i don't care much about the impl details - i just care about the return value from [[Get]] being useful
[21:06] <ashb> and a unary ByteString is far from useful
[21:06] <deanlandolt> but in the future, toBitString and other such monstrosities would be possible
[21:06] <Wes-> ashb: I agree, unary ByteString means you have to charCodeAt(0) it to use it reasonably
[21:06] <ashb> Wes-: which makes [[Get]] useless from what i can think of
[21:06] <Wes-> deanlandolt: true
[21:06] <Wes-> OTOH, number would be faster
[21:07] <Wes-> ashb: yeah
[21:07] <Wes-> If we are writing heavy-use binary code, say, for rendering graphics, the overhead of Byte() would be very measurable
[21:07] <Wes-> *OTOH*
[21:07] <deanlandolt> true...i'm all for [[Get]] returning number, but at the very least it's a really interesting idea for a compromise
[21:07] <Wes-> You could have ByteArray returning a number, and Byte().valueOf() doing that too
[21:08] <Wes-> I think everything would still hang together properly
[21:08] <Wes-> *OTOH*
[21:08] <Wes-> [[Get]] isn't really all that special, so another method could be used for perf concerns
[21:08] <deanlandolt> Wes-: i don't see too much overhead -- the objects only get allocated once, at start up
[21:08] <Wes-> *except* for the JS stack function call overhead
[21:08] <Wes-> hmmmm
[21:09] <Wes-> deanlandolt: think of iterating over 16MB of data and applying transformations
[21:09] <deanlandolt> then the methods take over, and you can use charCodeAt() without a problem
[21:09] <Wes-> Every time you use [[Get]] you would have to marshall an object
[21:09] <deanlandolt> Wes-: then don't use [[Get]] in that code :)
[21:09] <Wes-> Yeah. But then you may still have to pay for the JS stack and functional call over head
[21:10] <deanlandolt> [[Get]] returning an object completely mirrors charCodeAt() as far as i know
[21:10] <Wes-> no, charCodeAt() returns an intrinsic
[21:10] <inimino> if the added clarity of 'if (ba[0] == Byte("\n"))' is seen as compelling you can always define a Byte() constructor returning Number
[21:10] <Wes-> and charCodeAt() mandatates a function call
[21:10] <deanlandolt> inimino: true
[21:10] <Wes-> inimino: yes
[21:11] <Wes-> Anybody looked at the WebGL BLOB specification?
[21:11] <Wes-> What are they doing?
[21:11] <ashb> array of numbers i think
[21:13] <Wes-> we could decide that Byte is to String and 123 is to "123"
[21:13] <Wes-> we could decide that Byte is to String as 123 is to "123"
[21:14] <ashb> doesn't making everything just treat it as Numbers get that for us?
[21:15] <Wes-> yup, LOL
[21:15] * Wes- is coming full circle
[21:17] <Dantman> Well anyways, symmetry != "binary data are strings"... symmetry == "text type string is a sequence of chars, and binary type bytestring/blob is a sequence of bytes and expecting that all behaviours common to sequences behave the same." but I have work to do now...
[21:18] <ashb> fine i wont bother arguing then.
[21:18] <ashb> no point arguing with someone who's not around
[21:22] * Wes- is seeing double
[21:23] <Dantman> I'll probably just implement two api's anyways a expanded Binary/C and IO/B/Buffer that works fine in all the use cases as well as whatever gets ratified.
[21:39] <ashb> hmm script name - should it end in a / or not?
[21:39] <ashb> i guess not?
[21:39] <ashb> scriptName (JSGI) or SCRIPT_NAME (CGI)
[21:40] <deanlandolt_> ashb: not, if we require pathInfo to always start with a slash
[21:40] <ashb> ah okay. good
[21:41] <ashb> should probably explicitly say that it mustnot end with a '/' then
[21:41] <deanlandolt_> good point: i'll edit the wiki now
[21:49] <ashb> deanlandolt_: hmmm did there used to be a e.host ?
[21:50] <deanlandolt_> e.host?
[21:50] <deanlandolt_> there's a headers.host
[21:50] <deanlandolt_> (if it exists on the headers)
[21:51] <deanlandolt_> ashb: wait...
[21:51] <deanlandolt_> from the changes: env.SERVER_NAME => request.host
[21:52] <deanlandolt_> so yes, request.host is what used to be env.SERVER_NAME, and request.headers.host is a different, related beast
[21:52] <deanlandolt_> damn...how did that slip through?!
[21:53] <deanlandolt_> wait...no
[21:53] <deanlandolt_> damn...i can't figure out which is right...request.serverName or request.host
[21:54] <deanlandolt_> the spec calls for serverName and serverPort (not this phantom request.host)
[21:54] <ashb> yeah - i'm using .host
[21:54] <deanlandolt_> ashb or Dantman|Work: does mediawiki have a "blame" feature?
[21:54] <ashb> and i wonder if it used to exist but got removed or i just made it up
[21:54] <ashb> ish.
[21:54] <ashb> history tab
[21:55] <deanlandolt_> ashb: that just gives rev history...can i get a blame from that?
[21:55] <ashb> env.SERVER_NAME => request.host
[21:55] <ashb> in the changes from 0.2
[21:55] <deanlandolt_> yes, i see that...that's what i'm looking for
[21:55] <ashb> so it used to exist at one point
[21:55] <ashb> no you can't see who made that change
[21:55] <ashb> not without looking at each rev
[21:55] <ashb> sadyl
[21:56] <deanlandolt_> yeah...i'm sure it was from one of those discussions...i'd love to see when that made it in so i can find the requisite ML conversation
[21:56] <ashb> http://search.cpan.org/~daxim/Mediawiki-Blame-0.0.3/lib/Mediawiki/Blame.pm
[21:56] <ashb> unless you fancy using that
[21:56] <deanlandolt_> i'll just pick through the history :-/
[21:56] <ashb> race you :)
[21:57] <deanlandolt_> in the first commit
[21:57] <deanlandolt_> i win :_)
[21:57] <ashb> ah
[21:57] <deanlandolt_> so it's been around since the beginning, which doesn't help me much...now to search through gmail
[21:58] <ashb> yeah, i'm setting env.host and env.port
[21:58] <ashb> (based on the headers if found, or else based on the name i'm listening on
[21:59] <deanlandolt_> the changes section was the most /normative/ IIRC
[21:59] <ashb> yeah, i wonder if it used to be env.host and got renamed to env.serverName
[22:00] <deanlandolt_> it's very possible i just missed updating the changes (duplicate data is evil)
[22:00] <deanlandolt_> gmailfail on serverName serverPort -- hmmm
[22:01] <deanlandolt_> damn...kriszyp's using serverName/serverPort in perstore and pintura
[22:03] <deanlandolt_> i know i'd intended it to be host/port all along (to mirror the http spec)
[22:03] <deanlandolt_> i do not recall anyone complaining
[22:03] <ashb> can you find a link to pastie in the jsgi threads?
[22:04] <ashb> might be a link to my env dumps in there?
[22:04] <deanlandolt_> i'll dig that up, and i'll dig up the 0.2-0.3 middleware i made
[22:05] <ashb> yeah .serverName seems to have been there since the virst revision
[22:06] <deanlandolt_> here's my middelware: http://pastie.textmate.org/663962
[22:06] <ashb> which has host and port
[22:11] <ashb> deanlandolt_: ask kriszyp
[22:11] <kriszyp> what?
[22:11] <ashb> JSGI spec
[22:11] <ashb> do you ever remeber it haveing env.host instead of env.serverNAme
[22:11] <deanlandolt_> kriszyp: ashb found a spec bug
[22:11] <kriszyp> I don't remember
[22:12] <ashb> because both Zest and dean's 2->3 middleware use host/port instead
[22:12] <kriszyp> It looks my code uses host/posrt
[22:12] <ashb> deanlandolt_: just change it - make the wiki commint comment obvious
[22:12] <ashb> and see if anyone complains
[22:12] <ashb> *commit
[22:13] <deanlandolt_> heh...good deal :)
[22:13] <deanlandolt_> i'll tell the ML just in case
[22:13] <kriszyp> so you are changing it back to host/port?
[22:13] <ashb> i'd prefer it as such.
[22:13] <deanlandolt_> kriszyp: you're using serverName/serverPort in jsgi-client
[22:13] <kriszyp> heh, I see that
[22:13] <deanlandolt_> but you're also using your url extension so you probably don't use it
[22:14] <kriszyp> and host/port in simple handler...
[22:14] <kriszyp> and host/port in servlet handler
[22:14] <kriszyp> well at least I was consistent within the project :P
[22:14] <ashb> i have host/port in zest and juice
[22:14] <ashb> but then i would in jucie if i do in zest
[22:15] <deanlandolt_> host/port is definitely more inline with the stick-to-http-in-the-top-level-request priniciple...oh, and it's way shorter :)(
[22:15] <Dantman|Work> deanlandolt_, ^_^ blame would murder Wikipedia
[22:15] <deanlandolt_> Dantman|Work: heh...yay php
[22:16] <deanlandolt_> it could be regenerated on each change, but yeah, i hear ya
[22:16] <Dantman|Work> Heh, nah... the real issue is the mass amount of data and how revisions store entire blobs
[22:17] <deanlandolt_> oh well...it'd still be an awesome feature...wikipedia just needs more servers ;)
[22:18] <Dantman|Work> Heh... don't underestimate WP's traffic
[22:18] <deanlandolt_> oh i know
[22:18] <Dantman|Work> And it's content
[22:18] <deanlandolt_> i was (mostly) kidding
[22:18] <Dantman|Work> heh
[22:19] <deanlandolt_> "throw more servers at it" works at scales approaching wikipedia, but eventually it has to fall apart
[22:29] <ashb> deanlandolt_: course not - you hae on server per page >_>
[22:30] <ashb> writing tests is boring
[22:34] <ashb> speaking of which - maybe http://github.com/ashb/juice/blob/experimental/test/lib/fs-mock.js might be of use to someone else
[22:34] <ashb> tho not without docs
[22:34] <ashb> http://github.com/ashb/juice/blob/experimental/test/templates.t.js#L115-117
[22:34] <ashb> you basically give it a list of files and it mocks up the list, exists and isDir/isFile functions appropriately
[22:36] <ashb> doesn't handle writing yet mind
[22:36] <ashb> but i dont need that for my tests yet :)
[22:44] <deanlandolt_> kriszyp: i'm still hung up on line 1049 of events.js in your narwhal fork: Q.promise(value).emit("when", function (value)...
[22:45] <deanlandolt_> jsgi-client refuses to work complaining about a lack of emit here
[22:45] <kriszyp> what uses "events"?
[22:45] <kriszyp> where is there a require("events")?
[22:45] <deanlandolt_> jsgi-client
[22:46] <deanlandolt_> no it doesn't
[22:46] <deanlandolt_> hmm
[22:46] <kriszyp> it doesn't in http://github.com/kriszyp/commonjs-utils/blob/master/lib/jsgi-client.js
[22:46] <deanlandolt_> i wonder where the world i got require("events").when
[22:46] <kriszyp> it used to use "events"
[22:46] <kriszyp> but I switched back to "promise" a few weeks ago
[22:47] <deanlandolt_> oh...come...on! heh..i'd updated but already used the old stuff to start my store/couch.js module :-/
[22:48] <deanlandolt_> kriszyp: and she works! okay, my bad -- and i'll have something usable to push to github tonight or tomorrow night :)
[22:48] <kriszyp> oh, awesome

 

 

Logs by date :