<<02-02-2013>>

00:00:12Araquse message passing and watch the horrible performance
00:00:27Araqnimrod's message passing implementation is VERY slow
00:00:53gradhaI presume I would use the locks module along with allocShared's result?
00:01:04Araqperhaps
00:01:41Araqyou can also just split the imagines into non-overlapping parts and process these without locks
00:02:11Araq*images
00:02:43gradhayou would still need locking at some point between the worker threads when they finish and try to get more tiles to process
00:02:57gradhamaybe a locked queue is somewhere?
00:03:46Araqsure that's what threads are supposed to communicate with
00:04:22Araqbut I'd try fork&join and not do any work stealing
00:05:01Araqin fact, just use the || iterator and don't perform any allocations in the loop body
00:05:45gradhais there an API which exposes the number of cores to create the optimal number of threads for a pool?
00:06:17Araqosproc.getNumberOfCPUs or something like that
00:06:22Araqit's in osproc
00:06:23gradhaosproc.countProcessors?
00:06:26Araqyeah
00:06:53gradhadoes that work at the physical level or at the logical one? you know, intel throwing multi-whatever-simulation-virtualization-stuff and so
00:07:04gradhahyperthreading
00:07:07gradhathat's the word
00:07:22Araqit does the right thing (TM), ok?
00:07:31Araqthat means I don't know ... ;-)
00:07:41gradhathat's fine
00:07:45Araqit asks the OS what it thinks
00:09:13gradhaI'll ask my pillow what it thinks, good night
00:09:22Araqbye
00:09:27*gradha quit (Quit: bbl, have youtube videos to watch)
02:59:54*ccssnet quit (Quit: http://atccss.net)
03:03:04*ccssnet joined #nimrod
03:28:13*fowl joined #nimrod
05:24:35*zahary1 joined #nimrod
05:25:27*zahary quit (Ping timeout: 245 seconds)
12:32:16*q66[bru] joined #nimrod
12:32:22q66[bru]#join #d
12:32:25q66[bru]errr
12:32:48q66[bru]fucking irc commands
12:35:52Araqjoining #d is a mistake anyway :P
12:37:38q66[bru]Araq, yes
12:37:41q66[bru]i like to troll it there
12:37:50Araqoh alright
13:03:49*q66[bru] quit (Quit: Computer has gone to sleep.)
13:20:28dom96hello
14:39:21*FreeArtMan quit (Quit: Leaving)
14:46:26*Trix[a]r_za is now known as Trixar_za
15:06:01*Trixar_za is now known as Trix[a]r_za
15:14:15*Trix[a]r_za is now known as Trixar_za
16:02:54*Trixar_za is now known as Trix[a]r_za
16:36:01*FreeArtMan joined #nimrod
16:41:36*q66[bru] joined #nimrod
16:59:42*q66[bru] quit (Quit: Computer has gone to sleep.)
17:04:00*XAMPP_8 joined #nimrod
17:11:45*Zerathul joined #nimrod
17:37:20fowl 16808f2 revert to old GC; use --gc:v2 to activate the new GC
17:37:23fowlwhats that about
17:38:01Araqfowl: zahary is working on a new GC which supports garbage collecting a shared heap
17:38:15Araqand incremental operation for the cycle collector
17:38:34Araqbut currently it uses more memory and is slower
17:39:52*q66[bru] joined #nimrod
17:40:27fowlo cool
17:40:42q66[bru]cool what
17:41:02fowl113800: <Araq> fowl: zahary is working on a new GC which supports garbage collecting a shared heap
17:41:02fowl113814: <Araq> and incremental operation for the cycle collector
17:41:02fowl113833: <Araq> but currently it uses more memory and is slower
17:41:08Araqq66[bru]: http://build.nimrod-code.org/irclogs/
17:41:23*gradha joined #nimrod
17:41:35q66[bru]neat
17:42:46gradhanot sure, using more memory and being slower is so mainstream
17:46:37Araqgradha: do you feel like investigating some bugs on windows?
17:47:07gradhafortunately I don't have windows
17:47:32Araqfowl: same question
17:48:10gradhaI might get a surface pro this year if the windows platform starts picking up speed on mobile though
17:49:52Araqoh wait, there is a pull request for #322 now
17:51:04gradhatoday I was told by unreliable sources Microsoft is already working on Windows 9 due to 8 having lackluster sales
17:51:21gradhaI can't believe I'm getting news about tech through meatspace earlier than through internet
17:56:22*FreeArtMan quit (Ping timeout: 276 seconds)
17:57:47*q66[bru] quit (Quit: Computer has gone to sleep.)
18:19:38gradhacan't call an immediate template from within another immediate template?
18:21:39Araqsure you can
18:22:39gradhaI guess I'm failing again at syntax, will try dividing the code
18:23:16Araqwhat's the error message?
18:23:27gradhaok, found the problem, typo
18:23:55gradhahad vim autocomplete me a variable name similar to the template name
18:24:19gradhaI think I'll rename the variable to avoid future problems
18:54:28gradhain what situations would you pass in a typedesc[something] to a proc as a parameter?
18:55:01AraqI don't know
18:56:23AraqI don't really remember what it means ;-)
18:57:02AraqI know what expr[string] means and I'll remove it again once I feel like it
18:57:17gradhait means I fucked up writing proc(a = string) instead of proc(a: string)
18:57:32gradhaexpr[string] ?
18:59:18Araqit means string{lit}
19:01:33gradhainteresting
19:14:48gradhaassignment to discriminant changes object branch
19:14:51*shevy quit (Ping timeout: 244 seconds)
19:14:58gradhaso I guess I can't do that
19:19:14gradhalooks like $ won't stringify a ref E_base, is there any proc which will?
19:19:37Araqnope
19:19:45Araqrepr should work
19:22:27gradhaI get ref 0x102817788 --> []
19:22:35gradhaif I try to deref with []?I get just the blank brackets
19:22:58Araqwell it doesn't use the dynamic type
19:23:01Araqbut the static type
19:23:30AraqE_Base does contain the fields though, hm
19:25:46Araqbbl
19:28:22*shevy joined #nimrod
19:41:26*gradha quit (Ping timeout: 246 seconds)
19:49:17*gradha joined #nimrod
20:03:19gradhaI'm failing to instantiate an object variant through a template https://gist.github.com/4699026
20:03:32gradhamaybe this is where templates don't cut it and I have to resort to macros?
20:05:35dom96gradha: think about it this way, new_node(...) gets replaced with your templates body.
20:05:56dom96so you should put the `let t3 = new_node(...)` inside your templates body.
20:07:05gradhathe error is the same if I call new_node without assigning it anywhere
20:07:30gradhaI guess the problem is this generates wrong type branches for the switch
20:07:49gradhabut a template is run at compile time, so it would leave just the code of the selected branch
20:08:02dom96the return type of the template should also be: stmt
20:09:01gradhas/template is.../macro is.../
20:09:45dom96a template is also run at compile time
20:11:29gradhait's a pity the compiler dislikes my template
20:13:54dom96hrm, lets see what I can do.
20:14:29dom96first thing I notice is your 'expr' arg, that seems like a bad idea (not giving it a type)
20:14:44gradhawell, that's the point of the template/macro
20:15:07dom96you should make it "e: expr"
20:15:11dom96expr is a type
20:16:23dom96oh, I see the problem.
20:17:02dom96I suppose what you do is fine, but it feels risky to me.
20:17:30dom96the 'kind' arg actually causes a problem, in that 'result.kind' is transformed into 'result.PK_INT'
20:18:40gradhaugh, what?
20:19:05gradhaok, I renamed the parameter to tkind and now the error is indeed different
20:19:13dom96yeah.
20:19:20gradhanow it fails where I expected it to fail: the case with all branches
20:20:32gradhaI guess Araq will come and beat me with some obscure oneliner from the manual explaining the why of the kind variable substitution
20:21:05gradhaaha, indeed, "Lookup rules for template parameters"
20:22:15dom96hrm, perhaps this is a bug.
20:22:54gradhait's even more than one line of doc, so I bet it's definitely a feature
20:24:56dom96here is a workaround: https://gist.github.com/20159763f3812bc0f131
20:25:02dom96But you don't get compile time safety then
20:26:02gradhaisn't that evil?
20:26:07*dom96 didn't know that you could have templates which return a proper type :O
20:26:27dom96seems to be quite evil, yeah.
20:27:03gradhabut clever evilness
20:27:58gradhaso the compiler will leave the case there, and at runtime will pick one of the branches, so if I pass the wrong type will raise an exception, correct?
20:28:48dom96yeah
20:29:04dom96It should be possible to get compile time safety though
20:29:45gradhaany time is good to stat learning macros, so there I go
20:30:19gradhaand thanks for the evil suggestion
20:30:22dom96ooh
20:30:48dom96https://gist.github.com/20159763f3812bc0f131
20:30:48dom96:D
20:30:55dom96You can use a when
20:31:11gradhanice!
20:31:21dom96A compile-time case would be even awesomer.
20:31:40dom96oh and don't mind the {lit}
20:31:50dom96It works without that too it seems.
20:32:06gradhaI still don't know what {lit} means
20:33:04dom96I think it might only apply to term rewriting macros
20:33:28dom96Sadly, the following will not work: var blah = PK_INT; let t3 = new_node(blah, 2)
20:33:41dom96but that's correct I think
20:33:55gradhaI was going to ask that
20:34:11gradhasince I thought when was only available for compilation defines
20:34:15gradhalike release or debug
20:34:20gradhacompilation constants
20:34:37dom96yeah, I would just use a proc for the runtime version.
20:46:58*FreeArtMan joined #nimrod
20:51:15gradhayou mentioned a compile time case, sounds like that could be provided by an expression macro named static_case
20:52:57gradhaI wonder if the macro could be made to generate a runtime case if the input parameter was not appropriate
20:57:54AraqI can only shake my head about this conversation
20:58:44Araq'case' should work fine too in the template
20:59:38Araqand dom96, T{lit} is now available for ordinary templates too
21:00:02Araqbut I wonder why you use it, if you don't know what it means ... ;-)
21:00:14gradhait is a bug then that case didn't work?
21:00:27Araqdunno yet
21:00:44Araqoften I say it's a bug and then figure out the compiler is correct ;-)
21:07:07AraqError: type mismatch: got (int literal(3)) but expected 'string'
21:07:32Araqwell you can't do it that way
21:08:03Araqindeed the 'case' is not evaluated at the instantation time
21:08:56Araqa 'static case' construct is planned but for now you have to use 'when'
21:10:31Araq when tkind == PK_EMPTY: nil
21:10:33Araq elif tkind == PK_INT: result.int_val = expr
21:10:34Araq elif tkind == PK_STRING: result.str_val = expr
21:10:36Araq else: {.error: "unknown kind".}
21:10:42Araqworks fine too
21:11:05Araqso no bug here
21:11:21Araqand dom96 was correct
21:13:59*Zerathul quit (Ping timeout: 256 seconds)
21:14:21*Zerathul joined #nimrod
21:14:54*gradha quit (Quit: bbl, have youtube videos to watch)
21:21:56*FreeArtMan quit (Ping timeout: 255 seconds)
21:43:54*gradha joined #nimrod
21:46:46gradhanimrod templates, cool
21:46:55gradhaforgetting to eat dinner because of nimrod, not so cool
21:47:37Araqcan't be that bad, you didn't forget to watch youtube
21:51:51gradhaactually, I didn't undestand yesterday's video: why does this kratos throw chains from his hands? is he like ancient-greece-spiderman?
21:52:55Araqthe chains are between the sword's blade and handle
21:53:04AraqI think
21:53:38gradhahaha, reminds me of mazinger z when he launched the forearms
21:53:58Araqinspector gadget?
21:54:19gradhathat would be closer, yes, since the forearms weren't attached
21:55:34gradhamazinger z: http://www.toei-anim.co.jp/lineup/tv/mazingerz/ pretty popular when I was a child, did watch films of it in the basement of our local church
21:55:58gradhacan't find the name in english, huh, maybe the translation was different?
21:56:14Araqno idea
21:56:42gradhais the static case more work than just joining the when/elif?
21:56:52gradhaI mean, does it do something else the when/elif construct can't do?
21:56:59Araqnah
21:57:52Araqdid you also watch "Gamera" as a child?
21:58:00gradhano idea what that is
21:58:10Araqhttp://www.youtube.com/watch?v=Gqejmh-nJFo
21:58:44gradhaah, no, I came late to this genre with the power rangers
22:00:51gradhaholy cow! it's september 11 in tortoise mode!
22:01:35AraqI especially like the voice acting in the movie
22:02:02gradhaoh man, watching this as an adult is not so fun, realizing puny human structures wouldn't support the weight of those monsters
22:03:18gradhaand now it's pacman!
22:03:28gradhaand a hovercraf!
22:05:57gradhathis is confusing, why are we programming in nimrod and not in gamera?
22:06:36Araqbecause I didn't know about gamera back then
22:09:21Araqbut we should give versions names like Ubuntu
22:09:35gradhayou mean, pokemon names?
22:09:37Araqso it'll be "Nimrod -- the Gamera edition" XD
22:44:34dom96Araq: Is there a way to give wrapped functions docs?
22:45:02gradhamaybe forward declaring?
22:46:45dom96hrm, not sure what you mean
22:47:34gradhaby wrapped function you mean a proc which uses the importc pragma, right?
22:48:05dom96yeah
22:48:42fowldid you try it
22:49:05fowliirc some of the sdl functions are documented
22:49:39gradhayeah, tried adding a comment to a gtk2 proc, worked without problem
22:49:59gradhahttp://pastebin.com/ben9qdjT
22:50:17gradhano need to forward declare then
22:50:39dom96cool, thanks.
22:51:20gradhathe forward declaration doc is used in the system module, system.nim forward declares and documents, included files implement, so that would be possible too
22:55:47dom96oh yeah, I forgot about that.
22:57:06gradhaAraq: we talked the other day about procs being "overwritten", and you having this style of documenting only where the export mark is
22:57:34gradhadoes idetools support telling you that for the proc x there are several points declaring that? maybe this could help finding such cases
22:57:45gradhaby default idetools could give the "most recent", whatever that meant in compiler terms
22:58:24gradhaI guess idetools already gives the "most recent" one
22:58:57gradhaoh, and I think idetools has stopped working completely since last update
22:59:05gradhaI will try to bisect the change
23:00:46gradhaalso: gamera edition is nice, but what would follow?
23:58:31*FreeArtMan joined #nimrod
23:58:44*gradha quit (Quit: bbl, have youtube videos to watch)