00:06:52 | OrionPK | cool |
00:11:11 | * | Demos quit (Read error: Connection reset by peer) |
00:15:11 | OrionPK | oh cool. http://ideone.com/zAs2Zn |
00:43:34 | * | brson quit (Ping timeout: 240 seconds) |
00:48:26 | * | Raynes quit (Ping timeout: 260 seconds) |
00:52:25 | * | Raynes joined #nimrod |
00:52:49 | * | Raynes is now known as Guest20118 |
00:54:07 | * | Guest20118 quit (Excess Flood) |
00:54:44 | * | xenagi joined #nimrod |
00:58:29 | * | Raynes_ joined #nimrod |
01:01:40 | * | ics quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
01:29:31 | * | q66 quit (Quit: Leaving) |
01:33:59 | * | darkf quit (Read error: Connection reset by peer) |
01:35:01 | * | darkf joined #nimrod |
01:35:46 | * | darkf quit (Read error: Connection reset by peer) |
01:36:07 | * | Raynes_ is now known as Raynes |
01:36:07 | * | Raynes quit (Changing host) |
01:36:07 | * | Raynes joined #nimrod |
01:57:19 | * | EXetoC quit (Quit: WeeChat 0.4.3) |
02:04:25 | * | Fx00F joined #nimrod |
02:17:24 | * | jpoirier joined #nimrod |
02:17:35 | * | jpoirier quit (Client Quit) |
02:18:33 | * | ics joined #nimrod |
02:25:14 | * | superfunc joined #nimrod |
02:29:35 | * | superfunc quit (Ping timeout: 256 seconds) |
02:41:50 | * | linkmonitor joined #nimrod |
02:43:19 | linkmonitor | Anyone know if it's possible to define a constructor syntax similar to the array constructor syntax with [ ... ]? Like <<1,2>> as an alias for creating some TVector type? |
02:49:09 | * | darkf joined #nimrod |
02:52:57 | flaviu | linkmonitor: Not unless you want to do some seriously hackish things |
02:53:19 | flaviu | How about `vec[1,2]`? |
02:54:08 | linkmonitor | Thank you. vec[1,2], 1<>2, and vec(1,2) all work well. It was a speculative type question to find out how built in the array constructor syntax is |
02:55:17 | flaviu | night |
02:55:25 | linkmonitor | night |
02:59:58 | * | flaviu quit (Ping timeout: 272 seconds) |
03:05:41 | * | linkmonitor quit (Quit: Page closed) |
03:47:15 | adoniscik | speaking of arrays, is there any reason not to use column-major order since nimrod doesn't have a native preference? |
04:10:28 | * | mwbrown quit (Ping timeout: 250 seconds) |
04:34:27 | * | ics quit (Ping timeout: 245 seconds) |
04:35:14 | * | ics joined #nimrod |
04:54:28 | * | xenagi quit (Quit: Leaving) |
04:58:29 | * | ARCADIVS joined #nimrod |
05:19:42 | * | nande quit (Remote host closed the connection) |
06:26:50 | * | superfunc joined #nimrod |
06:31:02 | * | superfunc quit (Ping timeout: 245 seconds) |
06:42:00 | Araq | adoniscik: intiutive is row-major though, when you think about array of strings, for instance |
06:43:36 | adoniscik | I'm interfacing with a FORTRAN library, so I have to decide whether it's worth the conversions rather than sticking with column-major order. I wish there were some guidelines or reference libraries for numerical work. I'm just winging it. |
06:45:19 | Araq | well you're the first, you should write the guidelines |
06:52:33 | Fx00F | Araq: in mathematics vectors are column vectors |
06:53:24 | adoniscik | there's that too, but the deciding factor is reducing impedance between the libraries |
06:57:41 | Fx00F | and as nimrod compiles to c, it makes some sense to use c's default order |
06:58:02 | adoniscik | decisions, decisions :) |
06:59:46 | Fx00F | any really good reason to have those ':' after if/for ? |
07:07:15 | Skrylar | because <...>: is a block |
07:07:19 | * | kunev joined #nimrod |
07:07:56 | Skrylar | there's also the "blah do:" notation and you can have macros with "customname: <...>" |
07:07:58 | Fx00F | is that used for macros/templates/metaprogramming? |
07:08:06 | Skrylar | yes |
07:08:12 | Skrylar | full consistency between built-in and macros |
07:08:14 | Skrylar | or such |
07:08:16 | Fx00F | ok, that's a good reason |
07:08:30 | Fx00F | thx |
07:08:32 | Skrylar | :) |
07:08:41 | * | ARCADIVS quit (Quit: WeeChat 0.4.3) |
07:17:44 | * | gsingh93 joined #nimrod |
07:20:20 | * | zahary joined #nimrod |
07:22:33 | Araq | hey zahary |
07:29:19 | * | Boscop_ is now known as Boscop |
07:29:37 | * | Boscop quit (Changing host) |
07:29:37 | * | Boscop joined #nimrod |
08:02:32 | * | Fr4n quit (Quit: Leaving) |
08:49:22 | Skrylar | hmm |
08:49:30 | Skrylar | i need to think of some exercizes for unrestraining programmer brains |
08:50:13 | Skrylar | I was just thinking about how growing up in the C world heavily shackles your way of thinking, case in point how a C person will have a "buffer, bufferLen, bufferPos" variable; a lisp/forther will just abstract it once and recycle, the C community will repeat it ad infinitum |
09:18:36 | * | ics quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
09:20:54 | * | Fr4n joined #nimrod |
09:30:00 | * | Fx00F quit (Quit: leaving) |
09:31:11 | * | adoniscik quit (Ping timeout: 264 seconds) |
10:09:39 | * | gsingh93 quit (Quit: Connection closed for inactivity) |
10:13:35 | * | woodgiraffe quit (Ping timeout: 260 seconds) |
10:28:27 | * | superfunc joined #nimrod |
10:32:57 | * | superfunc quit (Ping timeout: 256 seconds) |
11:48:29 | * | saml_ joined #nimrod |
12:03:53 | Skrylar | reactormonk: ping |
12:18:17 | * | mwbrown joined #nimrod |
12:23:04 | * | flaviu joined #nimrod |
12:35:05 | * | untitaker quit (Ping timeout: 255 seconds) |
12:41:02 | * | untitaker joined #nimrod |
12:51:25 | * | darkf quit (Quit: Leaving) |
13:03:30 | * | Demos joined #nimrod |
13:03:54 | * | saml_ quit (Ping timeout: 250 seconds) |
13:09:06 | * | mwbrown quit (Ping timeout: 250 seconds) |
13:12:25 | * | zahary1 joined #nimrod |
13:12:46 | * | Boscop_ joined #nimrod |
13:14:44 | * | clone1018_ joined #nimrod |
13:15:06 | * | flaviu quit (Ping timeout: 245 seconds) |
13:15:06 | * | zahary quit (Ping timeout: 245 seconds) |
13:15:10 | * | bstrie_ quit (Ping timeout: 240 seconds) |
13:15:10 | * | krusipo quit (Ping timeout: 240 seconds) |
13:15:11 | * | Boscop quit (Read error: Connection reset by peer) |
13:15:18 | * | def- quit (Ping timeout: 245 seconds) |
13:15:18 | * | clone1018 quit (Ping timeout: 245 seconds) |
13:15:23 | * | betawaffle quit (Ping timeout: 240 seconds) |
13:15:29 | * | def- joined #nimrod |
13:15:51 | * | bstrie joined #nimrod |
13:15:54 | * | krusipo joined #nimrod |
13:16:10 | * | betawaffle joined #nimrod |
13:16:52 | * | flaviu joined #nimrod |
13:29:13 | flaviu | <span>foo</span> |
14:30:01 | * | superfunc joined #nimrod |
14:34:20 | * | superfunc quit (Ping timeout: 255 seconds) |
14:37:33 | Skrylar | Araq: why are doc comments for enums so derpy? |
14:38:24 | Skrylar | (e.g. in doxygen i would put the comment prior to the definition, nimrod doesn't recognize this. a doc comment underneath the = enum <newline> is considered an error, while its ok for = object <newline>; instead, enums take the comment for the first member as the type comment while leaving the first member undocumented |
15:14:56 | * | kunev quit (Quit: leaving) |
15:17:42 | * | ics joined #nimrod |
15:20:51 | Demos | I just got a stack overflow when running nimrod serve in "debug mode" (with --lineDir and --debugInfo) |
15:27:43 | OrionPK | just submitted another bug, probably related |
15:29:21 | Demos | did you update with my fix for those out of range errors> |
15:34:27 | OrionPK | I got latest |
15:34:31 | OrionPK | yes |
15:35:27 | Demos | hm I could not reproduce an error |
15:35:32 | Demos | did you do this in a new file? |
15:41:53 | Demos | well i can not get it to happen... lets see |
15:46:11 | Demos | ah I got the error |
15:48:54 | Demos | WTAF |
15:50:11 | Demos | when you have a class with a getLength() method and then some getFoo methods that take an integer index you dont really expect -1! |
15:56:24 | Demos | OK it should be fixed now |
16:03:52 | OrionPK | coo |
16:03:55 | OrionPK | i'll retest |
16:05:10 | OrionPK | worked |
16:11:04 | * | flaviu quit (Remote host closed the connection) |
16:12:20 | * | flaviu joined #nimrod |
16:15:55 | Demos | yeah, I also made the completions work if you have spaces in your project path :D |
16:16:12 | Demos | although that may have broken completions for stuff in subfolders |
16:22:25 | * | Boscop_ is now known as Boscop |
16:22:26 | * | Boscop quit (Changing host) |
16:22:26 | * | Boscop joined #nimrod |
16:24:53 | * | io2 joined #nimrod |
16:31:11 | * | superfunc joined #nimrod |
16:35:50 | * | superfunc quit (Ping timeout: 255 seconds) |
16:39:00 | Demos | does nimrod have something like offsetof or do I need to do like cast[pointer](addr cast[Object](nil).field)? |
17:03:18 | dom96 | it doesn't |
17:03:36 | dom96 | the particle benchmarks has a template which implements it |
17:06:29 | * | flaviu quit (Remote host closed the connection) |
17:06:47 | * | flaviu joined #nimrod |
17:08:28 | * | q66 joined #nimrod |
17:14:53 | * | Ven joined #nimrod |
17:31:09 | * | io2 quit (Quit: ...take irc away, what are you? genius, billionaire, playboy, philanthropist) |
17:34:00 | Demos | yeah I made one |
17:55:24 | * | Fx00F joined #nimrod |
18:00:21 | * | adoniscik joined #nimrod |
18:04:37 | * | Kelet joined #nimrod |
18:06:46 | * | kunev joined #nimrod |
18:08:24 | * | enurlyx joined #nimrod |
18:10:10 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
18:16:22 | * | io2 joined #nimrod |
18:31:57 | * | superfunc joined #nimrod |
18:35:09 | * | Ven joined #nimrod |
18:35:50 | * | Guest98548 joined #nimrod |
18:36:22 | * | superfunc quit (Ping timeout: 250 seconds) |
18:36:49 | * | mwbrown joined #nimrod |
18:52:01 | * | Guest98548 quit (Read error: Connection reset by peer) |
19:03:41 | NimBot | nimrod-code/packages master 5b66a9c def [+0 ±1 -0]: Add nim-nanomsg |
19:03:41 | NimBot | nimrod-code/packages master a299434 Dominik Picheta [+0 ±1 -0]: Merge pull request #75 from def-/master... 2 more lines |
19:25:06 | * | Demos quit (Quit: Leaving) |
19:40:57 | enurlyx | How can I pass a PNimrodNode from one macro into another, without the PNimrodNode beeing converted to an new PNimrodNode of kind nnkIdent? |
19:43:19 | Araq | enurlyx: you can use getAst(macroCall(x, y, z)), I think |
19:43:46 | Araq | the usual way of doing it is to pass it to a .compileTime proc though |
19:44:10 | enurlyx | proc works, but i will lose the n[] shortcut |
19:44:28 | Araq | er ... why? |
19:44:52 | enurlyx | because that access is only for macros? |
19:45:15 | Araq | nah |
19:46:15 | enurlyx | comcallwrapper.nim(25, 14) Error: cannot generate code for '[]' |
19:46:39 | enurlyx | but as macro works |
19:47:22 | Araq | .compileTime |
19:47:33 | Araq | add this to your proc |
19:48:35 | * | Ven quit (Read error: Connection reset by peer) |
19:49:36 | enurlyx | cool thanks. now it works like i wanted it to work. |
19:49:45 | * | Ven joined #nimrod |
20:07:32 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
20:08:03 | * | Demos joined #nimrod |
20:08:34 | * | Matthias247 joined #nimrod |
20:15:36 | * | flaviu quit (Ping timeout: 250 seconds) |
20:19:14 | * | flaviu joined #nimrod |
20:20:15 | * | Trustable joined #nimrod |
20:25:20 | * | gsingh93 joined #nimrod |
20:29:04 | * | flaviu quit (Ping timeout: 240 seconds) |
20:32:33 | * | kunev quit (Ping timeout: 240 seconds) |
20:36:09 | * | Ven joined #nimrod |
20:38:13 | * | flaviu joined #nimrod |
20:40:24 | * | brson joined #nimrod |
20:53:53 | * | brson quit (Ping timeout: 240 seconds) |
20:58:49 | * | flaviu quit (Remote host closed the connection) |
21:05:18 | * | brson joined #nimrod |
21:09:22 | * | Trustable quit (Quit: Leaving) |
21:14:43 | * | flaviu joined #nimrod |
21:29:57 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
21:50:04 | * | brson quit (Ping timeout: 240 seconds) |
21:54:38 | Demos | question: why do some warnings/errors display [XErrorNameInTheCompiler] after them and some just display the error? |
21:55:16 | Araq | hints and warnings to that |
21:55:22 | Araq | so that you know how to disable them |
21:55:24 | * | brson joined #nimrod |
21:57:22 | Demos | objections to adding that to errors as well? |
21:57:44 | def- | but you can't disable errors? |
21:58:25 | Demos | it is really handy for parsing them though |
22:03:04 | Fx00F | proc f(a, b :int) : auto = var (c, d) = f(a - 1, b - 1) if a == 0 or b == 0: return (a,b) else: return (3,3) |
22:03:07 | Fx00F | echo f(2, 3) |
22:03:33 | Fx00F | indentation.. well, tuple expected |
22:04:58 | def- | Fx00F: s/auto/tuple[x,y: int]/ |
22:05:39 | Fx00F | thanks |
22:06:16 | def- | Fx00F: difficult to automatically infer that the return type will be tuple while still inside the function which recursively calls itself |
22:06:21 | def- | (i guess) |
22:06:47 | Fx00F | undecidable i guess |
22:07:33 | Fx00F | well, udecidable for sure |
22:16:16 | * | io2 quit (Quit: ...take irc away, what are you? genius, billionaire, playboy, philanthropist) |
22:17:52 | Araq | so .. who wants to fix the most recent JS codegen bug? |
22:18:10 | Araq | def-? |
22:19:45 | * | Matthias247 quit (Read error: Connection reset by peer) |
22:21:57 | Araq | reactormonk? |
22:23:19 | def- | Araq: i can take a look |
22:23:45 | * | io2 joined #nimrod |
22:24:19 | Araq | thanks |
22:29:20 | Demos | it is annoying that you can not say table[key].field = value |
22:29:47 | Araq | table.mget(key).field = value is not too bad |
22:30:17 | Araq | and we'll get that once somebody rewrote overloading resolution |
22:30:33 | Araq | didn't you volunteer for that? |
22:33:14 | * | superfunc joined #nimrod |
22:37:43 | * | superfunc quit (Ping timeout: 256 seconds) |
22:37:44 | * | mwbrown quit (Ping timeout: 250 seconds) |
22:38:18 | Demos | yeah I did, but I did not know where to start, and I figured that finishing the VS plugin would be something I could... well.. finish |
22:39:17 | Demos | and that would require overloading on return type would it not? |
22:39:24 | Demos | or maybe just on the type of the argument |
22:39:30 | Araq | where to start? replace the module with your own implementation |
22:39:37 | Araq | and no, it would not |
22:40:03 | Araq | call a special a[i] if a is an lvalue |
22:40:14 | Araq | in fact, that's already possible with AST based overloading |
22:40:28 | Demos | can we not currently overload on "varness"? |
22:40:39 | Araq | yes we can |
22:40:51 | Demos | so why not do that? |
22:40:58 | Araq | dunno lol |
22:41:10 | Araq | 'var T' still scares me as a return type |
22:42:02 | Demos | well you are going to either get its address with addr, which is unsave in the first place, or it is going to turn into a T when you assign it to something |
22:42:29 | Araq | the thing is that is supposed to be memory safe |
22:42:44 | Araq | but we are missing some checks for that to work |
22:42:55 | Demos | and for sigmatch there is no documented interface for the module and a bunch of exported functions |
22:43:17 | Araq | well you should only change the implementation |
22:43:37 | Demos | well then why even rewrite it in the first place |
22:44:02 | Araq | because it's not spec'able |
22:44:19 | Araq | I guess we should start with a spec though |
22:44:32 | Demos | yeah little bit |
22:44:38 | Araq | and then implement it, fix it, fix the spec |
22:46:14 | Demos | I sorta like the idea of converting everything to typeclasses then doing the subset analysis, but I don't understand all of the code there |
22:47:17 | Araq | the code is also performance critical for obvious reasons |
22:47:30 | Demos | yeah that is one problem with that plan |
22:50:02 | Araq | also auto deref for pointers needs to be implemented |
22:50:40 | Demos | does that have anything to do with overload resolution (aside from allowing pointers to be used for some params) |
22:51:24 | Araq | well yes, that's where it has to be implemented |
22:52:04 | Demos | oh. Right. |
22:52:11 | Demos | do we have auto deref for refs? |
22:56:18 | Araq | we have it for dots, foo.bar instead of foo[].bar |
23:14:41 | * | flaviu quit (Read error: Connection reset by peer) |
23:16:04 | * | bjz quit (Ping timeout: 240 seconds) |
23:17:10 | * | flaviu joined #nimrod |
23:17:13 | * | darkf joined #nimrod |
23:24:22 | * | enurlyx left #nimrod (#nimrod) |
23:26:39 | def- | Araq: https://github.com/Araq/Nimrod/blob/devel/compiler/jsgen.nim#L758 |
23:27:14 | Araq | def-: pong |
23:27:16 | def- | i want to write r.res = stmt here, but can't figure out how to do that |
23:27:27 | def- | I thought I could use genAsgn |
23:28:21 | Araq | why? it puts it into 'stmt' instead which is then moveInto(p, stmt, r) |
23:28:34 | Araq | which is what you want to accomplish? |
23:29:22 | def- | oh right, but somehow that doesn't appear in the resulting JS |
23:29:45 | Araq | maybe you need to move var cond, stmt: TCompres into the loop body |
23:29:58 | Araq | then they will get resetted |
23:30:06 | Araq | which might be the problem |
23:30:41 | def- | no difference |
23:31:26 | Araq | yeah, gen sets it to nil anyway |
23:31:44 | Araq | well in what way is the generated code wrong? |
23:31:58 | def- | inside the if{} and else{} there is nothing |
23:32:12 | def- | while there should be an assignment Tmp1 = 1/2 |
23:33:04 | def- | Ah, stmt.kind is resNone |
23:34:42 | def- | I see why |
23:34:46 | Araq | btw I consider the jsgen a good starting point when hacking the compiler |
23:34:51 | def- | for int literals the res type is not set |
23:35:49 | Araq | there are only 2 tricks here iirc |
23:36:31 | def- | ok, fixed |
23:36:42 | def- | 2 tricks? |
23:36:46 | Araq | trick 1: we perform some analysis if we need goto based code or if expression based code for 'and' and 'or' suffices |
23:37:20 | Araq | trick 2: sometimes we introduce fat pointers, for instance for 'var int' |
23:37:39 | Araq | a fat pointer is a [base, idx] as a JS array iirc |
23:38:03 | Araq | that's it, the rest is boring |
23:38:42 | def- | i can imagine why trick 1 is necessary, what about the fat pointers? (I don't know JS actually) |
23:39:07 | Araq | proc foo(x: var int) = inc x |
23:39:22 | Araq | JS is like Java in this regard, only pass by value is supported |
23:39:27 | * | io2 quit (Quit: ...take irc away, what are you? genius, billionaire, playboy, philanthropist) |
23:40:04 | Araq | so we pass [a, 0] to foo and foo does a[0] += 1 |
23:40:19 | Araq | and then we need to ensure we can do that |
23:40:32 | Araq | so if you do foo(local_int) |
23:41:10 | Araq | the compiler translates local_int into local_int[0] everywhere and lifts it into a single element array |
23:41:54 | Araq | it's crazy :P |
23:42:47 | OrionPK | why [a, 0] |
23:42:50 | Araq | to compensate for this, we translate 'ref object' into a JS object, so no additional indirection is produced |
23:42:53 | OrionPK | and not just [a] |
23:43:08 | Araq | OrionPK: addr(a) becomes [a, 0] |
23:43:17 | OrionPK | i know |
23:43:24 | OrionPK | but why not just addr(a) become [a] |
23:43:56 | Araq | and how do you do addr(a[8]) then? |
23:44:03 | def- | OrionPK: so it also works for arrays? |
23:44:06 | OrionPK | ah |
23:44:16 | OrionPK | makes sense thanks |
23:46:43 | def- | Tested around a bit and made a pull request |
23:48:19 | Araq | excellent |
23:48:37 | Araq | what about the other JS bug? the high vs len bug? |
23:48:42 | Araq | or has that been fixed? |
23:49:06 | def- | still open |
23:49:12 | def- | I'll take a look too |