<< 09-03-2017 >>

00:02:03*rauss joined #nim
00:14:40*ftsf_ quit (Remote host closed the connection)
00:15:06*ftsf_ joined #nim
00:15:57*gangstacat joined #nim
00:20:03*Pisuke joined #nim
00:26:36*girvo joined #nim
00:27:13girvoHey all
00:27:34PMunchHi
00:28:41ftsf_o/ howdy
00:32:13girvoI'm trying to work out whether it's possible to specify a proc on a type via a concept, where the proc can receive the "concept" type as it's first param, but specifying the concrete types of the _other_ params
00:35:06PMunchNot quite sure if I follow
00:35:13girvoHehe I explained it terribly
00:35:20girvoLet me upload a dumb example, should make it clearer
00:36:33girvohttps://hastebin.com/inuzagonot.nim
00:41:22PMunchHmm
00:42:57PMunchI don't think so
00:44:27Araqsure, it's easy
00:44:31Araqvar s: string
00:44:38Araqdance(x, s)
00:44:56Araqin the concept body
00:47:11PMunchHuh, cool
00:47:17PMunchNever heard of concepts before
00:47:22*brson joined #nim
00:47:56PMunchIt's similar to interfaces in OO
00:48:31PMunchWhich is something I've been missing in Nim
00:50:05Araqno, concepts are not interfaces, nor are they similar.
00:50:14PMunchThey're not?
00:50:31Araqthey will get similar capabilites though, zahary_ is working on it
00:50:38PMunchAh right
00:50:52Araqno, they are not. it's just an advanced generic constraint.
00:52:09PMunchYeah, but interfaces specify an object to have various functions. So you could create a concept which checks if the type has those functions and then have functions that only works on those concepts
00:52:17PMunchWouldn't that be kind of the same?
00:53:39Araqno. you can have an array of Interf and then you get a heterogenous container
00:54:11Araqin contrast an array of concepts is not valid.
00:54:26Araqit's really nothing like an interface.
00:55:08Araqit's a generic constraint, you get type specialization, multiple instantiations etc etc
00:57:30PMunchHmm, I'm too tired to think about this kind of stuff..
00:57:46PMunchI'll have to look into it tomorrow
00:58:56*couven92 quit (Read error: Connection reset by peer)
01:01:19girvo@Araq, amazing, that's exactly what I was hoping for!
01:02:38girvoYeah, best to not even think of it like an interface from my understanding of it. Gets rid of a lot of boilerplate and annoyances of some of my crazy generics I've played with
01:03:55girvoThough I suppose if you squint a little, they can kind of look like Go's interfaces
01:05:05*PMunch quit (Quit: leaving)
01:41:49*Jesin quit (Quit: Leaving)
01:45:24*Jesin joined #nim
01:49:06*girvo quit (Ping timeout: 240 seconds)
02:09:54*girvo joined #nim
02:14:37*girvo quit (Ping timeout: 260 seconds)
02:14:59*girvo joined #nim
02:19:45*girvo quit (Ping timeout: 260 seconds)
02:22:36*arnetheduck quit (Ping timeout: 240 seconds)
02:22:55*Nobabs27 joined #nim
02:24:46*girvo joined #nim
02:29:34*girvo quit (Ping timeout: 268 seconds)
02:35:32*girvo joined #nim
02:36:23*chemist69 quit (Ping timeout: 264 seconds)
02:39:58*girvo quit (Ping timeout: 240 seconds)
02:45:41*def-pri-pub joined #nim
02:49:39*chemist69 joined #nim
02:50:12*girvo joined #nim
02:51:00*Pisuke quit (Ping timeout: 240 seconds)
03:17:19*Nobabs27 quit (Quit: Leaving)
03:34:59*ftsf_ quit (Ping timeout: 246 seconds)
03:39:22*brson quit (Quit: leaving)
03:41:44*Serenit0r joined #nim
03:42:29*vendethiel- quit (Ping timeout: 240 seconds)
03:44:19*vendethiel joined #nim
03:45:09*SerenityStyle quit (Ping timeout: 240 seconds)
03:46:56*ftsf_ joined #nim
03:53:26*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
04:18:02*zachcarter quit (Quit: zachcarter)
04:43:20*vendethiel- joined #nim
04:44:53*vendethiel quit (Ping timeout: 260 seconds)
04:50:03*def-pri-pub quit (Quit: leaving)
05:05:39*Pisuke joined #nim
05:48:43*BitPuffin|osx quit (Ping timeout: 256 seconds)
06:05:11*rauss quit (Quit: WeeChat 1.7)
06:06:04*ofelas_ quit (Quit: Leaving)
06:08:41*ofelas joined #nim
06:41:10*nsf joined #nim
07:06:58*dexterk_ joined #nim
07:07:13*dexterk quit (Ping timeout: 260 seconds)
07:07:51*byte512 joined #nim
07:19:05*Vladar joined #nim
07:22:59*girvo quit (Ping timeout: 240 seconds)
07:27:10*ftsf_ quit (Quit: :q!)
07:27:22Araqhmmm, would it harm if isAbsolute() considers paths starting with ~ as absolute on Unix?
07:28:08cheatfatemaybe because ~ is alias for /home/xxx ?
07:28:59Araqyes, exactly
07:29:29Araqit's unclear when the expansion should happen though
07:29:42Araqyou can do the replacement before calling isAbsolute
07:31:20*vlad1777d quit (Remote host closed the connection)
07:31:32*rokups joined #nim
07:39:10cheatfateAn absolute or full path points to the same location in a file system, regardless of the current working directory.
07:39:16cheatfateso ~ is absolute path
07:39:43def-but you can have a directory called ~
07:40:02def-only the shell expands ~ to $HOME
07:41:44Araq~ is not a filesystem feature, but a shell feature. difficult question, but I think some parts of os.nim already consider ~
07:42:11cheatfatedoes anybody tested it?
07:42:18cheatfatei dont think ~ is allowed to be even filename
07:42:38def-mkdir \~
07:42:40def-cd \~
07:42:55*girvo joined #nim
07:43:54cheatfatebut in such case ~ is actually escaped
07:44:55def-only in the shell because the shell expands ~ to $HOME
07:46:12def-and if you start emulating shell behaviour, where to stop? ~username is also nice
07:47:09*girvo quit (Ping timeout: 240 seconds)
07:47:32def-oh, and instead of escaping you can also do mkdir '~'
07:47:56*girvo joined #nim
07:51:06*bjz joined #nim
07:52:42*girvo quit (Ping timeout: 268 seconds)
07:53:03cheatfateAraq, then paths starting from `~` can't be considered as absolute, because they can actually be relative
07:53:15*gokr joined #nim
07:54:58*girvo joined #nim
07:56:24*vendethiel- quit (Ping timeout: 268 seconds)
07:58:23*gokr left #nim (#nim)
07:59:37*girvo quit (Ping timeout: 260 seconds)
08:00:19*Andris_zbx joined #nim
08:00:36Araqyup. agreed. it's a bad idea to handle it in os.nim.
08:00:40*girvo joined #nim
08:04:49*girvo quit (Ping timeout: 240 seconds)
08:12:06*tankfeeder joined #nim
08:14:45*cheatfate quit (Read error: Connection reset by peer)
08:15:04*cheatfate joined #nim
08:42:02*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
08:42:25*xmonader joined #nim
08:52:40*bjz joined #nim
08:54:03*Arrrr joined #nim
08:56:55FromGitter<vegansk> @Araq, what do you think about possibility to specify ref type to be always not nil, something like: ⏎ ⏎ ```type X = ref object not nil``` [https://gitter.im/nim-lang/Nim?at=58c118d6872fc8ce62d981d4]
08:58:44Araqjust don't use 'not nil' until we fixed the compiler
08:59:10AraqI've never seen a bug prevented by it.
09:00:11Araq'not nil' should be the default anyway, but it'll take some blood and sweat to get there
09:01:37FromGitter<Varriount> Araq: And beer? :P
09:02:17AraqVarriount: I don't drink anymore.
09:02:26Araqnah, just kidding :P
09:03:58*rauce quit (Ping timeout: 240 seconds)
09:04:25FromGitter<vegansk> The bug is simple :-) Just add the field to the object that must be not nil semantically and forget to initialize it in the places where you create that object
09:05:36FromGitter<vegansk> That's why I made the macro to create data types with constructors, immutability, etc :-) Example: https://github.com/vegansk/nimboost/blob/master/tests/boost/test_typeutils.nim#L116
09:06:04*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
09:06:08*rauce joined #nim
09:06:29Araqvegansk: the same bug could be prevented by enforcing object constructors name every field explictly
09:07:03Araqthat's what Jehan argued for. if you have explicit initializations everywhere 'nil' bugs can only creep in when 'nil' is in the source code
09:07:35Araqand maybe that's what we should do for v1
09:09:18*bjz joined #nim
09:10:06FromGitter<vegansk> @Araq, then please look an my implementation, it also has default values, mutable/immutable fields. Maybe it will be good to have all of these features in the standard object definition?
09:16:15FromGitter<vegansk> @Araq, the small description here (http://vegansk.github.io/nimboost/docs/0.4.0/boost/typeutils.html)
09:31:00AraqI dunno. we in general discourage object constructors
09:31:15Araqwhy should they get more features then.
09:43:08*bjz_ joined #nim
09:43:57*bjz quit (Ping timeout: 258 seconds)
09:50:50*Serenit0r quit (Quit: Leaving)
09:56:19*girvo joined #nim
10:00:59*girvo quit (Ping timeout: 264 seconds)
10:01:35*Arrrr quit (Ping timeout: 268 seconds)
10:06:16*PMunch joined #nim
10:10:52*Arrrr joined #nim
10:10:52*Arrrr quit (Changing host)
10:10:52*Arrrr joined #nim
10:14:04*couven92 joined #nim
10:27:59*Arrrr quit (Ping timeout: 264 seconds)
10:32:01*tankfeeder quit (Quit: Leaving)
10:38:42*arnetheduck joined #nim
10:39:25*Arrrr joined #nim
11:51:53*CcxWrk quit (Read error: Connection reset by peer)
11:53:22*CcxWrk joined #nim
11:57:05*girvo joined #nim
12:01:29*girvo quit (Ping timeout: 240 seconds)
12:02:31*Snircle joined #nim
12:03:16*elrood joined #nim
12:06:00*zachcarter joined #nim
12:07:37*bjz_ quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
12:11:28*bjz joined #nim
12:51:34*BitPuffin|osx joined #nim
13:06:47*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
13:12:39*zachcarter quit (Quit: zachcarter)
13:13:03*zachcarter joined #nim
13:15:15*bjz joined #nim
13:27:14*zachcarter quit (Quit: zachcarter)
13:36:58*SusWombat quit (Remote host closed the connection)
13:38:22*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
13:38:50*SusWombat joined #nim
13:58:01*girvo joined #nim
14:02:33*girvo quit (Ping timeout: 260 seconds)
14:15:52*shashlick quit (Ping timeout: 260 seconds)
14:16:09*zachcarter joined #nim
14:16:44*shashlick joined #nim
14:53:21*abeaumont joined #nim
15:00:52*yglukhov joined #nim
15:07:04*fvs joined #nim
15:08:28*rauss joined #nim
15:08:47*yglukhov quit (Ping timeout: 264 seconds)
15:10:24*yglukhov joined #nim
15:15:05*yglukhov_ joined #nim
15:15:05*yglukhov quit (Read error: Connection reset by peer)
15:21:59*yglukhov_ quit (Ping timeout: 264 seconds)
15:22:57*yglukhov joined #nim
15:29:04*brson joined #nim
15:29:04*elrood quit (Remote host closed the connection)
15:40:46*Snircle quit (Read error: Connection reset by peer)
15:41:26*Snircle joined #nim
15:44:47*rauce quit (Ping timeout: 264 seconds)
15:47:25*rauce joined #nim
15:56:17*fredrik92 joined #nim
15:58:52*girvo joined #nim
16:02:03*couven92 quit (Disconnected by services)
16:02:11*fredrik92 is now known as couven92
16:02:27*fredrik92 joined #nim
16:02:58*girvo quit (Ping timeout: 240 seconds)
16:11:29*arnetheduck quit (Ping timeout: 256 seconds)
16:17:54FromGitter<Varriount> Araq: Object constructors as in the procedures, or the notation `Type(name: value)` ?
16:19:10Araqnotation
16:22:19*Salewski joined #nim
16:24:19*Andris_zbx quit (Remote host closed the connection)
16:24:32SalewskiAraq, I just updated Nim and Nimsuggest from git. It seems that you have disabled error detection in Nimsuggest completely?
16:25:37SalewskiIn my NEd editor I get always zero errors! nim check file.nim still detects errors.
16:27:49SalewskiGoto definition still works fine, also showing information about symbols.
16:28:35SalewskiBut I can do arbitrary changes, and always get zero errors. Well, not a big problem.
16:32:08zachcarterblegh, I’m back to facing memory access issues / hard crashes with nim-bgfx
16:35:11SalewskiWell, calling nimsuggest from the command line still shows errors. Maybe socket communication has changed, I have to investigate that.
16:38:36*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
16:40:07*fvs left #nim ("leaving")
16:42:56SalewskinsProcess = startProcess(nimsuggestBinPath, nimPath, ["--v2", "--threads:on", "--port:" & $NSPort, $path], options = {poStdErrToStdOut, poUsePath})
16:43:35SalewskiIs that code deprecated in some way now? Was working until todays update.
16:44:03zachcarterI know I’m reaching here… but maybe someone can look at this backtrace for me and tell me why this is happening
16:44:05zachcarterhttps://gist.github.com/zacharycarter/8a533120ac1545e8bc7775d342c37c14
16:44:18zachcarterif I uncomment - https://gist.github.com/zacharycarter/8a533120ac1545e8bc7775d342c37c14#file-crashes-nim-L55
16:44:27zachcarterand comment out - https://gist.github.com/zacharycarter/8a533120ac1545e8bc7775d342c37c14#file-crashes-nim-L24
16:44:32zachcarterthings work
16:45:00zachcarterI’m not sure why calling this proc inside of another proc, is causing the EXC_BAD_ACCESS error to be thrown
16:45:17zachcarterbut calling it outside of the proc seems fine
16:57:38SalewskiOK, found it. The problem is only, that the output of nimsuggests check command has changed a bit, so I have to tune my evaluation proc!
16:57:47SalewskiThanks, bye.
16:57:59*Trustable joined #nim
17:01:39*Salewski left #nim (#nim)
17:07:16*kulelu88 joined #nim
17:07:49*PMunch quit (Quit: leaving)
17:20:25*abeaumont quit (Ping timeout: 260 seconds)
17:33:09*BitPuffin|osx quit (Ping timeout: 240 seconds)
17:37:15*BitPuffin|osx joined #nim
17:39:52*bjz joined #nim
17:47:52*vlad1777d joined #nim
17:59:46*girvo joined #nim
18:04:26*girvo quit (Ping timeout: 268 seconds)
18:10:49*deavmi joined #nim
18:13:31*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
18:16:56*deavmi quit (Quit: deavmi)
18:22:13*rokups quit (Quit: Connection closed for inactivity)
18:24:52*deavmi__ joined #nim
18:26:57*deavmi__ quit (Client Quit)
18:27:32*deavmi__ joined #nim
18:32:17*deavmi__ quit (Quit: deavmi__)
18:33:44*yglukhov quit (Remote host closed the connection)
18:37:36*Arrrr quit (Ping timeout: 240 seconds)
18:41:27*jjido joined #nim
18:51:18*Arrrr joined #nim
18:51:19*Arrrr quit (Changing host)
18:51:19*Arrrr joined #nim
18:53:16*jjido quit (Ping timeout: 258 seconds)
19:11:21*couven92 quit (Quit: Leaving)
19:11:28*fredrik92 quit (Quit: Client disconnecting)
19:27:18*jjido joined #nim
19:56:02*elrood joined #nim
20:00:01*Arrrr quit (Ping timeout: 260 seconds)
20:00:39*girvo joined #nim
20:05:08*girvo quit (Ping timeout: 246 seconds)
20:15:00*bjz joined #nim
20:18:26*jjido quit (Read error: No route to host)
20:25:27*Jesin quit (Quit: Leaving)
20:44:49*xmonader quit (Ping timeout: 258 seconds)
20:46:29*kulelu88 quit (Ping timeout: 240 seconds)
20:59:03*kulelu88 joined #nim
21:10:17*Vladar quit (Quit: Leaving)
21:12:06FromGitter<konqoro> hey is there a reason to use the quit proc than raise an exception?
21:17:04dom96konqoro: yeah, if you want to quit with a successful error code.
21:18:51FromGitter<konqoro> ok thanks dom96
21:33:46*Jesin joined #nim
21:33:56*kulelu88 quit (Ping timeout: 260 seconds)
21:39:10Araqexceptions also produce a stack trace in debug mode.
21:39:24Araqand usually you don't want your users to look at stack traces
21:45:59*zachcarter quit (Ping timeout: 264 seconds)
21:46:53*kulelu88 joined #nim
21:48:58*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
21:50:49*kulelu88 quit (Ping timeout: 240 seconds)
21:51:12*girvo joined #nim
21:54:10*Trustable quit (Remote host closed the connection)
21:56:18*girvo quit (Ping timeout: 268 seconds)
22:02:11*byte512 quit (Ping timeout: 264 seconds)
22:03:06*kulelu88 joined #nim
22:04:46*bjz joined #nim
22:05:27*Matthias247 joined #nim
22:14:39*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
22:16:58*kulelu88 quit (Ping timeout: 240 seconds)
22:23:04*PMunch joined #nim
22:29:37*kulelu88 joined #nim
22:30:39*rauss quit (Quit: WeeChat 1.7)
22:36:49*kulelu88 quit (Ping timeout: 256 seconds)
22:42:22*nsf quit (Quit: WeeChat 1.7)
22:46:15*zachcarter joined #nim
22:49:15*kulelu88 joined #nim
22:49:33*joshbaptiste quit (Ping timeout: 252 seconds)
22:49:38zachcarterI could use some help with understanding some memory issues I’m having with my program
22:49:38zachcarterhttps://github.com/zacharycarter/demo is an example repo I’ve created - if you’re running OSX you should be able to check it out and compile and run with nim 16.1
22:49:38zachcarterhttps://github.com/zacharycarter/demo/blob/master/examples/01-spritebatch/main.nim
22:50:23zachcarterthis example app works
22:50:23zachcarterhttps://github.com/zacharycarter/demo/blob/master/examples/02-engine/main.nim
22:50:23zachcarterthis example does not
22:51:09zachcarterthe difference between the two is, I’ve moved a lot of code out of main.nim and into an engine module
22:51:09zachcarterif anyone is willing to help me, I can explain more thoroughly what is going on
22:53:27*zachcarter quit (Read error: Connection reset by peer)
22:54:28*zachcarter joined #nim
22:55:11Araqif it's some help for you:
22:55:26Araqif you have a stack corruption, moving code around may hide it
22:55:40Araqbut the corruption exists in both programs
22:56:11zachcarterhrm
22:56:20zachcarterI’m not sure if it’s a stack corruption or not
22:56:39Araqso don't think "wtf, how can this fail suddenly" but instead "ok, where is the mismatched C/Nim declaration"
22:57:05AraqI'm not sure either, just saying.
22:57:07zachcarterright
22:59:50zachcarterin the second example the program hangs and if I debug it with lldb I get an EXC_BAD_ACCESS error in the bgfx render thread, which is a thread I have no control over
23:01:15zachcarterthe main difference is I’ve moved this code https://github.com/zacharycarter/demo/blob/master/examples/01-spritebatch/main.nim#L43 into https://github.com/zacharycarter/demo/blob/master/src/engine.nim#L28
23:02:30zachcarterand I’m also now passing in an instance of this tuple - https://github.com/zacharycarter/demo/blob/master/src/engine.nim#L15 | https://github.com/zacharycarter/demo/blob/master/src/app/app.nim and calling the procs declared in it
23:06:37*couven92 joined #nim
23:11:32*PMunch quit (Quit: leaving)
23:16:13*joshbaptiste joined #nim
23:29:47*Jesin quit (Quit: Leaving)
23:30:06*Jesin joined #nim
23:30:06*kulelu88 quit (Ping timeout: 240 seconds)
23:38:17zachcarterI added another example of the freeze, a simpler one - https://github.com/zacharycarter/demo/blob/master/examples/01-spritebatch2/main.nim
23:39:19zachcarternow the only difference between this and the working example is this section https://github.com/zacharycarter/demo/blob/master/examples/01-spritebatch2/main.nim#L29-L36 and this line - https://github.com/zacharycarter/demo/blob/master/examples/01-spritebatch2/main.nim#L63
23:42:09*kulelu88 joined #nim
23:42:22Araqthat's not how it works.
23:42:59Araqyou cannot look at code diffs when you have a corruption. the corruption could be in both programs, but only triggered in one.
23:43:16zachcarterhow can I detect the corruption?
23:43:20zachcarteror if there is one?
23:48:43Araqvalgrind
23:49:17*Jesin quit (Quit: Leaving)
23:49:48*girvo joined #nim
23:50:30zachcarterthanks I’ll check that out
23:53:26*bjz joined #nim