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:23 | bogen | in a macro that is invoked by a procedure, how can I get the name of the procedure? |
04:12:01 | bogen | callsite () 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:03 | bogen | I 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:01 | bogen | never 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:16 | bogen | Varriount: 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:37 | bogen | Araq: 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:32 | bogen | Varriount: 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:50 | saml | http://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:56 | Demos | you can write proc foo(title = "unknown") |
16:22:09 | Demos | instead of proc foo(title: string = "unknown") |
16:22:09 | saml | ah thanks |
16:22:12 | Demos | neat hm |
16:22:24 | Demos | also neat is that you can do proc foo(a,b,c,d: int) and they are all ints |
16:22:39 | Demos | in 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:15 | dom96 | hi |
18:21:39 | Demos | hi dom96! |
18:21:57 | dom96 | what's up Demos? |
18:22:23 | Demos | working on that openGL interface thing. And I fixed some more visual nimrod tokenizer bugs today |
18:23:16 | Demos | there 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:48 | Demos | https://github.com/barcharcraz/Phosphor/blob/master/tests/coloredTriangle.nim |
18:49:00 | dom96 | cool |
18:49:51 | Demos | I 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:07 | Demos | I guess the block name is what matters |
19:13:20 | Demos | can `.` overloading handle subfields |
19:13:35 | Demos | like 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:11 | OrionPK | Demos |
19:26:16 | Demos | OrionPK, |
19:26:32 | OrionPK | https://dl.dropboxusercontent.com/u/417554/sublanguages.png |
19:26:41 | OrionPK | you've got a GLSL string in there |
19:26:43 | OrionPK | :P |
19:26:52 | Demos | in my link |
19:27:02 | Demos | yeah, but I dont use sublime |
19:27:20 | OrionPK | you can still annotate it :P |
19:27:36 | * | vbtt joined #nimrod |
19:28:09 | OrionPK | annotate also fixes indentation |
19:28:55 | Demos | does vim have something like sublanguages? |
19:30:28 | OrionPK | https://gist.github.com/onionhammer/7673438a60eb9b3ece31 |
19:32:43 | OrionPK | http://stackoverflow.com/questions/2030839/sub-match-syntax-highlighting-in-vim |
19:32:44 | * | io2 quit (Ping timeout: 244 seconds) |
19:32:46 | OrionPK | maybe? idk |
19:32:47 | OrionPK | I dont use vim |
19:33:55 | Demos | I can live without it |
19:34:07 | Demos | any 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:52 | OrionPK | its for readability |
19:34:59 | OrionPK | not codability |
19:35:18 | OrionPK | for future readers |
19:35:22 | Demos | yeah whatever, these are like really small snippits |
19:35:28 | Demos | and they are not exactly complex shaders |
19:37:03 | Demos | I 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:40 | OrionPK | probably wont have time today, i'll check em out tomorrow |
19:40:04 | * | silven joined #nimrod |
19:45:43 | Hat_and_Cloak | Hi guys, mind if bother you with some unspecific and potentially noob-ish questions? |
19:46:36 | OrionPK | fire away, i'm sure someone here will be able to answer ;) |
19:47:33 | Hat_and_Cloak | I was doing the knight tour problem for rosetta code, here: https://gist.github.com/nullmove/9adf8a6ee12a41fd745e |
19:48:03 | dom96 | Hat_and_Cloak: We love questions! |
19:48:06 | saml | i wish i can write good code like that |
19:48:13 | Hat_and_Cloak | It does what I expect it to do but blows the memory pretty quick |
19:48:40 | saml | you are using recursion |
19:48:45 | saml | knight_tour |
19:49:13 | Hat_and_Cloak | Yes recursive depth first search |
19:49:31 | saml | is it stack overflow memory blow up? |
19:50:21 | Hat_and_Cloak | Consumed all of the ram really quick |
19:50:25 | saml | i'm nto sure if there's tail call optimization |
19:50:34 | saml | wow |
19:50:47 | saml | tables is standard library? |
19:50:50 | saml | let me try that code |
19:51:42 | saml | it runs fine. which start and board_size did you use? |
19:52:00 | Hat_and_Cloak | Try with board size 8 |
19:53:41 | saml | yah it is slow and memory keeps growing |
19:53:53 | saml | i mean not sure if it's slow.. but memory keeps growing slowly |
19:54:02 | saml | let's make it use constant memory size |
19:54:43 | Hat_and_Cloak | Hmm fwiw I did a quick python prototype with the same algorithm which behaves normally: https://gist.github.com/nullmove/f1f5a9f4fb2a45698655 |
19:54:49 | dom96 | You can try using the memory profiler: http://build.nimrod-lang.org/docs/estp.html |
19:55:02 | * | kunev joined #nimrod |
19:55:08 | dom96 | it might tell you where the memory is being allocated |
19:58:20 | vbtt | Hat_and_Cloak: I see a few differences, you're using closures in nimrod, e.g. |
19:58:30 | vbtt | also the starting position is different. |
19:58:51 | vbtt | python has no tce and it will probably run out of recursive stack before nimrom. |
19:59:15 | saml | python is still running |
19:59:27 | vbtt | python can only do 1000 depth recursion by default. that shouldn't blow the stack on nimrod. |
19:59:48 | Hat_and_Cloak | Tried doing without closure and declaring board_size or start a global variable, same happened |
20:00:06 | vbtt | may have to do with stack allocation vs heap allocation. |
20:00:20 | vbtt | but my nimrod is not that great. |
20:00:41 | Araq | Hat_and_Cloak: try it with --gc:markAndSweep please |
20:00:57 | Hat_and_Cloak | ok |
20:01:03 | Araq | if it's a codegen/GC bug usually that reveals it |
20:01:28 | Araq | however you keep lots of seqs alive via the call stack, I think |
20:03:10 | Araq | btw the code sucks ;-) |
20:03:28 | Hat_and_Cloak | :( |
20:03:55 | Hat_and_Cloak | anyway problem persists with --gc:markAndSweep |
20:05:12 | Hat_and_Cloak | Nimrod 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:58 | Araq | well for a start, use 'result' instead of 'graph', this avoids some expensive copyings |
20:06:40 | * | vendethiel joined #nimrod |
20:08:40 | saml | lol python is still running |
20:10:39 | Hat_and_Cloak | Yeah the memory usage is probably consistent though |
20:13:10 | Hat_and_Cloak | I am doing path: var seq[int], does this copy? |
20:13:40 | Araq | nope |
20:15:32 | * | Trustable quit (Quit: Leaving) |
20:17:13 | Hat_and_Cloak | Used result and updated the gist https://gist.github.com/nullmove/9adf8a6ee12a41fd745e |
20:17:28 | Hat_and_Cloak | memory still grows exponentially |
20:22:45 | def- | Hat_and_Cloak: awesome, someone else is solving rosetta code tasks in nimrod! |
20:24:54 | Hat_and_Cloak | def-, Wow so you are the author of this: https://github.com/def-/nimrod-unsorted ? |
20:25:02 | def- | Hat_and_Cloak: yes |
20:25:11 | Hat_and_Cloak | I learned a ton from there :D |
20:25:27 | saml | how can I have a dictionary of int and seq[int] ? |
20:25:34 | saml | initTable[int, seq[int]] ? |
20:25:39 | def- | saml: sounds right |
20:26:02 | def- | Hat_and_Cloak: Glad to hear. |
20:26:21 | * | Varriount-Mobile joined #nimrod |
20:26:25 | def- | Hat_and_Cloak: how do you find out that memory grows exponentially? |
20:26:35 | saml | https://gist.github.com/saml/5db356bd51d6a248d375 |
20:26:56 | def- | saml: var table = f() |
20:27:32 | Hat_and_Cloak | looked in the task manager |
20:27:34 | saml | ah thanks |
20:27:51 | def- | Hat_and_Cloak: for me it finishes so quickly i can't even check |
20:27:56 | def- | Hat_and_Cloak: do you compile with -d:release ? |
20:28:11 | Hat_and_Cloak | Yes, try with bigger board_size like 8 |
20:28:35 | def- | alright, now i see it |
20:29:18 | * | Fx00F quit (Quit: leaving) |
20:29:33 | * | Fx00F joined #nimrod |
20:29:58 | Hat_and_Cloak | result of the profiler here: http://bpaste.net/show/lEuaudZsLQma3pcreGzk/ |
20:30:20 | Hat_and_Cloak | used board_size 5 so that it can finish |
20:32:48 | def- | a lot of sequence copying going on? |
20:33:29 | saml | how can I append an int to var x: seq[int] ? |
20:33:33 | saml | add(x, 1) right? |
20:33:35 | def- | var (path, success) = knight_tour(child, path) |
20:33:41 | def- | this line is pretty bad for example |
20:33:48 | def- | it copies the entire path seq every time |
20:36:10 | saml | https://gist.github.com/saml/5db356bd51d6a248d375 what am i doing wrong? |
20:36:50 | def- | Hat_and_Cloak: this would be a bit better, I'm not copying the path anymore: https://gist.github.com/def-/2d8a2b40acac2ba3e47d |
20:38:22 | Hat_and_Cloak | I tried doing this too with no better luck, does it do better in your machine? |
20:41:57 | def- | Hat_and_Cloak: yes, seems better |
20:42:08 | def- | works with board_size 6, while the old version doesn't |
20:42:57 | def- | saml: some small things |
20:43:30 | def- | saml: like this it works: https://gist.github.com/def-/349c4ed778eb7ebbc05b |
20:43:39 | saml | i don't like import tables |
20:43:49 | saml | i wanted to import only things that i needed |
20:43:59 | def- | sure, still works |
20:44:05 | saml | ah yah |
20:44:10 | saml | forgot about argument n |
20:44:44 | saml | even if i pass f(8) or re define proc f() with no argument, same error |
20:44:52 | saml | i feel like from tables import TTable, initTable isn't enough |
20:45:07 | saml | i need to import more things from tables even though i'm not explicitly using them |
20:45:28 | def- | saml: nope, works for me |
20:46:37 | saml | https://gist.github.com/saml/5db356bd51d6a248d375 |
20:46:49 | saml | maybe t.nim is a bad name |
20:46:52 | def- | Hat_and_Cloak: i guess the recursive algorithm is just slow |
20:47:28 | Hat_and_Cloak | Yeah ultimately this is most likely it |
20:47:37 | def- | saml: what is "let x = result[0]" supposed to do? |
20:47:49 | saml | i just wanted to access result[0] |
20:48:00 | saml | that's where compiler error message gets triggered. result[0] |
20:48:16 | saml | i thought it was the samething.. f() was bad. var x = f() was good |
20:48:28 | def- | Hat_and_Cloak: the D solution on RC has your algorithm as the slow one, and another fast one |
20:49:19 | saml | def-, i'm trying to make https://gist.github.com/def-/2d8a2b40acac2ba3e47d work with explicit imports |
20:49:25 | def- | saml: aah, now you need to import `[]` as well |
20:49:33 | def- | from tables import TTable, initTable, `[]` |
20:49:35 | saml | instead of import tables, from tables import TTable |
20:49:37 | saml | ah thanks |
20:49:59 | Hat_and_Cloak | Most of the solutions there uses a heuristic that just works |
20:49:59 | saml | `[]` is for results[0] ? |
20:50:02 | def- | yes |
20:50:18 | saml | which is same as results.mget(0) |
20:50:20 | def- | [] is just a proc, which takes a table and an int and returns that value of it |
20:50:39 | def- | well, with mget you can also edit the result |
20:50:52 | def- | directly in the table |
20:50:55 | Demos | mget will also throw an exception if the value does not exist |
20:50:57 | Demos | I think |
20:51:05 | def- | right, Demos |
20:51:27 | saml | initTable[int, seq[int]] won't initialize? |
20:51:36 | saml | ah right doesn't make sense to initialize hash table |
20:51:47 | saml | i mean.. size is unbound |
20:52:03 | def- | sure you can initialize a hashtable, with {12: "foo", 13: "bar"}.toTable |
20:54:59 | def- | Hat_and_Cloak: the efficient solutions looked so long, i guess that's why i didn't solve this yet |
20:58:03 | def- | Hat_and_Cloak: instead of "0 <= possible.x and possible.x < board_size" you can write "possible.x in 0 .. <board_size" |
20:58:54 | Hat_and_Cloak | def-: Nice that is elegant |
21:00:39 | Hat_and_Cloak | def-: Anyway that warnsdoff heuristic takes away all the fun from this challange |
21:00:45 | Hat_and_Cloak | https://gist.github.com/nullmove/f1f5a9f4fb2a45698655 |
21:01:33 | Hat_and_Cloak | only 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:00 | saml | wow python so fast |
21:42:45 | def- | saml: well, it's another algorithm |
21:46:28 | saml | i 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:06 | def- | 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:51 | Fx00F | saml: 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:18 | def- | in case anyone's interested, faster version here (same algorithm though): https://gist.github.com/def-/2d8a2b40acac2ba3e47d |
23:20:27 | def- | 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:52 | saml_ | nice |
23:50:05 | saml_ | so iterate second time you get memory leak |
23:51:08 | def- | saml_: nono, it's about the var instead of let |
23:51:30 | def- | and about it being a seq |
23:51:46 | saml_ | oh i see |
23:54:21 | saml_ | only difference is c = t_82023[(0)- 0]; vs. genericSeqAssign(&c, t_82023[(0)- 0], (&NTI82018)); |
23:54:31 | saml_ | var is genericSeqAssign |
23:54:37 | saml_ | probably a bug in that method |
23:54:57 | def- | genericSeqAssign should copy the seq |
23:55:04 | def- | into a new one, which makes sense for a var |
23:55:11 | def- | but it should be freed afterwards |
23:55:20 | def- | and that's what doesn't happen apparently |
23:55:48 | * | xenagi joined #nimrod |
23:55:54 | saml_ | yah i thought nimrod was no gc by default |
23:56:00 | saml_ | looks like gc by default |