00:15:16  * cybaijoined
00:34:48  * AtumTquit (Quit: AtumT)
00:53:47  * cybaiquit (Ping timeout: 248 seconds)
00:57:59  * jwaldenquit (Quit: ChatZilla 0.9.92-rdmsoft [XULRunner 35.0.1/20150122214805])
01:24:23  * cloudshuquit (Quit: Connection closed for inactivity)
01:28:05  * cybaijoined
01:51:15  * Jessidhiajoined
02:14:19  * keith_m__quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
02:46:25  * keith_mi_joined
02:50:43  * keith_mi_quit (Client Quit)
02:55:03  * keith_mi_joined
02:58:30  * Jessidhiaquit (Read error: Connection reset by peer)
03:02:49  * Jessidhiajoined
03:49:55  * keith_mi_quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
03:50:59  * howdoijoined
03:51:50  * kpattichajoined
04:26:03  * jmdyckquit (Remote host closed the connection)
06:26:57  * Jessidhiaquit (Quit: My MacBook has gone to sleep. ZZZzzz…)
06:28:30  * Jessidhiajoined
07:46:22  * kpattichaquit (Ping timeout: 246 seconds)
08:01:38  * kpattichajoined
08:04:06  * kpattich_joined
08:06:40  * kpattichaquit (Ping timeout: 252 seconds)
10:51:14  * mquy90joined
11:00:51  * Jessidhiaquit (Ping timeout: 246 seconds)
11:49:04  * kpattichajoined
11:49:41  * kpattich_quit (Ping timeout: 268 seconds)
11:50:49  * jmdyckjoined
11:54:36  * cybaiquit (Remote host closed the connection)
11:55:06  * cybaijoined
11:59:30  * cybaiquit (Ping timeout: 252 seconds)
12:18:20  * gibson042quit (Quit: Leaving.)
12:23:08  * cybaijoined
12:27:55  * cybaiquit (Ping timeout: 268 seconds)
12:33:28  * cybaijoined
13:10:01  * mgolquit (Ping timeout: 245 seconds)
13:12:08  * mgoljoined
13:15:22  * oliverdunkjoined
13:28:05  * howdoiquit (Quit: Connection closed for inactivity)
13:30:03  * andychenquit (Remote host closed the connection)
14:19:02  * gibson042joined
14:30:11  * Jessidhiajoined
15:20:56  * cloudshujoined
15:25:21  * Nimelrian_joined
15:27:44  * mquy90quit (Quit: Leaving)
15:38:54  * jwaldenjoined
15:52:52  * AtumTjoined
16:01:53  * AtumT_joined
16:04:36  * AtumTquit (Ping timeout: 245 seconds)
16:10:10  <Domenic>devsnek: what does .enumerate() do
16:10:41  <devsnek>Domenic: goes from an iterator of [V1, V2, V3] to [[0, V1], [1, V2], [2, V3]]
16:10:58  <devsnek>from my experience with iteration in rust and python its a very useful function
16:11:15  <Domenic>Huh. Maybe not the best name.
16:11:21  <Domenic>I can see it though
16:11:33  <Domenic>I've often had to keep a counter when iterating maps/sets
16:11:56  <devsnek>there's an argument that map can replace enumerate
16:12:03  <devsnek>but i think having both is okay
16:12:53  <devsnek>you'd have to add an index to map
16:13:01  <devsnek>and i'm not a fan of map on iterators having an index
16:13:11  <Domenic>Yeah, I tend to agree
16:13:51  <devsnek>i really need to write all these methods for the async prototype
16:14:34  * AtumTjoined
16:15:02  <devsnek>maybe we can just bring up "specifying async generators" at the june meeting
16:15:30  * kpattichaquit (Ping timeout: 246 seconds)
16:15:35  * AtumT_quit (Ping timeout: 255 seconds)
16:16:07  <ljharb>if map shouldn’t have an index then why have enumerate? map having an index seems appropriate, even if we don’t call it index
16:16:37  <devsnek>iterators don't have well defined starts and ends
16:16:41  <devsnek>in a generic sense
16:16:48  <devsnek>enumerate explicitly adds a counter
16:17:02  <devsnek>but map is just going from value to value, there's no explicit sense of counting there
16:17:33  <ljharb>right but i can use enumerate and ignore the counter, so why would i need map
16:17:48  <devsnek>enumerate and ignore the counter?
16:17:59  <devsnek>enumerate doesn't take a mapfn
16:18:26  <devsnek>it just introduces a counter into your iterator chain
16:18:44  <ljharb>oh, hm
16:19:06  <ljharb>I’d rename it then but i think i get what it’d be for
16:19:45  <devsnek>well its called enum or enumerate in other langs
16:19:54  <devsnek>i don't want js to be the special kid
16:22:53  <ljharb>enumerate in ruby is what it makes me think of
16:23:26  <ljharb>other langs have a method called “enumerate” that inject an index into a new lazy iterator?
16:23:41  <devsnek>at least python, c#, and rust
16:24:14  <devsnek>actually c# has it twice, because such is the way with c#
16:24:19  <devsnek>Select and Enumerate
16:24:54  <devsnek>ruby apparently calls this `each_with_index`
16:25:11  <ljharb>that sounds like a clearer name to me, modulo snake case
16:25:31  <ljharb>or just “withIndex()” taking no arguments
16:25:59  <devsnek>perhaps
16:31:48  * vikash-afkquit (Ping timeout: 244 seconds)
16:34:26  * vikash-afkjoined
16:38:14  * mgolquit (Quit: My MacBook has gone to sleep. ZZZzzz…)
16:42:08  <rkirsling>Ruby's probably not the best go-to for standard namings of things, hehe
16:49:00  <ljharb>perhaps, but “enumerate” already has a meaning in js and “add an index” isn’t it
16:49:29  <devsnek>everything has seven meanings
16:50:00  <rkirsling>ljharb: yeah I suppose that's fair
16:50:19  <ljharb>devsnek: xkcd standards dot jpg
16:57:53  * oliverdunkquit (Ping timeout: 255 seconds)
16:58:06  <rkirsling>I think the conception is less about "adding an index" and more about "counting off the list items" (i.e. enumerating them), but it's tricky when you've got an `enumerable` property so fundamental to the language that indicates not ability to *be* an enumeration but rather ability to be *included* in an enumeration
16:59:12  <devsnek>oh yeah that thing
17:02:34  <rkirsling>never thought about how unfortunate that name choice is until now
17:04:37  <ljharb>but also, "enumerate" is a verb that describes what `.forEach` and friends does.
17:04:53  <ljharb>the index is already there, it's not added by the verb
17:06:00  * cybaiquit (Remote host closed the connection)
17:06:01  <rkirsling>yeah but that's not in conflict
17:06:24  <rkirsling>if your collection has a `.forEach` method then there's nothing further to do, right?
17:06:37  * cybaijoined
17:10:32  <rkirsling>though that is admittedly different from the other languages mentioned given the dynamicness of "hey there's a second param here if you want it"
17:10:48  * cybaiquit (Ping timeout: 252 seconds)
17:11:47  <rkirsling>in the others, iterating over a list would just give you the items and you'd need to explicit request to get tuples instead
17:14:03  <ljharb>what would happen with `['a', 'b', 'c'].entries().withIndex().withIndex()`? would it just keep nesting deeper entries each time?
17:19:08  <rkirsling>ha, hadn't thought to try that before, but yeah, Python and Rust give `[(0, (0, 'a')), (1, (1, 'b')), (2, (2, 'c'))]`
17:19:30  <rkirsling>(if you make a list out of it again that is)
17:28:03  * mgoljoined
17:30:49  * keith_mi_joined
17:40:46  * keith_mi_quit (Remote host closed the connection)
17:41:06  * keith_mi_joined
17:46:26  * keith_mi_quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
17:48:00  * keith_mi_joined
17:58:26  <gibson042>is the idea here something like `%IteratorPrototype%.withIndex = function*(){ let i=0; for(let v of this) yield [i++, v] }`?
17:58:26  <gibson042>or maybe `%IteratorPrototype%.map = (call => function*(callbackfn, thisarg){ let i=0; for(let v of this) yield call(callbackfn, thisarg, v, i++, this) })(Function.prototype.call.bind(Function.prototype.call))`?
17:59:34  <ljharb>gibson042: for withIndex, yes
17:59:45  <ljharb>harder for me to parse that latter one
18:03:40  <gibson042>the latter is analogous to Array.prototype.map; it would be used like e.g. `str[Symbol.iterator]().map((codePoint, cpIndex) => …)`
18:05:33  <gibson042>or perhaps more appropriately, `.map((element, index) => [index, element])` (which is identical to withIndex)
18:05:39  <ljharb>gotcha
18:10:56  * keith_mi_quit (Remote host closed the connection)
18:11:45  * keith_mi_joined
18:14:22  <Domenic>I think there's a larger discussion as to whether we think generic iterators have indices or not
18:15:07  <Domenic>If we said they have indices then lots of operations become more applicable, e.g. findIndex, indexOf, ...
18:30:14  <rkirsling>I really think "index" might be the wrong word in that case (Rust and Python docs just say "(iteration) count", say) -- 'cause the output from a generator, say, can be counted but that doesn't mean it's an indexed collection
18:35:28  * cybaijoined
18:39:55  * cybaiquit (Ping timeout: 248 seconds)
18:40:46  * keith_mi_quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:46:30  * Nimelrian_quit (Ping timeout: 252 seconds)
18:49:03  * Nimelrian_joined
18:49:31  * Nimelrian_quit (Read error: Connection reset by peer)
18:53:11  <ljharb>i mean sure, but it's basically just a zero-based counter
18:53:12  * keith_mi_joined
18:53:27  <ljharb>`.withEventualIndexWhenSpreadIntoAnArray`
18:54:05  <Domenic>I don't think making a distinction between indices and iteration count is useful
18:55:40  <ljharb>i agree, but i don't think `.withIndex` would need to imply that generic iterators have indices either
18:55:48  <Bakkot>Domenic: +1 to larger discussion about whether iterators have indices
18:56:27  <Domenic>+1 ljharb. But if we changed iterator.map(el => ...) to iterator.map((el, index) => ...) then I think we're in the larger-discussion territory.
18:56:52  <ljharb>fair point, agreed!
18:57:11  <ljharb>`.withIndex().map` is simple enough, assuming the methods are lazy
18:57:19  <Bakkot>I tend to think iterators do have indices, but that is maybe my math background leaking in ("has an iterator" means "enumerable" means "has a bijection with N" means "has indices")
18:57:42  <Domenic>I tend to think so too, but people get really upset when I suggest sets have indices
18:57:53  <Bakkot>bah
18:57:59  <ljharb>some people get upset when i remind them that JS Sets have an explicit ordering too
18:58:05  <Bakkot>abstract sets don't, but JS's Sets do
18:58:08  <ljharb>right
18:58:25  <Bakkot>(aside: that reminds me I gotta get on specing for-in order for this meeting)
18:59:27  <Domenic>While we're all here, anyone have any suggested fun examples for JSON modules? Along the lines of https://html.spec.whatwg.org/multipage/scripting.html#script-type-module-example-2
18:59:39  <Domenic>Otherwise I'm just gonna import a config file
19:01:01  <ljharb>Domenic: we use a JSON file for translation phrases in airbnb, so we effectively have `import Polyglot from 'node-polyglot'; import phrases from './phrases.json'; const p = new Polyglot(); p.extend(phrases);` altho i suppose that's also a config file
19:01:09  <Bakkot>Domenic: https://catalog.data.gov/dataset?res_format=JSON
19:01:13  * oliverdunkjoined
19:01:22  <Domenic>Oooh these are both nice.
19:02:12  <Domenic>What is a fun open data set... i.e. not vehicle crash deaths...
19:02:52  * Jessidhiaquit (Disconnected by services)
19:02:53  * Jessidhiajoined
19:02:57  <Domenic>https://github.com/jdorfman/awesome-json-datasets
19:03:26  <Domenic>I think I'll go with people in space right now http://api.open-notify.org/astros.json
19:03:53  <Bakkot>spaaaace
19:03:56  <Bakkot>if you want to be meta, https://github.com/mdn/browser-compat-data/tree/master/javascript
19:04:08  <Domenic>Oh wow that's tempting hrm
19:04:17  <Domenic>But without rawgit there are no headers
19:04:44  <ljharb>i found raw.githack.com that can replace it
19:05:16  <Domenic>Nice find. Probably not good to put in the HTML spec, but I'll still use it.
19:06:00  <bradleymeck>Domenic: JSON translations are also used at GoDaddy similarly
19:06:49  <bradleymeck>we do have configs per env as well but that would combine import() as well which idk if is desired
19:35:38  * oliverdunkquit (Ping timeout: 250 seconds)
19:45:46  * oliverdunkjoined
19:46:31  <rkirsling>Bakkot: your math explanation makes a lot of sense -- I think for me it's that the act of iteration is imperative / temporal and so such an "index" would have to be a time, whereas an index in a collection is a location. it's convenient that math and FP can just step outside of time and view those as the same, but yeah 😅
19:48:40  <rkirsling>(anyway I'm not really objecting to `withIndex`, it's just the implication that `indexOf` would follow that felt like "whoa hang on a sec")
19:58:53  * keith_mi_quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
20:12:07  * mgolquit (Quit: My MacBook has gone to sleep. ZZZzzz…)
20:35:39  * keith_mi_joined
20:38:57  <Bakkot>`indexOf` is super weird for iterators, because they represented ephemeral streams
20:39:09  <Bakkot>getting an index into an ephemeral stream is not generally a useful thing to do
20:39:23  * oliverdunkquit (Ping timeout: 248 seconds)
20:43:57  <rkirsling>right! ephemeral is the perfect word
21:04:25  <devsnek>i'm not a fan of map having an index
21:04:38  <devsnek>i think you should be explicit to introduce a counter
21:06:26  <devsnek>Bakkot: i agree that an iterator over X where X has indices would mean that the items of that iterator also technically have indices
21:06:50  <Bakkot>devsnek: that's not really the case I was talking about
21:06:56  <Bakkot>was talking about arbitrary iterators
21:07:29  <devsnek>you could also say "this is the fifth item this map iterator has seen"
21:07:33  <devsnek>but it seems rather arbitrary to me
21:07:39  <devsnek>and other languages seem to agree
21:07:59  <devsnek>map iterator being iterator.map() not Map.p.values()
21:24:06  * gibson042quit (Quit: Leaving.)
21:36:43  * cybaijoined
21:38:25  * cybaiquit (Read error: Connection reset by peer)
21:38:51  * cybaijoined
21:42:29  * cybai_joined
21:43:23  * cybaiquit (Ping timeout: 248 seconds)
21:46:35  * cybai_quit (Ping timeout: 248 seconds)
22:44:29  * keith_mi_quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
22:47:55  * keith_mi_joined
23:28:29  * keith_mi_quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
23:38:37  * keith_mi_joined
23:55:45  * gibson042joined