00:05:25  <xaxxon>devsnek: it would be pretty hard to work with values if you couldn't ever store them outside of a lexical scope...
00:05:50  <xaxxon>or are you referring to global beyond persistenthandle or whatever its base type is?
00:06:07  <devsnek>Global : PersistentBase i think
00:06:11  <devsnek>but yea that class
00:09:43  <xaxxon>devsnek: it's basically a unique_ptr for javascript values
00:10:01  <devsnek>yea and its a+
00:10:59  <xaxxon>you seem to be quite impressed with it.. what were you using before?
00:12:47  <devsnek>nothing
00:12:56  <devsnek>i wasn't aware what i'm trying to do is possible
00:14:04  <xaxxon>yes, without global, you basically can't store JS values in data structures..
00:14:12  <xaxxon>are you doing anyhting particularly fancy? or just getting started?
00:14:12  <devsnek>yea i was having a bad time
00:17:15  <xaxxon>devsnek: once you start embedding c++ objects inside your javascript objects and then setting c++ functions as callbacks for when the value is cleaned up... that's when the real power of Global starts to shine... but damn if it's not a pain in the ass, at the same time
00:17:38  <devsnek>i'm working with maps of Local<Module> right now
00:19:13  <xaxxon>if you're not following it already, make sure you check out the v8-users mailing list. this channel is usually completely dead, but you can get help pretty regularly there.. or just learn from other people's questions
00:19:24  <xaxxon>https://groups.google.com/forum/#!forum/v8-users
00:19:26  <devsnek>i've never done a mailing list before
00:20:09  <devsnek>as long as you're around can you help me with this cryptic error i just got
00:20:29  <devsnek>i don't know what to make of this https://gc.gy/⚃⚢拏.png
00:21:29  <xaxxon>is this node stuff?
00:21:34  <devsnek>yea
00:21:43  <xaxxon>devsnek: I don't know anyhting about node
00:21:45  <xaxxon>yeah, no clue.
00:21:49  <devsnek>but in this case all i did is set up an unordered_map<Global<Module>, int>
00:22:00  <xaxxon>ok
00:22:06  <devsnek>and then i did `map[Global<Module>(isolate, module)] = id`
00:23:22  <xaxxon>that line causes the error?
00:23:48  <devsnek>https://www.irccloud.com/pastebin/h6OxDo9C/
00:23:52  <devsnek>i guess its this?
00:24:42  <xaxxon>in order to make a unordered map, you have to implement std::hash of the key type
00:25:15  <devsnek>i was just sorta doing what i saw in d8
00:25:15  <xaxxon>..which probably doesn't make much sense for a javascript value
00:25:41  <devsnek>d8 has a map from cstring to module and from module to cstring
00:25:43  <xaxxon>it would be VERY expensive to look up this way. instead, maybe if you can get a string name of the module, just key it by std::string
00:25:50  <devsnek>however in node
00:25:56  <devsnek>we can't key the module map by urls
00:26:16  <devsnek>because they aren't guaranteed to be unique
00:26:31  <devsnek>so i'm using an incrementing int
00:26:45  <devsnek>is that where the problem came from?
00:27:03  <xaxxon>well, this SPECIFIC problem is that you don't have std::hash specialized for global<module
00:27:03  <xaxxon>>
00:27:11  <xaxxon>whichi is required for unordered_map/set
00:27:28  <devsnek>is there some thing in d8 i didn't see that handles that?
00:27:43  <xaxxon>I don't know much about d8, either. I just use the raw api
00:27:56  <xaxxon>link me the file/line in d8 that has this?
00:28:01  <xaxxon>I'll take a quick look
00:28:03  <devsnek>sec
00:28:27  <devsnek>https://cs.chromium.org/chromium/src/v8/src/d8.cc?l=765
00:28:39  <devsnek>oh heck
00:28:43  <devsnek>GlobalModuleHash
00:28:43  <devsnek>lol
00:29:01  <devsnek>i guess that answers my question
00:29:51  <xaxxon>there ya go
00:30:09  <xaxxon>yeah, the alternative to implementing std::hash for the key type is to specify your own comparator
00:30:18  <xaxxon>that's the third parameter.. which is the type you emntioned
00:31:15  * AtumTquit (Remote host closed the connection)
00:36:49  * not-an-aardvarkquit (Quit: Connection closed for inactivity)
00:38:36  <devsnek>wow its actually building
00:50:47  <xaxxon>devsnek: yay
01:36:41  * xaxxonquit (Ping timeout: 256 seconds)
01:39:30  * xaxxonjoined
01:46:25  <devsnek>xaxxon: thanks i got everything working now :D https://github.com/devsnek/node/commit/91f415c029dd4b26a66b704ea87c60aa2fdb075a
01:46:32  <xaxxon>sweet
01:47:42  <devsnek>oh wait i forgot one thing
01:48:14  <devsnek>`delete env()->module_to_id_map[Global<Module>(env()->isolate(), module)];` won't compile
01:48:39  <devsnek>cannot delete expression of type mapped_type
01:49:53  <devsnek>oh hmm erase works
01:50:04  <devsnek>i thought unordered_map had an overload for delete[]
02:29:52  <xaxxon>devsnek: I don't think it's technically possible to do what you were trying to do
02:30:03  <devsnek>it all works
02:30:10  <xaxxon>I mean this: delete env()->module_to_id_map[Global<Module>(env()->isolate(), module)];
02:30:11  <devsnek>wdym
02:30:13  <devsnek>oh
02:30:30  <devsnek>i changed it to env()->module_to_id_map.erase(Global<Module>(env()->isolate(), module))
02:30:43  <xaxxon>yes, that works :)
02:30:51  <devsnek>i just incorrectly thought that unordered_map had an overload for delete[]
02:31:00  <xaxxon>I don't think that's something you can even do
02:31:04  <devsnek>i think it is
02:31:21  <devsnek>yep operator delete[] is a thing
02:32:16  <xaxxon>yes, there is such a thing, but I don't think you can make it take a reference type and have it perform an arbitrary action... especially pointing back to a different object (the actual map) to have it operate on
02:32:50  <devsnek>well you probs know better than i do
02:32:51  <xaxxon>env()->module_to_id_map[Global<Module>(env()->isolate(), module)]; returns a reference to a value object
02:33:01  <xaxxon>it has no notion of being associated with a map
02:33:31  <devsnek>yea that makes sense
02:33:35  <devsnek>i'm too used to js
02:33:38  <xaxxon>delete[] is for calling the destructor of an array of objects
02:33:55  <xaxxon>:)
02:34:00  <xaxxon>I'm the opposite. my JS is ass
02:34:31  <devsnek>so are you a v8 dev or
02:34:37  <devsnek>rando good guy
02:35:05  <xaxxon>I have 1 patch in v8 and it was a trivial one-liner
02:35:19  <xaxxon>no I just hang out here in case there's another living soul that shows up
02:35:38  <xaxxon>which is literally about once every 6 months
02:35:41  <xaxxon>other than a dev saying like 3 things to another dev who never responds
02:35:52  <devsnek>i have 0 patches cuz anything v8 related that isn't the public api is more complex than rocket science
02:36:21  <xaxxon>my patch was to the public api
02:36:29  <xaxxon>I think it literally added the word "explicit" somewhere
02:36:32  <xaxxon>it was a while ago
02:36:49  <devsnek>nice
03:18:31  * Garbeequit (Quit: Connection closed for inactivity)
05:05:27  * not-an-aardvarkjoined
05:38:58  * xaxxonquit (Read error: Connection reset by peer)
05:51:15  * xaxxonjoined
05:56:12  * xaxxon_joined
05:59:10  * xaxxonquit (Ping timeout: 264 seconds)
06:49:28  * xaxxon_quit (Quit: xaxxon_)
06:57:35  * xaxxonjoined
07:12:43  * xaxxonquit (Quit: xaxxon)
07:45:59  <trungl-bot>Tree closed by mach[email protected]: closed - maintenance
07:57:05  <trungl-bot>Tree opened by [email protected]: open
08:30:14  * chimera3____quit (Ping timeout: 256 seconds)
08:30:15  * pcarrierquit (Ping timeout: 256 seconds)
08:32:05  * pcarrierjoined
08:32:05  * chimera3____joined
10:07:02  * bradleymeckjoined
10:25:33  * mylesborinsquit (Quit: farewell for now)
10:26:01  * mylesborinsjoined
10:26:23  * cloudshujoined
10:30:23  * AtumTjoined
10:35:05  * not-an-aardvarkquit (Quit: Connection closed for inactivity)
11:26:15  * bradleymeckquit (Quit: bradleymeck)
11:31:15  * bradleymeckjoined
11:39:07  <aklein>devsnek: your experience definitely suggests that we should have a little documentation somewhere about how we expect people to use the Module API
11:57:16  * bradleymeckquit (Quit: bradleymeck)
12:13:48  * plutoniixquit (Quit: Leaving)
12:17:20  <devsnek>aklein: definitely hehe
12:18:51  <devsnek>I've been working on like a hello-world.cc equiv
13:04:47  <aklein>devsnek: if you happen to generate something you'd be up for contributing...let us know :)
13:05:17  <devsnek>yea I've been meaning to figure out how to contribute to v8
13:11:31  * bradleymeckjoined
13:17:18  * bradleymeckquit (Quit: bradleymeck)
13:21:55  <devsnek>and meanwhile in d8 `Local<Context> realm` 😓
13:26:23  * rwaldron_joined
13:31:55  * bradleymeckjoined
13:34:36  <trungl-bot>Tree closed by [email protected]: closed (https://build.chromium.org/p/client.v8/builders/V8%20Linux64%20-%20internal%20snapshot/builds/14603 from 520b025f721e432da28f04748952746e57333572)
13:50:53  * Garbeejoined
13:53:45  <trungl-bot>Tree opened by [email protected]: open
13:54:46  <trungl-bot>Tree closed by [email protected]: closed (https://build.chromium.org/p/client.v8/builders/V8%20Linux64%20-%20verify%20csa/builds/6488 from 0fe64b7e62ceea7b726dad7df8d16cfeb1dfa8ef)
13:55:38  * rwaldron_quit (Quit: Textual IRC Client: www.textualapp.com)
13:56:24  * rwaldron_joined
13:56:35  * rwaldron_quit (Client Quit)
13:57:14  * rwaldron_joined
13:57:46  * rwaldron_quit (Client Quit)
13:58:31  * rwaldron_joined
14:00:49  <trungl-bot>Tree opened by [email protected]: open
14:04:15  * rwaldron_quit (Quit: Textual IRC Client: www.textualapp.com)
14:04:47  * rwaldron_joined
14:06:26  * rwaldron_quit (Client Quit)
14:06:49  * rwaldron_joined
14:10:22  * rwaldron_quit (Client Quit)
14:11:13  * rwaldron_joined
14:13:12  * rwaldron_changed nick to rwaldron
14:28:15  * bradleymeckquit (Quit: bradleymeck)
14:45:09  * bradleymeckjoined
15:09:19  * bradleymeckquit (Quit: bradleymeck)
15:21:54  * bradleymeckjoined
15:28:55  * Owl_owjoined
16:04:47  * bradleymeckquit (Quit: bradleymeck)
16:09:10  * bradleymeckjoined
16:27:24  * bradleymeckquit (Quit: bradleymeck)
16:29:42  * bradleymeckjoined
16:37:08  * bradleymeckquit (Quit: bradleymeck)
16:38:56  * RT|Chatzillaquit (Quit: ChatZilla 0.9.86.1 [Firefox 2.0.0.22pre/2010030309])
16:43:52  * bradleymeckjoined
16:55:33  * bradleymeckquit (Quit: bradleymeck)
16:56:28  * rwaldronquit (Quit: My MacBook has gone to sleep. ZZZzzz…)
17:45:07  * rwaldronjoined
17:47:30  * seventhjoined
18:16:17  <devsnek>hmm one question that occurred to me
18:16:22  <devsnek>why do modules not have the url on them
18:16:27  <devsnek>d8 has a map from module to module url
18:37:38  * Owl_owchanged nick to Owl
18:38:07  * Owlchanged nick to Guest57651
18:39:10  * Guest57651changed nick to accnameOwl
18:47:12  <devsnek>aklein: i have a thingy which runs modules (all sync unfortunately)
18:47:22  <devsnek>i would have to make an entire map just to setup import.meta.url though
18:47:40  <devsnek>i'm debating how worth it that is
18:59:09  <trungl-bot>Tree closed by [email protected]g: closed (https://build.chromium.org/p/client.v8.ports/builders/V8%20Arm%20GC%20Stress/builds/6618 from f52d0053951709160cb634ce74102ec2edea13bd)
19:09:59  * not-an-aardvarkjoined
19:53:36  * seventhquit (Remote host closed the connection)
20:02:17  * rwaldronquit (Quit: My MacBook has gone to sleep. ZZZzzz…)
20:04:38  <trungl-bot>Tree opened by [email protected]: open
20:51:37  <devsnek>aklein: i came up with this, probably needs some work to be v8-repo-worthy :P https://gist.github.com/devsnek/ab79226130f097e1b009b774f3c8ec9c
21:11:26  * AtumT_joined
21:13:58  * AtumTquit (Ping timeout: 240 seconds)
21:24:29  * AtumTjoined
21:26:09  * AtumT_quit (Ping timeout: 264 seconds)
21:42:59  * xaxxonjoined
21:52:06  * AtumT_joined
21:52:33  * AtumTquit (Ping timeout: 240 seconds)
22:31:04  * RT|Chatzillajoined
23:40:26  * plutoniixjoined
23:55:49  * xaxxonquit (Ping timeout: 260 seconds)