00:11:03 | * | askatasuna joined #nim |
00:23:04 | Araq | argh, I will kill you dom96 |
00:23:24 | Araq | you call setCurrentException |
00:48:45 | * | vasher_ quit (Quit: Connection closed for inactivity) |
00:58:13 | * | vikaton quit (Quit: Connection closed for inactivity) |
00:58:15 | Araq | reactormonk: nah. |
01:07:45 | * | thepreacher quit () |
01:19:15 | * | dddddd quit (Ping timeout: 246 seconds) |
01:32:11 | * | vendethiel joined #nim |
01:35:55 | Varriount | Araq: O_O |
01:37:54 | * | vikaton joined #nim |
01:38:17 | * | dddddd joined #nim |
01:39:26 | * | JStoker quit (Ping timeout: 272 seconds) |
01:40:33 | * | JStoker joined #nim |
01:49:01 | onionhammer | Varriount did u release prior to that number fix? |
01:51:18 | * | jaco60 quit (Ping timeout: 256 seconds) |
02:01:45 | * | ddl_smurf quit (Quit: ddl_smurf) |
02:19:05 | * | Guest54694 quit (Quit: Leaving) |
02:32:02 | * | dddddd quit (Ping timeout: 252 seconds) |
02:33:23 | * | vendethiel quit (Ping timeout: 256 seconds) |
02:38:07 | onionhammer | dom96 it'd be cool to have a nimble build switch to ignore warnings in nimble modules |
02:38:52 | Quora | or not have you reconfirm downloading deps every build |
02:54:23 | * | darkf joined #nim |
03:11:17 | * | Demon_Fox joined #nim |
03:41:13 | * | ozra quit (Ping timeout: 246 seconds) |
03:41:35 | * | BitPuffin|osx quit (Ping timeout: 248 seconds) |
03:46:37 | * | askatasuna quit (Ping timeout: 264 seconds) |
04:08:22 | * | tennix joined #nim |
04:12:42 | * | strcmp1 joined #nim |
04:18:14 | * | fioco joined #nim |
04:18:34 | fioco | I'm writing a nim server with asyncnet.... what encoding should I use on the client? |
04:19:03 | fioco | Java wants me to say what encoding for the transmission but I can't find anything related in the manual for nim |
04:37:40 | Varriount | onionhammer: before |
04:38:58 | Varriount | fioco: You generally have to decide encoding for yourself. Most sending procedures work on a byte level. |
04:39:12 | * | Demon_Fox quit (Quit: Leaving) |
04:39:53 | fioco | Ok Varriount |
04:39:55 | fioco | Thanks |
04:40:16 | * | fioco quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
04:45:46 | * | lokulin quit (Changing host) |
04:45:46 | * | lokulin joined #nim |
04:47:30 | * | apense quit (Ping timeout: 246 seconds) |
04:58:38 | * | MyMind joined #nim |
05:00:30 | * | Sembei quit (Ping timeout: 265 seconds) |
05:09:53 | * | gunn joined #nim |
05:13:44 | * | scoeri quit (Ping timeout: 252 seconds) |
05:15:20 | * | scoeri joined #nim |
05:27:16 | * | irezvov joined #nim |
05:31:28 | * | irezvov quit (Ping timeout: 246 seconds) |
05:44:59 | * | Jesin joined #nim |
05:46:25 | * | dalarmmst joined #nim |
05:47:45 | * | Demon_Fox joined #nim |
05:52:32 | * | woadwarrior joined #nim |
06:06:32 | * | profan joined #nim |
06:09:59 | dtscode | does nim have a good json lib? |
06:11:52 | fowl | Got a module called json it reads a subset of javascript |
06:12:35 | fowl | It's yours for $12.99 modules are pay-as-you-go now |
06:12:37 | dtscode | how well does it work? |
06:12:41 | dtscode | oshit |
06:13:08 | fowl | Quite simply you can pay by PayPal or bank transfer through sketchy nigerian domain |
06:13:26 | dtscode | sure |
06:13:30 | dtscode | give me a routing number |
06:13:33 | fowl | I get a cut of the second option so |
06:13:53 | Xe | dtscode: mine is 4206942069 |
06:13:55 | fowl | Oh sure its 4922 wait |
06:14:10 | dtscode | Xe: I just h4xxed you |
06:14:36 | Xe | Why good sir, my ip address is 127.0.4.20 |
06:14:41 | Xe | I kindly invite you to do your worst |
06:14:44 | Xe | omg what |
06:14:46 | Xe | you ahcked me |
06:15:10 | dtscode | haha |
06:16:28 | * | jszymanski joined #nim |
06:22:02 | * | vendethiel joined #nim |
06:22:37 | * | jubalh joined #nim |
06:26:00 | Varriount | Hm. What's the best way to determine if a parameter is static or not? |
06:32:05 | * | Jesin quit (Quit: Leaving) |
06:37:28 | dtscode | are peg semantics pretty similar to pcre semantics? |
06:45:11 | * | vendethiel quit (Ping timeout: 244 seconds) |
06:50:12 | Varriount | dtscode: Huh? What do you mean? |
06:50:20 | dtscode | nmd |
06:50:27 | dtscode | I answered my question |
06:57:10 | * | Ven joined #nim |
06:57:59 | * | woadwarrior quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
07:04:48 | * | vendethiel joined #nim |
07:09:33 | * | dtscode is now known as dtscodefish |
07:09:36 | * | dtscodefish is now known as dtscode |
07:09:48 | * | ddl_smurf joined #nim |
07:11:13 | * | dalarmmst quit (Ping timeout: 255 seconds) |
07:11:52 | * | mnemonikk_ is now known as mnemonikk |
07:11:53 | * | mnemonikk quit (Changing host) |
07:11:53 | * | mnemonikk joined #nim |
07:14:25 | dtscode | https://bpaste.net/show/8da1be6176c7 can someone help me with this? |
07:25:50 | * | woadwarrior joined #nim |
07:28:15 | * | milosn quit (Read error: Connection reset by peer) |
07:28:19 | * | milosn_ joined #nim |
07:30:29 | Varriount | dtscode: There's an invalid token? |
07:30:42 | dtscode | Varriount: I can't see which one it is though |
07:32:07 | * | milosn_ is now known as milosn |
07:32:53 | Varriount | dtscode: I think it's your peg matcher. |
07:33:01 | dtscode | what do you mean? |
07:34:44 | Varriount | dtscode: ',' is not a valid part of the peg expression "I choose you, ({\ident})\!" |
07:35:03 | dtscode | oh |
07:35:08 | dtscode | so I need to escape it |
07:35:09 | dtscode | ? |
07:35:26 | Varriount | dtscode: I don't know, probably? |
07:35:55 | Varriount | Have you tested the peg by itself? |
07:36:58 | * | Trustable joined #nim |
07:39:27 | Varriount | Hello Trustable |
07:39:50 | Trustable | Hi Varriount |
07:39:55 | dtscode | Varriount: no. I should do that |
07:49:46 | * | vendethiel quit (Ping timeout: 244 seconds) |
07:50:54 | * | bjz joined #nim |
07:58:14 | * | vikaton quit (Quit: Connection closed for inactivity) |
08:02:12 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
08:02:44 | * | yglukhov__ joined #nim |
08:03:17 | * | yglukhov__ quit (Client Quit) |
08:07:59 | * | vendethiel joined #nim |
08:12:39 | * | bjz joined #nim |
08:17:04 | * | bjz quit (Ping timeout: 252 seconds) |
08:20:33 | * | coffeepot joined #nim |
08:33:07 | * | milosn quit (Quit: leaving) |
08:37:27 | * | ddl_smurf quit (Quit: ddl_smurf) |
08:55:12 | * | gokr joined #nim |
09:01:51 | * | yglukhov__ joined #nim |
09:16:25 | * | vendethiel quit (Ping timeout: 276 seconds) |
09:16:53 | * | ddl_smurf joined #nim |
09:17:13 | * | yglukhov__ quit (Quit: Be back later ...) |
09:25:36 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
09:25:40 | * | askatasuna joined #nim |
09:30:57 | * | jaco60 joined #nim |
09:44:11 | * | irezvov joined #nim |
09:44:27 | irezvov | hi there |
09:45:00 | irezvov | i have tests module only with one testcase, but then i compile it i got Undefined symbols for architecture x86_64: "_main", referenced from: implicit entry/start for main executable ld: symbol(s) not found for architecture x86_64 |
09:45:43 | irezvov | should i define main proc by hand? |
09:45:47 | * | Ven joined #nim |
09:46:28 | * | askatasuna quit (Ping timeout: 272 seconds) |
09:47:18 | irezvov | i could provide more code, if it is needed |
09:50:08 | * | Ven quit (Ping timeout: 256 seconds) |
09:55:03 | irezvov | i've renamed file with test(it was named same as tested module) and all compiles fine, odds behaviour |
09:57:53 | irezvov | what about testing of async code? |
10:00:09 | * | Ven joined #nim |
10:01:52 | * | bjz joined #nim |
10:02:23 | * | bjz quit (Client Quit) |
10:02:44 | Araq | irezvov: sounds like a GCC installation problem |
10:02:53 | Araq | nim does generate a 'main' for you |
10:03:19 | Araq | and when you define a proc main, Nim names it main_8999 and it has nothing to do with the C side of things |
10:03:48 | * | arnetheduck joined #nim |
10:04:18 | arnetheduck | ekarlso, svensk |
10:04:46 | irezvov | Araq: compilre wrote: memcache.nim(77, 6) Hint: 'memcache.main()' is declared but not used [XDeclaredButNotUsed] |
10:05:05 | irezvov | so it defined it, but didn't use |
10:05:10 | * | MatrixBridge quit (Remote host closed the connection) |
10:05:18 | * | MatrixBridge joined #nim |
10:05:30 | Araq | irezvov: yes that's what I just said |
10:05:46 | Araq | in Nim top level statements are run at startup |
10:05:57 | Araq | proc main() = ... |
10:06:01 | Araq | main() # call it! |
10:06:14 | r-ku | Araq: mind explaining "ordered select" from ast? |
10:06:46 | Araq | I don't mind but no have no idea what you're talking about |
10:07:05 | * | boopsiesisaway is now known as boopsies |
10:07:33 | r-ku | turned out grammar kit doesnt know what it is and i could not find any info on internets somehow. oh and i mean "/" in module = stmt ^* (';' / IND{=}) |
10:07:41 | irezvov | Araq: you are right, this message left in terminal log after i tried to fix compilation fail. my blame |
10:08:13 | irezvov | i will try to write short example, which doesn't compile |
10:10:18 | * | MatrixBridge quit (Remote host closed the connection) |
10:10:26 | * | MatrixBridge joined #nim |
10:10:27 | Araq | r-ku: ordered choice is from PEGs, it means "try this first, then that, no ambiguities here" |
10:10:57 | r-ku | Araq: isnt regex (a|b) same? doesnt it try a first and b later? |
10:11:12 | Araq | no, it is not |
10:12:00 | r-ku | so how could i expand it in stupid bnf? |
10:13:18 | Araq | you can try | |
10:13:43 | r-ku | okie, thats what i did anyway hehe |
10:13:45 | r-ku | thanks |
10:13:47 | Araq | but I wouldn't mess with BNFs, I found no way to embed actions properly |
10:14:00 | Araq | I'd translate the parser to java instead |
10:14:41 | Araq | it's not *that* big and I can automate it, "nim2java" is not hard, you only need to patch the renderer.nim |
10:17:52 | r-ku | i guess, might be easiest way after all |
10:18:19 | Araq | if you ignore indentation the AST will be too weird for refactorings |
10:23:30 | arnetheduck | any convenient way of calling a proc for a base class? ie if B inherits from A, and we have both init(x: A) and init(x: B), is there a generic way to call init(x: A) - something like java's super? or is explicit cast to A the way to go? |
10:23:30 | * | yglukhov__ joined #nim |
10:24:08 | Araq | arnetheduck: fowl implemented 'super' as a macro, we really need an oohelper.nim module |
10:25:45 | * | vendethiel joined #nim |
10:26:54 | ddl_smurf | beautiful |
10:29:59 | arnetheduck | if it can be macro-implemented, that's nice. if it can be supplied in the std lib, that's even nicer :) |
10:34:55 | * | ddl_smurf quit (Quit: ddl_smurf) |
10:37:48 | gokr | arnetheduck: Its out there, one sec |
10:38:16 | gokr | https://gist.github.com/fowlmouth/3c74409c30533bb0a5b4 |
10:40:28 | * | yglukhov___ joined #nim |
10:40:28 | * | yglukhov__ quit (Read error: Connection reset by peer) |
10:41:49 | arnetheduck | gokr, great, thanks |
10:42:00 | * | bjz joined #nim |
10:42:23 | gokr | arnetheduck: Svensk? |
10:42:36 | gokr | Btw, I wrote a whole series of articles on OO in Nim. |
10:46:15 | arnetheduck | Svensk = Swede (in Swedish, which a Norwegian would understand - he was asking yesterday) |
10:46:41 | arnetheduck | gokr, cool, url? |
10:47:17 | gokr | http://goran.krampe.se/category/nim/ |
10:48:10 | gokr | So where in Sweden, or was it Norway? :) |
10:48:47 | gokr | Arne kinda gave you away as Swedish though, but perhaps Arne exists in Norway too. |
10:50:25 | Araq | Arne is a german name too |
10:50:51 | gokr | But you don't have a comic called Arne the Duck? :) |
10:50:55 | arnetheduck | Singapore, ex-Stockholm :) nick's derived from Arne Anka though |
10:51:08 | Araq | right, we don't |
10:51:09 | gokr | Singapore, cool. Was there once. |
10:51:17 | gokr | http://www.lysator.liu.se/~mosh/arne/arne01.gif |
10:51:35 | * | dddddd joined #nim |
10:51:36 | arnetheduck | that's the one |
10:51:41 | gokr | Translated "To think before you talk is like wiping your ass before you crap" |
10:52:09 | gokr | I am 30 km north of Stockholm. |
10:52:13 | Araq | looks like a donald duck rip-off |
10:52:29 | gokr | Hehe, well, Disney sued him IIRC |
10:52:42 | gokr | The comic is brilliant. Not for kids :) |
10:53:13 | arnetheduck | that's what... knivsta? |
10:56:45 | gokr | No, Åkersberga |
10:58:56 | gokr | Arne being Arne: http://www.lysator.liu.se/~mosh/arne/arne15.gif |
10:59:05 | gokr | Sorry for the offtopic ;) |
11:04:53 | * | woadwarrior quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
11:07:36 | * | askatasuna joined #nim |
11:10:38 | * | mnemonikk quit (Ping timeout: 276 seconds) |
11:12:18 | arnetheduck | gokr, nice blog posts |
11:12:39 | gokr | thanks |
11:14:15 | * | woadwarrior joined #nim |
11:18:02 | * | MatrixBridge quit (Remote host closed the connection) |
11:18:18 | * | MatrixBridge joined #nim |
11:25:10 | * | mnemonikk joined #nim |
11:25:10 | * | mnemonikk quit (Changing host) |
11:25:10 | * | mnemonikk joined #nim |
11:29:53 | * | tennix quit (Remote host closed the connection) |
11:31:43 | * | vendethiel quit (Ping timeout: 256 seconds) |
11:33:11 | * | ddl_smurf joined #nim |
11:33:23 | * | ddl_smurf quit (Client Quit) |
11:41:23 | * | Demon_Fox quit (Quit: Leaving) |
11:44:35 | arnetheduck | is it just me, or is there no bitwise and / or for uint32? |
11:46:23 | * | Mamemon joined #nim |
11:50:38 | Araq | arnetheduck: import unsigned |
11:50:46 | arnetheduck | ah, thanks |
11:51:06 | * | askatasuna quit (Quit: WeeChat 1.2) |
11:54:00 | * | ddl_smurf joined #nim |
12:00:58 | irezvov | Araq: i've posted issue with my previous trouble https://github.com/nim-lang/Nim/issues/3017 |
12:01:26 | * | askatasuna joined #nim |
12:03:57 | * | BitPuffin|osx joined #nim |
12:05:25 | * | Senketsu quit (Quit: Leaving) |
12:07:49 | * | vendethiel joined #nim |
12:08:32 | * | Kingsquee quit (Quit: Konversation terminated!) |
12:18:23 | * | fowl quit (Ping timeout: 248 seconds) |
12:21:43 | * | askatasuna quit (Ping timeout: 255 seconds) |
12:29:42 | * | vendethiel quit (Ping timeout: 252 seconds) |
12:31:34 | * | ozra_ joined #nim |
12:43:24 | * | vendethiel joined #nim |
12:52:18 | Araq | irezvov: that is not supported. that only works when you're in different nimble packages |
12:52:30 | Araq | error message could be much bettter ofc |
13:01:15 | irezvov | Araq: thx, i got it already, cache has flat structure |
13:01:21 | * | mnemonikk quit (Ping timeout: 276 seconds) |
13:04:47 | * | vendethiel quit (Ping timeout: 248 seconds) |
13:05:24 | * | mnemonikk joined #nim |
13:05:24 | * | mnemonikk quit (Changing host) |
13:05:24 | * | mnemonikk joined #nim |
13:05:26 | * | woadwarrior quit (Quit: Textual IRC Client: www.textualapp.com) |
13:16:52 | * | coffeepot quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
13:17:06 | * | coffeepot joined #nim |
13:27:08 | * | vendethiel joined #nim |
13:27:08 | * | milosn joined #nim |
13:39:12 | * | irezvov quit (Quit: Page closed) |
13:51:43 | * | vendethiel quit (Ping timeout: 255 seconds) |
13:56:30 | * | vendethiel joined #nim |
14:00:52 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
14:02:07 | * | bjz joined #nim |
14:03:16 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
14:11:09 | * | MatrixBridge quit (Remote host closed the connection) |
14:11:54 | * | MatrixBridge joined #nim |
14:14:35 | * | MatrixBridge quit (Remote host closed the connection) |
14:14:49 | * | MatrixBridge joined #nim |
14:17:15 | * | fowl joined #nim |
14:17:16 | * | vendethiel quit (Ping timeout: 244 seconds) |
14:21:18 | * | Ven joined #nim |
14:22:05 | * | vendethiel joined #nim |
14:25:45 | * | jubalh quit (Quit: Leaving) |
14:28:14 | * | drewsrem joined #nim |
14:28:34 | drewsrem | am I correct under the assumption that the functionality of nimsuggest is "shaky" at best? |
14:34:08 | * | coffeepot quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
14:40:31 | * | Ven quit (Ping timeout: 244 seconds) |
14:44:52 | * | thotypous quit (Quit: WeeChat 1.2) |
14:46:46 | * | Demos joined #nim |
14:48:44 | * | pregressive joined #nim |
14:48:56 | * | ddl_smurf quit (Quit: ddl_smurf) |
14:59:29 | * | boopsies is now known as boopsiesisaway |
15:05:23 | pigmej | drewsrem: what do you mean by 'shaky' ? |
15:06:54 | drewsrem | pigmej, e.g. no suggest within "when isMainModule" blocks, it suggests me procs for the wrong types when I suggest on a var of another type etc. |
15:08:08 | * | Demos quit (Remote host closed the connection) |
15:08:30 | Araq | it falls back to "suggest everything" which we considered more useful than "suggest nothing" |
15:08:47 | Araq | that's not a bug, if you already know what to write you don't need nimsuggest |
15:08:50 | * | boopsiesisaway is now known as boopsies |
15:09:39 | Araq | use --debug to see why the compiler cannot determine the type |
15:12:26 | * | Demos joined #nim |
15:13:05 | * | Demos quit (Remote host closed the connection) |
15:13:55 | * | jefus quit (Ping timeout: 276 seconds) |
15:17:43 | drewsrem | I've done fine without auto-completion/suggest so far, but I consider it a very very nice thing to have, but I wasn't complaining or anything, just trying to figure out if the suggest-wrapper I use is buggy |
15:18:22 | Araq | complaining it fine but I prefer proper bug reports |
15:18:25 | Araq | *is |
15:24:20 | * | vasher_ joined #nim |
15:24:27 | * | saml joined #nim |
15:24:41 | * | onr joined #nim |
15:25:21 | * | MatrixBridge quit (Remote host closed the connection) |
15:25:29 | * | MatrixBridge joined #nim |
15:26:16 | * | yglukhov___ quit (Ping timeout: 276 seconds) |
15:26:46 | drewsrem | right, but was trying/am trying to figure out what's nimsuggests expected behavior, so I'm far from being able to do that :) |
15:27:12 | * | BitPuffin|osx quit (Ping timeout: 272 seconds) |
15:27:21 | drewsrem | but I'll set up the latest Aporia and check if it works better there |
15:27:29 | drewsrem | I'm not on devel version atm |
15:27:38 | * | MatrixBridge quit (Remote host closed the connection) |
15:27:47 | * | MatrixBridge joined #nim |
15:28:42 | * | jefus joined #nim |
15:29:15 | * | Arrrr joined #nim |
15:30:15 | * | xcombelle joined #nim |
15:31:51 | * | MatrixBridge quit (Remote host closed the connection) |
15:31:59 | * | MatrixBridge joined #nim |
15:36:24 | * | Mamemon quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
15:42:56 | * | Mamemon joined #nim |
15:47:39 | * | BitPuffin|osx joined #nim |
15:59:26 | * | Jesin joined #nim |
16:01:38 | * | darkf quit (Quit: Leaving) |
16:09:47 | * | Demos joined #nim |
16:10:07 | * | Demos quit (Remote host closed the connection) |
16:10:52 | * | Demos joined #nim |
16:15:18 | * | Ven joined #nim |
16:17:59 | * | dalarmmst joined #nim |
16:19:55 | * | yglukhov___ joined #nim |
16:27:53 | * | jszymanski quit (Quit: computer sleeps...) |
16:28:02 | * | jszymanski joined #nim |
16:29:45 | * | pregressive quit (Remote host closed the connection) |
16:36:34 | r-ku | nimsuggest.nim(338, 5) Error: undeclared identifier: 'gPrefixDir' when running nimble build. compiler is on PATH, not installed. what did i do wrong? |
16:37:10 | * | apense joined #nim |
16:38:22 | * | FedeOmoto joined #nim |
16:42:18 | * | Demos quit (Remote host closed the connection) |
16:44:56 | dtscode | can someone tell me why this regex won't match "I choose you, Pikachu!" with the re module, but works fine when I use a regex tester? |
16:47:20 | onr | i don't get the Pokemon joke |
16:48:31 | dtscode | its not a joke |
16:49:12 | boopsies | dtscode: can we see your code? |
16:49:29 | dtscode | god damn it I forgot to paste the code again |
16:49:30 | dtscode | my bad |
16:49:40 | dtscode | https://bpaste.net/show/d747d737be50 |
16:51:37 | boopsies | hm |
16:52:00 | boopsies | have you verified that event.params[event.params.high] is what you're looking for? |
16:53:06 | dtscode | yeah |
16:53:25 | dtscode | both from long term usage of this module and printing out that elem |
16:56:15 | * | thotypous joined #nim |
16:56:39 | * | xcombelle quit (Remote host closed the connection) |
17:00:26 | Araq | dtscode: re defaults to reExtended which means you can use whitespace to improve readability. the cost is that you need to use \s to match against whitespace. |
17:00:43 | dtscode | ah |
17:01:07 | dtscode | so just wrap the whole regex in \s ... \s? |
17:01:21 | Araq | "Note: The 're' proc defaults to the extended regular expression syntax which lets you use whitespace freely to make your regexes readable. However, this means to match whitespace \s or something similar has to be used." |
17:01:27 | * | xcombelle joined #nim |
17:01:27 | Araq | http://nim-lang.org/docs/re.html |
17:01:47 | dtscode | thanks |
17:02:28 | Araq | and yeah, in retrospect I think we should have created re"foo bar" and rex"foo bar" |
17:02:51 | Araq | will talk with flaviu about this. we can do this for nre |
17:03:44 | dtscode | oh goody :D It will be much appreciated |
17:03:48 | * | Jesin quit (Quit: Leaving) |
17:06:07 | apense | I think the error that necessitated the "false" at https://github.com/nim-lang/Nim/blob/devel/lib/pure/math.nim#L222 is that there needs to be a "#define _CRT_RAND_S" before "rand_s" becomes available. Is there a way to do that other than the emit pragma? |
17:07:01 | * | Demos joined #nim |
17:08:27 | apense | extern "C"{ |
17:08:27 | apense | #define _CRT_RAND_S |
17:08:27 | apense | #include <stdlib.h> |
17:08:27 | apense | int main(void) { |
17:08:27 | apense | unsigned int m; |
17:08:28 | apense | rand_s(&m); |
17:08:32 | apense | } |
17:08:34 | apense | } works fine in VS2013 |
17:08:38 | r-ku | Araq: should proc new(_: typedesc[Foo]) be preferred instead of system.new(T: typedesc)? Because its not when custom new is imported from another module. If custom new is in same module it is preferred than system.new. Im unsure if this is bug or not. |
17:08:45 | r-ku | apense: i want to say mean things to you now. |
17:09:51 | r-ku | and answer to your question is passC pragma |
17:10:11 | r-ku | {.passC: "-D_CRT_RAND_S".} |
17:12:05 | * | Jesin joined #nim |
17:15:10 | * | BitPuffin|osx quit (Ping timeout: 265 seconds) |
17:15:56 | * | BitPuffin|osx joined #nim |
17:22:13 | * | pregressive joined #nim |
17:22:22 | Araq | apense: but I cannot emit #define _CRT_RAND_S that easily |
17:22:30 | Araq | ok I can, but it's too ugly |
17:46:04 | * | Demos quit (Remote host closed the connection) |
17:48:46 | * | vasher_ quit (Quit: Connection closed for inactivity) |
17:53:55 | * | Demos joined #nim |
18:00:06 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
18:01:23 | Varriount | Araq: If you're against Option monads, then why does the new regex library have them? |
18:02:43 | Araq | cause it makes sense in this case |
18:03:16 | Araq | personally I would have used 'nil' strings though |
18:04:00 | Varriount | Araq: I agree. :/ |
18:06:59 | Arrrr | What do you have against options |
18:08:16 | Araq | they make me use 'if' when I know better |
18:08:27 | Varriount | Arrrr: Cumbersome, rarely useful when you have actual exceptions. |
18:08:30 | Araq | or alternatively a "nice" monad for easy chaining |
18:08:45 | Xe | nim has monad support? |
18:09:02 | Varriount | I guess they're alright for a language without exceptions. |
18:09:28 | Araq | that works so well that even Haskell doesn't use it for everything. So Haskell has exceptions too. |
18:09:55 | * | ozra_ quit (Ping timeout: 246 seconds) |
18:11:15 | Araq | Xe: monads don't require much, you can write monads in Nim too. |
18:13:17 | dtscode | just fyi: https://github.com/nim-lang/Nim/wiki/Editor-Support the gedit one is a dead link |
18:14:54 | Varriount | Araq: You could still edit nre to use nil strings/objects - It's not like it's been in an official release yet, has it? |
18:15:27 | Varriount | Or rather, let me change it. :D |
18:16:36 | * | Demos quit (Remote host closed the connection) |
18:17:22 | * | ErikBjare quit (Quit: SIGQUIT) |
18:17:32 | reactormonk | Varriount, option is nothing but nil, except the typesystem knows about the nillable type |
18:17:58 | dtscode | nmd fixed the link |
18:18:07 | Varriount | reactormonk: I don't follow. |
18:19:17 | reactormonk | Varriount, instead of returning a magic value (nil), you return a None. so instead of the value only you now about, you return something that the compiler knows about. |
18:19:37 | * | Matthias247 joined #nim |
18:20:05 | Varriount | reactormonk: And this is useful how...? |
18:20:25 | Arrrr | It forces you to check against none |
18:20:54 | reactormonk | and if you don't care, you can always use `get`, which gives you a fail early advantage instead of the code failing somewhere else because you have a nil |
18:21:25 | Varriount | reactormonk: Then why not an exception? |
18:21:34 | * | Demos joined #nim |
18:22:35 | reactormonk | Varriount, because an Option gives you the choice to handle it however you want it - which is possible without exceptions too, except options are faster because no stack unrolling. |
18:22:59 | Varriount | Arrrr: And you don't normally check against 'nil |
18:23:01 | Varriount | '? |
18:23:48 | Arrrr | Yes, but if i miss one, the compiler will not blame. On the other hand, with options, i have one problem less |
18:24:16 | reactormonk | Varriount, also, checked exceptions are horrible. |
18:24:49 | Arrrr | Like the difference between safe/unsafe casting |
18:25:11 | Varriount | Arrrr: Then why not wrap it up in an option yourself? |
18:25:30 | Arrrr | Humm, what do you mean |
18:25:57 | reactormonk | Arrrr, that we need a proc toOption[T] which basically checks via if isNil |
18:26:05 | * | onr left #nim ("Leaving") |
18:26:43 | Arrrr | so, instead of if isSome bla(), i have to do if isSome bla().toOption ? |
18:26:53 | reactormonk | basically >:) |
18:26:57 | Varriount | Arrrr: Yep. Using the procedure reactormonk just mentioned. |
18:27:20 | reactormonk | But this is not perl, imo nim should hint you in the correct direction - via option instead of nil-checks |
18:28:09 | Varriount | reactormonk: My two main gripes are A: It's cumbersome, and B: It's so different from the rest of the stdlib. |
18:28:09 | Arrrr | Well, because 1) Is uglier, 2) : Option[T] is self documented and 3) i can forget to write it. |
18:28:33 | Varriount | Arrrr: And the get() isn't ugly? |
18:28:34 | reactormonk | Varriount, time to break stuff >:) |
18:29:07 | Arrrr | Yes, but also obvious |
18:29:08 | dom96 | Options[T] with proper pattern matching are superior to nilable types. |
18:29:20 | Araq | yes but the disadvantages are never mentioned: instead of error value (nil, -1) and exceptions you have yet another way to model things |
18:29:21 | dom96 | Try Haskell and you will be enlightened. |
18:29:23 | reactormonk | Honestly, if there were some way to auto-unpack options via get, I'd be totally in |
18:29:29 | reactormonk | dom96, haskell is slow. |
18:29:50 | reactormonk | And I don't expect nim to become haskell, just picking up a few good ideas along the road. |
18:30:07 | Arrrr | Option module needs more love, for example "getOr(paramInCaseIsNull)" |
18:30:22 | * | Jehan` joined #nim |
18:30:22 | Arrrr | or "do(procInCaseOptionIsSome)" |
18:30:33 | dom96 | Arrrr: I'm not sure I agree. |
18:31:04 | dom96 | At a certain point people just don't use these additional procedures. |
18:31:32 | Varriount | Arrrr: Or just add it as a default value to the current 'get' procedure? |
18:31:48 | reactormonk | Which reminds me to punch some concepts s into the stdlib |
18:31:53 | Arrrr | Yeah, it could be a default value |
18:35:24 | * | jubalh joined #nim |
18:35:43 | * | pregressive quit (Remote host closed the connection) |
18:36:06 | reactormonk | I like the default value idea. |
18:36:41 | Varriount | reactormonk: Fine, I concede against superior numbers. |
18:36:56 | Varriount | I don't have to like it though. :? |
18:37:21 | reactormonk | Varriount, just call .get on it and be done |
18:37:22 | * | jubalh quit (Client Quit) |
18:44:04 | * | fioco joined #nim |
18:44:21 | * | fioco left #nim (#nim) |
18:44:24 | * | keypusher joined #nim |
18:46:38 | Varriount | reactormonk: Or make a converter to do it for me >:D |
18:47:11 | * | Varriount waits for Araq's enraged cries |
18:47:29 | reactormonk | Varriount, that's what I mentioned for bringing Option to all of stdlib - backwards compability with a converter :-) |
18:48:51 | * | pregressive joined #nim |
18:49:01 | * | dalarmmst quit (Ping timeout: 264 seconds) |
18:49:27 | Varriount | Demos: Working for tripadvisor? |
18:49:37 | Demos | *v* |
18:50:08 | Varriount | Demos: I know, I know, it's no surprise that I'm psychic. |
18:50:23 | dom96 | Varriount: You stalking Demos? |
18:50:37 | Araq | Varriount: didn't take it seriously |
18:50:59 | Varriount | dom96: .... Maybe. |
18:51:16 | Demos | I mean I don't have a cloak sooo |
18:53:02 | dom96 | I see. |
18:53:23 | dom96 | Shouldn't be IRC'ing from work. |
18:53:29 | * | dom96 shakes head |
18:55:16 | * | Varriount|OnTheR joined #nim |
18:56:17 | * | Varriount|OnTheR is now known as Varriount|Road |
18:56:41 | Varriount|Road | Oh yay, colors. |
19:01:01 | * | Varriount|Road quit (Ping timeout: 246 seconds) |
19:04:50 | dtscode | hey guys... I'm serializing JSON, whats the proper way to read/write to JSON files? |
19:05:00 | * | Jesin quit (Quit: Leaving) |
19:05:28 | * | Varriount|Mobile joined #nim |
19:05:45 | fowl | dtscode the json module |
19:06:12 | Varriount|Mobile | http://nim-lang.org/docs/json.html |
19:06:13 | dtscode | fowl: I didn't see anything in there for writing/reading to a json file, just serializing |
19:06:35 | Varriount|Mobile | dtscode: Read a file into a string, then parse it wil the json module? |
19:06:36 | Xe | fowl: the filesystem handling functions? |
19:06:43 | Xe | er |
19:06:45 | Xe | dtscode: * |
19:06:56 | fowl | Parsefile and $ |
19:06:57 | dtscode | Varriount|Mobile: eh fair enough |
19:06:57 | Varriount|Mobile | dtscode: Stringify a json object, then write it out? |
19:07:01 | dtscode | thanks guys |
19:07:21 | Varriount|Mobile | dtscode: If you want to create helper procedures for the json module, it would be appreciated. |
19:12:15 | Varriount|Mobile | Araq: I just noticed the 'nep1' option in c2nim. I feel so appreciated. :) |
19:14:37 | Araq | Varriount|Mobile: you're welcome. actually nep1 should be the default I never use anything else |
19:14:51 | Araq | dtscode: pretty sure there a stream based procs |
19:23:50 | * | filcuc joined #nim |
19:41:37 | * | Varriount|Mobile quit (Ping timeout: 246 seconds) |
19:41:56 | * | Arrrr quit (Quit: WeeChat 1.2) |
20:10:25 | flaviu | dtscode, Araq: How about re"\xfoo bar"? |
20:13:05 | Araq | flaviu: good enough for me |
20:13:24 | * | dalarmmst joined #nim |
20:32:58 | * | Varriount|Mobile joined #nim |
20:36:14 | Araq | btw flaviu I think you should have changed .crc to .sha1 as file extension: https://github.com/nim-lang/Nim/issues/3018 |
20:41:28 | * | Varriount|Mobile quit (Ping timeout: 246 seconds) |
20:41:51 | * | BitPuffin|osx quit (Ping timeout: 248 seconds) |
20:46:39 | * | Jesin joined #nim |
20:50:35 | * | Trustable quit (Quit: Leaving) |
20:54:55 | flaviu | That's an interesting bug. |
20:55:52 | flaviu | PR sent. Mind if I rename all the variables that reference "CRC"? I probably should have done that in the initial PR. |
20:57:51 | * | jfs joined #nim |
20:58:50 | Araq | I don't mind |
20:59:29 | * | miglo joined #nim |
21:00:41 | * | filcuc quit (Quit: Konversation terminated!) |
21:03:26 | miglo | is there something like a "const reference" in nim? |
21:05:57 | Araq | let foo = addr(x) means the pointer is const, not its contents |
21:05:58 | miglo | like "const MyObj& obj" in c++ that is typically used to pass objects to functions/methods and to indicate that is isn't allowed to modify the object? |
21:06:38 | Araq | oh you don't need that. Nim always passes by const reference under the hood if that's the most efficient way to do it |
21:07:08 | Araq | const MyObj& obj is just obj: MyObj in Nim |
21:07:47 | miglo | and if I use "var" for the object then there is no "const" |
21:08:05 | Araq | yes |
21:08:50 | miglo | recently I've also studied a little bit the documentation of Rust and it seems to be very similar to what I've leared about nim |
21:12:27 | miglo | after reading the last days only python and nim code I found all the curly braces of the Rust syntax quite ugly |
21:14:16 | Araq | he he he |
21:15:51 | Araq | flaviu: that "parseSecureHash" doesn't do any bounds checking is amusing ;-) |
21:18:51 | miglo | Araq, only one additional question. You've mentioned that the chat server example might not work properly or at least async with threads. Could you please explain this a little bit where threading is used in this example? |
21:19:48 | miglo | is it somewhere within the library used, by one of the async source files? |
21:20:38 | Araq | no, it's not using threads yet. I assumed you compiled with --threads:on |
21:20:48 | Araq | and hence got these errors |
21:21:11 | dtscode | who made the compiler output pretty? |
21:22:19 | * | jfs quit (Quit: Page closed) |
21:22:33 | * | filcuc joined #nim |
21:22:42 | Araq | OnO |
21:22:56 | miglo | no I haven't used this switch |
21:23:24 | Araq | not sure. dom96 ? what's teh chat server example? |
21:23:44 | dom96 | the one in the asyncnet module's docs? |
21:24:20 | * | xcombelle quit (Quit: Leaving) |
21:26:00 | Araq | well the example should compile |
21:26:07 | * | apense quit (Ping timeout: 248 seconds) |
21:26:07 | dtscode | does it not? |
21:26:27 | miglo | the original example from the docs compiles and works fine |
21:26:45 | miglo | but my slightly modified version doesn't |
21:27:14 | dtscode | ah |
21:27:38 | miglo | I've moved the source line where the clients are added into the sequence from proc serve to proc processClient |
21:28:11 | miglo | and whenever a client gets added the program crashes |
21:28:21 | * | Demos quit (Remote host closed the connection) |
21:29:46 | dom96 | miglo: gist it |
21:31:42 | miglo | ok, here it is..... https://gist.github.com/anonymous/e4f882ebaa0420d939ec |
21:32:51 | dom96 | where does it crash? |
21:32:54 | miglo | line 16 triggers the crash |
21:33:13 | dtscode | whats the syntax for pass by ref to a function again? like proc foo(bar: var int) right? |
21:34:13 | dom96 | miglo: you're not initialising 'clients' |
21:34:20 | * | Mamemon quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
21:37:00 | fowl | dtscode to be mutable ye |
21:45:46 | * | ozra_ joined #nim |
21:52:10 | * | filcuc quit (Quit: Konversation terminated!) |
21:55:41 | * | FedeOmoto quit (Quit: Leaving) |
22:06:06 | * | jszymanski quit (Quit: computer sleeps...) |
22:07:01 | * | yglukhov___ quit (Quit: Be back later ...) |
22:09:36 | * | ozra_ quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
22:09:55 | * | ozra_ joined #nim |
22:14:15 | miglo | the documentation mentions "var glock: TLock" but the compiler doesn't know the type "TLock". do I have to import something? |
22:16:51 | Araq | import locks |
22:17:09 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
22:19:38 | * | Matthias247 quit (Read error: Connection reset by peer) |
22:26:41 | * | pregressive quit (Remote host closed the connection) |
22:27:19 | dtscode | thanks fold |
22:27:21 | dtscode | fowl: |
22:28:14 | miglo | do I need an additional lib if the linker cannot find `pthread_mutex_trylock'? I've on my system already "libpthread-stubs0-dev" |
22:28:16 | * | xet7 quit (Quit: Leaving) |
22:28:51 | * | ozra_ quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
22:29:06 | * | ozra- joined #nim |
22:29:27 | * | Demos joined #nim |
22:33:55 | * | Demos quit (Ping timeout: 250 seconds) |
22:44:39 | * | xet7 joined #nim |
22:44:41 | * | miglo left #nim ("http://quassel-irc.org - Chat comfortably. Anywhere.") |
22:54:28 | * | BitPuffin|osx joined #nim |
23:03:51 | * | vasher_ joined #nim |
23:13:53 | * | pregressive joined #nim |
23:33:19 | * | Jehan` quit (Quit: Leaving) |
23:35:21 | * | vendethiel quit (Ping timeout: 256 seconds) |
23:37:07 | * | thaless joined #nim |
23:38:08 | * | vendethiel joined #nim |
23:40:55 | * | filwit joined #nim |
23:57:04 | * | boopsies is now known as boopsiesisaway |