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

2010-11-12:

[17:23] <WesMac> deanlandolt: You around? Do you know what this does on most platforms? (from the interop tests): test.print('DONE', 'info');
[17:23] <WesMac> On GPSEE and BravoJS, that prints "DONEinfo" to the screen
[17:24] <deanlandolt> WesMac: test.print? is that supposed to be like system.print or just the print free var?
[17:25] <deanlandolt> in any event, systems are a little seedy there...print exists in the process obj in node, and it just throws the first arg to stdin w/o a newline
[17:25] <deanlandolt> print in narwhal and ringojs IIRC does an Array.prototype.join.call(arguments)
[17:25] <deanlandolt> err, join.call(arguments, " ")
[17:26] <WesMac> deanlandolt: from test.js, looks like he maps it to free-var print when there is one, otherwise calls require("system").stdio.print
[17:26] <deanlandolt> ah, yes
[17:26] <WesMac> which is odd, I thought Rhino had a free print
[17:26] <deanlandolt> hmm, stdio.print? odd
[17:26] <deanlandolt> rhino does
[17:26] <WesMac> Yeah, doubly odd for a modules test suite
[17:26] <deanlandolt> i think narwhal overrides it
[17:26] <WesMac> Ah, that probably explains that; spidermonkey and rhino normally are very similar for same-named htings
[17:26] <deanlandolt> yeah
[17:27] <WesMac> spidermonkey's print concats the arguments; that's what GPSEE's print emulates
[17:27] <deanlandolt> concats? no " "?
[17:27] <WesMac> Hm, good question!
[17:27] * WesMac checks
[17:27] <deanlandolt> that's odd...i'd think it'd at least throw a "," in there
[17:28] <WesMac> deanlandolt: Yeah, there's a space
[17:28] <deanlandolt> (considering that's default behavior, if arguments were an array at least)
[17:28] <deanlandolt> what about a newline?
[17:28] <deanlandolt> node has util.puts for tat
[17:28] <deanlandolt> that
[17:28] <WesMac> A newline per statement
[17:28] <deanlandolt> k
[17:28] <deanlandolt> yeah, that's pretty much standard for everyone but node
[17:28] <WesMac> print("Hello," + firstName);
[17:29] <deanlandolt> and that would print "Hello,WesMac"?
[17:29] <WesMac> So the test suite has at least two non-standard requirements: 1) print 2) program module *must* be a top-level dir
[17:29] <WesMac> deanlandolt: Yes
[17:29] <deanlandolt> as opposed to print("Hello,", firstName)
[17:29] <WesMac> wesmac: er
[17:29] <WesMac> print("Hello, " + firstName);
[17:29] <WesMac> print("Hello,", firstName);
[17:29] <WesMac> same output
[17:29] <deanlandolt> gotcha
[17:30] <WesMac> #1 is no big deal, #2 is pretty frustrating
[17:30] <deanlandolt> yeah, that's pretty useful (but probably shouldn't be a free var considering the browser legacy)
[17:30] <deanlandolt> yeah, i can imagine
[17:30] <WesMac> frustrating because it always requires tweaking the module path, and require.paths() is not really browser-appropriate
[17:30] <deanlandolt> yeah
[17:31] <WesMac> I provide a free variable in BravoJS's interoperability test running, I guess I should make it behave non-standardly so it passes tests 8p
[19:13] <cadorn> kriszyp: How difficult would it be to add an option to nodules to make it sync?
[19:51] <kriszyp> cadorn: hmm, that seems like it should be reasonable
[19:52] <kriszyp> it works on rhino synchronously
[19:52] <cadorn> ok ok
[19:52] <cadorn> I can look at reusing that
[19:52] <kriszyp> however, cadorn, I don't think NodeJS has a sync http api
[19:52] <cadorn> not for nore
[19:52] <kriszyp> are you looking at this only locally (file)?
[19:53] <kriszyp> nore=node?
[19:53] <cadorn> yeah
[19:53] <cadorn> one of my use-cases is to assemble a program using nodules loading files from file:// as a chrome URL handler for firefox
[19:54] <cadorn> the chrome protocol handler does not support an async response
[19:54] <cadorn> so I need to block until nodules has loaded all modules
[19:55] <cadorn> I can look at the rhino code and add an option for xulrunner
[19:55] <cadorn> so nodules also runs i the browser?
[20:11] <hannesw> In case anybody's interested in patterns for composing JSGI applications
[20:11] <hannesw> I've started working on this little framework called Stick:
[20:12] <hannesw> https://github.com/hns/stick
[20:12] <hannesw> I think it's kind of neat, and composing JSGI apps always felt awkward before
[20:26] <cadorn> kriszyp: can nodules be used in the browser?
[20:26] <cadorn> is there an example?
[20:28] <kriszyp> cadorn, no, I haven't done anything to support nodules in the browser, I did make sure transporter works with nodules so you can deliver to RequireJS or something like
[20:29] <cadorn> ok
[20:54] <cadorn> kriszyp: the rhino code seems to be async as well, any pointers as to what I need to do to add a sync option?
[20:56] <kriszyp> I didn't think rhino could even run in async
[20:57] <kriszyp> hmm, maybe there is something async in there
[20:57] <cadorn> the module loading is done via rhino-delay
[20:58] <cadorn> the FS calls are sync
[20:58] <kriszyp> ah, ok
[20:58] <cadorn> so I guess I just need to bypass the timeouts?
[20:59] <kriszyp> now that I think about it, it seems like there was a bug when I went full sync, maybe it will work for you :/
[21:01] <cadorn> kriszyp: ok, I'll see what I can do
[21:01] <kriszyp> you could try setting enqueue to just do a straight callback instead of enqueuing
[21:01] <kriszyp> that would make it sync, I think
[21:01] <cadorn> k
[21:06] <cadorn> kriszyp: bingo - seems to work

 

 

Logs by date :