<< 12-04-2015 >>

00:05:44*pregressive joined #nim
00:08:14*MagusOTB quit (Ping timeout: 250 seconds)
00:12:08*bcinman joined #nim
00:21:32*user7181 quit (Quit: leaving)
00:26:18*MagusOTB joined #nim
00:31:38*pregressive quit (Remote host closed the connection)
00:32:27*vendethiel quit (Ping timeout: 252 seconds)
00:34:16*flaviu quit (Read error: Connection reset by peer)
00:34:20*cjbest joined #nim
00:38:08*bcinman quit (Quit: My Mac has gone to sleep. ZZZzzz…)
00:38:10*flaviu joined #nim
00:38:27*bcinman joined #nim
00:39:56*vendethiel joined #nim
00:48:11*bcinman quit (Quit: My Mac has gone to sleep. ZZZzzz…)
00:50:18*flaviu quit (Remote host closed the connection)
00:53:05*flaviu joined #nim
01:04:51*vendethiel quit (Ping timeout: 256 seconds)
01:04:55*cjbest quit (Quit: My Mac has gone to sleep. ZZZzzz…)
01:05:38*Trustable quit (Quit: Leaving)
01:07:01*vendethiel joined #nim
01:07:36MagusOTBhow do you split expressions across lines?
01:08:07MagusOTBI have echo("really_long_format_string" % [list_of_args]) and when I break the line after the % it doesn't compile
01:09:44def-MagusOTB: you need to indent the new line
01:27:57*vendethiel quit (Ping timeout: 245 seconds)
01:31:29*vendethiel joined #nim
01:36:52*bjz quit (Quit: Textual IRC Client: www.textualapp.com)
01:38:15Joe-Teugh when you save a file in vim and it freezes completely for 5 seconds when it checks syntax
01:38:56def-Joe-T: did you build the compiler with ./koch boot -d:release?
01:39:05Joe-Tdebug lol
01:39:26Joe-TI'm complaining more about vim not being multi threaded :p
01:39:27def-the compiler without -d:release is really slow
01:39:54Joe-TI'm trying to get my head around some stack trace
01:42:32Joe-Tthought i'd fixed a bug, try to compile the test and then:
01:42:40Joe-Tlib/system.nim(2274, 6) Error: unhandled exception: not (operand.flagMask == 0)
01:42:55cazovthe vim thing can be really slow if you do a lot of complex const stuff too
01:43:56Joe-Tis it possible to used the embedded debugger with the build in libraries?
01:44:11Joe-TI'm doing so much echo debugging
01:45:09def-For debugging you can use writeStackTrace and gdb when compiling with --linedir:on --debuginfo
01:46:06Joe-Tok thanks
01:47:14*bcinman joined #nim
01:48:09Joe-Twhat's the best editor to use for things like quickly jumping to definitions etc?
01:48:29Joe-Tvim freezes for me when I try that
01:48:48*bjz joined #nim
01:49:56def-Joe-T: There's a new nimsuggest tool that makes this possible. Aporia should be the first that will have support for that. (Doesn't work for me yet) But today someone tried to add it to emacs as well.
01:50:07MagusOTBis there a reason GLshort = int64?
01:50:40Joe-Toh cool
01:52:04Joe-Tdoes it also have find usages?
01:56:11*anthony joined #nim
01:56:35*anthony is now known as Guest10328
02:03:10def-Joe-T: yes
02:05:00Joe-Twere unsigned ints added at a later date or something, or is there a reason why where are so many nkCharLit..nkUInt64Lits in the code
02:06:51fowlJoe-T, because that is the range of nodes that store a literal int value
02:07:14Joe-Tbut what about UInt64
02:07:59def-Yes, unsigned ints were added later to Nim
02:10:29fowlMagusOTB, i looked at the first commit when i moved opengl from the stdlib to its own repo, in the first commit GLshort = int16, it looks like someone changed it later, i dont have the git-fu to figure out who or when
02:11:17def-fowl: git blame or the "Blame" button on github
02:13:26*wink-s quit (Quit: Page closed)
02:15:07fowlso blame, find last commit for that line, go to parent commit, repeat ?
02:15:37def-I think so, looks a bit stupid, but I think I found the culprit: https://github.com/nim-lang/opengl/commit/2d65a0dcd3b2d317dddd5f8b17ecf2f8ca768df9
02:20:29*pregressive joined #nim
02:22:51Joe-Twow d:release is fast
02:24:09Joe-Tand I get a shorter stack trace and shows just the things done wrong in the file being compiled
02:24:23Joe-Tand it was an assert statement that I swear I had the same error when I commented out.. wot m8
02:24:48renesacd:debug for the compiler is only for debuging the compiler
02:24:56Joe-Tok now getting sigsegv, d:debug time
02:24:57renesacif it crashes, for example
02:25:10*pregressive quit (Ping timeout: 250 seconds)
02:30:24*TEttinger joined #nim
02:31:11*bcinman quit (Quit: My Mac has gone to sleep. ZZZzzz…)
02:37:16*vendethiel quit (Ping timeout: 252 seconds)
02:38:02*vendethiel joined #nim
02:48:19*darkf joined #nim
02:55:09VarriountI don't suppose anyone here has some 'appropriate sources' that could be added to Nim's wikipedia page, to save it?
02:56:52*brson joined #nim
02:57:21*bcinman joined #nim
03:01:01*vendethiel quit (Ping timeout: 256 seconds)
03:02:17*vendethiel joined #nim
03:10:51*Guest10328 quit (Ping timeout: 250 seconds)
03:16:03*BitPuffin quit (Ping timeout: 250 seconds)
03:17:30*b0z983oj joined #nim
03:17:52renesacVarriount: you may try to send e-mails to some reputable sites that may be interested in making a third party review on Nim
03:18:03b0z983ojdoes anyone recommend any tool when working on Nim? Or just the default compiler/debugger?
03:18:05*MagusOTB quit (Ping timeout: 276 seconds)
03:18:09renesacPhoronix covers rust, for example
03:18:23Varriountrenesac: Hm, good idea...
03:18:34Varriountb0z983oj: What do you mean?
03:18:46VarriountRenesac: Any ideas for other sites?
03:18:55b0z983ojI mean are there any ... newbie friendly tools when working with Nim code
03:19:17renesacVarriount: search for big ones that covered rust, D or go?
03:20:30renesacb0z983oj: syntax highlighting should help: https://github.com/Araq/Nim/wiki/Editor-Support
03:20:39renesacfor starters
03:20:44b0z983ojrenesac, I already have that
03:20:57b0z983ojI was looking for autocompletion for instance
03:21:11renesacsee the editors that support "idetools" and such
03:21:18renesacthere is some ongoing work about that
03:21:27renesacthere is a visual studio plugin
03:21:33b0z983ojoh
03:21:37renesacvim also seems to have something
03:21:38b0z983ojI did not know about idetools
03:21:43renesacaporia probably too
03:22:03renesacI think it is called nimsuggest now
03:22:30renesacI'm using kate, and nobody has made a plugin supporting it yet
03:22:43renesacand the compiler support is still experimental also
03:23:18renesacwell, you might also look into Nimble, for packages and dependency solving
03:23:31*Varriount|Mobile joined #nim
03:25:03b0z983ojI followed the instructions to build nim on github but the only binary in bin/ is "nim"
03:25:10b0z983ojhow do I install tools like idetools?
03:25:45renesacI dunno, check with the plugin writters for your editor
03:25:56renesacor with araq if you plan to implement it in a new editor
03:29:23b0z983ojdoes anyone use Zeal for offline doc?
03:29:31Varriount|MobileYou need to download their respective repositories
03:29:49Varriount|MobileEither via Babel, or manually
03:30:02b0z983ojoh, I thought it's a compiler tool
03:30:12Varriount|MobileIt used to be.
03:30:29Varriount|MobileBut I believe it's now separate
03:31:01Varriount|MobileOr rather, in a separate repository. It still uses compiler code.
03:31:29Varriount|MobileTry looking through github.com/nim/
03:32:12b0z983ojany idea what the "norm" tool is?
03:34:07b0z983ojlol that's the wrong github link
03:34:48*adu joined #nim
03:35:29b0z983ojidetools is actually a command in the compiler now
03:36:43b0z983ojbtw, does anyone use Zeal for offline documentation (for Nim ofc)?
03:41:41renesacnever heard of it
03:41:50renesacyou can use ctrl + f here: http://nim-build.nim-lang.org/theindex.html
03:42:07renesacnot the same thing of course
03:43:46Joe-Tlol wow my linter does not like repr.nim
04:03:03*brson quit (Quit: leaving)
04:09:15*pregressive joined #nim
04:13:42*pregressive quit (Ping timeout: 252 seconds)
04:26:49*pregressive joined #nim
04:30:16*endragor joined #nim
04:36:46*gsingh93 joined #nim
04:36:59reactormonkb0z983oj, it's nimsuggest now
04:37:29b0z983ojreactormonk, isn't it "nim idetools <command>" ?
04:39:57reactormonkb0z983oj, from what I gathered it's been replaced... but I might be misinformed
04:40:51*endragor quit (Remote host closed the connection)
04:41:10b0z983ojoh I see
04:42:13VarriountIt has been replaced.
04:42:42Varriountonionhammer: Have you seen the new sublime text 3 language syntax files?
04:45:10*Senketsu joined #nim
04:46:04b0z983ojI just built nim(master branch) which is 0.10.2 but nimsuggest asks for 0.10.3, should I check out devel?
04:46:24*endragor joined #nim
04:47:16Varriountb0z983oj: Yes.
04:47:54Varriountb0z983oj: You'll probably need to recompile a csources version of nim (use the devel branch of csources)
04:48:10b0z983ojI must have messed up somehow, after checking out "devel" I ran "bin/nim c koch && ./koch boot -d:release"
04:48:16b0z983ojbut the second command fails
04:48:24b0z983ojlib/pure/collections/tables.nim(98, 39) Error: type expected
04:48:29VarriountSee my last comment.
04:48:37b0z983ojoh
04:48:43b0z983ojdidnt notice that
04:54:14*msmith491 joined #nim
05:10:42*pregressive quit (Remote host closed the connection)
05:15:33*endragor quit (Remote host closed the connection)
05:16:27*vendethiel quit (Ping timeout: 256 seconds)
05:24:33*endragor joined #nim
05:25:26*endragor quit (Remote host closed the connection)
05:37:49*vendethiel joined #nim
05:45:31b0z983oj~/.nimble/pkgs/compiler-0.10.3/compiler/nimfix/prettybase.nim(10, 7) Error: cannot open 'ast'
05:45:49b0z983ojcan anyone help me understand what this error is
05:48:44*TylerE_ joined #nim
05:51:25*Araq_ joined #nim
05:51:42aduhi all
05:51:46*b0z983oj quit (Ping timeout: 264 seconds)
05:52:21*endragor joined #nim
05:53:53*egrep quit (*.net *.split)
05:53:55*ldlework quit (*.net *.split)
05:53:55*fold quit (*.net *.split)
05:53:55*Araq quit (*.net *.split)
05:53:55*TylerE quit (*.net *.split)
05:55:20*ldlework joined #nim
05:58:51*endragor quit (Remote host closed the connection)
05:59:02*vendethiel quit (Ping timeout: 246 seconds)
06:02:34*fold joined #nim
06:04:37*wb quit (Ping timeout: 255 seconds)
06:06:37*b0z983oj joined #nim
06:06:52*clynamen joined #nim
06:08:37*b0z983oj quit (Client Quit)
06:12:58*Varriount|Mobile quit (Quit: AndroIRC - Android IRC Client ( http://www.androirc.com ))
06:13:43*adu quit (Ping timeout: 245 seconds)
06:25:20*repax quit (Ping timeout: 252 seconds)
07:00:25*endragor joined #nim
07:22:02*BlaXpirit joined #nim
07:36:31endragor> tkInfixOpr, tkPrefixOpr, tkPostfixOpr < are these tokens used at all? Can't find usages
07:54:11*akiradeveloper joined #nim
07:56:13*gsingh93 quit (Ping timeout: 264 seconds)
07:57:56BlaXpiritendragor, looking at this i can only guess
07:58:11BlaXpiritthey are used after the first stage of parsing
07:58:25BlaXpiritthen they are changed to proc calls like `*`(stuff)
07:59:11BlaXpiritalso pretty sure postfix `*` (public) stays until the end
08:01:05endragorlexer is the first stage, right? in lexer.nim it looks like endOperator() can only return one of tkColon, tkColonColon, tkEquals, tkDot, tkDotDot, tkOpr
08:01:53*gmpreussner|work quit (Read error: Connection reset by peer)
08:03:04endragorwell, maybe tkOpr somewhere later gets converter into one of tkInfixOpr, tkPrefixOpr, tkPostfixOpr using enum arithmetic, so it makes hard to find usages by string search
08:10:45*bcinman quit (Quit: My Mac has gone to sleep. ZZZzzz…)
08:11:31*msmith491 quit (Ping timeout: 246 seconds)
08:11:38*pregressive joined #nim
08:13:22*akiradeveloper quit ()
08:14:14*xcombelle joined #nim
08:15:48*pregressive quit (Ping timeout: 245 seconds)
08:27:02*vendethiel joined #nim
08:39:20*HakanD joined #nim
08:42:39*b0z983oj joined #nim
08:47:22*xcombelle quit (Remote host closed the connection)
08:49:24BlaXpiritendragor, oh yeah, these enum ranges are a horrible practice seen everywhere in compiler
08:52:03b0z983ojhi, what is a "converter" in nim lang?
08:52:16b0z983ojthere's one in asyncio
08:54:09BlaXpiritrtfm?
08:54:46BlaXpiritvery easy to find http://nim-lang.org/manual.html#converters
08:57:50b0z983ojany reason why osInvalidSocket = INVALID_SOCKET is a "let" and not a "const"
08:57:53b0z983ojin rawsockets
09:00:30BlaXpiritb0z983oj, winlean.INVALID_SOCKET is a macro in C, so it can't be imported as nim const, so it's actually a var
09:00:43b0z983ojok
09:04:58*milosn quit (Ping timeout: 245 seconds)
09:26:02b0z983ojaside from the technical details behind the initialization of a "const" and "let", they should be the same usage wise right?
09:27:07BlaXpiritb0z983oj, can't use let at compiletime :s
09:27:14b0z983ojI realized that
09:27:28BlaXpiriti mean, can't use its value at compile time
09:27:31BlaXpiritbut otherwise yes
09:27:33b0z983ojjust that, in the entire standard library, there's only one "let"
09:27:47BlaXpiritcan't be true
09:27:54b0z983ojwell I checked
09:28:01BlaXpiritnope nope nope
09:30:58b0z983ojby only one I mean only one found in the doc like this one http://nim-lang.org/rawsockets.html
09:31:27b0z983ojI downloaded it recursively for offline use and that's the only section that uses "lets"
09:32:21BlaXpiritwow, it might actually be true
09:36:44*filcuc joined #nim
09:43:49*filcuc quit (Quit: Konversation terminated!)
09:45:04*filcuc joined #nim
09:45:17*repax joined #nim
09:54:25*ffffffffBG joined #nim
09:54:55*ffffffffBG quit (Client Quit)
10:01:38EXetoCBlaXpirit: because it's not always obvious what the range covers?
10:01:54BlaXpirithuh
10:02:53federico3mornin'
10:06:29*b0z983oj quit (Ping timeout: 245 seconds)
10:08:56EXetoCBlaXpirit: enum ranges
10:10:32EXetoC"only one let in the compiler"??
10:12:19*filwit joined #nim
10:12:23EXetoCoh, standard library. still not true
10:13:33*flaviu quit (Remote host closed the connection)
10:14:01*flaviu joined #nim
10:14:50*Mimbus joined #nim
10:15:08*milosn joined #nim
10:18:16*Arrrrrrrr joined #nim
10:27:18*milosn quit (Read error: Connection reset by peer)
10:27:34filwitany way to convert a NimNode -> type inside a macro?
10:27:39*milosn joined #nim
10:27:59filwitmacro foo(T): stmt =
10:28:06filwit let t = T() # I want this
10:30:02filwitactually, scratch that question.. what I'm really looking for is a way to iterator over a types field names/types inside a macro
10:30:37dom96hrm, haven't dabbled with the type api yet
10:30:41dom96so I can't help much
10:30:44filwiti can achieve this using 'fieldPairs' inside a template, storing them into a static seq, then iterating over them inside the macro
10:31:21filwitbut I remember Araq saying typetraits had seen some improvements recently, so I'm wondering if there's anything more straight forward
10:32:38filwitdom96: type api? I'm not sure exactly what you're referring too.
10:33:12dom96Araq added a type API recently
10:33:37filwitright, that's what I'm thinking of
10:33:44filwiti'm guessing there's no docs yet?
10:34:02dom96dunno. Look through the macros module and see if you can find something
10:34:06filwitbut do you know what files in the compiler was changed for this? something new or just typetraits?
10:34:16filwitdom96: been doing that :P
10:34:48filwitanyways, i'll keep hunting
10:35:52dom96I think it's 'typ[]' in macros
10:36:05dom96proc typ[](n: PNimrodNode): typedesc {.magic: "NGetType", noSideEffect.}
10:36:32filwitah.. thanks, i'll try that out
10:37:17*filcuc quit (Quit: Konversation terminated!)
10:40:36*davidhq joined #nim
10:45:15HakanDwikipedia article is relisted, again
10:47:58ArrrrrrrrNice http://www.wikiwand.com/en/Nim_(programming_language)
10:51:21*BitPuffin joined #nim
10:51:25*Trustable joined #nim
11:01:49*HakanD quit (Quit: Be back later ...)
11:02:14*irrequietus joined #nim
11:03:27flaviufilwit: fowl did something with that, perhaps I can find the Gist again.
11:05:05flaviufilwit: https://gist.github.com/fowlmouth/9b9010397ad5fe4b9872
11:05:07filwitwas gone for a sec
11:05:15filwitflaviu: thanks.
11:05:44*flaviu left #nim (#nim)
11:05:48*flaviu joined #nim
11:05:50filwitdom96: btw, 'typ' from macros doesn't seem to be working
11:06:04dom96pity
11:06:30filwitdom96: well I mean, it's not even being found.. i wonder if it was removed in devel and the docs don't reflect that yet
11:07:01*untitaker quit (Ping timeout: 255 seconds)
11:07:12dom96ahh, we really need devel docs: https://github.com/Araq/Nim/blob/devel/lib/core/macros.nim#L169
11:07:21dom96try that
11:07:36filwitah, okay
11:09:15*Arrrrrrrr quit (Quit: Page closed)
11:09:55*user7181 joined #nim
11:11:02filwitkinda odd though.. i can't do `macro foo(T): stmt = echo getType(T)` .. i get "Error: node has no type"
11:11:34filwiti'll take a look at what fowl did
11:14:03*untitaker joined #nim
11:17:55*MouldySammich joined #nim
11:28:40*milosn quit (Ping timeout: 272 seconds)
11:31:11*banister joined #nim
11:44:26*MouldySammich quit (Quit: Page closed)
11:48:14*milosn joined #nim
11:56:07*milosn quit (Read error: Connection reset by peer)
11:56:35*milosn joined #nim
11:57:57*davidhq quit (Quit: Textual IRC Client: www.textualapp.com)
12:07:12*milosn quit (Read error: Connection reset by peer)
12:07:57*milosn joined #nim
12:08:35*tmku joined #nim
12:10:32*BlaXpirit quit (Read error: Connection reset by peer)
12:11:30*BlaXpirit joined #nim
12:14:50*wb joined #nim
12:15:50BlaXpiritseq is implemented as pointer to {length, reserved, pointer to data}
12:16:08BlaXpiritwhy the need for the outer pointer?
12:19:30filwiti've always wondered that too.. was it proven "faster" (in a broad sense) to make seq's a reference type or was this choice made for other reasons?
12:19:36*Kingsquee quit (Quit: Konversation terminated!)
12:21:48filwitit's even more odd given that an object with only an int and pointer in it with pass by copy, while anything larger will implicitly pass by ref in Nim.. I always assumed that was due to a better understanding of cache systems than I was aware of.. but then why don't seq's follow this pattern?
12:23:41filwitref seq's also seem 'gotcha prone' since the length is invalid before explicit allocation
12:23:53def-BlaXpirit: probably so you can make them shallow
12:24:27BlaXpiritfilwit, it wouldn't hurt to get 0 length seq by default
12:25:23BlaXpiritdef-, it's difficult to think about, but maybe you're right
12:29:24*milosn quit (Ping timeout: 245 seconds)
12:29:27filwitBlaXpirit: well I don't think seq's should auto-allocate (because that will cause a lot of pointless allocations), and even with ref seq's you can make 'len' perform nil checks and be useful before allocation.. I just don't understand why you would do ref seqs for performance reasons.. it seems like in many ways (length on stack, pass by copy, no need for nil checks on 'len') non-ref seqs would be better.
12:29:37filwitperhaps it's something to do with threading
12:30:00filwiti know Nim handles ref objects differently inside spawned procs
12:30:39BlaXpiritthere is no need to allocate
12:30:54BlaXpiritmake what is currently a nil seq synonymous to 0-length seq
12:31:16BlaXpiriti mean, make reserved==0 be synonymous to data==nil
12:31:30filwitright
12:32:29BlaXpiritalthough that adds some data!=nil checks on many operations
12:33:06filwitthose ops should probably use len > 0
12:33:24BlaXpiritwhat about add
12:33:38filwitdoes allocation if needed
12:33:40BlaXpiritwell it checks capacity anyway
12:33:48filwitthat's what already happens cause it needs to expand
12:34:04filwitso it would work out well
12:34:11BlaXpiritwell now i don't see any real reasons
12:34:17filwitme either
12:34:24filwitawaiting Araq's explanation
12:34:33BlaXpiritwe have def-'s explanation for now :|
12:35:12filwiti don't really understand how 'shallow' applies though
12:35:13BlaXpiritthe real problem now would be that things rely on this nillability
12:35:50filwitwell theoretically 'inNil' and even 's == nil' could be overwridden to not break code
12:35:54BlaXpiritbut it's much more harm than good to allow seqs and strings to be nil
12:36:03BlaXpirityes, that is true
12:36:23BlaXpiritbut nil synonymous to zero length, remember?
12:36:59filwitsure, but what are you implying by that?
12:37:05BlaXpiritwell they're different
12:37:22BlaXpiritcode will start swearing at empty strings and whatnot
12:37:23filwittechnically 'nil' doesn't apply to a stack seq at all
12:38:00filwitit would just exist temporarily as a transitional thing for old code, type of deal
12:38:36filwiti don't see any downsides.. but I am just guessing at the reasons here, so I'm just speculating
12:38:36*milosn joined #nim
12:38:42*b0z983oj joined #nim
12:38:47BlaXpiritnil can't be synonymous to zero length tho
12:39:29b0z983ojif anyone uses Zeal offline doc, I made a package for nim: http://nim.trungaczne.info/nim.xml
12:39:38b0z983ojnot sure if it works for OSX Dash since I don't use OSX
12:40:34filwitBlaXpirit: if you made seq and object, nil wouldn't apply at all... I'm not sure what problem you're trying to demonstrate.. the only reason you could have a isNil/== proc for object seqs at all would be for backward compat
12:40:44*b0z983oj is now known as trungaczne
12:40:45filwitmade seq an** object...
12:40:53BlaXpiritfilwit, i'm saying it is impossible to make a backward compat isNil
12:41:44filwithmm.. yeah that might cause problems in some places, true
12:43:10*trungaczne quit (Quit: Leaving)
12:43:59filwitdepreciated errors/warnings would probably be best if was to actually change. I'm really curious as to Araq's reason for this now..
12:44:39BlaXpiritnil strings are omnipresent.
12:46:08*milosn quit (Remote host closed the connection)
12:47:27*milosn joined #nim
12:48:05filwitthat doesn't seem to hard to fix though.. first you make a isNil/== op which dumps LINE to the console and mimics len>0 behavior as a way to track down and remove everything from the compiler/libs.. then make a major breaking change announcement in the next release (and maybe leave the ops in temporarily for others to do the same, but marked as depreciated)
12:49:04filwitit'd be grunt work, but hell i'd gladly spend a few hours doing that for a good cause
12:49:38filwitalthough I doubt Araq would trust anyone but himself to do it
12:50:29BlaXpirityou don't understand, it is omnipresent in libraries too
12:51:07filwityou mean third-party libs? I know it's used everywhere.. thus the major breaking change message
12:51:39filwitstand libs would be just as easy to fix as the compiler would be
12:51:46BlaXpiritok but let's keep thinking here.
12:52:35BlaXpirit@[] is allocated
12:52:54BlaXpiritone can even keep the nil behavior by just checking data!=nil
12:54:57filwityeah I didn't think about that, you're right.. I don't know what you're saying about @[].. that would basically function the same as now, just without heap allocating the seq structure
12:55:35BlaXpirithonestly, the nillability of seq bothers me even more than implementation detail
12:56:26filwityeah, i agree, but I need to get back to doing stuff now, and I want to hear Araq's reasoning before speculating too much (although I'm guessing you're on point about breaking changes being his biggest concern)
12:56:44BlaXpiritbye
13:02:00BlaXpiriti've thought something up
13:02:34BlaXpiritseq's default state would be (length: 0, capacity: -1, data: null)
13:02:54BlaXpirit@[] would be (0, 0, null)
13:03:12BlaXpiritisNil would be capacity==-1
13:04:55BlaXpiritnah, much simpler to make default state (0, 0, null) and @[] (0, 0, []) and isNil data==null
13:05:13BlaXpiritthere would be some extraneous ifs but they can be removed when isNil is phased out
13:07:47filwiti forgot seq's had a capacity
13:08:04*irrequietus quit ()
13:11:54*b0z983oj joined #nim
13:12:04b0z983ojthe tutorial on the main site is out of date isn't it
13:14:21filwitb0z983oj: you'll have to be more specific, but I'm yes some of the documentation is out of sync with the devel branch of course, and surely there are places it's even out of sync with master as well.
13:15:09b0z983ojsay where do I get documentation for anything
13:15:15b0z983ojslices don't seem to be documented in manual.html
13:15:44filwitslices are documented in the system libs docs
13:16:06filwitdocs -> Standard Libs -> system
13:16:07b0z983ojI am on devel branch and slices now use ^ for negative indexing while the tutorial says it's - (minus). Also the tutorial uses the $ which is apparently deprecated
13:16:11b0z983ojI will look into it
13:17:06filwityeah, unfortunately devel docs where dropped awhile ago (due to time constraints, IIRC)
13:17:36filwitthe IRC is the best place to get up-to-date information about devel stuff
13:17:46b0z983ojokay then
13:31:33*milosn quit (Ping timeout: 248 seconds)
13:37:24flaviuI found the problem with findAll performance!
13:37:25flaviuhttps://gist.githubusercontent.com/flaviut/d3a0747dfac02eaa239a/raw/81587cae6a5a5f2b51c56b9d75a84847d506cf4d/-
13:38:06flaviuIf zero-length matches are impossible, then the last ~20k are totally unnecessary!
13:38:08BlaXpiritwut
13:38:21BlaXpiritoh i get it
13:38:28flaviuAnd it just so happens that PCRE provides PCRE_INFO_MATCH_EMPTY!
13:38:47BlaXpiritso zero-length matches make everything horrible?
13:39:24flaviuyep, but we can choose a sane implementation for patterns that always match something, which leads to a much faster implementation.
13:40:41BlaXpiritwhy is find called so many times?
13:40:55flaviuIt's called for every character in the input file.
13:40:56BlaXpiritor does pcre only provide a "match" function?
13:41:03BlaXpiritdoesn't pcre provide a "find"?
13:41:10flaviumatch is find.
13:41:18BlaXpiritno it isn't
13:41:34BlaXpiritdo you mean "pcre"s match is what we call "find"
13:41:51flaviuIt is, pcre_exec(ANCHORED) == match, pcre_exec() == find.
13:41:52BlaXpiritand "pcre"s match with start-only argument is what we call "match"?
13:41:58BlaXpirit:>
13:42:09flaviuyep
13:42:38flaviuThe problem is that findIter has basically this code: if notMatched: idx += 1; # try again
13:43:04*HakanD_ joined #nim
13:46:57Varriountflaviu: Are you the author of NRE?
13:48:11flaviuVarriount: yes
13:51:58*HakanD__ joined #nim
13:52:35*HakanD___ joined #nim
13:55:13*HakanD_ quit (Ping timeout: 250 seconds)
13:56:04*HakanD__ quit (Ping timeout: 245 seconds)
14:02:17*irrequietus joined #nim
14:03:07*b0z983oj quit (Quit: Leaving)
14:16:38*darkf quit (Quit: Leaving)
14:17:15filwitwell it looks like there is still a deficiency with macros.getType().. works great for instances of a Type, but not on typedesc itself AFAIK
14:17:36filwitneed to report I guess
14:23:41renesacdom96, filwit: by devel docs, do you mean this: http://nim-build.nim-lang.org/documentation.html
14:23:42renesac?
14:24:36dom96that's the same as http://nim-lang.org/documentation.html
14:24:53flaviurenesac: f3w703p9ahtp9wawh59gp.nim-lang.org/documentation.html
14:25:22renesachum
14:28:17renesacwhy time constraints prevents the script from building it?
14:28:28renesacor the script became broken?
14:31:04*BoobLord joined #nim
14:31:24*b0z983oj joined #nim
14:31:53b0z983ojhow do I init an openArray? I tried "var x : openArray[int]" but this doesn't seem to work. Also can't find any proc like newSeq in system either
14:32:18renesacopenArray is only for parameters
14:32:33b0z983ojhow do I use algorithms procs then?
14:32:33renesacI don't think you can init it
14:32:39renesac?
14:32:41b0z983ojalgorithms.reverse for example
14:32:45b0z983ojit requires an openArray
14:32:45renesacwith either seqs or arrays
14:32:53renesacread the manual
14:32:55renesacor the tutorial
14:33:08renesacsearch for "openArray"
14:33:23BlaXpiritgah i cringe every time
14:34:17*HakanD___ quit (Quit: Be back later ...)
14:34:32renesac"arrayLike" would probably be a better name
14:34:39renesacfor a concept
14:35:19renesacor SomeArray
14:35:51renesacbut it don't helps that "seq" has a completely different name
14:35:53*BoobLord left #nim ("Leaving")
14:35:53b0z983ojwell I read the tutorial and it was too mystique for me. One paragraph saying that it's for parameter only (does that mean I have to cast it? Or is it magically resolved?) . It does say that "array" of compatible type could be passed, but is it referring to openArray or the array type, or is it seq? Then the manual/system doesn't help either
14:36:08BlaXpiritb0z983oj, think of it like this:
14:36:16BlaXpirittype openArray = seq or array
14:38:21BlaXpiritthe line i just wrote crashes the compiler. it's heresy
14:39:15*HakanD___ joined #nim
14:41:28b0z983ojyeah I got that part. I was just *really* confused about the compiler message I got. I wrote "reverse(@[1, 2, 3, 4, 5])" which is of course stupid (but I didn't realize) and it said it expected an array or a seq. I thought i meant openArray is neither seq nor array
14:44:13flaviuCan I get some bikeshedding on https://github.com/flaviut/nre/issues/11 ?
15:03:46*flaviu quit (Remote host closed the connection)
15:07:55*b0z983oj quit (Quit: Leaving)
15:08:44*flaviu joined #nim
15:14:58*filcuc joined #nim
15:15:27*filcuc quit (Client Quit)
15:15:44*filcuc joined #nim
15:24:18onionhammerVarriount nope i havent. Whats new?
15:27:01novistso i was talking to my friend about nim
15:27:56novisthe was blown away by pervasive -1 and [0.. ^2] (to which he replied "wtf xor 2??")
15:28:44novistwell we both think these two things will bite lang in the ass in a long run..
15:29:28renesacI think the problem is inclusive ranges, instead of half-inclusive ranges that everybody else uses
15:29:50novistit certainly is. i think inclusive ranges would have made sense with 1-based array indexing
15:30:00novistw/ 0-based it wrecks havoc
15:30:02renesacwe can't even have a safe "for i in x .. y" if they are "int"
15:30:13*bcinman joined #nim
15:30:31*milosn joined #nim
15:31:18BlaXpiritnovist, that's what i've been saying
15:31:32BlaXpiritbut it can't be changed
15:31:40renesacand novist, ^ isn't xor in nim, anymore than "type X* = int" has anything to do with pointers
15:31:46flaviuThe problem is the conflated usage of ranges.
15:31:47novistsure it can, everything can be changed
15:31:59novistnot immediately but it can be changed
15:32:02renesacI already proposed a "..<" iterator
15:32:16flaviuThey do three things: iteration bounds, sets, and slicing.
15:32:29renesacthat should be used for half inclusive ranges
15:32:44BlaXpiritrenesac, it's already there, just add a space in between
15:32:56renesacthe .. iterator will just be slower for ints then, and if you care about the performance difference you use the ..<
15:33:17renesacBlaXpirit: it is not the same thing
15:33:37renesacnegative ranges also showed this
15:34:28novistbeing perfectionist it nags me that less obvious longer ..< should be used most of the time while more obvious .. is reserved for something that is rather a corner-case ('a'..'z')
15:35:57novistBlaXpirit: what was the reason for [0..-1] being impossible?
15:36:15BlaXpiritand what do u mean by "impossible"
15:36:30BlaXpirithttps://github.com/Araq/Nim/issues/1979
15:36:40novistwell if its not how it works while being most obvious way then i bet there was a problem
15:36:47*pregressive joined #nim
15:37:58novistcause "abc"[0:-1] meaning "-"=reverse, "1"=one, resulting in "ab", i can understand why it takes one last char
15:38:20novist"abc"[0..^1] still being full "abc" i dont quite get
15:38:40BlaXpirit"abc"[0:-1] was "abc"
15:38:50BlaXpirit"abc"[0 .. -1] was "abc"
15:38:52BlaXpirituh
15:39:08BlaXpiritblah, i'm not getting into this
15:39:55novistbut whats the reasoning for having a slice return full string when its not "full" slice?
15:40:47novistand "abc"[:-1] returns "ab" in py
15:41:04novistand i think in php substr works same way, -1 taking away last char
15:42:32novistanyway alright, to ease frustration im gonna use range() in loops and s.slice() instead of []. but its bummer to see twovery important lang features incapacitated
15:43:09BlaXpiritand what about substr?
15:43:20novistalso reason im talking about this is that basically every person i talk to about nim feels weirded out by these things. and they dont plan to use nim due to such surprises
15:43:28novistyeah i noticed substr also returns one char too long
15:43:34novistthe hell idk
15:43:38BlaXpiritand what about everything else?
15:43:50novistwhat do you mean everything else?
15:44:06renesacnovist: you can't expect a new language being equal to every other language
15:44:09BlaXpiritanything that has a range is inclusive
15:44:16renesac^ is not xor in nim, get over it
15:44:25BlaXpiriton point
15:44:33novistrenesac: i dont expect that, but there is obvious shortcoming
15:44:48renesacas for "Language design: Undesired property", yeah, they should be fixed
15:44:49novist^/- problem is that one is more obvious than other
15:44:58BlaXpiritno
15:45:03novistofc yes
15:45:08renesacI don't see a problem there
15:45:16novistwhile ^ can have many meanings - usually has one
15:45:18BlaXpiritgoddammit dude. go unlearn python then return here
15:45:27federico3[insert quote about off-by-one errors]
15:45:48renesacas Araq said, he optimizes the language not for the complete newebie that hasn't read the manual, but for who is programming some time in nim
15:46:18renesacnovist: yes, it means "pow"
15:46:22novistalright fine. hell fuck ^/- thing. but inclusive ranges on 0-base lang is.. you know
15:46:36BlaXpirityes, most people will agree it's bad
15:46:44BlaXpiritit's will not be changed
15:47:02novistnot even for say 2.0? if its too late for 1.0
15:47:13renesaceven more unlikely then
15:47:24BlaXpirit^
15:47:31novistbut why?
15:47:41novisttoo much code would become unusable?
15:47:46federico3is there a design reason behind inclusive ranges (not arguing, just curious)
15:48:19novisti think it stems from araq's love for pascal
15:48:21novistbut its 1-based
15:48:31BlaXpiritAraq thinks thinks int.low .. int.high is a reason
15:48:45BlaXpiritbut no, there is no real reason
15:48:48renesacfederico3: araq don't fells like 'a' .. 'Z' should be a special case
15:49:03renesacbut I would be perfectly fine typing 'a' ... 'Z' for those cases
15:49:05novistas far as im concerned 'a'...'z' could be that solution
15:49:05federico3what?
15:49:41BlaXpirit`:` is not taken
15:49:44renesacwell, Araq likes inclusive ranges, but I think they do much more harm than good for nim
15:50:10novist^
15:50:37*pregress_ joined #nim
15:51:25novisti would love to use nim for next thing we will do in our line of work. that software should be in native code, easily deployable and multiplatform. nim fits the bill perfect
15:51:33novistbut now im thinking of workarounds im gonna use for these problems
15:51:44renesacnovist: just define ..< for half-inclusive ranges
15:52:17renesacI think I will make an issue proposing it and the deprecation of the < unary operator
15:52:19novistsure, workaround
15:52:22*banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
15:52:48novistor range() being non-inclusive iterator
15:52:59novistagain workaround. even if im very used to it its a workaround
15:53:22BlaXpiritrenesac, lol that's no good
15:53:31renesacBlaXpirit: why?
15:53:36BlaXpiritat least people can do substr(4, <6) now
15:53:44renesachum
15:53:57*pregressive quit (Ping timeout: 248 seconds)
15:53:57BlaXpirit..< is something that is on everybody's mind
15:53:58novistBlaXpirit: but that substr is one more not so obvious thing
15:54:02BlaXpiritsaves 1 space of typing, whatevber
15:54:08BlaXpiritnovist, everything is obvious
15:54:20BlaXpiritjust different to what you're used to. get over it.
15:55:13novisteh nim is pretty much what i have dreamed about for quite some years
15:55:26novistits sad to see it come so close, but not quite
15:55:32BlaXpirityou sound exactly like me a few months ago
15:55:35novistthats why im talking here..
15:55:37renesacthe uncanny valley
15:55:38renesac:P
15:56:07novistBlaXpirit: but i think there will be more people like me
15:56:13BlaXpiritof course
15:56:18novistwho will flip the table and scream "feck this sh1t"
15:56:25novistit does no good to anyone
15:57:11BlaXpiritand what good is rewriting half of existing code?
15:57:20federico3sounds like we should rather improve the documentation and flag very clearly any surprising behavior
15:57:51novistwell it depends what would be outcome of rewriting/not rewriting half of existing code
15:58:09novistif it will be something that seriously slows adoption then..
15:58:12*bluenote10 joined #nim
15:58:30novistim greedy person, i dont want nim to be language that araq made just for himself to enjoy :))
15:58:31flaviuWhy can't existing code use an old compiler?
15:58:41BlaXpiritlibs
15:59:00flaviuUseful libs will be adapted, and they might even gain a test suite in the process!
15:59:26BlaXpiritwho needs 1.0, let's release 2.0
15:59:31flaviuExactly!
15:59:50BlaXpiritimmediately better than rust
16:00:53*filcuc quit (Ping timeout: 248 seconds)
16:01:46HakanD___hah
16:03:54renesacif the inclusive to half-inclusive conversion can be done entirelly mechanically, by a script, then I would be more for it
16:04:26renesacbut I fell those things are tricky
16:04:47renesacas they say: there are two hard things in computer science: cache invalidation, naming things, and off-by-one errors.
16:05:03*HakanD___ quit (Quit: Be back later ...)
16:05:43novistimo biggest problem is lack of desire to fix this
16:06:04flaviurenesac: certainly feels that way.
16:06:08novistimportant people seem to be at peace with this and are prepared to live with consequences
16:06:37BlaXpiritthat's why you couldn't make a programming language
16:07:04novistthats true. my level aint that high. if it was i would just maintain a fork for myself w/ these two solved
16:07:18flaviunovist: I dislike this inclusive bounds, but I can't go against the convention.
16:07:23novistbut oh well.. must do politics now instead
16:08:15novistflaviu: well there are two ways.. not use those things, use helper procs instead, and not use language (very bad solution)
16:08:21novistboth dont go against convention..
16:08:26novistnevertheless there is a problem
16:11:24flaviunovist: I'm coming from the opposite prospective, as a person writing a library. (with major contributions from BlaXpirit, credit where credit is due)
16:11:25*HakanD___ joined #nim
16:11:48flaviuI can't have the library use exclusive upper bounds, as it does not mesh well with other things.
16:12:55novistits probably too rather specific lib no?
16:13:13novistnot casual code people write daily to get things done i bet?
16:13:40flaviuSorry, I don't understand what you wrote
16:13:47novistcause so far i cant recall doing for (i=0; i < SOMETHING+1; i++)
16:14:11novistwell im saying 'a'..'z' is cornercase
16:14:22novistmeaning useful inclusive ranges cornercase
16:14:32BlaXpiritnovist, yes, so?
16:14:44BlaXpiritnobody's even arguing for inclusive ranges
16:15:06flaviuBlaXpirit: Araq is.
16:15:11novistso preferring cornercase while having more often written code to deal with it's fallout is kind of odd
16:15:26*filcuc joined #nim
16:15:29renesacnovist: I've done plenty of for (i=0; i <= SOMETHING; i++)
16:15:46novistrenesac: you lost +1 bit :)
16:15:49renesacmuch less than the < version, of course
16:15:51novistoh <=
16:15:59renesacnovist: nim don't do +1
16:16:00renesacyeah
16:16:01novistwell yeah, thats what im saying
16:16:17novistor another solution would be for everyone to use 1-based arrays
16:16:25novistand strings to be 1-based then
16:16:31novistand seqs etc..
16:17:02novistthough i still prefer 0-based..
16:17:16renesacI don't think there is anyone pushing for this
16:17:29novistcause its crappy solution maybe
16:17:48novistbigger part of the world is 0-based
16:18:21renesacit is confusing for non-programmers though
16:18:27renesacmathematics is 1 based
16:18:45renesacand most of the world outside programming is also 1 based
16:18:51novistyou speaking of some advanced math maybe?
16:19:10novistcause from school i dont remember anything like that heh
16:19:35renesacmatrixes
16:19:36renesacon school
16:19:55novistyeah.. never dealt with that
16:20:21novistaside from 3d libs where its 0-based hehe
16:21:12renesaclua for example was made 1-based to cater to non-programming engineers at the time
16:21:38renesacfortran too, for mathematicians
16:21:46novistdifferent target audience though
16:21:51renesacI agree
16:22:41renesacand for new languages, Julia is 1-indexed too
16:22:49renesacagain, aiming at scientists
16:23:48*filcuc quit (Quit: Konversation terminated!)
16:24:01renesacMathematica, matlab, etc too
16:24:44renesacbut yeah, not nim target audience
16:25:02renesacand even that target audience can adapt to 0-based indexing, as seen by python science community
16:27:14novistwell its not a rocket science. you aint supposed to learn 10 different gotcha situations and keep an eye for them when learning 0-based indexing. in c and friends anyway
16:27:55novistbtw this is great explanation why py has 0-based indexing https://plus.google.com/115212051037621986145/posts/YTUxbXYZyfi
16:28:06renesacthe problem of nim seems to be inclusive plus 0-based indexing
16:28:34federico30 or 1?
16:28:52renesacis there any other languages that use inclusive ranges and have 0-based indexing?
16:29:01novisti not know of one
16:29:16renesacfederico3: I meant, the combination of the two
16:30:41BlaXpiriti dont know any
16:31:29BlaXpirithttp://irclogs.nim-lang.org/15-01-2015.html 20:21:35 lol
16:31:33novistmaybe that combination isnt widespread for a good reason
16:31:39BlaXpiritwe've been here 3 months ago
16:32:12BlaXpiriti was even more passionate about this than novist
16:32:33novistBlaXpirit: what broke your spirit? :D
16:32:48EXetoCcorner case? why?
16:33:08BlaXpiriti was mostly mad about a broken behavior as described in my issue
16:33:19BlaXpiritthat was fixed, negative indices were removed, good enough for me
16:34:06novistisnt ^2 still negative indice except working one and not looking negative?
16:34:33novistoh dom96 agrees with me: dom96 I kind of wish that we just copied Python's intervals.
16:34:41EXetoCno
16:34:44renesac^2 isn't negative indice, it is indexing the array in reverse
16:36:05renesacsome languages do the same thing using negative indices
16:37:08renesacwhile on others they are invalid or point to values before the spot pointed by the initial array pointer
16:37:16*Gilgamesh joined #nim
16:37:40*Gilgamesh is now known as Guest81738
16:38:04BlaXpiritusing inclusive indices is working out pretty nicely for me at this moment
16:38:09novistwell i do not have high knowledge of good terminology so for me it meant pretty much same thing
16:39:16novistso you people think its totally unrealistic to expect any fix for this?
16:39:38BlaXpiritnot totally
16:39:41BlaXpiritalmost
16:39:57renesacI hope an ..< operator is realistic...
16:40:16novistthat i can define myself, its not a fix though
16:40:30TEttinger,,
16:40:40novistfix would be 1-based+inclusive or 0-based+non-inclusive
16:41:00renesac..< is non-inclusive, plus the 0 based of the language
16:41:01renesacis a fix
16:41:12BlaXpiritsubstr says no
16:41:16renesacok
16:41:18EXetoCI still don't have a problem with the current behavior, but then again I don't care too much about what people are used to
16:41:23novistand slicing too
16:41:26BlaXpiritreturn values
16:41:33BlaXpiritreturn values are the worst
16:41:41BlaXpiritlike regex match - it returns a..b
16:41:44dom96Isn't Araq's fix good enough?
16:41:46BlaXpiritno
16:41:51dom96how much more time must we waste on this? :(
16:41:59*bcinman quit (Quit: My Mac has gone to sleep. ZZZzzz…)
16:42:02Guest81738:(
16:42:16BlaXpiritwhenever someone comes really caring about the language, time will be wasted, forever, unless it is fixed
16:42:26renesacdom96: araq fix for "for" didn't fix it for integers
16:42:35renesacint integers
16:42:39dom96renesac: huh?
16:42:43dom96what fix for "for"?
16:42:43renesacI must open a new issue because he closed the last one
16:43:31*EXetoC quit (Quit: WeeChat 1.1.1)
16:44:32renesachttps://github.com/Araq/Nim/issues/148
16:44:33renesacthis one
16:48:17renesachum, ok, now trying:
16:48:21renesacfor i in int.high - 1 .. int.high:
16:48:21renesac echo i
16:48:33renesacfails with an overflow error, instead of an infinite loop
16:50:34renesacbut with uint64 it is still an infinite loop
16:51:09renesacand there goes one of the advantages of inclusve ranges: being able to easily loop to the highest value
16:51:15renesacwell, now it works for smaller types, at least
16:52:07renesacuh, for uint32 it also gives an infinite loop
16:52:29Guest81738it has been like that for 3 year now?
16:52:31renesachttps://github.com/Araq/Nim/issues/1008 <-- this needs to be reopened
16:53:33renesaccan you do that for me dom96?
16:53:57dom96can't you reopen it? It's your issue?
16:54:05renesaclet's see
16:54:32BlaXpiritdid i really just implement this thing without any mistakes
16:54:40renesacnope, I can't open it
16:55:27dom96ok, I reopened it
17:00:05Joe-Twot that code doesn't even compile for me
17:01:38Joe-TI don't have any proc `-` for uints in system.nim
17:02:49renesacJoe-T: import unsigned
17:02:56Joe-Tohh thanks lol
17:02:56renesac:P
17:03:41BlaXpiriti can't believe it. i wrote a really complicated piece of code and it worked first try
17:03:49BlaXpiritwriting test after test and none fail
17:04:16Guest81738maybe the compiler is broken
17:04:24Joe-Tyeah I was surprised by how much I could first try write code taht compiles with nim, without even knowing the language
17:04:37dhasenanGuest81738: wouldn't be surprised.
17:04:38Joe-Twhat does the infinite loop do?
17:04:43Joe-TI'm still counting up in the
17:04:51Joe-Tlike 160 millions or something
17:05:18Joe-Toh it wraps around
17:05:27Joe-Tok this is gonna take a while..
17:06:16BlaXpirit:>
17:06:22BlaXpiritkill it with fire
17:07:38*irrequietus quit ()
17:07:44BlaXpiritlol novist will be so happy to hear thi
17:08:06BlaXpiritthese loops with inclusive indices don't work because they are implemented with a noninclusive index
17:08:06novistwha?
17:08:08*gever-gever quit (Remote host closed the connection)
17:08:21BlaXpiritkinda..
17:08:30BlaXpiritnot really
17:08:30novistseeeeee!!! :)
17:09:13BlaXpiritthis is what i meant. https://github.com/Araq/Nim/issues/148#issuecomment-6693883
17:09:52novistlots of gotchas to watch out for..
17:11:48*HakanD___ quit (Quit: Be back later ...)
17:12:51*irrequietus joined #nim
17:13:02Joe-Twhy am I running this code with echo in the loop, going to make it take so much longer lol
17:15:08BlaXpiritforever*100?
17:15:59Guest81738when reading a char from windows's terminal i get the char 224 after pressing a key, is this normal?
17:16:51*pregress_ quit (Remote host closed the connection)
17:16:53BlaXpiritprobably not. elaborate.
17:16:56*endragor quit (Ping timeout: 240 seconds)
17:17:08BlaXpiritare you writing in your language?
17:17:16BlaXpiritand by that i mean non-english language?
17:17:35BlaXpiritand by that I mean non-ASCII characters
17:17:38Guest81738i'm using conio.h getch, and when i press any arrow key, it gets both the arrow pressed and that strange char
17:18:12Guest81738with nim, language agnostic
17:18:15*bluenote10 quit (Quit: Page closed)
17:18:19BlaXpiritbleh
17:18:27BlaXpiritdo it in C, gonna get the same result
17:18:35Guest81738Yeah, i guess.
17:19:36BlaXpiritGuest81738, "When reading a function key or an arrow key, each function must be called twice; the first call returns 0 or 0xE0, and the second call returns the actual key code."
17:19:53BlaXpiritthat's your 224. RTFM :p
17:19:58Joe-TI was runing it for like 15 mins, didn't reach the wraparound, took out the echo and it wrapped around almost instantly
17:20:15BlaXpiritJoe-T, you took the joke far enough :|
17:20:28Joe-Tlol
17:20:38Guest81738wow, how did you find that?
17:20:42flaviuJoe-T: Well, that's the difference between a hundred instructions and a lock and a branch + increment.
17:20:57BlaXpirithttp://google.com/#q=winapi+arrow+keys+getch
17:20:59Joe-Tyeah and system calls
17:21:04Joe-Tfor each echo
17:21:34Joe-Tbut that's what the code in the issue did lol
17:22:08Guest81738my google-fu needs more leveling
17:22:20Guest81738thank you based BlaXpirit
17:33:54*HakanD___ joined #nim
17:38:15*egrep joined #nim
17:39:59*TEttinger quit (Ping timeout: 276 seconds)
17:41:15*endragor joined #nim
17:48:49onionhammerdom96 you should change the topic URL slightly every time someone posts something on the forum so new posts mark links unread
17:49:02onionhammerjust add a &t={lastposttime}
17:49:39dom96ooh cool idea
17:49:53dom96create an issue for this please
17:50:57renesacJoe-T: the code with echo wrapps around immediatedly
17:51:03*filwit quit (Quit: Leaving)
17:51:05renesacotherwise you wouldn't be seeing those low numbers
17:51:28onionhammerdone
17:51:55dhasenanIf I don't report at least two compiler bugs in a day, it feels like I'm not getting any work done.
17:52:10renesacisn't better to just add a "see new posts" button on the side of the topic title?
17:52:40renesacwhen there are new posts since your last visit?
17:52:44renesacusing cookies?
17:55:18onionhammerrenesac that would be nice, but it would be a lot more effort
17:55:34onionhammerinvolving db queries and storing each users last visit to each thread
17:58:13Joe-Toh yeah lol, what was I thinking, it was only counting from 100 less than max
17:59:07Joe-TError: type mismatch: got (uint8, Operand:ObjectType) but expected one of: utils.isFlagSet(f: uint8, mask: uint8)
17:59:08Joe-Twat
17:59:44renesacwhat line you gave it?
17:59:57Joe-Thttps://github.com/Araq/Nim/issues/2518
18:00:14Joe-T+ not cpu.f.isFlagSet(`operand.flagMask`)
18:00:35Guest81738how can i run a console command in nim (like ls, or rm)
18:00:58def-Guest81738: osproc module
18:01:03Joe-Thttp://nim-lang.org/osproc.html
18:01:19renesacGuest67437: os module is probably a better fit for what you want
18:01:21dom96Joe-T: Are you trying to get my gbemulator running?
18:01:26Guest81738Thanks, you both were fast
18:01:31Joe-Tyeah lol
18:01:39renesacyou don't want to call shell operations by string
18:01:40Guest81738os? i'll check it now
18:02:16dom96Joe-T: It barely works :P
18:02:27renesachttp://nim-lang.org/os.html
18:03:06renesacif you want to call a program, use osproc
18:03:11Guest81738ok thanks, is string concat done with + ?
18:03:19dom96Guest81738: &
18:03:25Guest81738I just wanted to invoke mode command in win
18:03:29Guest81738thanks dom96
18:06:18Joe-Thmm quotes don't seem to like:
18:06:24Joe-Tobj.intVar
18:06:35Joe-Tyou have to do like var intVar = obj.intVar first
18:07:09dom96Joe-T: what are you trying to do?
18:07:12*HakanD___ quit (Quit: Be back later ...)
18:07:31Joe-TI was using it as a test script for uint stuff
18:10:08Joe-Twat it compiles now
18:24:09*HakanD___ joined #nim
18:25:32*endragor quit (Remote host closed the connection)
18:27:51*Matthias247 joined #nim
18:28:37pigmejreactormonk: ping
18:36:30Joe-Thmm, like 170, pragmas.nim
18:36:32Joe-Tline*
18:36:45Joe-TexpectIntLit
18:36:59Joe-Tof nkIntLit..nkInt64Lit: result = int(n.sons[1].intVal)
18:37:15Joe-Tthat method can't deal with UInt then can it?
18:37:31Joe-TUInt64 can't be cast to int?
18:43:23*wink-s joined #nim
18:46:18Joe-Thmm BiggestInt is int64
18:47:48renesachttp://nim-lang.org/manual.html#ordinal-types
18:54:30BlaXpiritis it possible to turn the expression that a template got into string?
18:54:57BlaXpirittpl(blah) - i'd like to get "blah"
18:55:21Joe-Tso atm unsigned ints can't be compared to signed?
18:55:54renesacJoe-T: yeah
18:56:15BlaXpiritimport unsigned
18:56:15renesacBlaXpirit: I think I saw some debug thing
18:56:23BlaXpiritrenesac, that might be macro
18:56:25renesacBlaXpirit: even with import unsigned
18:56:45BlaXpiritrenesac, good tip
18:56:54Joe-Tyeah it's T: SomeUnsignedInt
18:56:55BlaXpiriti distinctly remember the words "powerful debug macro" in some tutorial or manual
18:57:04Joe-T== in unsigned only compares unsigned
18:57:39BlaXpiritdon't use unsigned lol
18:57:51BlaXpiritAraq pushes it too hard
18:58:38renesacunsigneds are often the best tool for the job
18:58:53renesacyou even have "byte" defined by default
18:58:57renesacto uint8
18:59:04renesacIIRC
18:59:09*pigmej gosh, I really hate elisp
18:59:32renesacyep
18:59:59renesacvar b:byte = 5 # the only line here that works.
19:00:00renesac var y:int = b + 2 # Error: type mismatch: got (Byte) but expected 'int'
19:02:59*Pokon joined #nim
19:03:15*bcinman joined #nim
19:03:16*onionhammer quit (Ping timeout: 244 seconds)
19:04:14Guest81738behold! new roguelike incoming http://i.imgur.com/h2V0o7c.gif
19:04:35Guest81738100% nimrod
19:04:53renesac*nim
19:05:01Guest81738& rod
19:06:10*banister joined #nim
19:06:43renesacnim should have changed name again to 'rod' 12 days ago
19:07:15Pokony'all are confusing with the name changes
19:07:30renesacPokon: ?
19:08:18Pokonit's just nim now, right? no rod?
19:09:27Guest81738whenever i want to compile something i have to write: rod c file.rod
19:09:57ggVGcactually, it's now called rimscript
19:09:57renesacPokon: yes, just nim
19:10:18renesacGuest81738 that is weird
19:12:55*Varriount_ joined #nim
19:13:08*bcinman quit (Quit: My Mac has gone to sleep. ZZZzzz…)
19:13:43*Varriount quit (Ping timeout: 252 seconds)
19:23:54tmkuGuest81738: pdcurses?
19:32:08a5idoes Ruby support more aspects of functional programming than JS ?
19:32:53a5isorry, wrong chat room...
19:33:07Araq_a5i: I can answer anyway: no.
19:33:30a5iAraq: what about vice versa ?
19:34:08*user7181_ joined #nim
19:34:34Araq_the question makes not much sense. both are imperative dynamically typed languages with first class functions, well in Ruby's case it's blocks instead
19:36:32Araq_both are in reality quite far away from FP when you consider that the major point of FP is its additional *constraints* and not map and filter
19:36:47*user7181 quit (Ping timeout: 264 seconds)
19:36:55*Araq_ is now known as Araq
19:37:13a5iI see
19:37:16BlaXpiritAraq, could you read our discussion about seq being a pointer?
19:37:43AraqBlaXpirit: I skimmed it. what's the concrete question?
19:37:57BlaXpiritwhy is seq implemented as a pointer?
19:38:04Araqwhy not?
19:38:14BlaXpiritbecause it's an indirection
19:38:19BlaXpiritperformance hit adds up
19:38:36Araqas opposed to what alternative?
19:39:02BlaXpiritlike i said, seq is implemented as pointer to {length, reserved, pointer to data}
19:39:10BlaXpiritthe alternative is {length, reserved, pointer to data}
19:39:17Araqwell you said that, but it's wrong
19:39:31*anthony joined #nim
19:39:47BlaXpiritwhat is wrong?
19:39:51Araqit's pointer to {length, reserved, data[0], data[1], ...}
19:39:54*anthony is now known as Guest49234
19:40:07BlaXpiritoh really
19:40:41Araqyes.
19:40:51BlaXpiriti don't think that's true
19:41:36BlaXpiritvar a: seq[int] = @[]; var p = cast[ptr int](a); echo cast[int](p.offset(2))
19:41:37*Guest49234 quit (Max SendQ exceeded)
19:41:44BlaXpiritoutput is 140613933871200
19:42:21BlaXpirit(offset is part of fowltek.pointer_arithm, advances pointer by 2*sizeof)
19:43:01a5iAraq: But Ruby has lambdas
19:43:02BlaXpiritwait, that doesn't necessarily prove it. but same thing if the seq is not empty
19:43:17Araqso? do you think I don't know how seqs are implemented?
19:43:27Guest81738tmku: nop, windows module
19:43:31BlaXpiritapparently yes
19:43:58BlaXpiritlet me just check again... maybe i'm a complete dummy
19:44:18BlaXpirityes, it appears so
19:44:45BlaXpiritecho((length: p[], capacity: p.offset(1)[], data: p.offset(2)[])) (length: 2, capacity: 2, data: 123)
19:45:10Guest81738i have to go, thanks for your help nimroders.
19:45:12*Guest81738 quit (Quit: Page closed)
19:45:25*MagusOTB joined #nim
19:45:31BlaXpiritthx for the reply. now it all makes sense
19:46:04Araqa5i: eine Schwalbe macht noch keinen Sommer.
19:46:32a5ibrb translating
19:47:04a5i"one swallow does not make a summer"
19:48:09Pokonis there a destructor-like function defined when compiling with --app:lib?
19:48:56a5iAraq, you dont think Ruby has lambdas ?
19:49:00AraqPokon: I don't think so
19:49:21Araqa5i: I don't think "lambdas" are the essence of functional programming
19:49:30a5iOh
19:49:57a5ibut haskell's logo is a lambda !
19:50:07BlaXpiritlol
19:50:08flaviuAraq: What is the essence of functional programming then?
19:50:09PokonAraq: ok thanks. couldn't find anything and wasn't sure if i was overlooking it
19:50:13a5iclearly Ruby has more functional aspects then !
19:50:25a5i</jokin>
19:51:20Araqflaviu: additional constraints in the form of static typing and functions that don't have side effects
19:51:38Araqimmutable data structures
19:52:28*UberLambda joined #nim
19:54:46BlaXpiritis it possible to make a macro work for only one type, but still get the passed expression as a tree?
19:55:09AraqBlaXpirit: macros always get trees anyway
19:58:03BlaXpiritimport macros;macro test(a: int): expr =; dumpLisp(a); 6;discard test(1+2)
19:58:28BlaXpiritoutput: Ident(!"a")
19:58:41*Kingsquee joined #nim
20:01:10*Trustable quit (Remote host closed the connection)
20:04:27Araqdon't dump*
20:04:40Araqthese are .immediate and so dump too early
20:05:26Araqecho repr like the rest of us :P
20:05:52BlaXpiritaha. thanks.
20:06:36*bcinman joined #nim
20:16:16*bcinman quit (Quit: My Mac has gone to sleep. ZZZzzz…)
20:17:46*pregressive joined #nim
20:17:52BlaXpirithow to do bool literal in macros? :o
20:18:32BlaXpirithow to call a proc with a boolean argument inside a macro?
20:19:31AraqbindSym"true" ?
20:19:45AraqbindSym"false" ?
20:20:03BlaXpiritwell what if it is in a variable?
20:20:15BlaXpiritvar x: bool
20:20:25BlaXpiritnewCall(..., bindSym"x") is what i tried
20:20:47BlaXpiritfor others I just did newLit(x)
20:20:55BlaXpiritbut no such thing for bool
20:22:15*pregressive quit (Ping timeout: 265 seconds)
20:25:44Joe-Tam I right in saying you can't have sets containing uints and uint64s?
20:27:01BlaXpiritprobably
20:27:02AraqJoe-T: sets only work for 0..0xffff anyway iirc
20:27:05renesacI don't think you can have sets containing ints either
20:27:07def-Joe-T: there are two kinds of sets, see the sets module
20:27:08renesacyeah
20:27:52AraqBlaXpirit: yeah I should add that :P
20:27:58Joe-Tit says it has to be an ordinal type
20:28:15Joe-Toh or is that because
20:28:27Joe-TI specified values in {....}, which
20:28:30BlaXpiritfor now i suppose bindSym($x) might work??
20:28:35Joe-Trequires ordinal types to do ranges
20:29:12*bcinman joined #nim
20:29:57Joe-Tah no, let s: set[uint] says it too
20:30:16*bcinman quit (Client Quit)
20:30:20BlaXpiritbindSym gives me bool | proc (...)
20:30:37Joe-Tin repr.nim, addSeElem
20:30:40Joe-Tat it's
20:30:40BlaXpiriti'm doing something so wrong
20:30:56Joe-Tof tyInt..tyInt64: add result, reprInt(elem)
20:31:14MagusOTBis it possible to make a generic that takes only primitive types?
20:31:32Joe-Twould: of tyInt..tyInt64, tyUInt8..tyUInt32: add result, reprInt(elem) be ok?
20:32:03renesac[17:27:42] <Araq> Joe-T: sets only work for 0..0xffff anyway iirc <-- and 0xffff don't works for numbers that set works, XD
20:32:27renesacjust filled a bug about this, but I've already complained about this earlier: https://github.com/Araq/Nim/issues/2539
20:36:34reactormonkpigmej, o/
20:39:05Joe-Tis this stuff in tpegs.nim?
20:39:30Joe-Tlike handleHexChar takes an int
20:40:15*bcinman joined #nim
20:45:04*jholland quit (Quit: Connection closed for inactivity)
20:45:43*Jehan_ joined #nim
20:51:59*TEttinger joined #nim
20:58:53*bcinman quit (Quit: My Mac has gone to sleep. ZZZzzz…)
21:06:14*bcinman joined #nim
21:14:44*UberLambda quit (Remote host closed the connection)
21:29:25*Matthias247 quit (Read error: Connection reset by peer)
21:48:30*bcinman quit (Quit: My Mac has gone to sleep. ZZZzzz…)
22:03:36renesacwell, I guess it can take an int64/uint64 and cast it to the appropriate result
22:04:41flaviu.eval let x = 0xFFFF_FFFF_FFFF_FFFFu64
22:04:42Mimbusflaviu: <no output>
22:04:47flaviurenesac: ^
22:05:49renesachumm
22:06:02renesacso it is supported some way
22:06:23flaviuIts shorter to use a postfix then to bother type out the type anyway.
22:06:51renesacyeah, but there is no reason why the way I typed shouldn't work too
22:07:12renesacI wonder if that code compiles on 32bit
22:07:30renesacif nim really uses an 'int' to store that value
22:07:33flaviurenesac: Agreed, but you can see why fixing that bug is not a high priority.
22:08:07renesacflaviu: the signed integer version is uglier
22:08:36flaviu.eval let x = int64(0xFFFF_FFFF_FFFF_FFFFu64)
22:08:37Mimbusflaviu: <no output>
22:09:30*vendethiel quit (Ping timeout: 256 seconds)
22:11:23renesachumm
22:11:37renesacit fails for literal though
22:12:09renesac.eval let x = int8(0xFF)
22:12:10Mimbusrenesac: eval.nim(3, 12) Error: conversion from int literal(255) to int8 is invalid
22:12:18renesac.eval let x = int8(0xFFu64)
22:12:20Mimbusrenesac: <no output>
22:12:25renesacthat is weird
22:12:35*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
22:12:48renesacthe second works
22:12:51renesacby the way
22:13:56flaviu.eval let x = int8(0xFFu8)
22:13:57Mimbusflaviu: <no output>
22:14:07renesacflaviu: I know tha
22:14:10renesac*that
22:14:37renesacI just finds it weird this conversion be allowed for normal types but not for literals
22:14:45renesac*find it
22:15:24renesacis this conversion defined anywhere in the documentation?
22:15:52flaviurenesac: Well, you're converting int literal 255 -> int8, there is a check. I think that all checks are disabled on uints.
22:16:37TEttinger.eval let x = int8(0x7F)
22:16:38MimbusTEttinger: <no output>
22:18:33renesachttp://nim-lang.org/manual.html#convertible-relation <-- this don't explains what we saw
22:20:28*vendethiel joined #nim
22:20:36renesacthe algorithm would return false for u64
22:21:04renesacthe isExplicitlyConvertible()
22:29:59Varriount_*this doesn't explain what we saw
22:30:05*Varriount_ is now known as Varriount
22:30:55renesacthis is a weak point in my english grammar
22:30:56renesac:P
22:31:19Varriountrenesac: Don't worry, at least you know more than one language.
22:31:47Varriountrenesac: Also, I'm sorry to say, most native english speakers would make the same mistake.
22:32:18renesacheh
22:32:27renesacmight become the right way in some decades
22:32:28renesac:P
22:37:02Jehan_The code is in handleRange() in compiler/sigmatch.nim
22:37:12Jehan_But I'm too tired right now to figure out what's going wrong there.
22:39:01renesacwell, I agree that it isn't high priority, but it will require a breaking backwards compatibility fix eventually
22:42:24*vendethiel quit (Ping timeout: 250 seconds)
22:51:54*wb quit (Read error: Connection reset by peer)
22:54:45*Jehan_ quit (Quit: Leaving)
23:02:25*user7181_ quit (Quit: leaving)
23:05:27*vendethiel joined #nim
23:21:04VarriountHm...
23:21:14VarriountThe windows core audio api is strange...
23:21:20VarriountIt seems to be C++
23:24:04*BlaXpirit quit (Quit: Quit Konversation)
23:24:39cazovis it a new api?
23:25:07cazovMS (probably due to herb sutter) has been pushing towards being more C++ with their newer stuff
23:26:35*vendethiel quit (Ping timeout: 246 seconds)
23:52:15*irrequietus quit ()
23:56:57Varriountcazov: https://msdn.microsoft.com/en-us/library/windows/desktop/dd370802%28v=vs.85%29.aspx
23:56:58*bcinman joined #nim
23:57:28VarriountIt's irritating, because C++ is so hard to wrap
23:57:34cazovyeah