<< 04-06-2017 >>

00:01:07*yingjun joined #nim
00:05:20*girvo joined #nim
00:05:27*yingjun quit (Ping timeout: 240 seconds)
00:06:15*Snircle quit (Excess Flood)
00:09:42*murych quit (Ping timeout: 255 seconds)
00:10:57*girvo quit (Ping timeout: 240 seconds)
00:18:00*chemist69 quit (Ping timeout: 272 seconds)
00:20:00*chemist69 joined #nim
00:41:19*girvo joined #nim
01:03:12*SusWombat_ joined #nim
01:03:47*SusWombat quit (Ping timeout: 245 seconds)
01:15:15*chemist69 quit (Ping timeout: 260 seconds)
01:19:51*Nobabs27 quit (Quit: Leaving)
01:28:55*chemist69 joined #nim
01:58:18*Neomex quit (Quit: Leaving)
02:02:39*yingjun joined #nim
02:06:57*yingjun quit (Ping timeout: 240 seconds)
02:24:13*martinium quit (Quit: WeeChat 1.7)
02:38:05*dddddd quit (Remote host closed the connection)
03:23:34ftsfhmm can I somehow pass a type to a generic function when calling it if none of the arguments are of that type?
03:24:09ftsfeg addData[float32](bytebuffer, 10) addData[uint8](bytebuffer, 10)
03:25:51ftsfi could just make separate procs for each type, but this seems like the thing generics are made for
03:26:19ftsfmaybe i need to use a template
03:28:27ftsfproc storeData*[T](self: var Vao, size: GLint, data: pointer, elements: int) = storeData[float32](vao, 3, inPosition, numVertexes) expression 'storeData[float32](vao, 3, inPosition, numVertexes)' cannot be called
05:05:13*yingjun joined #nim
05:08:03*chemist69 quit (Ping timeout: 255 seconds)
05:10:02*yingjun quit (Ping timeout: 268 seconds)
05:12:50*chemist69 joined #nim
05:17:52*Jesin quit (Quit: Leaving)
05:20:09*Jesin joined #nim
06:01:34*Trustable joined #nim
06:16:34*pilne quit (Quit: Quitting!)
06:25:33*StarBrilliant joined #nim
06:37:37*benny_ joined #nim
07:13:33*Arrrr joined #nim
07:13:33*Arrrr quit (Changing host)
07:13:33*Arrrr joined #nim
07:22:01*Trustable quit (Remote host closed the connection)
07:47:25*nsf joined #nim
07:51:19*Vladar joined #nim
08:05:44FromGitter<Varriount> ftsf: yes, just pass the type in the generic argument list
08:07:06ftsfhmm i thought that's what I did with storeData[float32](...)
08:07:09*yingjun joined #nim
08:07:23ftsfmaybe it cannot be called for some other reason
08:10:36*Matthias247 joined #nim
08:11:17*yingjun quit (Ping timeout: 245 seconds)
08:38:41*murych joined #nim
09:03:11*vlad1777d joined #nim
09:04:32FromGitter<StefanSalewski> /quit
09:08:15*nsf quit (Quit: WeeChat 1.7.1)
09:26:02*girvo quit (Quit: leaving)
10:08:51*yingjun joined #nim
10:10:27*chemist69 quit (Ping timeout: 255 seconds)
10:12:59*chemist69 joined #nim
10:13:19*yingjun quit (Ping timeout: 260 seconds)
10:15:05*Sembei quit (Read error: Connection reset by peer)
10:15:10*nsf joined #nim
10:16:04*Sembei joined #nim
10:28:49*yglukhov joined #nim
10:31:00*nsf quit (Quit: WeeChat 1.7.1)
10:33:23*yglukhov quit (Ping timeout: 260 seconds)
10:40:17*Arrrr quit (Read error: Connection reset by peer)
11:19:38*LeNsTR joined #nim
11:33:12*yglukhov joined #nim
11:34:50*yglukhov quit (Read error: Connection reset by peer)
11:35:22*yglukhov joined #nim
11:50:30*dddddd joined #nim
12:06:41*ritchie_ quit (Quit: Leaving)
12:12:00*nsf joined #nim
12:14:33*couven92 joined #nim
12:25:44*yglukhov quit (Remote host closed the connection)
12:26:19*yglukhov joined #nim
12:30:27*yglukhov quit (Ping timeout: 245 seconds)
12:30:46*yglukhov joined #nim
12:35:51*Neomex joined #nim
12:43:23yglukhovAraq: hi, I'm trying to fix https://github.com/nim-lang/Nim/issues/4384 . Could you please help me understand a couple of things?
12:52:36*yingjun joined #nim
12:56:57*yingjun quit (Ping timeout: 240 seconds)
13:19:13*Neomex quit (Quit: Leaving)
14:00:45FromGitter<evacchi> question about closures: it looks like the context they close over is gc'd, is this correct ?
14:02:02FromGitter<evacchi> I'm creating "curried" functions to represent an actor body... in other words I have a function `proc(parent: ptr Actor)` which returns a `proc(message: Message)` which is the message handler
14:02:34FromGitter<evacchi> then my code iterates over all the "actors" that have been created; it looks like at some point `parent` becomes nil
14:03:09FromGitter<evacchi> (actually, it's even a bit more complicated: `proc(parent: ptr Actor)` -> `proc(self: ptr Actor)` -> `proc(message: Message)`
14:03:52FromGitter<evacchi> (also, this is pseudo code, as I have `Actor[A]` and `Message` is generic `A`, but you get the problem)
14:04:47FromGitter<evacchi> this is currently single-threaded, the dispatcher just iterates over an Array of actor ptrs, which is pre-allocated (this is because I wanted precisely to debug this issue); even the actor mailboxes are pre-allocated Arrays
14:05:38FromGitter<evacchi> in other words, I'm using closures to persist actor states, but it seems like at some point the context I'm closing over is GC'd, so it is unreliable
14:07:28FromGitter<evacchi> in fact, the problem goes away if I use boehm
14:08:48FromGitter<evacchi> (in this context, actors are just shared ptrs to structs wrapping an array -- the mailbox)
14:16:54*pilne joined #nim
14:19:34FromGitter<evacchi> and it seems to fail more consistently with --threads:on
14:19:37FromGitter<evacchi> weird
14:21:34FromGitter<evacchi> here's an example https://gist.github.com/evacchi/aff9d3be19a695c2798f7ba5d4a26d6c
14:24:07*benny_ quit (Remote host closed the connection)
14:24:31*benny_ joined #nim
14:28:22*PMunch joined #nim
14:33:34*yglukhov quit (Remote host closed the connection)
14:34:45*yglukhov joined #nim
14:35:35*arnetheduck quit (Ping timeout: 260 seconds)
14:44:00*yglukhov quit (Remote host closed the connection)
14:45:52*Trustable joined #nim
14:47:33*yglukhov joined #nim
14:52:17*yglukhov quit (Remote host closed the connection)
14:56:37*yglukhov joined #nim
14:56:42FromGitter<Varriount> @evacchi Yes, closures have a garbage collected state.
14:57:19FromGitter<evacchi> @Varriount ok, so that's never going to work :-P
14:57:29FromGitter<Varriount> Use the reference incrementing function to prevent them from being collected
14:58:54FromGitter<evacchi> you mean GC_ref[T] ? but that takes a `ref`
14:59:20FromGitter<evacchi> do I have to get somehow a ref to the closure state ?
14:59:33FromGitter<Varriount> Hm, good question
15:00:59FromGitter<Varriount> @evacchi try casting the result of https://nim-lang.org/docs/system.html#rawProc,T to a reference
15:01:16*yglukhov quit (Ping timeout: 260 seconds)
15:02:07FromGitter<Varriount> Sorry, I meant the rawEnv procedure
15:03:38FromGitter<evacchi> uhm... cast to a ref to what ? I can't seem to be able to just cast[ref]
15:04:00FromGitter<evacchi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=593421606549436c7d15c0ef]
15:04:08FromGitter<Varriount> RootRef
15:04:13FromGitter<evacchi> this gives `n.nim(49, 24) Error: type mismatch: got (pointer) but expected 'int'`
15:04:29FromGitter<evacchi> ok
15:05:02FromGitter<evacchi> ICan'tBelieveItWorked™
15:05:10FromGitter<evacchi> :D
15:05:47FromGitter<Varriount> If this doesn't work out, I'd suggest just storing the closure in a reference type, and incrementing that
15:06:06FromGitter<Varriount> That's site to work, but means more bookkeeping
15:08:25FromGitter<evacchi> cool
15:10:08FromGitter<Varriount> There's a gc assert symbol that you can define, but I can't remember it offhand...
15:14:51FromGitter<evacchi> @Varriount what would that do?
15:16:02FromGitter<Varriount> Make sure that the gc incrementing is valid
15:16:29FromGitter<evacchi> huh
15:27:24FromGitter<Varriount> @evacchi What I would do is look at what the C code does to increment a reference to a closure, and see if you can produce Nim code that does the equivalent
15:27:44FromGitter<evacchi> right
15:28:44FromGitter<Varriount> *generated C code
15:33:22*benny_ quit (Remote host closed the connection)
15:53:14*benny_ joined #nim
15:54:54*yingjun joined #nim
15:59:10*yingjun quit (Ping timeout: 240 seconds)
16:01:23*benny_ quit (Remote host closed the connection)
16:19:00*chemist69 quit (Ping timeout: 255 seconds)
16:21:24*chemist69 joined #nim
16:36:11*yglukhov joined #nim
16:40:27*yglukhov quit (Ping timeout: 245 seconds)
16:41:22*benny_ joined #nim
16:57:47*benny_ quit (Remote host closed the connection)
16:59:09FromGitter<Varriount> @evacchi Looking at the code, it appears that retrieving the closure environment, casting it to a RootRef, and then incrementing the reference count via gc_Ref should work.
16:59:45FromGitter<Varriount> That's what the assignment procedure does when assigning a closure.
17:00:06FromGitter<Varriount> You just need to be careful to decrement the reference count when you're done with the closure.
17:01:36FromGitter<Varriount> @araq: "Refcounting + Mark&Sweep. Complex algorithms avoided. Been there, done that, didn't work."
17:09:36*faix joined #nim
17:10:42*benny_ joined #nim
17:14:42*Neomex joined #nim
17:35:09*nsf quit (Quit: WeeChat 1.7.1)
17:44:57FromGitter<evacchi> thanks @Varriount that was really helpful!
18:00:51FromGitter<evacchi> so, in my code a shared ptr is holding a closure, so, since I'm managing the ptr myself I'm expected to +1 the ref count to the "behavior" closure. I guess it makes sense, right?
18:04:36*benny__ joined #nim
18:05:10*benny_ quit (Ping timeout: 272 seconds)
18:31:49*vlad1777d_ joined #nim
18:32:32shmuphm ftsf NicoController isn't picking up anything except arrows. i.e. not A B or X and also pressing shift results in: SIGSEGV: Illegal storage access. (Attempt to read from nil?
18:33:33*vlad1777d quit (Ping timeout: 255 seconds)
18:33:47demi-dom96: the memory leaks in jester seem to be getting worse :(
18:57:11*yingjun joined #nim
19:01:47*yingjun quit (Ping timeout: 255 seconds)
19:12:31*nsf joined #nim
19:16:16dom96demi-: Not sure I can do much about it without something that reproduces the issue.
19:22:24*benny_ joined #nim
19:25:51*benny__ quit (Ping timeout: 260 seconds)
19:44:14*couven92 quit (Quit: Client Disconnecting)
19:45:20*couven92 joined #nim
19:56:38*faix quit (Ping timeout: 272 seconds)
19:59:46*SusWombat_ quit (Remote host closed the connection)
20:07:52*yglukhov joined #nim
20:12:38*yglukhov quit (Remote host closed the connection)
20:17:37*yglukhov joined #nim
20:17:49*Vladar quit (Quit: Leaving)
20:26:03shmupnvm ftsf
20:29:12*chemist69 quit (Ping timeout: 255 seconds)
20:31:43*chemist69 joined #nim
20:38:39*cncl quit (Ping timeout: 260 seconds)
20:40:23*cncl joined #nim
20:45:00*hlt joined #nim
20:46:07*Neomex quit (*.net *.split)
20:46:09*m712 quit (*.net *.split)
20:46:23*vopi181[m] quit (*.net *.split)
20:46:23*stisa quit (*.net *.split)
20:46:23*zielmicha_ quit (*.net *.split)
20:47:12*Neomex joined #nim
20:47:26*stisa joined #nim
20:47:26*vopi181[m] joined #nim
20:47:26*zielmicha_ joined #nim
20:49:29*jivank[m] quit (Ping timeout: 240 seconds)
20:49:29*MrAxilus[m] quit (Ping timeout: 240 seconds)
20:49:34*hohlerde quit (Ping timeout: 264 seconds)
20:49:40*TheManiac quit (Ping timeout: 258 seconds)
20:49:41*M-Quora quit (Ping timeout: 258 seconds)
20:49:52*vopi181[m] quit (Ping timeout: 272 seconds)
20:49:52*stisa quit (Ping timeout: 272 seconds)
20:49:52*ehmry quit (Ping timeout: 255 seconds)
20:49:53*Guest73656[m] quit (Ping timeout: 255 seconds)
20:50:10*Jipok[m] quit (Ping timeout: 264 seconds)
20:50:11*mindB quit (Ping timeout: 240 seconds)
20:50:19*erwana[m] quit (Ping timeout: 246 seconds)
20:50:20*faix joined #nim
20:50:42*dyce[m] quit (Ping timeout: 276 seconds)
20:51:43*couven92 quit (Ping timeout: 260 seconds)
20:55:13*stefantalpalaru joined #nim
20:56:58*couven92 joined #nim
21:00:47*yglukhov quit (Remote host closed the connection)
21:01:07stefantalpalaruHi. I'm having trouble with ALE - a vim linting plugin that makes a /tmp copy of the edited buffer before checking it with "nim check --path:/original/path --threads:on --verbosity:0 --colors:off --listFullPaths /tmp/[...]/file.nim". How do I set the project dir so the proper config file can be loaded and the proper additional paths be set from it? It would be nice to also cover files in subdirectories (i.e.
21:01:07stefantalpalarusrc/* tests/*).
21:01:46stefantalpalarurelevant vimscript file: https://github.com/w0rp/ale/blob/master/ale_linters/nim/nimcheck.vim
21:04:13*Trustable quit (Remote host closed the connection)
21:04:28*stisa joined #nim
21:06:41dom96stefantalpalaru: You can't, the vim plugin should copy the config file from your project.
21:06:45dom96(to /tmp I guess)
21:07:53stefantalpalaruit can't really guess what's my project dir when I edit foo/bar/tests/test1.nim
21:09:23PMunchHmm, the stream.write procedure. Does it write with any specific byte order?
21:11:02*ehmry joined #nim
21:11:02*MrAxilus[m] joined #nim
21:11:02*M-Quora joined #nim
21:11:02*dyce[m] joined #nim
21:11:09*Guest73656[m] joined #nim
21:11:09*Jipok[m] joined #nim
21:11:09*hohlerde joined #nim
21:11:09*jivank[m] joined #nim
21:11:09*vopi181[m] joined #nim
21:11:10*erwana[m] joined #nim
21:11:10*TheManiac joined #nim
21:11:10*mindB joined #nim
21:11:41FromGitter<ephja> no
21:13:01PMunchSo no specific order?
21:14:24FromGitter<ephja> PMunch: that's right. there are no endian-aware streams atm
21:14:56PMunchHmm
21:15:45FromGitter<ephja> so, either implement one or convert to the expected endian first
21:16:27*murych quit (Ping timeout: 255 seconds)
21:16:51*noethics quit (Remote host closed the connection)
21:17:10*noethics joined #nim
21:17:38PMunchWell, the problem would be to get the expected endianness
21:18:09FromGitter<ephja> PMunch: see the endians module
21:18:49FromGitter<ephja> I said I was going to look at this but of course I didn't. unexpected, wasn't it
21:18:50PMunchBut the reader accepts and converts the endian-ness. So it should be fine whichever it uses
21:19:18FromGitter<ephja> I'll let you know if I create a PR
21:19:36FromGitter<ephja> alright, let's see. step 1: high level endians procs
21:20:39*faix quit (Ping timeout: 260 seconds)
21:27:08*vlad1777d_ quit (Remote host closed the connection)
21:59:31*yingjun joined #nim
22:04:02*yingjun quit (Ping timeout: 255 seconds)
22:08:24*Snircle joined #nim
22:23:12*nsf quit (Quit: WeeChat 1.7.1)
22:26:38FromGitter<zacharycarter> Sorry i was camping all weekend
22:27:10FromGitter<zacharycarter> Zetashift: ill have a look at the assimp errors
22:27:44stefantalpalaruALE problem solved by checking the original file (only on save, instead of on buffer change as before). Patch sent upstream: https://github.com/w0rp/ale/pull/620
22:32:01FromGitter<zetashift> @zacharycarter yoo, wb hope you enjoyed your trip. I fixed the asssimp one but I still get the type mismatch error
22:32:20FromGitter<zetashift> this one: https://pastebin.com/D4ZAHHcs
22:32:52FromGitter<zetashift> running the 00-hello world example
22:33:04FromGitter<zacharycarter> Okay cool and thank you. Unpacking now will have a look shortly
22:33:51FromGitter<zetashift> take your time! I'm in no rush
22:34:28FromGitter<zacharycarter> Thank you ☺
22:38:05*stefantalpalaru left #nim ("Leaving")
22:41:48*Matthias247 quit (Read error: Connection reset by peer)
22:52:19*Sentreen quit (Ping timeout: 240 seconds)
22:58:12*Neomex quit (Quit: Leaving)
22:59:57*dddddd quit (Ping timeout: 255 seconds)
23:05:13*Sentreen joined #nim
23:12:44*dddddd joined #nim
23:23:19*def-pri-pub joined #nim
23:59:38*rosshadden joined #nim