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

2010-10-29:

[14:55] <WesMac> deanlandolt1: you around?
[14:57] <deanlandolt1> WesMac: hey
[14:57] <WesMac> deanlandolt1: You know when you write a program-module? The first one that kicks stuff off?
[14:57] <WesMac> It can be in a #!
[14:57] <WesMac> or in a <SCRIPT> tag right inside a web page?
[14:57] <deanlandolt1> yeah, the stuff that's in bin
[14:57] <WesMac> We have said previously that those are modules
[14:57] <deanlandolt1> hmm...i guess a <script> tag could be a program mod
[14:58] <WesMac> But is "program module" a good name?
[14:58] <WesMac> "program" ?
[14:58] <WesMac> "primordial module"?
[14:58] <deanlandolt1> a main module is how i've always thought of it
[14:58] <deanlandolt1> partly because of other langs like java and .net
[14:58] <WesMac> FWIW - they (can?) execute in "program" context instead of "function" context
[14:58] * WesMac nods
[14:58] <WesMac> I've been calling them primordial modules in my local docs
[14:59] <WesMac> THey also have one interesting property
[14:59] <WesMac> vars on the primordial module are on other modules' scope chains
[14:59] <WesMac> It's actually a bit of an unfortunate property, as it doesn't mesh with ES-H module think-space
[15:01] <deanlandolt1> hmm...is that unfortunate?
[15:02] <deanlandolt1> i guess it's not true of other "main module" langs
[15:02] <WesMac> *nod* - it's a significant criticism raised with me more than once by more than one member of TC-39
[15:03] <WesMac> It's also recognized as unfortunate and unffixable with only ES-5
[15:03] <WesMac> But we can gateway CJS to ES-H by explicitly saying that the scope chain behaviour is undefined
[15:04] <WesMac> deanlandolt1: do you think that talking about a CommonJS Program would be more or less confusing than one of "main module", "program module", "primordial module" ?
[15:05] <deanlandolt1> both, depending on who you're talking to :)
[15:05] <deanlandolt1> probably /more/ confusing to me, because to me program encapsulates /everything/, including requires
[15:07] <WesMac> *nod* that's a good point
[15:07] * WesMac thinks a little more

 

 

Logs by date :