<< 09-09-2016 >>

00:14:23*mcc joined #nim
00:24:29*libman quit (Read error: Connection reset by peer)
00:29:52*yglukhov joined #nim
00:30:15*GangstaCat quit (Quit: Leaving)
00:38:05*yglukhov quit (Ping timeout: 265 seconds)
00:40:44*libman joined #nim
00:49:46*libman left #nim (#nim)
01:06:45*chemist69 quit (Disconnected by services)
01:06:50*chemist69_ joined #nim
01:09:27*yglukhov joined #nim
01:14:16*yglukhov quit (Ping timeout: 264 seconds)
01:58:42*brson quit (Ping timeout: 276 seconds)
02:03:28*pie__ quit (Ping timeout: 264 seconds)
02:23:34*Sembei quit (Read error: Connection reset by peer)
02:23:34*learath2 quit (Read error: Connection reset by peer)
02:24:00*learath2 joined #nim
02:24:35*Sembei joined #nim
02:27:59*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
02:43:01*dddddd quit (Ping timeout: 244 seconds)
02:56:14*yglukhov joined #nim
03:00:46*yglukhov quit (Ping timeout: 255 seconds)
03:18:47*desophos quit (Read error: Connection reset by peer)
03:38:39*yglukhov joined #nim
03:42:48*yglukhov quit (Ping timeout: 244 seconds)
03:58:40*Sentreen quit (Ping timeout: 265 seconds)
04:07:53*yglukhov joined #nim
04:08:20*yglukhov quit (Remote host closed the connection)
04:10:05*Sentreen joined #nim
04:35:30*brson joined #nim
04:35:30*brson quit (Client Quit)
04:35:50*Demon_Fox quit (Quit: Leaving)
04:46:47*ics joined #nim
04:59:32*dashed joined #nim
05:04:51*gokr joined #nim
05:51:26*gokr quit (Ping timeout: 252 seconds)
06:05:50*yglukhov joined #nim
06:10:31*chemist69_ quit (Quit: WeeChat 1.5)
06:19:06*csoriano_ joined #nim
06:19:09FromGitter<endragor> @Araq @dom96 do you plan to use bountysource donations for bounties? The goals are entitled as “medium bounty budget”, “large bounty budget”, but there were no bounties created since the campaign started.
06:20:52*xet7 quit (Quit: Leaving)
06:32:15*yglukhov quit (Ping timeout: 250 seconds)
06:33:42*zaquest joined #nim
06:36:07*yglukhov joined #nim
06:40:39*filcuc joined #nim
06:45:03*yglukhov quit (Remote host closed the connection)
06:47:18*ics quit (Quit: Connection closed for inactivity)
06:53:42*Trustable joined #nim
06:54:28*chemist69 joined #nim
07:01:06*gokr joined #nim
07:25:00*nairobi joined #nim
07:27:20*nairobi_ joined #nim
07:28:19*nairobi quit (Read error: Connection reset by peer)
07:34:50*GangstaCat joined #nim
08:12:41*girvo quit (Ping timeout: 244 seconds)
08:12:48*dashed quit (Quit: Connection closed for inactivity)
08:18:30*coffeepot joined #nim
08:34:45dom96endragor: that was my intention but Araq needs to agree to it first.
08:37:35*kulelu88 joined #nim
08:45:32*JeffCanJam4a20 joined #nim
08:45:32*nairobi_ quit (Read error: Connection reset by peer)
08:51:43*Arrrr joined #nim
08:55:58*Arrrr quit (Client Quit)
09:04:52*Arrrr joined #nim
09:04:52*Arrrr quit (Changing host)
09:04:52*Arrrr joined #nim
09:17:44*girvo joined #nim
09:17:48*yglukhov joined #nim
09:19:24*nairobi joined #nim
09:21:55*girvo quit (Ping timeout: 244 seconds)
09:59:12*xet7 joined #nim
10:05:30*JeffCanJam4a20 quit (Ping timeout: 250 seconds)
10:13:44*dddddd joined #nim
10:18:43*kulelu88 quit (Quit: Leaving)
10:52:58*bjz joined #nim
10:57:21*PMunch joined #nim
10:59:29*dddddd quit (Ping timeout: 260 seconds)
11:02:08*Snircle joined #nim
11:07:35*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
11:08:04*GangstaCat quit (Quit: Leaving)
11:09:45*brechtm_ joined #nim
11:12:14*dddddd joined #nim
11:12:54*brechtm quit (Ping timeout: 260 seconds)
11:18:33*girvo joined #nim
11:18:38*GangstaCat joined #nim
11:23:01*girvo quit (Ping timeout: 250 seconds)
11:23:15*bjz joined #nim
11:28:22*nairobi quit (Read error: Connection reset by peer)
11:34:59*bjz_ joined #nim
11:37:22*bjz quit (Ping timeout: 255 seconds)
11:37:36*elrood joined #nim
11:47:46*arnetheduck joined #nim
11:57:38*brechtm_ quit (Remote host closed the connection)
11:58:12*brechtm joined #nim
12:03:58*gokr quit (Ping timeout: 244 seconds)
12:27:39*Arrrr quit (Quit: WeeChat 1.5)
12:46:54*ngc quit (Remote host closed the connection)
12:57:23*xet7 quit (Quit: Leaving)
13:15:38*xet7 joined #nim
13:16:00*gokr joined #nim
13:19:20*girvo joined #nim
13:23:12*gokr quit (Ping timeout: 265 seconds)
13:23:32*girvo quit (Ping timeout: 240 seconds)
14:24:06coffeepotshould a threadvar in a proc crash the compiler? https://gist.github.com/coffeepots/1122e6aeef686266c6d42861e47ae134
14:24:19*dddddd quit (Ping timeout: 255 seconds)
14:25:08coffeepotwell, not crash compiler but produce error in c code
14:33:29elroodwhat is the error you're getting? that gist looks.. kind of useless but compiles and runs fine here
14:33:35kiercoffeepot: doesn't seem to cause an error for me. what nim version are you using?
14:33:40kiersnap
14:35:01coffeepotah ok, running windows?
14:35:10coffeepotrunning latest devel from earlier today
14:35:27coffeepotsec i'll add the msg to the gist
14:37:13coffeepotupdated
14:37:23*dddddd joined #nim
14:37:40coffeepot"error: 'NimThreadVars' has no member named 'str0'"
14:39:37coffeepotthe irony is i dont even need threadvars here, but due to an issue I encountered yesterday with running --threads:on and the compiler saying globals aren't threadsafe when being used in the main thread, I used threadvar as quick dirty get around
14:42:47coffeepoti can upload the test2.c if it helps?
14:44:35elroodeven without any ironies, catching a compiler glitch is always useful, under any circumstances. can't reproduce the error, though
14:44:52coffeepotyeah that's what i thought, but odd you can't reproduce it :/
14:46:51coffeepotnim's version is 0.14.3 (2016-09-09), git has 083b31b47314c1aa70b2726a9b7d0a3c942c2bd8
14:48:14*nsf quit (Quit: WeeChat 1.5)
14:52:37kierlet y: uint8 = (x.uint8 and 0x0Fu8) shl 4
14:52:44kier"type mismatch: got (int) but expected 'uint8'"
14:52:48kierwhat am I doing wrong here?
14:55:32kierif I change 4 to 4u8 it works, but only for certain value of the second operand of 'and'
14:55:41kiercertain values*
14:56:20Araqkier: shl/shr are weirdly typed :P
14:56:25Araqbut consistent.
14:56:47AraqI think we should change it though, it often comes up.
14:56:58Araqpatch system.nim please
15:04:30csoriano_Araq: hey, yesterday I was wondering about constructors. Someone pointed me to ask you. As far as I can see there is no regular way for having constructors? So the compiler cannot know when an object is not allocated and point that out? Also there is no syntaxt enforcement on how to create an object?
15:06:39kierAraq: https://github.com/nim-lang/Nim/pull/4743
15:09:06*arnetheduck quit (Ping timeout: 276 seconds)
15:09:40Araqcsoriano_: initialization checking doesn't require constructors
15:10:05csoriano_Araq: right
15:10:11Araqand yes, Nim has no C++ style constructors, but it has a notion of construction
15:10:17csoriano_and about the syntax enforcement?
15:10:20csoriano_hm
15:10:30csoriano_is that on pourpose?
15:10:51Araqwhat about it? the syntax "enforcement" leads to factories and crazy shit to work around it
15:11:05Araqit's on purpose, yes.
15:11:46csoriano_at the end of the day you have to always create an object. So any object can have it's own way to be created, that kinda makes it unconvenient no?
15:12:26Araqthe convention is clearly documented.
15:13:04AraqinitT for value type T, newT for pointer to T.
15:13:24Araqand since it's only a convention and not syntax, factories can be named newT too
15:13:36Araqmakes perfect sense. IMO.
15:20:18*girvo joined #nim
15:21:26coffeepotaraq, in the tutorial it gives an example of object construction using T(), but the tutorial states it should only be used internally. Is this just to maintain the proc init/new convention or are there other reasons?
15:22:08coffeepotI'm thinking of student = Student(name: "Anton", age: 5, id: 2) in http://nim-lang.org/docs/tut2.html
15:24:44csoriano_hm okay...
15:24:51Araqwell you essentially cannot change the object when you expect people to create them manually
15:24:57*girvo quit (Ping timeout: 244 seconds)
15:25:23coffeepotfair point
15:27:13csoriano_where is the newT vs initT documented?
15:27:53csoriano_also one thing I didn't understand from the docs is, why not every object does ref object of RootObj by default
15:28:04csoriano_similar to what java does
15:28:40SentreenI am using getType in the macro module to turn a typedesc into a NimNode, however, for some reason, it does not simply return the type identifier, instead, it returns `typeDesc[int]` for an int, and the entire object implemenentation for one of my own types
15:28:59SentreenAny idea what I'm doing wrong? experimenting with macros is not working out so great for me right now!
15:29:51AraqSentreen: if you pass 'int' to the macro, then its type is typeDesc[int]
15:30:27Araqcsoriano_: http://nim-lang.org/docs/apis.html
15:31:07Araqcsoriano_: because inheritance sucks and should be used more conciously than in Java
15:32:02csoriano_Araq: thanks, I saw this document before, but I guess I was expecting some explanation (I understand the docs are in an early state)
15:32:06Araqalso 'ref object' is inherently slower than 'object' if the object is small and after 3 decades Java still cannot optimize away reference semantics...
15:33:18SentreenThanks Araq, I did not know I could index a typedesc to get the inner type :)
15:33:28csoriano_Araq: okay...
15:33:53SentreenAh wait, I'm actually indexing the node that it returns, makes much more sense.
15:35:41coffeepotaraq, whilst you're about, you mentioned yesterday you had an idea to do with the issue I had with threading and "not thread safe" errors in the main thread, will that be something that's changed any time soon or is it a big job?
15:38:22Araqmy idea is a builtin assumeRunsOnMainThread() that checks the thread id at runtime
15:38:40federico3"assume"?
15:38:50Araqand is known by the compiler so that it can say "aha, ok, accesses global but is gcsafe"
15:39:23coffeepotwouldn't everything be implicitly threadsafe that isn't marked by {.thread.} pragma anyway?
15:39:48Araqno, that's not how it works.
15:40:25Araqfederico3: compiler assumes, runtime assures
15:41:58coffeepothow would thread context change for any procs that aren't called from a {.thread.} proc?
15:42:33coffeepotor createThread/spawn
15:43:24coffeepottbf any fix would be welcome. Is there a github issue for this already?
15:43:36Araqno.
15:43:44coffeepotok i'll make one
15:43:47Araqyou think of this problem like a human being :P
15:43:55Araqthe compiler works differently
15:44:32*PMunch quit (Quit: leaving)
15:44:57coffeepotha yes that I can appreciate
15:59:03*filcuc quit (Read error: Connection reset by peer)
16:02:10coffeepotwell.. having trouble creating a simple test case for the threads issue without jester
16:03:44*mcc quit (Quit: Connection closed for inactivity)
16:13:18*brson joined #nim
16:15:13*yglukhov quit (Ping timeout: 244 seconds)
16:15:56coffeepotreported here https://github.com/nim-lang/Nim/issues/4744
16:20:59kierI have:
16:20:59kierproc `shl`*[T1: SomeUnsignedInt, T2: SomeInteger](x: T1, y: T2): T1
16:21:20kierwhy doesn't `shl`(1'u32, 1'u8) match this?
16:25:23*coffeepot quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
16:52:40*brechtm quit (Ping timeout: 264 seconds)
16:54:01*brechtm joined #nim
17:08:32*desophos joined #nim
17:12:46*libman1 joined #nim
17:17:17*aziz joined #nim
17:19:52*acidx quit (Quit: leaving)
17:21:08FromGitter<kteza1> What is the reason behind not being able to modify non ref objects inside methods?
17:21:09*girvo joined #nim
17:21:53*acidx joined #nim
17:24:26BlaXpiritkteza1, please show an example
17:26:15*girvo quit (Ping timeout: 276 seconds)
17:26:42FromGitter<kteza1> http://pastebin.com/kBD2vxYY
17:27:41BlaXpiritkteza1, the reason is that these objects are passed by copy
17:28:49BlaXpiritkteza1, https://glot.io/snippets/eiahyfa6i3
17:32:13FromGitter<kteza1> Ohh. This is just a reminder for explicitness ? So that user is sure that he wants to modify the copy but not the original object?
17:32:56BlaXpiritkteza1, well I don't know if there is a way to modify the copy
17:33:17BlaXpirit`var` is passing by reference so it can be modified
17:36:04FromGitter<kteza1> Ohh. 'var Object' in method is a reference to Object?
17:37:31FromGitter<kteza1> This is confusing
17:37:37*libman1 quit (Read error: Connection reset by peer)
17:37:51FromGitter<kteza1> IMO 'ref Object' would have been better
17:38:21BlaXpiritkteza1, but it has a different meaning already
17:39:12kier"var Object" is like passing by reference in C++. the value is likely allocated on the stack somewhere, and you're passing a pointer to it so that code unrelated to that stack frame can modify it
17:39:20*Matthias247 joined #nim
17:39:32kier"ref Object" is instead referring to a heap-allocated value
17:40:11FromGitter<kteza1> Ohh cool. Makes sense now :)
17:45:20kierhow does one indicate you want to allow a type class to bind to more than one concrete type during overload resolution?
17:45:48kierthe manual says "use the distinct keyword", but it's not particularly specific about it and none of my attempts have worked yet
17:49:17*nsf joined #nim
17:55:31*libman1 joined #nim
18:15:01BlaXpiritkier, always best with an example
18:15:18BlaXpiritbecause i don't even remember the syntax, but i may have an idea because i used to mess with this stuff
18:37:42kierBlaXpirit: suppose I have proc foo(a: SomeUnsignedInt, b: SomeUnsignedInt)
18:38:27*gokr joined #nim
18:38:47kiernormally only foo(0'u32, 0'u32) or foo(0'u8, 0'u8) etc are valid, not foo(0'u32, 0'u8), because both a and b must be bound to the same concrete type (and that concrete type must be a member of the SomeUnsignedInt typeclass)
18:39:15kierthe manual says you can specify that a and b can be different concrete types using the distinct keyword, but i'm not sure how to do this
18:39:25kierhmm just though of something
18:40:17kierwait what
18:40:37kierthat example I just gave is wrong, foo(0'u32, 0'u8) does compile
18:46:00BlaXpiritkier, what is even going on with that SomeUnsignedInt
18:46:10BlaXpiritit's either bugged or just too special of a type
18:46:35BlaXpirithttps://glot.io/snippets/eiak3tn7j4 ?????
18:49:42*gokr quit (Ping timeout: 244 seconds)
18:50:37*planhths joined #nim
18:56:27kieryeah ignore what I said, I didn't actually test before I spoke
18:56:31kiernvm
18:56:49*nsf quit (Quit: WeeChat 1.5)
18:57:13BlaXpirityes but the question remains - how to force them to be the same type
19:07:43*GustavoLapasta joined #nim
19:09:17*brson quit (Ping timeout: 250 seconds)
19:22:06*girvo joined #nim
19:26:52*girvo quit (Ping timeout: 264 seconds)
19:36:18*aziz quit (Remote host closed the connection)
20:07:18*brson joined #nim
20:08:19*planhths quit (Ping timeout: 252 seconds)
20:09:16*planhths joined #nim
20:33:49*libman1 left #nim (#nim)
20:38:57*GangstaCat quit (Quit: Leaving)
20:45:58*_stowa joined #nim
20:52:09*nairobi joined #nim
20:52:32*Trustable quit (Remote host closed the connection)
20:53:46*GustavoLapasta quit (Quit: Leaving)
20:53:49*_stowa quit (K-Lined)
21:03:07*gokr joined #nim
21:07:05*planhths quit (Quit: Konversation terminated!)
21:15:32*brson quit (Ping timeout: 240 seconds)
21:22:58*girvo joined #nim
21:27:33*girvo quit (Ping timeout: 250 seconds)
22:13:26*kjrose quit (Read error: Connection reset by peer)
22:13:47*kjrose joined #nim
22:13:47*nairobi quit (Read error: Connection reset by peer)
22:21:42*kjrose quit (Read error: Connection reset by peer)
22:22:02*kjrose joined #nim
22:28:18*kellyjrose joined #nim
22:28:48*kjrose quit (Ping timeout: 244 seconds)
22:32:04*kjrose joined #nim
22:35:31*kellyjrose quit (Ping timeout: 244 seconds)
22:41:47*kjrose quit (Read error: Connection reset by peer)
22:42:07*kjrose joined #nim
22:53:20*brson joined #nim
22:53:51*gokr quit (Ping timeout: 276 seconds)
22:54:25*Ven_ joined #nim
23:00:26*Matthias247 quit (Read error: Connection reset by peer)
23:00:27*kjrose quit (Read error: Connection reset by peer)
23:00:43*kjrose joined #nim
23:05:05*elrood quit (Quit: Leaving)
23:18:13*brson quit (Ping timeout: 244 seconds)
23:23:43*girvo joined #nim
23:27:01*yglukhov joined #nim
23:27:59*girvo quit (Ping timeout: 250 seconds)
23:31:40*yglukhov quit (Ping timeout: 264 seconds)
23:58:14*nsf joined #nim