<< 29-06-2015 >>

00:11:03*askatasuna joined #nim
00:23:04Araqargh, I will kill you dom96
00:23:24Araqyou call setCurrentException
00:48:45*vasher_ quit (Quit: Connection closed for inactivity)
00:58:13*vikaton quit (Quit: Connection closed for inactivity)
00:58:15Araqreactormonk: nah.
01:07:45*thepreacher quit ()
01:19:15*dddddd quit (Ping timeout: 246 seconds)
01:32:11*vendethiel joined #nim
01:35:55VarriountAraq: 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:01onionhammerVarriount 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:07onionhammerdom96 it'd be cool to have a nimble build switch to ignore warnings in nimble modules
02:38:52Quoraor 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:34fiocoI'm writing a nim server with asyncnet.... what encoding should I use on the client?
04:19:03fiocoJava wants me to say what encoding for the transmission but I can't find anything related in the manual for nim
04:37:40Varriountonionhammer: before
04:38:58Varriountfioco: 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:53fiocoOk Varriount
04:39:55fiocoThanks
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:59dtscodedoes nim have a good json lib?
06:11:52fowlGot a module called json it reads a subset of javascript
06:12:35fowlIt's yours for $12.99 modules are pay-as-you-go now
06:12:37dtscodehow well does it work?
06:12:41dtscodeoshit
06:13:08fowlQuite simply you can pay by PayPal or bank transfer through sketchy nigerian domain
06:13:26dtscodesure
06:13:30dtscodegive me a routing number
06:13:33fowlI get a cut of the second option so
06:13:53Xedtscode: mine is 4206942069
06:13:55fowlOh sure its 4922 wait
06:14:10dtscodeXe: I just h4xxed you
06:14:36XeWhy good sir, my ip address is 127.0.4.20
06:14:41XeI kindly invite you to do your worst
06:14:44Xeomg what
06:14:46Xeyou ahcked me
06:15:10dtscodehaha
06:16:28*jszymanski joined #nim
06:22:02*vendethiel joined #nim
06:22:37*jubalh joined #nim
06:26:00VarriountHm. What's the best way to determine if a parameter is static or not?
06:32:05*Jesin quit (Quit: Leaving)
06:37:28dtscodeare peg semantics pretty similar to pcre semantics?
06:45:11*vendethiel quit (Ping timeout: 244 seconds)
06:50:12Varriountdtscode: Huh? What do you mean?
06:50:20dtscodenmd
06:50:27dtscodeI 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:25dtscodehttps://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:29Varriountdtscode: There's an invalid token?
07:30:42dtscodeVarriount: I can't see which one it is though
07:32:07*milosn_ is now known as milosn
07:32:53Varriountdtscode: I think it's your peg matcher.
07:33:01dtscodewhat do you mean?
07:34:44Varriountdtscode: ',' is not a valid part of the peg expression "I choose you, ({\ident})\!"
07:35:03dtscodeoh
07:35:08dtscodeso I need to escape it
07:35:09dtscode?
07:35:26Varriountdtscode: I don't know, probably?
07:35:55VarriountHave you tested the peg by itself?
07:36:58*Trustable joined #nim
07:39:27VarriountHello Trustable
07:39:50TrustableHi Varriount
07:39:55dtscodeVarriount: 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:27irezvovhi there
09:45:00irezvovi 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:43irezvovshould i define main proc by hand?
09:45:47*Ven joined #nim
09:46:28*askatasuna quit (Ping timeout: 272 seconds)
09:47:18irezvovi could provide more code, if it is needed
09:50:08*Ven quit (Ping timeout: 256 seconds)
09:55:03irezvovi've renamed file with test(it was named same as tested module) and all compiles fine, odds behaviour
09:57:53irezvovwhat 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:44Araqirezvov: sounds like a GCC installation problem
10:02:53Araqnim does generate a 'main' for you
10:03:19Araqand 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:18arnetheduckekarlso, svensk
10:04:46irezvovAraq: compilre wrote: memcache.nim(77, 6) Hint: 'memcache.main()' is declared but not used [XDeclaredButNotUsed]
10:05:05irezvovso 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:30Araqirezvov: yes that's what I just said
10:05:46Araqin Nim top level statements are run at startup
10:05:57Araqproc main() = ...
10:06:01Araqmain() # call it!
10:06:14r-kuAraq: mind explaining "ordered select" from ast?
10:06:46AraqI don't mind but no have no idea what you're talking about
10:07:05*boopsiesisaway is now known as boopsies
10:07:33r-kuturned 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:41irezvovAraq: you are right, this message left in terminal log after i tried to fix compilation fail. my blame
10:08:13irezvovi 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:27Araqr-ku: ordered choice is from PEGs, it means "try this first, then that, no ambiguities here"
10:10:57r-kuAraq: isnt regex (a|b) same? doesnt it try a first and b later?
10:11:12Araqno, it is not
10:12:00r-kuso how could i expand it in stupid bnf?
10:13:18Araqyou can try |
10:13:43r-kuokie, thats what i did anyway hehe
10:13:45r-kuthanks
10:13:47Araqbut I wouldn't mess with BNFs, I found no way to embed actions properly
10:14:00AraqI'd translate the parser to java instead
10:14:41Araqit's not *that* big and I can automate it, "nim2java" is not hard, you only need to patch the renderer.nim
10:17:52r-kui guess, might be easiest way after all
10:18:19Araqif you ignore indentation the AST will be too weird for refactorings
10:23:30arnetheduckany 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:08Araqarnetheduck: fowl implemented 'super' as a macro, we really need an oohelper.nim module
10:25:45*vendethiel joined #nim
10:26:54ddl_smurfbeautiful
10:29:59arnetheduckif 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:48gokrarnetheduck: Its out there, one sec
10:38:16gokrhttps://gist.github.com/fowlmouth/3c74409c30533bb0a5b4
10:40:28*yglukhov___ joined #nim
10:40:28*yglukhov__ quit (Read error: Connection reset by peer)
10:41:49arnetheduckgokr, great, thanks
10:42:00*bjz joined #nim
10:42:23gokrarnetheduck: Svensk?
10:42:36gokrBtw, I wrote a whole series of articles on OO in Nim.
10:46:15arnetheduckSvensk = Swede (in Swedish, which a Norwegian would understand - he was asking yesterday)
10:46:41arnetheduckgokr, cool, url?
10:47:17gokrhttp://goran.krampe.se/category/nim/
10:48:10gokrSo where in Sweden, or was it Norway? :)
10:48:47gokrArne kinda gave you away as Swedish though, but perhaps Arne exists in Norway too.
10:50:25AraqArne is a german name too
10:50:51gokrBut you don't have a comic called Arne the Duck? :)
10:50:55arnetheduckSingapore, ex-Stockholm :) nick's derived from Arne Anka though
10:51:08Araqright, we don't
10:51:09gokrSingapore, cool. Was there once.
10:51:17gokrhttp://www.lysator.liu.se/~mosh/arne/arne01.gif
10:51:35*dddddd joined #nim
10:51:36arnetheduckthat's the one
10:51:41gokrTranslated "To think before you talk is like wiping your ass before you crap"
10:52:09gokrI am 30 km north of Stockholm.
10:52:13Araqlooks like a donald duck rip-off
10:52:29gokrHehe, well, Disney sued him IIRC
10:52:42gokrThe comic is brilliant. Not for kids :)
10:53:13arnetheduckthat's what... knivsta?
10:56:45gokrNo, Åkersberga
10:58:56gokrArne being Arne: http://www.lysator.liu.se/~mosh/arne/arne15.gif
10:59:05gokrSorry 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:18arnetheduckgokr, nice blog posts
11:12:39gokrthanks
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:35arnetheduckis it just me, or is there no bitwise and / or for uint32?
11:46:23*Mamemon joined #nim
11:50:38Araqarnetheduck: import unsigned
11:50:46arnetheduckah, thanks
11:51:06*askatasuna quit (Quit: WeeChat 1.2)
11:54:00*ddl_smurf joined #nim
12:00:58irezvovAraq: 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:18Araqirezvov: that is not supported. that only works when you're in different nimble packages
12:52:30Araqerror message could be much bettter ofc
13:01:15irezvovAraq: 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:34drewsremam 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:23pigmejdrewsrem: what do you mean by 'shaky' ?
15:06:54drewsrempigmej, 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:30Araqit falls back to "suggest everything" which we considered more useful than "suggest nothing"
15:08:47Araqthat'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:39Araquse --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:43drewsremI'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:22Araqcomplaining it fine but I prefer proper bug reports
15:18:25Araq*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:46drewsremright, 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:21drewsrembut I'll set up the latest Aporia and check if it works better there
15:27:29drewsremI'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:34r-kunimsuggest.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:56dtscodecan 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:20onri don't get the Pokemon joke
16:48:31dtscodeits not a joke
16:49:12boopsiesdtscode: can we see your code?
16:49:29dtscodegod damn it I forgot to paste the code again
16:49:30dtscodemy bad
16:49:40dtscodehttps://bpaste.net/show/d747d737be50
16:51:37boopsieshm
16:52:00boopsieshave you verified that event.params[event.params.high] is what you're looking for?
16:53:06dtscodeyeah
16:53:25dtscodeboth 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:26Araqdtscode: 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:43dtscodeah
17:01:07dtscodeso just wrap the whole regex in \s ... \s?
17:01:21Araq"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:27Araqhttp://nim-lang.org/docs/re.html
17:01:47dtscodethanks
17:02:28Araqand yeah, in retrospect I think we should have created re"foo bar" and rex"foo bar"
17:02:51Araqwill talk with flaviu about this. we can do this for nre
17:03:44dtscodeoh goody :D It will be much appreciated
17:03:48*Jesin quit (Quit: Leaving)
17:06:07apenseI 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:27apenseextern "C"{
17:08:27apense#define _CRT_RAND_S
17:08:27apense#include <stdlib.h>
17:08:27apense int main(void) {
17:08:27apense unsigned int m;
17:08:28apense rand_s(&m);
17:08:32apense }
17:08:34apense} works fine in VS2013
17:08:38r-kuAraq: 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:45r-kuapense: i want to say mean things to you now.
17:09:51r-kuand answer to your question is passC pragma
17:10:11r-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:22Araqapense: but I cannot emit #define _CRT_RAND_S that easily
17:22:30Araqok 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:23VarriountAraq: If you're against Option monads, then why does the new regex library have them?
18:02:43Araqcause it makes sense in this case
18:03:16Araqpersonally I would have used 'nil' strings though
18:04:00VarriountAraq: I agree. :/
18:06:59ArrrrWhat do you have against options
18:08:16Araqthey make me use 'if' when I know better
18:08:27VarriountArrrr: Cumbersome, rarely useful when you have actual exceptions.
18:08:30Araqor alternatively a "nice" monad for easy chaining
18:08:45Xenim has monad support?
18:09:02VarriountI guess they're alright for a language without exceptions.
18:09:28Araqthat 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:15AraqXe: monads don't require much, you can write monads in Nim too.
18:13:17dtscodejust fyi: https://github.com/nim-lang/Nim/wiki/Editor-Support the gedit one is a dead link
18:14:54VarriountAraq: 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:27VarriountOr 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:32reactormonkVarriount, option is nothing but nil, except the typesystem knows about the nillable type
18:17:58dtscodenmd fixed the link
18:18:07Varriountreactormonk: I don't follow.
18:19:17reactormonkVarriount, 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:05Varriountreactormonk: And this is useful how...?
18:20:25ArrrrIt forces you to check against none
18:20:54reactormonkand 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:25Varriountreactormonk: Then why not an exception?
18:21:34*Demos joined #nim
18:22:35reactormonkVarriount, 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:59VarriountArrrr: And you don't normally check against 'nil
18:23:01Varriount'?
18:23:48ArrrrYes, but if i miss one, the compiler will not blame. On the other hand, with options, i have one problem less
18:24:16reactormonkVarriount, also, checked exceptions are horrible.
18:24:49ArrrrLike the difference between safe/unsafe casting
18:25:11VarriountArrrr: Then why not wrap it up in an option yourself?
18:25:30ArrrrHumm, what do you mean
18:25:57reactormonkArrrr, that we need a proc toOption[T] which basically checks via if isNil
18:26:05*onr left #nim ("Leaving")
18:26:43Arrrrso, instead of if isSome bla(), i have to do if isSome bla().toOption ?
18:26:53reactormonkbasically >:)
18:26:57VarriountArrrr: Yep. Using the procedure reactormonk just mentioned.
18:27:20reactormonkBut this is not perl, imo nim should hint you in the correct direction - via option instead of nil-checks
18:28:09Varriountreactormonk: My two main gripes are A: It's cumbersome, and B: It's so different from the rest of the stdlib.
18:28:09ArrrrWell, because 1) Is uglier, 2) : Option[T] is self documented and 3) i can forget to write it.
18:28:33VarriountArrrr: And the get() isn't ugly?
18:28:34reactormonkVarriount, time to break stuff >:)
18:29:07ArrrrYes, but also obvious
18:29:08dom96Options[T] with proper pattern matching are superior to nilable types.
18:29:20Araqyes but the disadvantages are never mentioned: instead of error value (nil, -1) and exceptions you have yet another way to model things
18:29:21dom96Try Haskell and you will be enlightened.
18:29:23reactormonkHonestly, if there were some way to auto-unpack options via get, I'd be totally in
18:29:29reactormonkdom96, haskell is slow.
18:29:50reactormonkAnd I don't expect nim to become haskell, just picking up a few good ideas along the road.
18:30:07ArrrrOption module needs more love, for example "getOr(paramInCaseIsNull)"
18:30:22*Jehan` joined #nim
18:30:22Arrrror "do(procInCaseOptionIsSome)"
18:30:33dom96Arrrr: I'm not sure I agree.
18:31:04dom96At a certain point people just don't use these additional procedures.
18:31:32VarriountArrrr: Or just add it as a default value to the current 'get' procedure?
18:31:48reactormonkWhich reminds me to punch some concepts s into the stdlib
18:31:53ArrrrYeah, it could be a default value
18:35:24*jubalh joined #nim
18:35:43*pregressive quit (Remote host closed the connection)
18:36:06reactormonkI like the default value idea.
18:36:41Varriountreactormonk: Fine, I concede against superior numbers.
18:36:56VarriountI don't have to like it though. :?
18:37:21reactormonkVarriount, 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:38Varriountreactormonk: Or make a converter to do it for me >:D
18:47:11*Varriount waits for Araq's enraged cries
18:47:29reactormonkVarriount, 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:27VarriountDemos: Working for tripadvisor?
18:49:37Demos*v*
18:50:08VarriountDemos: I know, I know, it's no surprise that I'm psychic.
18:50:23dom96Varriount: You stalking Demos?
18:50:37AraqVarriount: didn't take it seriously
18:50:59Varriountdom96: .... Maybe.
18:51:16DemosI mean I don't have a cloak sooo
18:53:02dom96I see.
18:53:23dom96Shouldn'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:41Varriount|RoadOh yay, colors.
19:01:01*Varriount|Road quit (Ping timeout: 246 seconds)
19:04:50dtscodehey 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:45fowldtscode the json module
19:06:12Varriount|Mobilehttp://nim-lang.org/docs/json.html
19:06:13dtscodefowl: I didn't see anything in there for writing/reading to a json file, just serializing
19:06:35Varriount|Mobiledtscode: Read a file into a string, then parse it wil the json module?
19:06:36Xefowl: the filesystem handling functions?
19:06:43Xeer
19:06:45Xedtscode: *
19:06:56fowlParsefile and $
19:06:57dtscodeVarriount|Mobile: eh fair enough
19:06:57Varriount|Mobiledtscode: Stringify a json object, then write it out?
19:07:01dtscodethanks guys
19:07:21Varriount|Mobiledtscode: If you want to create helper procedures for the json module, it would be appreciated.
19:12:15Varriount|MobileAraq: I just noticed the 'nep1' option in c2nim. I feel so appreciated. :)
19:14:37AraqVarriount|Mobile: you're welcome. actually nep1 should be the default I never use anything else
19:14:51Araqdtscode: 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:25flaviudtscode, Araq: How about re"\xfoo bar"?
20:13:05Araqflaviu: good enough for me
20:13:24*dalarmmst joined #nim
20:32:58*Varriount|Mobile joined #nim
20:36:14Araqbtw 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:55flaviuThat's an interesting bug.
20:55:52flaviuPR 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:50AraqI don't mind
20:59:29*miglo joined #nim
21:00:41*filcuc quit (Quit: Konversation terminated!)
21:03:26miglois there something like a "const reference" in nim?
21:05:57Araqlet foo = addr(x) means the pointer is const, not its contents
21:05:58miglolike "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:38Araqoh 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:08Araqconst MyObj& obj is just obj: MyObj in Nim
21:07:47migloand if I use "var" for the object then there is no "const"
21:08:05Araqyes
21:08:50miglorecently 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:27migloafter reading the last days only python and nim code I found all the curly braces of the Rust syntax quite ugly
21:14:16Araqhe he he
21:15:51Araqflaviu: that "parseSecureHash" doesn't do any bounds checking is amusing ;-)
21:18:51migloAraq, 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:48miglois it somewhere within the library used, by one of the async source files?
21:20:38Araqno, it's not using threads yet. I assumed you compiled with --threads:on
21:20:48Araqand hence got these errors
21:21:11dtscodewho made the compiler output pretty?
21:22:19*jfs quit (Quit: Page closed)
21:22:33*filcuc joined #nim
21:22:42AraqOnO
21:22:56miglono I haven't used this switch
21:23:24Araqnot sure. dom96 ? what's teh chat server example?
21:23:44dom96the one in the asyncnet module's docs?
21:24:20*xcombelle quit (Quit: Leaving)
21:26:00Araqwell the example should compile
21:26:07*apense quit (Ping timeout: 248 seconds)
21:26:07dtscodedoes it not?
21:26:27miglothe original example from the docs compiles and works fine
21:26:45miglobut my slightly modified version doesn't
21:27:14dtscodeah
21:27:38migloI've moved the source line where the clients are added into the sequence from proc serve to proc processClient
21:28:11migloand whenever a client gets added the program crashes
21:28:21*Demos quit (Remote host closed the connection)
21:29:46dom96miglo: gist it
21:31:42miglook, here it is..... https://gist.github.com/anonymous/e4f882ebaa0420d939ec
21:32:51dom96where does it crash?
21:32:54migloline 16 triggers the crash
21:33:13dtscodewhats the syntax for pass by ref to a function again? like proc foo(bar: var int) right?
21:34:13dom96miglo: you're not initialising 'clients'
21:34:20*Mamemon quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
21:37:00fowldtscode 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:15miglothe documentation mentions "var glock: TLock" but the compiler doesn't know the type "TLock". do I have to import something?
22:16:51Araqimport 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:19dtscodethanks fold
22:27:21dtscodefowl:
22:28:14miglodo 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