<< 04-08-2014 >>

00:10:16*bogen left #nimrod (#nimrod)
00:27:02*flaviu quit (Remote host closed the connection)
01:01:53*bogen joined #nimrod
01:07:26*flaviu joined #nimrod
01:33:20*q66_ quit (Quit: Leaving)
01:58:58*ome joined #nimrod
02:11:08*Boscop quit (Ping timeout: 244 seconds)
03:06:33*Fx00F quit (Quit: leaving)
03:14:43*xtagon joined #nimrod
04:06:51*kshlm joined #nimrod
04:11:23bogenin a macro that is invoked by a procedure, how can I get the name of the procedure?
04:12:01bogencallsite () gives me the name of the macro I'm in (when converted to a string)
04:20:47*jj2baile left #nimrod (#nimrod)
04:22:02*kunev joined #nimrod
04:29:03bogenI can use lineinfo to determine from which line the macro was invoked from. But I'm not finding in the documentation how to get which procedure invoked the macro
04:46:20*xtagon quit (Quit: Leaving)
04:56:23*flaviu quit (Ping timeout: 240 seconds)
05:35:47*Demos quit (Read error: Connection reset by peer)
05:48:04*kunev quit (Ping timeout: 240 seconds)
06:10:01bogennever mind. I found out I can just use the macro to create the procedure, then I have the name...
06:34:18*johnsoft quit (Ping timeout: 250 seconds)
06:43:42*kunev joined #nimrod
07:14:23*johnsoft joined #nimrod
07:27:31*ome quit (Quit: Connection closed for inactivity)
07:48:26*Trustable joined #nimrod
09:09:50*io2 joined #nimrod
10:09:17*noam joined #nimrod
10:30:22*kunev quit (Quit: leaving)
10:36:07*kunev joined #nimrod
10:49:00*kshlm quit (Ping timeout: 250 seconds)
11:00:48*Varriount-Mobile joined #nimrod
11:41:04*darkf quit (Quit: Leaving)
12:19:04*eigenlicht quit (*.net *.split)
12:23:00*saml_ joined #nimrod
12:23:29*eigenlicht joined #nimrod
12:25:42*bjz_ quit (Read error: Connection reset by peer)
12:25:59*bjz joined #nimrod
12:30:23*io2 quit (Ping timeout: 240 seconds)
12:35:32*untitaker quit (Ping timeout: 255 seconds)
12:38:29*willwillson joined #nimrod
12:41:11*darkfusion quit (Ping timeout: 256 seconds)
12:41:45*untitaker joined #nimrod
12:42:07*darkfusion joined #nimrod
13:03:16bogenVarriount: I got the automatic function table thing figured out and I can use it. I went with the "collect with macro then generate the data structure" option.
13:20:43*io2 joined #nimrod
13:22:48*saml_ quit (Ping timeout: 244 seconds)
13:25:44*flaviu joined #nimrod
13:30:45*jez0990_ joined #nimrod
13:31:08*willwillson quit (Ping timeout: 240 seconds)
13:31:23*jez0990 quit (Ping timeout: 240 seconds)
13:31:37bogenAraq: the documentation for Nimrod is good. There is just a lot there to comprehend. I did get hung up for a while on not being to do a const instantiantion of a hashmap (the returned error message did not reflect that problem). I found that "let" allowed me to do what I needed.
13:33:11*io2_ joined #nimrod
13:33:36*io2_ quit (Remote host closed the connection)
13:33:37*Hat_and_Cloak joined #nimrod
13:33:48*io2_ joined #nimrod
13:34:24*willwillson joined #nimrod
13:35:42*io2 quit (Ping timeout: 260 seconds)
13:36:45*Varriount-Mobile quit (Ping timeout: 244 seconds)
13:51:32bogenVarriount: http://pastie.org/9444342 is what I ended up with as proof of concept
13:55:29*io2_ is now known as io2
14:04:15*saml joined #nimrod
15:32:03*Demos joined #nimrod
15:35:40*io2 quit (Ping timeout: 255 seconds)
15:43:16*kunev quit (Quit: leaving)
15:49:27*Hat_and_Cloak quit (Quit: Leaving)
15:50:47*bogen left #nimrod (#nimrod)
16:07:24*io2 joined #nimrod
16:20:50samlhttp://nimrod-lang.org/tut1.html#default-values "Note that type inference works for parameters with default values; there is no need to write title: string = "unknown", for example." what does this mean?
16:21:56Demosyou can write proc foo(title = "unknown")
16:22:09Demosinstead of proc foo(title: string = "unknown")
16:22:09samlah thanks
16:22:12Demosneat hm
16:22:24Demosalso neat is that you can do proc foo(a,b,c,d: int) and they are all ints
16:22:39Demosin fact you can do proc foo(a,b,c,d) as well, and you get a generic proc
16:46:23*bogen1 joined #nimrod
16:47:00*bogen1 left #nimrod (#nimrod)
16:47:47*bogen1 joined #nimrod
16:49:13*milosn quit (Read error: No route to host)
16:49:17*milosn_ joined #nimrod
17:02:18*Jesin joined #nimrod
17:07:23*io2 quit (Quit: ...take irc away, what are you? genius, billionaire, playboy, philanthropist)
17:09:40*Trustable quit (Quit: Leaving)
17:11:31*Trustable joined #nimrod
17:11:48*Matthias247 joined #nimrod
17:20:51*io2 joined #nimrod
17:34:10*brson joined #nimrod
17:35:19*q66 joined #nimrod
17:49:23*Hat_and_Cloak joined #nimrod
18:03:37*Hat_and_Cloak quit (Ping timeout: 256 seconds)
18:21:15dom96hi
18:21:39Demoshi dom96!
18:21:57dom96what's up Demos?
18:22:23Demosworking on that openGL interface thing. And I fixed some more visual nimrod tokenizer bugs today
18:23:16Demosthere is a nasty race condition that comes up when quitting the IDE though, I really want to fix it but I have no idea where to start, I think what happens is that things get finalized in the wrong order
18:35:06*Hat_and_Cloak joined #nimrod
18:48:48Demoshttps://github.com/barcharcraz/Phosphor/blob/master/tests/coloredTriangle.nim
18:49:00dom96cool
18:49:51DemosI am not sure I like being able to set a uniform by the block name, I kinda want to allow setting one field of a block by the block name though
18:50:07DemosI guess the block name is what matters
19:13:20Demoscan `.` overloading handle subfields
19:13:35Demoslike if I wanted to overload access to obj.a.b where neither a nor b are real fields?
19:22:45*Fx00F joined #nimrod
19:26:01*Hat_and_Cloak quit (Ping timeout: 244 seconds)
19:26:11OrionPKDemos
19:26:16DemosOrionPK,
19:26:32OrionPKhttps://dl.dropboxusercontent.com/u/417554/sublanguages.png
19:26:41OrionPKyou've got a GLSL string in there
19:26:43OrionPK:P
19:26:52Demosin my link
19:27:02Demosyeah, but I dont use sublime
19:27:20OrionPKyou can still annotate it :P
19:27:36*vbtt joined #nimrod
19:28:09OrionPKannotate also fixes indentation
19:28:55Demosdoes vim have something like sublanguages?
19:30:28OrionPKhttps://gist.github.com/onionhammer/7673438a60eb9b3ece31
19:32:43OrionPKhttp://stackoverflow.com/questions/2030839/sub-match-syntax-highlighting-in-vim
19:32:44*io2 quit (Ping timeout: 244 seconds)
19:32:46OrionPKmaybe? idk
19:32:47OrionPKI dont use vim
19:33:55DemosI can live without it
19:34:07Demosany shader complicated enough for it to be a problem should probably be in its own file
19:34:14*silven quit (Remote host closed the connection)
19:34:48*Hat_and_Cloak joined #nimrod
19:34:52OrionPKits for readability
19:34:59OrionPKnot codability
19:35:18OrionPKfor future readers
19:35:22Demosyeah whatever, these are like really small snippits
19:35:28Demosand they are not exactly complex shaders
19:37:03DemosI gotta go for a bit, you should check out the updates to the VS plugin, I added asynch completions and fixed some of the snytax highlighting problems
19:39:40OrionPKprobably wont have time today, i'll check em out tomorrow
19:40:04*silven joined #nimrod
19:45:43Hat_and_CloakHi guys, mind if bother you with some unspecific and potentially noob-ish questions?
19:46:36OrionPKfire away, i'm sure someone here will be able to answer ;)
19:47:33Hat_and_CloakI was doing the knight tour problem for rosetta code, here: https://gist.github.com/nullmove/9adf8a6ee12a41fd745e
19:48:03dom96Hat_and_Cloak: We love questions!
19:48:06samli wish i can write good code like that
19:48:13Hat_and_CloakIt does what I expect it to do but blows the memory pretty quick
19:48:40samlyou are using recursion
19:48:45samlknight_tour
19:49:13Hat_and_CloakYes recursive depth first search
19:49:31samlis it stack overflow memory blow up?
19:50:21Hat_and_CloakConsumed all of the ram really quick
19:50:25samli'm nto sure if there's tail call optimization
19:50:34samlwow
19:50:47samltables is standard library?
19:50:50samllet me try that code
19:51:42samlit runs fine. which start and board_size did you use?
19:52:00Hat_and_CloakTry with board size 8
19:53:41samlyah it is slow and memory keeps growing
19:53:53samli mean not sure if it's slow.. but memory keeps growing slowly
19:54:02samllet's make it use constant memory size
19:54:43Hat_and_CloakHmm fwiw I did a quick python prototype with the same algorithm which behaves normally: https://gist.github.com/nullmove/f1f5a9f4fb2a45698655
19:54:49dom96You can try using the memory profiler: http://build.nimrod-lang.org/docs/estp.html
19:55:02*kunev joined #nimrod
19:55:08dom96it might tell you where the memory is being allocated
19:58:20vbttHat_and_Cloak: I see a few differences, you're using closures in nimrod, e.g.
19:58:30vbttalso the starting position is different.
19:58:51vbttpython has no tce and it will probably run out of recursive stack before nimrom.
19:59:15samlpython is still running
19:59:27vbttpython can only do 1000 depth recursion by default. that shouldn't blow the stack on nimrod.
19:59:48Hat_and_CloakTried doing without closure and declaring board_size or start a global variable, same happened
20:00:06vbttmay have to do with stack allocation vs heap allocation.
20:00:20vbttbut my nimrod is not that great.
20:00:41AraqHat_and_Cloak: try it with --gc:markAndSweep please
20:00:57Hat_and_Cloakok
20:01:03Araqif it's a codegen/GC bug usually that reveals it
20:01:28Araqhowever you keep lots of seqs alive via the call stack, I think
20:03:10Araqbtw the code sucks ;-)
20:03:28Hat_and_Cloak:(
20:03:55Hat_and_Cloakanyway problem persists with --gc:markAndSweep
20:05:12Hat_and_CloakNimrod solutions in Rosetta Code are quite well done, learning a lot from those
20:05:52*vendethiel quit (Read error: Connection reset by peer)
20:05:58Araqwell for a start, use 'result' instead of 'graph', this avoids some expensive copyings
20:06:40*vendethiel joined #nimrod
20:08:40samllol python is still running
20:10:39Hat_and_CloakYeah the memory usage is probably consistent though
20:13:10Hat_and_CloakI am doing path: var seq[int], does this copy?
20:13:40Araqnope
20:15:32*Trustable quit (Quit: Leaving)
20:17:13Hat_and_CloakUsed result and updated the gist https://gist.github.com/nullmove/9adf8a6ee12a41fd745e
20:17:28Hat_and_Cloakmemory still grows exponentially
20:22:45def-Hat_and_Cloak: awesome, someone else is solving rosetta code tasks in nimrod!
20:24:54Hat_and_Cloakdef-, Wow so you are the author of this: https://github.com/def-/nimrod-unsorted ?
20:25:02def-Hat_and_Cloak: yes
20:25:11Hat_and_CloakI learned a ton from there :D
20:25:27samlhow can I have a dictionary of int and seq[int] ?
20:25:34samlinitTable[int, seq[int]] ?
20:25:39def-saml: sounds right
20:26:02def-Hat_and_Cloak: Glad to hear.
20:26:21*Varriount-Mobile joined #nimrod
20:26:25def-Hat_and_Cloak: how do you find out that memory grows exponentially?
20:26:35samlhttps://gist.github.com/saml/5db356bd51d6a248d375
20:26:56def-saml: var table = f()
20:27:32Hat_and_Cloaklooked in the task manager
20:27:34samlah thanks
20:27:51def-Hat_and_Cloak: for me it finishes so quickly i can't even check
20:27:56def-Hat_and_Cloak: do you compile with -d:release ?
20:28:11Hat_and_CloakYes, try with bigger board_size like 8
20:28:35def-alright, now i see it
20:29:18*Fx00F quit (Quit: leaving)
20:29:33*Fx00F joined #nimrod
20:29:58Hat_and_Cloakresult of the profiler here: http://bpaste.net/show/lEuaudZsLQma3pcreGzk/
20:30:20Hat_and_Cloakused board_size 5 so that it can finish
20:32:48def-a lot of sequence copying going on?
20:33:29samlhow can I append an int to var x: seq[int] ?
20:33:33samladd(x, 1) right?
20:33:35def- var (path, success) = knight_tour(child, path)
20:33:41def-this line is pretty bad for example
20:33:48def-it copies the entire path seq every time
20:36:10samlhttps://gist.github.com/saml/5db356bd51d6a248d375 what am i doing wrong?
20:36:50def-Hat_and_Cloak: this would be a bit better, I'm not copying the path anymore: https://gist.github.com/def-/2d8a2b40acac2ba3e47d
20:38:22Hat_and_CloakI tried doing this too with no better luck, does it do better in your machine?
20:41:57def-Hat_and_Cloak: yes, seems better
20:42:08def-works with board_size 6, while the old version doesn't
20:42:57def-saml: some small things
20:43:30def-saml: like this it works: https://gist.github.com/def-/349c4ed778eb7ebbc05b
20:43:39samli don't like import tables
20:43:49samli wanted to import only things that i needed
20:43:59def-sure, still works
20:44:05samlah yah
20:44:10samlforgot about argument n
20:44:44samleven if i pass f(8) or re define proc f() with no argument, same error
20:44:52samli feel like from tables import TTable, initTable isn't enough
20:45:07samli need to import more things from tables even though i'm not explicitly using them
20:45:28def-saml: nope, works for me
20:46:37samlhttps://gist.github.com/saml/5db356bd51d6a248d375
20:46:49samlmaybe t.nim is a bad name
20:46:52def-Hat_and_Cloak: i guess the recursive algorithm is just slow
20:47:28Hat_and_CloakYeah ultimately this is most likely it
20:47:37def-saml: what is "let x = result[0]" supposed to do?
20:47:49samli just wanted to access result[0]
20:48:00samlthat's where compiler error message gets triggered. result[0]
20:48:16samli thought it was the samething.. f() was bad. var x = f() was good
20:48:28def-Hat_and_Cloak: the D solution on RC has your algorithm as the slow one, and another fast one
20:49:19samldef-, i'm trying to make https://gist.github.com/def-/2d8a2b40acac2ba3e47d work with explicit imports
20:49:25def-saml: aah, now you need to import `[]` as well
20:49:33def-from tables import TTable, initTable, `[]`
20:49:35samlinstead of import tables, from tables import TTable
20:49:37samlah thanks
20:49:59Hat_and_CloakMost of the solutions there uses a heuristic that just works
20:49:59saml`[]` is for results[0] ?
20:50:02def-yes
20:50:18samlwhich is same as results.mget(0)
20:50:20def-[] is just a proc, which takes a table and an int and returns that value of it
20:50:39def-well, with mget you can also edit the result
20:50:52def-directly in the table
20:50:55Demosmget will also throw an exception if the value does not exist
20:50:57DemosI think
20:51:05def-right, Demos
20:51:27samlinitTable[int, seq[int]] won't initialize?
20:51:36samlah right doesn't make sense to initialize hash table
20:51:47samli mean.. size is unbound
20:52:03def-sure you can initialize a hashtable, with {12: "foo", 13: "bar"}.toTable
20:54:59def-Hat_and_Cloak: the efficient solutions looked so long, i guess that's why i didn't solve this yet
20:58:03def-Hat_and_Cloak: instead of "0 <= possible.x and possible.x < board_size" you can write "possible.x in 0 .. <board_size"
20:58:54Hat_and_Cloakdef-: Nice that is elegant
21:00:39Hat_and_Cloakdef-: Anyway that warnsdoff heuristic takes away all the fun from this challange
21:00:45Hat_and_Cloakhttps://gist.github.com/nullmove/f1f5a9f4fb2a45698655
21:01:33Hat_and_Cloakonly needed to do a small modification of the earlier python script
21:11:50*Hat_and_Cloak quit (Quit: Leaving)
21:25:17*flaviu quit (Remote host closed the connection)
21:27:22*flaviu joined #nimrod
21:30:14*io2 joined #nimrod
21:30:55*bogen1 quit (Quit: Leaving.)
21:36:12*io2 quit (Quit: ...take irc away, what are you? genius, billionaire, playboy, philanthropist)
21:36:24*io2 joined #nimrod
21:42:00samlwow python so fast
21:42:45def-saml: well, it's another algorithm
21:46:28samli don't know how choosing to move to the smallest number of available moves is a good heuristics
21:49:26*Jesin quit (Quit: Leaving)
21:50:42*Boscop joined #nimrod
21:51:13*Jesin joined #nimrod
22:09:06def-I found the reason for the high memory in knight's tour
22:11:10*kunev quit (Ping timeout: 250 seconds)
22:18:52*def- quit (Ping timeout: 250 seconds)
22:21:03*Varriount-Mobile quit (Remote host closed the connection)
22:38:02*bogen joined #nimrod
22:45:18*io2 quit (Ping timeout: 250 seconds)
22:46:15*def- joined #nimrod
23:04:19*darkf joined #nimrod
23:09:28*Jesin quit (Quit: Leaving)
23:11:15*Jesin joined #nimrod
23:14:51Fx00Fsaml: fail first, search locality
23:15:09*saml_ joined #nimrod
23:18:36*adoniscik joined #nimrod
23:19:08*Matthias247 quit (Read error: Connection reset by peer)
23:20:18def-in case anyone's interested, faster version here (same algorithm though): https://gist.github.com/def-/2d8a2b40acac2ba3e47d
23:20:27def-and bug report about the memory leak: https://github.com/Araq/Nimrod/issues/1445
23:22:30*nande joined #nimrod
23:24:34*bjz quit (Ping timeout: 240 seconds)
23:27:49*bjz joined #nimrod
23:29:54*ist joined #nimrod
23:30:01*ist left #nimrod ("Leaving")
23:30:23*bjz quit (Read error: Connection reset by peer)
23:30:51*bjz joined #nimrod
23:40:13*bjz quit (Ping timeout: 256 seconds)
23:49:52saml_nice
23:50:05saml_so iterate second time you get memory leak
23:51:08def-saml_: nono, it's about the var instead of let
23:51:30def-and about it being a seq
23:51:46saml_oh i see
23:54:21saml_only difference is c = t_82023[(0)- 0]; vs. genericSeqAssign(&c, t_82023[(0)- 0], (&NTI82018));
23:54:31saml_var is genericSeqAssign
23:54:37saml_probably a bug in that method
23:54:57def-genericSeqAssign should copy the seq
23:55:04def-into a new one, which makes sense for a var
23:55:11def-but it should be freed afterwards
23:55:20def-and that's what doesn't happen apparently
23:55:48*xenagi joined #nimrod
23:55:54saml_yah i thought nimrod was no gc by default
23:56:00saml_looks like gc by default