<< 07-01-2015 >>

00:03:58*BitPuffin joined #nim
00:09:02*pdeuchler joined #nim
00:09:07*pdeuchler quit (Client Quit)
00:10:22ldleworkAraq: devel crashes my app
00:10:30ldleworkSIGSEGV: Illegal storage access. (Try to compile with -d:useSysAssert -d:useGcAssert for details.)
00:10:38ldleworkthis is the only output after the compilation hints, etc
00:10:49ldleworkAraq: its an SDL app that uses the graphics module, etc
00:11:05Araqldlework: last time I checked we had a bug tracker
00:11:31ldleworkSure just checking if you expect anything like that to be severely broken right now
00:11:40Araqand it's called "devel" for a reason
00:11:52ldleworkAraq: should I step backwards until I find a commit that works?
00:12:08ldleworkAraq: right, that's why I asked, to see if you knew something about devel that would obviously cause the issue
00:12:17ldlework"oh yeah we broke X for now"
00:12:20*fungos_ quit (Remote host closed the connection)
00:12:21Araqusually it's faster to just 'koch temp' it
00:12:29gmpreussnerugh... i can never figure out how to properly pull upstream changes without making a commit to my fork on github :(
00:12:45ldleworkgmpreussner: add a remote to your checkout that points to Araq's repo
00:12:50gmpreussneri did that
00:12:55ldleworkthen do
00:13:01ldleworkgit pull araq devel
00:13:03ldleworkor whatever
00:13:11ldleworkthat should just fast forward
00:13:11gmpreussnerdid that, too
00:13:14gmpreussneryep
00:13:18ldleworkwhere does the commit come into play?
00:13:20gmpreussnerhow to push it back up to github then?
00:13:30gmpreussnerat that point i have the changes only locally
00:13:37gmpreussneri want to push them to my github fork online
00:13:44ldleworkgmpreussner: with your own changes?
00:13:46ldleworkontop?
00:13:54gmpreussnerwell, yeah, although i don't have any local changes of my own
00:14:13gmpreussneri basically want to bring both local and github to HEAD
00:14:15ldleworkthen just pushing to your fork should work
00:14:30gmpreussnerit does perform the push
00:14:35ldleworkif you didn't add any commits, etc
00:14:42ldlework(I mean it should work even if you did)
00:14:42gmpreussnerbut then on the website it says that i'm X commits ahead of Araq.nim
00:15:02gmpreussnerlike right now i'm 2 commits ahead, even though there are no changes
00:15:05ldleworkgmpreussner: those are just the commits you've added that haven't been submitted back to his fork
00:15:16gmpreussnerbut the commits are empty :)
00:15:21gmpreussnerthat's what i'm saying
00:15:29gmpreussnerif i create a PR, there's nothing in it
00:15:37gmpreussnernext time i do a real PR, they will go away
00:15:52ldleworkgmpreussner: right force pushing to your repo
00:15:57ldleworks/right/try
00:16:07gmpreussnerok
00:17:01gmpreussnerAraq: by the way, i tried this: "Try to compile with -d:useSysAssert -d:useGcAssert for details"
00:17:05gmpreussnertakes five days to compile
00:17:14gmpreussnerand the resulting compiler is slow as molasses
00:17:27ldleworkheh woops
00:17:34ldleworkI've been passing those to "nim c"
00:17:42ldlework"huh wow these don't do shit"
00:17:42willwillsonisnt that what you are supposed to do?
00:17:47Araqyeah, that is a typical "last commit before release"
00:19:06Araqin retrospect it was a bad idea to add that just to teach dom96 how to debug coredumps ...
00:19:25ldleworklol
00:19:50Araqthe old message was much more useful for everybody else ...
00:20:00ldleworkwhat was it
00:20:11Araq(attempt to read from nil?)
00:23:18*hasenj joined #nim
00:23:53dom96Araq: The message should show both things.
00:24:19gokrIdiotic question: If I have a "proc foo[T](self: Bar): T" I can call it like "foo[Bar](b)" but not like "b.foo[Bar]()". So ... the dot call doesn't fly with generic procs/methods?
00:24:35dom96Araq: Also nobody can remember it.
00:24:37Araqgokr yes.
00:24:48gokr"yes" as "it doesn't fly"?
00:25:07gokrIt seems to start thinking I am doing [] access or something.
00:25:30Araqdom96: the asserts are not useful for newcomers at all
00:26:01dom96Araq: Then why did *you* suggest adding that message?
00:26:16gmpreussnerbrb
00:26:18Araqgokr. yes. known gotcha. we can fix it but I don't like it
00:26:24*gmpreussner quit (Quit: Konversation terminated!)
00:26:27*saltylicorice joined #nim
00:26:57gokrAraq: I also discovered that its hard to define abstract methods using generics like that.
00:27:09AraqI'd rather introduce [. .] for disambiguation between array access and generics
00:27:19ldleworko.o
00:28:13reactormonkAraq, starting to run out of syntax?
00:28:44Triplefox(' . ')
00:28:50*gmpreussner joined #nim
00:28:56Araqgokr: yes, but subtyping with generics sucks anyway IMO
00:28:58gokrIf I have say a method foo (like described above - returning a T), and add an abstract such method in the superclass (using say discard or something as body) - then... when calling it on a thingy of the superclass type, it will complain that it can't infer the return type (although it clearly is declared as T).
00:29:52reactormonkgokr, code please
00:29:56gokrI agree that I would ... probably not design it like this - but I am porting PP and its an interesting exercise in finding corner cases.
00:30:03reactormonkPP?
00:30:07gokrPetitParser
00:30:31ldleworkI'd rather have <> for generics if collision with array access is a problem
00:30:48Araqldlework: that's worse though
00:31:05ldleworkAraq: asethetically, or in terms of collisions/ambiguities
00:31:17gokrreactormonk: I gotta hit the sack, I can come back to it
00:31:25reactormonkgokr, nope, now or never!
00:31:32gokrhehe
00:32:20Araqldlework: it requires arbitrary lookahead in the parser
00:32:39Araqand that seems to be the *easiest* way to implement it
00:32:47reactormonkAraq, § already used? ^^
00:32:53reactormonkor °
00:33:14Araqreactormonk: no, but the language already has [. .] as tokens
00:33:21Araqand (. .)
00:33:38Araqpragmas use {. .} for a reason
00:33:48*saltylicorice quit (Quit: leaving)
00:34:14reactormonkAraq, so now we get the bro-operator with [. .]?
00:34:35Triplefox(. .);;
00:35:02reactormonkor maybe robot-operator?
00:35:27TriplefoxThey are all cute tokens. Make nim the cutest language
00:37:19reactormonkLet's see how long til the first JANH comes out
00:37:45reactormonkAraq, so dots for compile-time operations?
00:38:42Araqreactormonk: no, (. .) [. .] {. .} because () [] {} doesn't cut it for any modern statically typed language
00:40:27reactormonkAraq, dot-flavoured operators, if you wanna say so. And how come three parens aren't enough?
00:40:30*vendethiel- joined #nim
00:40:37*vendethiel quit (Ping timeout: 244 seconds)
00:40:47*Etheco- quit (Read error: Connection reset by peer)
00:41:11*Etheco joined #nim
00:46:13*Sphax joined #nim
00:46:46*Sergio965 joined #nim
01:06:01ldleworkI do think it would be novel if dots signified compile-time operations
01:06:13ldleworksince we have so much compile-time stuff in the language
01:12:59areckizbhello, is there a pretty-print procedure in nim for printing tables, other than the standard $ ?
01:13:45reactormonkareckizb, if there's nothing in the docs, probably not
01:16:27flaviuareckizb: If you haven't come across it yet, http://nim-lang.org/theindex.html is fairly useful
01:18:04*Sergio965 quit (Ping timeout: 264 seconds)
01:20:51flaviugmpreussner: ping: https://gist.github.com/flaviut/0bfeca0cf9bc5fe53a51
01:21:38flaviugmpreussner: although you probably only care about the last bullet.
01:22:52*askatasuna joined #nim
01:24:09willwillsonareckizb: repr
01:25:17*askatasuna quit (Client Quit)
01:27:57gmpreussnerflaviu: thanks! i think --force will make the difference. i'll try it next time
01:32:28*VinceAddons quit (Read error: Connection reset by peer)
01:32:52Araqdef-: meh, the 'm' prefix was picked after some thought
01:33:29Araqas it can stand for "I intend to *m*odify it" or "mutable"
01:34:52*vendethiel- quit (Ping timeout: 245 seconds)
01:35:05*vendethiel joined #nim
01:38:34*yglukhov_____ quit (Quit: Be back later ...)
01:40:12Araqgood night
01:42:38*yglukhov_____ joined #nim
01:43:03*JinShil joined #nim
01:45:53*Sphax quit (Quit: CYA!!)
01:46:54*yglukhov_____ quit (Ping timeout: 245 seconds)
01:47:39*adam_s quit (Quit: Leaving)
01:55:35JinShilFirst time user of Nim here. Hello.
01:55:53JinShilI'm trying to do some experiments to obtain a small binary on Linux
01:56:02flaviuHi JinShil, welcome.
01:57:01*z1y joined #nim
01:57:12JinShilI'm compiling with --opt:speed --deadcodeElim:on but the binary is still 95K.
01:57:31JinShilequivalent C code is only 6K.
01:57:36JinShilWhat am I missing?
01:57:55flaviutry -d:release
01:58:04flaviuthat turns off stack traces, which are quite big.
01:58:47JinShilBetter. But still 58K.
01:59:04flaviuJinShil: Also, please post your code. I'd like to try it myself I can iterate faster.
01:59:12JinShilecho "Hello"
01:59:14JinShilthat's it.
01:59:17JinShilLove it.
02:04:25dtscodeJinShil, there are quite a few compile time checks done
02:04:31dtscodeoops
02:04:35dtscoderun time checks doen
02:04:41dtscodeor at least, there are switches for them
02:07:15flaviudtscode: Nope. Turning all checks off doesn't make a huge difference
02:07:47dtscodei will be quiet then
02:08:15*BitPuffin quit (Ping timeout: 244 seconds)
02:09:35JinShilThanks faviu and dtscode. I guess I'll try to analyze the generated C code and see what I can find.
02:13:14flaviuJinShil: Ok: https://gist.github.com/flaviut/0c3c0feae6b0b609cffd
02:13:30flaviuI got it down to 12976 bytes
02:16:13JinShilnot bad.
02:16:17flaviu11024 bytes!
02:16:36flaviuIt's hardly usable at that point though.
02:17:02JinShilhow so? It prints "Hello" doesn't it?
02:17:30flaviuYes, but you have to do manual memory management and most the runtime is missing.
02:18:19JinShilThat's ok. The reason I'm researching this is I want to try to use nim on a bare-metal resource constrained platform. So I'm ok doing all the low level stuff.
02:18:50flaviuhttps://github.com/dom96/nimkernel/ might come in useful as an example.
02:19:38JinShilThanks.
02:20:54*gsingh93 quit (Quit: Connection closed for inactivity)
02:30:14JinShilflaviu, what is the command-line switch for osstandalone?
02:30:28flaviu--os:standalone
02:30:39flaviunim c -d:release --gc:none --os:standalone --stacktrace:off ./small.nim; strip small; wc -c small
02:31:59JinShilThank you.
02:32:14dtscodeyour welcome
02:33:47flaviuNo problem, but I unfortunately need to sleep now :(
02:34:20JinShilgoodnight!
02:38:01*areckizb quit (Ping timeout: 246 seconds)
03:07:19*EXetoC quit (Ping timeout: 245 seconds)
03:09:12*areckizb joined #nim
03:20:19*brson quit (Quit: leaving)
03:31:29*yglukhov_____ joined #nim
03:34:23*vendethiel quit (Ping timeout: 240 seconds)
03:34:47*darkf joined #nim
03:36:03*yglukhov_____ quit (Ping timeout: 264 seconds)
03:48:07*hasenj quit (Quit: hasenj)
03:50:37*AMorpork is now known as ZzZMorpork
03:58:01dtscodeas someone who is a noob with character sets, whats the difference between unicode and decode?
04:04:45*z1y quit (Remote host closed the connection)
04:05:33*z1y joined #nim
04:31:59*kapil__ joined #nim
04:32:05*johnsoft quit (Ping timeout: 244 seconds)
04:32:58*johnsoft joined #nim
04:33:21*Sergio965 joined #nim
04:38:49*jefus_ joined #nim
04:40:01*willwillson quit (Ping timeout: 255 seconds)
04:42:53*jefus quit (Ping timeout: 265 seconds)
04:54:29*Demon_Fox quit (Ping timeout: 265 seconds)
04:55:16*Demon_Fox joined #nim
05:04:26*z1y quit (Ping timeout: 264 seconds)
05:05:01*z1y joined #nim
05:14:01*z1y quit (Remote host closed the connection)
05:14:18*adam_s joined #nim
05:14:47*z1y joined #nim
05:20:21*yglukhov_____ joined #nim
05:24:27*yglukhov_____ quit (Ping timeout: 245 seconds)
05:28:42Varriountdtscode: You still there?
05:28:56dtscodemaybe. whos asking?
05:29:18Varriountdtscode: Are you talking about unicode in general?
05:29:32dtscodesure
05:29:40dtscodei really wouldnt know the differnece
05:30:59Varriountdtscode: Unicode is a standard, decoding is an action.
05:31:10Varriountdtscode: This is a good article on it: http://www.joelonsoftware.com/articles/Unicode.html
05:31:17dtscodeok. thank you!
05:31:30*brson joined #nim
05:39:05*dyu joined #nim
05:40:01*yglukhov_____ joined #nim
05:41:57*Sergio965 quit (Ping timeout: 245 seconds)
05:44:45*yglukhov_____ quit (Ping timeout: 265 seconds)
06:01:10*Demon_Fox quit (Quit: Leaving)
06:01:14*z1y quit (Remote host closed the connection)
06:01:56*z1y joined #nim
06:06:32*kniteli quit (Ping timeout: 245 seconds)
06:21:14*z1y quit (Remote host closed the connection)
06:22:08*z1y joined #nim
06:29:36*Demon_Fox joined #nim
06:51:33*kapil__ quit (Quit: Connection closed for inactivity)
06:57:46*kapil__ joined #nim
06:58:34reactormonkHow do I slice of the first character off a string? Via substr?
06:58:43*khmm joined #nim
07:01:14*z1y quit (Remote host closed the connection)
07:01:29*khmm quit (Remote host closed the connection)
07:01:41*khmm joined #nim
07:02:24*z1y joined #nim
07:07:40*infrashortfoo joined #nim
07:10:17dv-i guess so.
07:10:22dv-"hello".substr 1
07:11:55*adam_s quit (Quit: Leaving)
07:15:20dtscodereactormonk, are you familiar with perl shift?
07:16:11dtscodeproc shift[T](input: var seq[T]): T = result = input[0]; delete(input, 0)
07:16:47dtscodeproc shift(input: var string): char = result = input[0]; delete(input, 0, 0)
07:17:58*Demon_Fox quit (Quit: Leaving)
07:18:55Varriountdtscode: Hrm.. how fast is that?
07:19:28Varriountdtscode: I mean, in Nim, doing that moves the entire string left in memory
07:19:54dtscodewell ive used it in nimbus, and it works pretty fast for me
07:19:58dtscodeill show you
07:20:31Varriountdtscode: Well, just be aware that the complexity is O(n)
07:20:32*Nimbus joined #nim
07:20:56dtscodewhile i agree that it could be better than O(n), it could be worse
07:21:05*Demon_Fox joined #nim
07:21:11dtscodeexecute order66()
07:21:11Nimbusdtscode: Killing all jedi...
07:21:12Nimbusdtscode: done.
07:21:16VarriountHello Demon_Fox!
07:21:43Demon_Foxhi
07:22:35dtscode~2 seconds to shift, compile, grab output, split output into a seq, test its length, and send each line of the seq to the server
07:22:38*nickles joined #nim
07:22:47*saml quit (Ping timeout: 245 seconds)
07:23:09Demon_FoxBy chance, does nim have classes?
07:23:32VarriountDemon_Fox: You mean, java/python-like classes?
07:23:36dtscodei dont know if you can call them classes
07:23:42dtscodesince there is no self/this
07:23:50reactormonkDemon_Fox, they're less classes, more like data containers.
07:23:58dtscodeits more like a c struct than anything
07:24:03Demon_FoxI was thinking on the lines of
07:24:19Demon_FoxSets of functions meant to operate on certain structures
07:24:26Demon_FoxLike this:
07:24:31reactormonkI have two vars of type array[0..2, int] - how would you take the dot product?
07:24:40Demon_Foxstructure.function_specifically_for_this();
07:24:55dtscodeDemon_Fox, so heres how you do that:
07:24:57Demon_FoxWhere any structure of a different type can use that
07:25:08Demon_Foxuse that name, that is
07:25:10VarriountDemon_Fox: Nim's procedure calling syntax allows that will all procedures.
07:25:16dtscode^
07:25:19dtscodethe UFI
07:25:20reactormonkDemon_Fox, we have unified function called syntax, aka structure.function_specifically_for_this() is equivalent to function_specifically_for_this(structure)
07:25:36reactormonkand please get those unseamingly ; out of here
07:25:58*Varriount gets the broom and sweeps the ';' away
07:26:03dtscodeso if i have a string class for some reason, "foo".print() and print("foo") are the same
07:26:03Demon_FoxWill it use the structure specifically for that type?
07:26:04reactormonkthank you :-)
07:26:14VarriountDemon_Fox: Yep
07:26:22*dtscode starts throwing ;'s at reactormonk, the heathen
07:26:24Demon_FoxI wish C had that feature
07:26:36*reactormonk regrets dropping op for this channel
07:26:39dtscodethat fucks up the abi though
07:26:44Demon_FoxIt would stop names from getting really ugly
07:26:48Varriountdtscode: Howso?
07:27:00Demon_FoxBy the way
07:27:12dtscodeVarriount, am i wrong? its late and i have no beer in me, so i could be wrong
07:27:25reactormonkdtscode, nah, syntax doesn't mess with ABI
07:27:27Demon_FoxDoes nim have name spaces?
07:27:37dtscodereactormonk, ah ok
07:27:38VarriountDemon_Fox: Not in the way C++ has them.
07:27:39reactormonkDemon_Fox, kinda. a file is a name space.
07:27:42Demon_Foxfor libs or modules or wtf they are called
07:27:55dtscodeDemon_Fox, think of the module as the namespace
07:28:02reactormonkthere's no nested namespace.
07:28:13Varriount(yet)
07:28:13Demon_Foxmod.function()
07:28:20dtscodetheres nested modules though :}
07:28:29Varriountdtscode: Huh?
07:28:29reactormonkdtscode, like?
07:28:30*saml joined #nim
07:28:53dtscodeinclude some_other_nim_file # this goes in the module youre importing
07:29:12VarriountDemon_Fox: Also, you can import using file paths.
07:29:25Demon_Foxintersting
07:29:28Demon_Foxinteresting*
07:30:17*dtscode goes back to rewriting Nimbus
07:30:28reactormonkAnd we have partial case sensitivity, aka Int and int are two different identifiers, but Int and INT are the same
07:30:47Demon_Foxok
07:30:49reactormonkSounds wierd, but it's really helpful with e.g. parseURL vs. parseUrl
07:30:58VarriountTo clarify: The first letter of an identifier is case sensitive.
07:30:59Demon_FoxSo, on that name space question
07:31:07reactormonkkinda
07:31:07Demon_FoxHow does it affect function names?
07:31:11JinShilDemon_Fox, I'm new to Nim. Just wrote my first program today. But I found this useful in my study to see how Nim approaches OOP: http://nim-by-example.github.io/oop/
07:31:15reactormonkDemon_Fox, no prefixes.
07:31:26dtscodeby default
07:31:42VarriountUnless you need to specify a specific procedure to remove ambiguity
07:31:49dtscodefrom module import nil requires you to prefix with the module name iirc
07:32:06reactormonkdtscode, well, I'm talking about no prefixes for function names like e.g. in elisp
07:34:35Demon_FoxI kind of wonder
07:34:44Demon_FoxIs there a nim compiler written in nim?
07:34:54VarriountDemon_Fox: Uh, that's what we have.
07:35:15dtscodei think thats all we have
07:35:19VarriountTechnically it's a transpiler, converting Nim to C, but that's close enough.
07:35:31Demon_Foxoh
07:35:33dtscodeunless the nim -> executable compiler was finished
07:35:38Demon_FoxI was going to say:
07:35:44Demon_FoxWhat came first, the goose of the egg?
07:35:55Demon_Foxoops, I really messed that up
07:36:01Demon_FoxThe chicken or the egg.
07:36:11dtscodei think it was first written in pascal, and then they bootstrapped it in nim
07:36:17Varriount^
07:36:55*dtscode still doesnt know what the c sources do
07:37:09VarriountDemon_Fox: Also, something to remember - avoid using inheritance with non-ref types
07:38:12Varriountdtscode: Technically it isn't needed, if you already have access to a Nim binary built for your system.
07:38:26dtscodeoh duh
07:38:47dtscodeis koch written in c?
07:38:51reactormonkwhat's the semantics for cmp in sort again? if x is bigger than y, should the int be positive or negative?
07:38:53Varriountdtscode: Nope.
07:39:10dtscodeguess im still a bit confused on it then. ill figure it out in the morning
07:39:20reactormonkdtscode, nah, it's bootstrapping code, because you need something to compile your first nim compiler
07:39:36dtscodehmmmm
07:39:46reactormonkAnd instead of shipping a binary, we ship sources.
07:39:52Varriountreactormonk: go to #nim-offtopic
07:40:01Demon_FoxAs where with gcc, it was written in C, hand compiled, then compiled.
07:40:15Varriount.eval cmp(1, 0).echo
07:40:19MimbusVarriount: 1
07:40:56Demon_Fox.eval cmp(1, 2).echo
07:40:59dtscode.eval echo((1.cmp 0))
07:41:00MimbusDemon_Fox: -1
07:41:02Mimbusdtscode: eval.nim(3, 13) Error: ')' expected
07:41:11dtscodeis echo built in?
07:41:41VarriountIf you want to use the bot often, use it in #nim-offtopic , that way you won't clutter up the chat here.
07:41:45Varriountdtscode: Nope.
07:41:59dtscodewhy does it not need () then?
07:42:17reactormonkVarriount, I'll just use stock cmp
07:42:27Varriountdtscode: Unified calling syntax
07:42:53Demon_Foxdid not know there was a bot
07:43:09reactormonkDemon_Fox, neither did I
07:43:15Demon_FoxI thought someone was being a smart***.
07:43:19Demon_FoxGuess I was wrong.
07:44:33*infrashortfoo quit (Remote host closed the connection)
07:45:44VarriountIt's handy when testing out short code snippets, or when on mobile.
07:46:21dtscode.eval proc print(foo: string)= echo(foo); "test".print
07:46:24Mimbusdtscode: test
07:47:07Demon_Fox(This is why the terminator turned into a killer)
07:47:14Demon_FoxHe was abused as a young IRC bot.
07:47:37VarriountHah! But we cherish our Mimbus bot.
07:47:49*Varriount pets Mimbus
07:52:18VarriountDemon_Fox: I found you: http://tinyurl.com/n4y7n66
07:52:43*brson quit (Ping timeout: 256 seconds)
07:53:11Demon_Foxlmfao
07:58:11*infrashortfoo joined #nim
07:58:22*gour joined #nim
07:58:41*infrashortfoo quit (Remote host closed the connection)
07:58:48Demon_Foxinteresting
07:58:50reactormonkVarriount, hey, my image shows up pretty high on the google search for "reactormonk"
07:58:55*infrashortfoo joined #nim
07:59:07reactormonkwell, image search.
07:59:40ekarlso-should one support uploading packages like tarballs ?
07:59:48reactormonkekarlso-, where?
08:00:09ekarlso-packages.nim-lang.org ish in the future ;)
08:00:45reactormonkekarlso-, hm, I'd go for git tags maybe
08:01:03ekarlso-reactormonk: it allows u to register that too atm
08:01:15reactormonkekarlso-, ok, then tarballs are a good alternative
08:01:16Demon_FoxThis is more like it (minus the naruto undertone): http://tinyurl.com/mkyr6wq
08:01:29reactormonkDemon_Fox, undertone? Overtone.
08:01:45ekarlso-POST /packages {"name": "mysql", "releases": [{"version": "0.0.1"}]}
08:01:47ekarlso-ish
08:01:57ekarlso-ehm, that's not a full example
08:03:01reactormonkI have seq[seq[int]], how do I ask if the inner seq has been initialized?
08:03:09Demon_Foxreactormonk, My bad
08:03:58reactormonkah, isNil should o
08:07:00*MrOrdinaire joined #nim
08:07:59MrOrdinaireI'm trying to solve issue #1832
08:08:29*nande quit (Remote host closed the connection)
08:08:36VarriountMrOrdinaire: Solve, or work around?
08:08:45MrOrdinaireVarriount: solve
08:09:32reactormonkwhy doesn't orderedTable have first?
08:09:38MrOrdinaireI've traced the code to compiler/ccgexprs.nim:1024
08:09:49MrOrdinairewhich is proc genSeqElemAppend
08:10:29dtscodeanyone familiar with the asyncet module that i can talk to?
08:11:02Varriountdtscode: dom96 is the author of the module, but I may be able to help.
08:11:26dtscodeVarriount, ok, firstly, what does the await keyword do?
08:13:38reactormonkWhy is it possible to get an out of bounds error with a seq?
08:14:02Varriountdtscode: It's used to wait on the return value of a future.
08:14:16VarriountAt least, in context of asyncio
08:14:17MrOrdinaireis getTemp the right call to put a temporary variable on the stack?
08:14:32dtscodeVarriount, whats a future?
08:15:10VarriountMrOrdinaire: Unfortunately, I don't know off the top of my head. Araq is the main developer with regards to the compiler, and he's currently asleep.
08:15:51MrOrdinaireVarriount: when is he usually on IRC?
08:16:06VarriountMrOrdinaire: I do ask that, for any compiler procedures you touch, please add documentation and comments, so that others don't have to work their way through the compiler blind.
08:16:20VarriountMrOrdinaire: In about... 3-6 hours, ussually.
08:16:37MrOrdinaireVarriount: thanks
08:16:41MrOrdinaireVarriount: will do
08:17:06VarriountMrOrdinaire: Unfortunately, the compiler isn't as well-documented as the standard library.
08:17:30Varriountdtscode: A future is a yet-to-arrive value.
08:17:51dtscodehrrmm... ok. so its not an actual type in this context?
08:18:05Varriountdtscode: In context of asyncronous processing, a future is a temporary data structure that can be passed around and used in place of an actual result that has yet to come.
08:18:22dtscodeah
08:19:43Varriountdtscode: Say I call a read operation that returns a future that will (eventually) contain a string. The read operation may block behind the scenes, but using a future, the read procedure can immediately return with the future as the return value, and other procedures just pass around the future until the string is actually needed.
08:20:28Varriountdtscode: `await` is also used in threaded code to achieve a similar result.
08:20:48dtscodeoh, ok. that makes sense. so await essientially turns on blocking for that one proc?
08:21:48Varriountdtscode: Sorta.
08:22:04Varriountdtscode: Read http://nim-lang.org/asyncdispatch.html carefully.
08:22:12dtscodeok
08:22:44*Sphax joined #nim
08:23:00dtscodesince you said to read carefully:
08:23:03dtscode> async macro which allows asynchronous code to be written in a synchronous style with the await keyword.
08:23:31dtscodedoes this mean its still async code that looks sync? or its async code acting as sync?
08:23:46dtscodemy guess is the former, but i just want to make sure]
08:24:35Varriountdtscode: The former
08:24:58dtscodeawesome. thanks Varriount :) youre being a real life saver
08:25:22Varriountdtscode: The funny thing is, I haven't used the async* modules
08:25:38VarriountWell, I have one time, but that was to interface with it.
08:25:55dtscodeo rly? you just have experience with async in general?
08:26:20Varriountdtscode: Yeah, I've used Python's Twisted web framework. It works on similar principles.
08:26:34dtscodeoh well thats good to know at least
08:27:04Varriountdtscode: Whats funny (and kinda sad) is that I don't actually touch/write much Nim code... I'm more of a helper.
08:27:12Varriount:/
08:27:15dtscodewhat do you mean?
08:27:59Varriountdtscode: I help people on IRC, answer questions on the forum, etc.
08:28:27dtscodeah. is there any reason you dont write nim code, or is that you just dont have the time?
08:29:32Varriountdtscode: Mostly time, somewhat inclination.
08:29:56Varriountdtscode: I'm either at work, working, or at home, sleeping/excercising
08:30:10VarriountOh, or eating.
08:30:15dtscode:/ yeah that is a shame. i really rather like nim.
08:30:59dtscodesee, my schedule is mostly like yours, except i did the smart thing and gave up excercising in exchange for writing nim code
08:31:15dtscodeor rather, code in general
08:31:43Varriountdtscode: My family has a history of bad health. If I don't excersize, I stay up at night, worrying about heart attacks.
08:31:54Varriount*exercise
08:31:59dtscodeim just hearing excuses
08:32:12Varriount:P
08:32:22dtscodehehe. i kid, i kid
08:32:29VarriountNow if only I could code while running on the treadmill...
08:32:40dtscodedragon?'
08:32:47VarriountHuh?
08:32:57dtscodethe dictation software
08:33:04dtscodebrb, chores
08:33:08VarriountI don't know if that would work too well.
08:33:41dtscode*note to self* tell dom96 he needs to write dictation software specifically for nim
08:34:06Varriountdtscode: Although, it is a thought.
08:34:12*MightyJoe quit (Ping timeout: 244 seconds)
08:34:31*BlaXpirit joined #nim
08:34:39ekarlso-how does one do a list comprehension ?
08:34:43ekarlso-in nim
08:35:05ekarlso-I have a seq of objects but I want to make a new seq out of a field out of all the objects
08:35:24dtscodei remember when i was in high school, i would write long parsers of all sorts on graph paper, and somehow find more bugs in them than when i went home and rewrote it. those were good days :} i was smarter and wrote much better code
08:36:12Varriountekarlso-: 'for i in seqOfObjects: seqOfFields.add(i.field)`
08:36:39ekarlso-Varriount: but u can't do like
08:36:42Varriountekarlso-: Nim doesn't have native list comprehensions, however there is a list comprehension in a macro in the 'future' library
08:36:51*MightyJoe joined #nim
08:37:12ekarlso-let mySeq = [i.fieldName for i in oldSeq] ?
08:37:14ekarlso-boo
08:37:16Varriountekarlso-: It would be nice to have native ones, possibly something python-like, but... *shrug*
08:38:53Varriountekarlso-: Unfortunately, there are far more important issues that need to be worked on.
08:39:17Varriountdtscode: Actually, I forgot, I am working on a filepath library in my spare time at work.
08:40:00Varriountdtscode: Strings as filepaths are ok, except when you need to calculate paths on one platform for another platform.
08:44:05lyroHi, a have a problem. The following code crashes with 'Stack overflow' in nim 0.10.2 when compiling with 'nim c test.nim' and run with './test': http://pastie.org/private/0jk2gilb4nslmcg7nskd6w
08:44:17lyrois this a bug?
08:45:17lyroit's a simple doubly linked list which seems the cause problems in the gc
08:45:25*MightyJoe quit (Ping timeout: 264 seconds)
08:45:28Varriountlyro: I'm assuming you get a stacktrace?
08:45:54Varriountlyro: And what version of the compiler are you using? Latest stable, or development version?
08:45:58lyroa lot of lines with 'gc.nim(xxx)'
08:46:05lyro0.10.2
08:46:18Varriountlyro: Hm, interesting.
08:48:00*Varriount|Mobile joined #nim
08:48:32Varriount|Mobilelyro: Does it happen when the 10000 is decreased?
08:49:35Varriount|MobileI'm not intimately familiar with the garbage collection internals, but I think I remember it using some sort of stack walking mechanism.
08:50:09Varriount|Mobilelyro: Oh, does this happen with the compiler, or the program?
08:50:29*MightyJoe joined #nim
08:55:15*SplinterOfChaos quit (Ping timeout: 264 seconds)
08:56:23lyrothe program
08:56:43lyrowhen the 10000 is decreased then everything works
08:57:13Varriountlyro: Hm, probably a GC issue then. Could you file an issue on github?
08:57:28lyrosure
08:58:52*yglukhov_____ joined #nim
08:59:21dtscodeVarriount|Mobile, interesting. is it going to be part of the stdlib?
09:02:35*yglukhov_____ quit (Client Quit)
09:03:35*JinShil quit (Quit: Konversation terminated!)
09:03:45Varriountdtscode: *shrug*
09:04:04dtscodeive been thinking of writing an ncurses wrapper
09:04:04Varriountlyro: Mention that it only happens with debug features enabled, not in release mode.
09:04:23*MightyJoe quit (Ping timeout: 240 seconds)
09:04:37Varriount*sigh*, relying on compiler optimization to optimize recursive procedures is a big no-no
09:04:56dtscodeo rly? why is that?
09:05:18dtscodei would imagine that would be the place to do that, but im very new to the field of compilers
09:05:38Varriountdtscode: Because there's no guarantee that the compiler will always optimize the recursion away.
09:06:41Varriountdtscode: I'm guessing that the extra debug information is causing the C compiler lyro is using to not optimize away a recusive path in Nim's GC code.
09:07:27Varriountdtscode: Of course, there are some areas where recursion is suited, such as traversing an AST, however you need to expect how nested such procedures will be.
09:09:03lyroof course, but the point is that my code is not recursive (the gc code may be) and 10000 is not very large for a list
09:09:46*MightyJoe joined #nim
09:10:09lyrois it possible to compile the gc code in release mode but everything else in debug mode (as a temporary workaround)?
09:10:43Varriountlyro: Possibly, but that's taking the more convoluted route, I think.
09:11:25Varriountlyro: You can add a compiler flag to GCC to tell it to perform optimizations (assuming you're using gcc)
09:11:51Varriountlyro: You can also compile in release mode, and turn on debug flags
09:12:47*gokr quit (Ping timeout: 245 seconds)
09:12:52Varriountlyro: For example, I commonly compile the Nim compiler using the flags "-d:release --stacktrace:on --linetrace:on"
09:13:08*skyfex_ joined #nim
09:13:12VarriountYou can add '--checks:on' for runtime checks.
09:15:01*skyfex quit (Ping timeout: 244 seconds)
09:15:55*gokr joined #nim
09:16:02VarriountWhich.. hrm, is not much help when '-stacktrace:on' causes the recursion bug to appear.
09:16:46Varriountlyro: It's also possible to compile the runtime library as a dll, and have the program use that, but that option isn't tested often.
09:17:51Varriountlyro: On the other hand, if you want, it shouldn't be too hard to fix the recursion bug, depending on where it is in the gc code. Manually unrolling recursion is tedious, but not too hard.
09:20:21*vendethiel joined #nim
09:21:15*z1y quit (Remote host closed the connection)
09:22:15*z1y joined #nim
09:22:49Varriountlyro: Could you give me a gist/pastebin of as much of the stacktrace as possible?
09:23:03ekarlso-does nim let you do something like .iter().map(|foo| {}) in rust ?
09:23:16Varriountekarlso-: What does that do in rust?
09:23:23AraqMrOrdinaire: what's the problem?
09:24:20VarriountAraq: He wants to know what getTemp does in the compiler.
09:24:41ekarlso-Varriount: takes a seq and iterates over each element
09:24:45Araqlyro, Varriount making the GC non-recursive is some work. you have to disable stack traces for now
09:24:54ekarlso-so within {} is a code block
09:25:17Araqekarlso-: map, mapIt etc. anon procs etc. learn how to read
09:25:31Araqdo your homework.
09:25:37ekarlso-Araq: be nice :/
09:26:26Triplefoxwe don't all know rust here so direct comparison like that is kind of...putting a burden on the answerer
09:26:54Araqyou always ask about Rust vs Nim and yet seem to use neither and only read some news articles
09:27:23Triplefoxlanguage window shopping :3
09:29:01VarriountAraq: I don't seem to recall ekarlso- asking too many questions...
09:29:26lyroVarriount: I put the backtrace in the issue on github (the lines repeat over and over again)
09:30:00*gsingh93 joined #nim
09:30:49gokrekarlso-: You can read my article on seq
09:31:05gokrIt tries to cover "most" of seq behaviors
09:31:23reactormonkmuh, hit https://github.com/Araq/Nim/issues/1741 again. I guess I should implement it.
09:31:53AraqVarriount it creates a temporary variable in the C code for further usage
09:33:08reactormonkWhere does the mitems come from btw, iterator which passes var? I can't find it anymore in the index.
09:33:24MrOrdinaireAraq: i have `var tmp:TLoc; getTemp(p, b.t, tmp)`
09:33:34MrOrdinaireAraq: and then genAssignment(p, tmp, b, {})
09:33:57MrOrdinairebut it seems `getTemp` does not fill `tmp.r`
09:34:47MrOrdinaireso when genAssignment calls rdLoc, it's empty, generating something like ` = value;` which throws off GCC
09:35:49Araqwell my getTemp is in cgen.nim:403 and sets 'result.r'
09:36:55dtscodeVarriount, sorry, was doing dishes. im back now. and ok. that makes sense
09:37:45VarriountPerhaps there is a field in 'tmp' that needs to be assigned to?
09:40:15MrOrdinaireVarriount: I guess, but I don't know which
09:40:36MrOrdinairehere's the diff of what I'm trying to do
09:40:38MrOrdinairehttp://pastebin.com/cw1Srt7S
09:41:40MrOrdinairethe full code http://pastebin.com/wCyqB7Kd
09:41:50VarriountMrOrdinaire: Maybe initLocExpr?
09:43:15*Varriount|Mobile quit (Quit: AndroIRC - Android IRC Client ( http://www.androirc.com ))
09:43:34*vendethiel quit (Ping timeout: 245 seconds)
09:45:39AraqMrOrdinaire: strange, your code looks correct. but you can echo "TEMP ", tmp.r.ropeToString
09:46:18MrOrdinaireAraq: checking that
09:47:21MrOrdinaireI see ropeToStr but not ropeToString, using that instead
09:47:30Araqlol
09:47:50Araqthat should be $ anyway
09:51:12dtscodei just found out about rope. it looks awesome
09:51:13MrOrdinaireI'm using `./koch boot -d:release --parallelBuild:1` and the output does not contain TEMP
09:51:58Araqthat's not how we work here
09:52:38Araquse './koch temp c fileThatTriggersBug.nim'
09:52:56Araqdon't bootstrap for the initial bugfix, that's crazy
09:52:57MrOrdinaireAraq: thanks
09:53:06MrOrdinaireokay
09:53:50Araqbut yeah, you should check bootstrapping still works after you fixed the bug
09:58:34*VinceAddons joined #nim
10:01:31reactormonkWhat's the correct way to output a few variabels inside a string? "score(" & $juggler.id & ", " & $course.id, & ", " & $course.score & ")" apparently isn't
10:01:56reactormonkoh, wait, I got a "," over
10:03:10*AndroUser2 joined #nim
10:03:42MrOrdinaireAraq: you're right. It messed up with everything and now I can't compile normally anymore. Recloning everything...
10:04:18AraqI dunno how you managed to do that. 'koch boot' is a transaction
10:04:33Araqif it fails the old nim binary is not touched
10:05:17MrOrdinairedoes it share nimcache between runs?
10:05:29*bjz joined #nim
10:05:44Araqyes
10:06:01MrOrdinairemy code touches the C code gen
10:06:02*bjz quit (Read error: Connection reset by peer)
10:06:09Araqbut that's irrelevant. the nim binary doesn't depend on nimcache, it's a binary
10:06:09MrOrdinairethat might be the cause?
10:06:12ekarlso-var newTags: seq[Tag] = pkg.tags.map(proc(t: string): Tag = getOrCreateTag(conn, t)) < that was what I wanted to do ish
10:06:30*ekarlso- hails to Araq for slapping himself
10:06:30gokrIdiotic question #347: In Java I can have a var being of type "Object" and thus hold both domain objects or an ArrayList of such. What would a Nimmer do in Nim?
10:06:36ekarlso-slapping me that is :9
10:06:43*bjz joined #nim
10:06:54reactormonkgokr, >:)
10:07:17gokrCome again?
10:07:25reactormonkthat's an evil smilie.
10:07:30Varriountgokr: Well, first, the object has to be a ref type
10:07:38Araqekarlso-: sorry for my grumpiness
10:07:46ekarlso-Araq: hah :p
10:08:04Varriountgokr: Then you just have the sequence hold RootRef instances
10:08:23gokrVarriount: I know that, but... a *var* that can hold both.
10:08:39ekarlso-is there a reason why getRow returns a row with empty strings vs a nil ?
10:08:42ekarlso-when there's no hit
10:08:48Varriountgokr: Have the var be of type RootRef?
10:08:51gokrIn java I can have an instance var of type "Object". It can then hold either an ArrayList or a Banana.
10:09:05gokrBut then it can't hold a seq, right?
10:09:24Varriountgokr: It should be able to hold a sequence...
10:09:27gokrOh
10:09:38Araqright, you have to wrap the seq in some SeqObject
10:09:45VarriountOh.
10:09:51gokrGood, was close to a face palm there.
10:10:03Araqyou can 'cast' but this is not wise
10:10:22VarriountI guess this is because seq is one of the core types?
10:10:22gokrAraq: This is the issue I was kinda gunning for the other day when I was asking about "equiv of Java Object".
10:10:37gokrRootRef is not as wide a net as Object in Java.
10:10:45BlaXpiritlist comprehensions can be made in a macro? miraculous.
10:10:58gokrOk, packing up and going to ice rink, later
10:11:07*gokr quit (Quit: Leaving.)
10:11:12MrOrdinaireAraq: I get "compiler/ccgexprs.nim(14, 34) Error: undeclared identifier: 'PRope'" when running `./koch temp c compiler/ccgexprs.nim`
10:11:14*AndroUser2 quit (Remote host closed the connection)
10:11:28*AndroUser2 joined #nim
10:11:48VarriountMrOrdinaire: That's because many of the compiler files are `include`ed into a central file.
10:11:58VarriountAnd thus share the same namespace.
10:12:06AraqMrOrdinaire: fileThatTriggersTheBug is usally some small file that triggers the bug
10:12:34MrOrdinaireso not the file i'm modifying
10:12:36MrOrdinaireokay
10:13:28Araqyou're working on https://github.com/Araq/Nim/issues/1832 right?
10:13:39MrOrdinaireyes
10:13:39*irrequietus joined #nim
10:13:43ekarlso-is there a efficient way to check if getRow actually returns something useful except checking each column in the returned row ?
10:13:47Araqso create a file with that content
10:14:28nicklesAraq: (I) Returning to yesterday's static table question: In the manuals you write about the "syntactic sugar" notation for table constructors.
10:14:35ekarlso-smth like row.isLoaded or smth
10:14:35Araqekarlso-: as I said the db_ modules need an overhaul, but if your data model has different semantics for NULL and "" it is broken
10:14:38nicklesAraq: (II) This notation suggests, that using it you create a table; actually, the table is created only after a call to toTable() on that referred array.
10:14:45nicklesAraq: (III) So - from my point of view - the sole purpose of the table notation is for it to be used with toTable()...
10:14:51nicklesAraq: (IV) Wouldn't it be nicer then (also when it comes to evangelizing Nim) to implicate that call, resulting in a) a true table notation, and b) a way to have static, i.e. compile time tables?
10:15:00nicklesAraq: (V) Right now big tables need to be created a run-time, probably consuming more time than necessary (as compared with static hashes/tables) on each run (think e.g. of a dir/ls implementation mapping extensions to colors).
10:15:59Araqnickles: but it's not obvious if you want toTable or toOrderedTable
10:16:17Araqwhich is why came up with the current design
10:16:21*gokr joined #nim
10:16:24ekarlso-Araq: no the question here is more like, SELECT * FROM tbl WHERE id = ? and if there's no hit it will return a row with all the columns "", what way to check if there was a hit or not ?
10:16:54Araqekarlso-: it returns no row at all then?
10:17:15nicklesAraq: I think, for most use cases (and if I look at other implementations) the unordered thingy would suffice. I could live with it
10:17:24MrOrdinaireAraq: it works
10:17:26ekarlso-Araq: retrieves a single row. If the query doesn't return any rows, this proc will return a TRow with empty strings < doc for that method
10:17:34Araqnickles: when you do the toTable too early the order is gone
10:17:36ekarlso-so it returns a TRow with all cols as ""
10:17:48Araqekarlso-: ok, use some other proc then
10:18:20Araqbut usually id cannot reasonably be "" so you can check that field
10:18:37ekarlso-Araq: yeah, i'll do that fow now ;P
10:18:43*yglukhov_____ joined #nim
10:19:16*gokr_ quit (Ping timeout: 264 seconds)
10:19:18nicklesNo need for any order, just lookup some static values is often required.
10:20:21Araqnickles: I disagree. Often 'dict' is picked without any thought and then later people regret it, for instance when generating some config file
10:20:48Araqwhere the order doesn't matter either but surely is convenient for the poor human being that likes to read the file
10:22:02nickles;-) True but that doesn't invalidate the use case I mentioned, big static arrays a run-time...
10:23:05*repax joined #nim
10:23:07Araq.toTable will be available at compile time eventually
10:23:27Araqyour use case doesn't argue for a syntax shortcut
10:24:51nicklesI'm not so interested in a shortcut (though having one would be nice, especially when it comes to boasting with it), but in minimizing possible runtime overhead.
10:25:31nicklesThe guys in the D forums are heavily struggling with that ...
10:27:09repaxHow does D's ctfe compare to nim's?
10:27:48*minciue quit (Quit: minciue)
10:29:09nicklesD has a hash notation for use in procedures => run-time. Globally they need static this() => also runtime.
10:30:00Varriountrepax, nickles: Well, theoretically, any code which doesn't depend on outside OS procedures should work. Practically, the VM isn't perfect.
10:31:23repaxI like the fact that files can be accessed at compile-time
10:31:58Varriountrepax: Well yes, there are some interfaces to work with the outside environment, but not an entire one.
10:32:11MrOrdinaireAraq: what does needToCopy and afDestIsNil mean?
10:32:54repaxVarriount, it's a useful one for parsing source that may not be "code" but perhaps some data format
10:33:07nicklesDon't get me wrong. I don't criticize Nim. In fact, right now it's my #1 candidate for converting some of my C programs to a more sophisticated language. However nowadays tables (dicts) are so overly present that I would seem a shame not to have a static implementation in Nim.
10:33:36nicklesI = it
10:33:49repaxnickles, would it be difficult to implement, you think?
10:34:17Varriountnickles: As has been said, the only reason static tables don't work correctly is due to bugs.
10:34:26repaxI see
10:34:54nicklesrepax: I don't know. But I guess it's absolutely possible. The data you throw in is static, and the algorithm is static...
10:35:02AraqVarriount: no, it's because you cannot have 'object' as a 'const'. that's not a bug, that's just not supported for now.
10:35:14Varriountnickles: Please know that there are many, many aspects of the language that need development, however the development team is small (about 4 people), and not all of us have the expertise to work with the compiler code.
10:35:32AraqI expect it to work out of the box once that feature is supported
10:36:00nicklesAraq: Pardon, which feature?
10:36:07repaxFor a newb, what corner of the compiler is most accessible?
10:36:16Varriountrepax: The parser
10:36:21Araqnickles: const foo = SomeObject(x: 1)
10:36:58Varriountrepax: Technically, the compiler contains at least two parsers. It uses one for the Nim language, and one or two others for config files.
10:37:45repaxI am going to try to familiarise myself with some corner
10:38:10Varriountrepax: Make sure to document anything lacking needed documentation.
10:38:11repaxSo I'll look at the one of the parsers then
10:38:34*bjz quit (Read error: Connection reset by peer)
10:38:37nicklesAraq: Have you already some time frame in mind/intention to implement that?
10:38:42ekarlso-when doing obj in objs is there a way I can make the hash a field of the obj ?
10:38:53repaxVarriount, in source comments?
10:38:58Varriountrepax: Yes.
10:39:06repaxRight
10:39:21Varriountrepax: Not every procedure needs documentation, just ones that... need it.
10:39:30repaxOf course
10:39:45repaxSome project wants less coments, some more
10:40:18Araqrepax: read our internal docs. they suck but they tell you to read ast.nim first and that's still a good entry point
10:40:27repaxLinux for example despises comments
10:40:32nicklesAraq: It would also be nice for saving/restoring objects...
10:40:51repaxAraq, thanks
10:41:41Araqthey also tell you how to debug things in the compiler
10:43:44MrOrdinaire Araq: what does needToCopy and afDestIsNil mean?
10:44:26AraqMrOrdinaire: usually the codegen doesn't emit a full copy as it's unnecessary. needToCopy tells it it's really required.
10:44:36*gokr1 joined #nim
10:44:41AraqafDestIsNil means that you know that the destination loc is nil
10:45:03Araqthis can be used to generate a faster write barrier but currently isn't used
10:45:12MrOrdinaireI see
10:45:33MrOrdinaireso for my code, it needs both flags, right?
10:45:58Araqyou don't want needToCopy
10:46:18Araqif your code requires it, it's broken
10:46:30VarriountAraq: Howso?
10:46:54AraqVarriount: performance will suck and we lose benchmarks
10:47:26VarriountOh! I thought needToCopy was a procedure, not a flag. Silly me.
10:47:29*bjz joined #nim
10:49:18*vendethiel joined #nim
10:51:31MrOrdinaireAraq: pushed and made a PR
10:52:28VarriountMrOrdinaire: Could you explain what the fix does?
10:52:41MrOrdinaireVarriount: it's in the PR
10:53:03ekarlso-meh, how can u solve a problem like bar = {"foo": 1} if "foo" in bar in nim ?
10:53:59*gokr quit (Ping timeout: 245 seconds)
10:54:14ekarlso-i've tried using a obj with a hash on the name field but doesn't seem to work :/
10:55:54Varriountekarlso-: Are you using a table, or just the sequence that the {} constructs?
10:56:35ekarlso-Varriount: I was using a set atm and a hash proc on the object
10:56:36VarriountMrOrdinaire: I guess I'm just concerned about the copying, since that effects every sequence construct...
10:58:38VarriountMrOrdinaire: Looking at the issue, it seems as if a better idea would be to grab s.high and store that in a temp variable.
10:58:56VarriountBut that's specific to that case...
10:59:19MrOrdinaireVarriount: we can try to be clever and emit the copy only when the code has that template
10:59:37MrOrdinairebut that will only fix that case...
11:00:46VarriountMrOrdinaire: Yeah... I guess we should just hope that the backend eliminates the copy.
11:00:58MrOrdinaireyup
11:01:31VarriountOh well.
11:01:45VarriountMrOrdinaire: Thanks very much for the help.
11:03:00MrOrdinaireVarriount: thanks :)
11:04:21Araqwell what kind of copy does the codegen end up with?
11:05:21VarriountAraq: What do you mean?
11:09:56MrOrdinaireAraq: http://pastebin.com/XDZEaudx
11:10:16MrOrdinairefor the program included in the issue
11:11:02*vendethiel quit (Ping timeout: 264 seconds)
11:11:07*bjz quit (Ping timeout: 245 seconds)
11:14:20ekarlso-is it possible with a closure in nim to place a whole function block inside it ?
11:14:35ekarlso-like in rust |foo| {} you can place code inside the {}
11:14:58Varriountekarlso-: You mean, put a closure in a closure? Or put a closure in a procedure call?
11:15:50*vendethiel joined #nim
11:15:55VarriountHi vendethiel
11:16:21*gour_ joined #nim
11:17:15ekarlso-Varriount: I'm taking a wild guess that i'm approaching the problem wrongly but: https://bpaste.net/show/815a0985cd03
11:17:18ekarlso-that example is bork
11:18:15*z1y quit (Ping timeout: 265 seconds)
11:18:15ekarlso-in python I could do something like a dict with the tag name as key and the tag as value but
11:18:36Varriountekarlso-: Lemme see if I can make it work.
11:19:49*gour quit (Ping timeout: 245 seconds)
11:19:54*Demon_Fox quit (Quit: Leaving)
11:20:29ekarlso-Varriount: something in rust that does the same https://github.com/rust-lang/crates.io/blob/master/src/keyword.rs#L83-L85 seems to use a map with a closure where the result is a HashMap with the name as the key and the value the object
11:21:24Varriountekarlso-: The only thing wrong in your example is that a uint can't be converted to a string via that syntax
11:22:10ekarlso-would be uber kinda if you could place a small function block in a nim closure
11:22:25Varriountekarlso-: Still don
11:22:53VarriountI still don't get what you mean. A closure is a procedure
11:23:45ekarlso-hmmm lemme try again
11:23:59ekarlso-Varriount: but stringtable works only with strings as values no ?
11:28:19Varriountekarlso-: https://bpaste.net/show/d283ca75a65a
11:28:48ekarlso-Varriount: ah, I tried var tagTable = newStringTable(tags.map((i: string) => (i, let i = create(i); $i.id)), modeCaseInsensitive)
11:30:59Varriountekarlso-: Also, remember that 7.string won't work, because using a type like that is for conversion, when the type can be safely cast to another type.
11:31:21*Mimbus quit (Excess Flood)
11:31:27*Mimbus joined #nim
11:32:46*JinShil joined #nim
11:34:47VarriountHi JinShil
11:35:05ekarlso-Varriount: too bad u can't do stuff like tags.map((s: string) => (let i = create(s); s; i.name)) ish
11:35:23JinShilHi Varriout
11:35:30ekarlso-rust basically let's you declare a variable using the "let" inside the closure block
11:35:36JinShilwith an 'n'
11:36:47*vendethiel quit (Ping timeout: 244 seconds)
11:37:41*gour_ quit (Remote host closed the connection)
11:40:13*nickles quit (Quit: Page closed)
11:42:57*repax_ joined #nim
11:44:31ramnesAraq: you should fetch/rebase instead of merging from origin to your repo, it would avoid useless commits
11:44:54*gour joined #nim
11:45:48*repax quit (Ping timeout: 265 seconds)
11:46:42ekarlso-will nim ever have a equiv of rust's HashMap a'la StringTable but allow for a value other then strings ?
11:47:48Varriountekarlso-: Um, you did see the tables modules, right?
11:48:22ekarlso-no :|
11:48:35*ekarlso- goes back to RTFM instead of asking
11:48:49Varriountekarlso-: Also, I really don't know rust, *at all*, so comparing Nim to that isn't very helpful. If you must compare Nim to something, use python, java, or possibly C++
11:49:04ekarlso-ok :)
11:49:33ekarlso-yeah, tables was more useful1
11:49:41*bjz joined #nim
11:49:43flaviuekarlso-: for `=>`, there's the future module
11:49:46areckizbhello ! I wrote an implementation of a aho-corasick search algorithm in nim and I would be interested in gettng a peer review form anyone interested: https://github.com/arekzb/nim-aho-corasick
11:49:53flaviualthough I don't know how well that works.
11:50:22ekarlso-flaviu: well what I meant was it would be awesome to be able to do something like a "let" inside a closure
11:50:29VarriountAnd for anyone who doesn't know what the aho-corasick algorithm is, it's a string matching algorithm.
11:50:54*gsingh93 quit (Quit: Connection closed for inactivity)
11:51:00areckizbbecause it is my first nim package, I'd like to get opinions on memory, syntax and overall design choice. thanks !
11:51:15areckizbvarriount: yes you are correct
11:51:16Varriountareckizb: I'm looking...
11:51:35areckizbawesome. i gotta jet to work, but i'll be back later
11:53:11areckizbi tried it on a very large set like a book and it gave an error: out of memory. other than that it works fine, but i have a feeling it is not most efficient
11:53:12*ZzZMorpork is now known as AMorpork
11:53:31areckizbbbl
11:59:26*vendethiel joined #nim
12:02:14*bjz quit (Ping timeout: 265 seconds)
12:04:06*Trustable joined #nim
12:05:55Varriountareckizb: Avoid using substr, it copies the input string.
12:08:07Varriountareckizb: Also, be aware that string assignment copies the string as well. Use shallowCopy to just copy the string reference.
12:08:14*z1y joined #nim
12:11:05Varriountareckizb: Those seem to be the two big things.
12:11:38Varriountareckizb: I would recommend simply passing around indice pairs of the source string, rather than copies of it.
12:19:09*Sphax quit (Quit: ZZZZZzzzzz)
12:20:38*bjz joined #nim
12:21:53*vendethiel quit (Ping timeout: 256 seconds)
12:26:40*gokr1 quit (Quit: Leaving.)
12:31:04ekarlso-Varriount: is it possible to foo.map((s: string) => (let i = s; s)) ?
12:31:16ekarlso-as in defined a var inside the closure
12:32:12*bjz quit (Ping timeout: 265 seconds)
12:32:54Varriountekarlso-: Maybe not with the `=>` macro, but with the regular inline procedure syntax, I think so.
12:33:18Varriountekarlso-: Although at that point, you may as well just define an actual procedure, separate from the line.
12:35:28*areckizb quit (Ping timeout: 246 seconds)
12:35:52AraqVarriount, MrOrdinaire that means the patch is not good enough. use the alias module to see if there is a conflict and only then do it via the additional temporary. Or cache s.high at the beginning.
12:36:49VarriountAraq: Is there a way to get a slice of a string without copying it?
12:37:52AraqVarriount: short answer: no.
12:38:03*Sphax joined #nim
12:38:38VarriountHello Sphax
12:38:54SphaxHi
12:39:14*zahary1 joined #nim
12:40:07*AndroUser2 quit (Read error: Connection reset by peer)
12:44:01*vendethiel joined #nim
12:44:27*repax_ quit (Quit: repax_)
12:47:20*EXetoC joined #nim
12:53:09*bjz joined #nim
13:00:38*bjz quit (Read error: Connection reset by peer)
13:02:08ekarlso-isn't var t = initTable[int, string]((1, "foo")) correct ?
13:02:50ekarlso-sorry newTable instead of the init
13:02:59*z1y quit (Remote host closed the connection)
13:03:49ekarlso-.eval newTable(@[(1, "foo")])
13:03:52Mimbusekarlso-: eval.nim(3, 0) Error: undeclared identifier: 'newTable'
13:04:02ekarlso-oh well, I found it anyways
13:04:25*z1y joined #nim
13:05:38EXetoCyou can also do this: newTable({1: "foo", ...})
13:06:43*vendethiel quit (Ping timeout: 255 seconds)
13:08:08ekarlso-meh, I ended up doing: let newTags = newTable(tags.map((s: string) => create(s)).map((t: Tag) => (t.id, t)))
13:08:33ekarlso-I forgot all about the chaining
13:10:07*keyle joined #nim
13:12:16*ekarlso- feels so stupid realizing how dead simple it was
13:12:37Araqramnes: I use what git defaults to.
13:13:03ramnesAraq: well, you use git pull
13:13:21Araqyeah?
13:13:42Araqwhat should I use instead?
13:14:08ramnesgit fetch and git rebase or git pull --rebase in this case
13:14:25*hasenj joined #nim
13:18:32Araqyeah I never got this rebasing stuff. or let's say it doesn't interest me at all so I never remember it
13:19:03*vendethiel joined #nim
13:19:16ekarlso-.evan {"foo": 1}
13:19:19ekarlso-.eval {"foo": 1}
13:19:22Mimbusekarlso-: eval.nim(3, 0) Error: value of type 'Array constructor[0..0, tuple[string, int]]' has to be discarded
13:20:22ekarlso-can you do a map in tbl.values ?
13:21:07*repax joined #nim
13:21:40*saml_ joined #nim
13:24:03ekarlso-too bad you can't tbl.values.map()
13:24:05*z1y quit (Remote host closed the connection)
13:24:06*gokr joined #nim
13:24:28AraqtoSeq(tbl.values).map() should work
13:25:00*z1y joined #nim
13:25:42ekarlso-.eval toSeq({"foo": 1}.values).map((i: int) => (i))
13:25:45Mimbusekarlso-: eval.nim(3, 16) Error: undeclared identifier: 'values'
13:25:50ekarlso-meh
13:27:32JinShilwhere is echo defined?
13:30:43AraqJinShil: system.nim
13:31:06*bjz joined #nim
13:31:34ramnesAraq: as you can see, each time you want to push but there already is some changes in the remote repository, you pull and it makes a merge commit
13:31:49*keyle quit (Ping timeout: 246 seconds)
13:31:50ramnesnext time, instead of pull, just do "git fetch; git rebase"
13:32:01ramnesit will put your changes on top of remote changes
13:32:02ramnesthat's all
13:32:27ramnesthere really is nothing to understand
13:32:36ramnesgit pull = git fetch + git merge
13:32:42*BitPuffin joined #nim
13:32:48JinShilAraq thanks, I see it now. That was the first placed I looked but just missed it.
13:33:14*keyle joined #nim
13:33:21keylere.
13:33:30ramnesrebase just put your commits on top of the history instead of merging them
13:33:31Araqramnes: ok. maybe i'll remember
13:33:32ekarlso-Araq: thnx
13:33:33keyleError: undeclared identifier: 'await' - any clues what I'm missing?
13:33:48ekarlso-keyle: improt asyncdispatch ?
13:34:08keyle import asyncdispatch is there
13:34:09hasenjspeaking of async, parts of the docs talk about it as if it's a keyboard
13:34:11hasenjerr, keyword
13:34:17kokozedmanhow do I readFile("/proc/sys/net/ipv4/icmp_echo_ignore_all") and actually get the '0' content?
13:35:03keyleekarlso-: even with import asyncdispatch I still get the same error
13:36:20Araqkeyle: it only works in an .async proc
13:36:38keyleah. Sorry. nim noob here :)
13:37:04ekarlso-keyle: i'm in the same boat as you so I dunno that much :)
13:37:36keyleso I'm guessing I need this signature {.async.}
13:39:02gokrHmmm, object variants seem to not be able to have one of the variants have "no fields".
13:39:32EXetoCgokr: why not? have you tried with 'nil'?
13:39:36keyleworks, thanks Araq
13:39:59gokrEXetoC: nil where?
13:40:30EXetoCgokr: as the only statement in the block
13:40:49EXetoCdiscard seems to make more sense, but it can't be used in this case
13:40:49gokrDoesn't fly
13:41:07gokrOr wait, perhaps it did
13:41:16gokrBut that's not really intuitive
13:41:34gokrI would rather have had "no block" at all.
13:42:15EXetoCI don't see a problem with either mentioning it explicitly or having an 'else' block
13:42:48gokrI mean, the use of "nil" here seems counter intuitive.
13:42:51*vendethiel quit (Ping timeout: 264 seconds)
13:43:05Araqit's a leftover from Ada really
13:43:10Araqgotta go, see you later
13:43:13gokrsure
13:44:21*bjz quit (Read error: Connection reset by peer)
13:44:34*bjz joined #nim
13:45:52*willwillson joined #nim
13:47:48gokrI am guessing distinct types doesn't work for object types?
13:49:53EXetoCit seems to work
13:51:27gokrOk, I did an object variant, then tried two distinct types of it
13:51:59gokrBut then trying to compile a constructor it says "object constructor needs an object type"
13:52:07*keyle quit (Ping timeout: 246 seconds)
13:52:22EXetoC.eval
13:52:25MimbusEXetoC: <no output>
13:53:40EXetoC.eval type; T = distinct U; U = object; case kind: bool; else: nil; discard T(U())
13:53:43MimbusEXetoC: <no output>
13:53:57gokrHmmm, perhaps I have done something else that is wrong.
13:56:22*vendethiel joined #nim
13:59:07*JinShil quit (Quit: Konversation terminated!)
14:02:10*jm116 quit (Read error: Connection reset by peer)
14:09:51*MajorTennis joined #nim
14:10:06*MajorTennis quit (Changing host)
14:10:06*MajorTennis joined #nim
14:10:20BlaXpiritforum.nimrod-lang.org does not redirect, and has Nimrod in title
14:14:44*nickles joined #nim
14:15:52nickles*: How would I print the type of a variable? Didn't find it in the manuals.
14:17:28*vendethiel quit (Ping timeout: 244 seconds)
14:20:50MajorTenniswhat language?
14:23:44gokrmeta question: How do I figure out how to copy a seq?
14:24:19*nickles quit (Ping timeout: 246 seconds)
14:25:53BlaXpiritgokr, i dunno
14:25:56BlaXpiritit's pretty obvious
14:26:13gokrAssignment?
14:26:20BlaXpirit.eval var a = @[1,2,3]; var b = a
14:26:23MimbusBlaXpirit: eval.nim(3, 4) Error: invalid indentation
14:26:29BlaXpiritoh really
14:26:35gokrBut, how would I know?
14:26:44gokrNote the "meta" in my question.
14:26:55BlaXpiritnote the "i dunno" in my answer
14:27:06gokrYes, I kinda thought you meant that
14:27:10BlaXpiritby learning the basics of the language? assignment copies...
14:27:36gokrWell, pretend it was a non basic type then. The meta question still stands.
14:27:44gokrIMHO I find it hard to find things.
14:28:01BlaXpirityes, it is very hard to find things
14:28:10gokrAlso, since a seq is a ref type (I guess) - its not apparent to me that it copies.
14:28:19gokrBut I am just a n00b of course.
14:28:21BlaXpiritespecially for me, who got used to clicking first result in google and almost always getting the answer
14:28:38BlaXpiritin what way is seq a ref type?
14:28:50BlaXpiritthat can't be correct
14:29:18gokrWell, ok, I may be wrong.
14:29:50gokrI just meant... its dynamic in size.
14:30:07gokrSo it must be using some kind of heap allocated area underneath, right?
14:30:15BlaXpiritprobably
14:30:45*bjz quit (Read error: Connection reset by peer)
14:30:59*bjz joined #nim
14:33:13gokrSo ok, let's say I have a seq coming in as a param, and I want to call a proc with a *copy* of it - then I need to use a var - and assign to it, in order to get a copy?
14:33:32gokrFeels a tad clumsy.
14:33:56BlaXpiritgokr, I actually still don't know how function arguments work
14:34:06BlaXpiritbut i'm pretty sure it would be copied in some cases
14:34:23BlaXpiritgokr, also, you can call @ on the seq :|
14:35:52*vendethiel joined #nim
14:39:15EXetoCgokr: omit var and it will be copied
14:40:39*nickles joined #nim
14:41:40EXetoC.eval var x = @[1, 2, 3]; y = x; y[0] = 10; echo x, ", ", y
14:41:43MimbusEXetoC: eval.nim(4, 0) Error: undeclared identifier: 'y'
14:41:51EXetoC.eval var x = @[1, 2, 3]; y = x; var y[0] = 10; echo x, ", ", y
14:41:53MimbusEXetoC: eval.nim(4, 0) Error: undeclared identifier: 'y'
14:41:58EXetoCcrap
14:42:16EXetoC.eval var x = @[1, 2, 3]; var y = x; y[0] = 10; echo x, ", ", y
14:42:19MimbusEXetoC: @[1, 2, 3], @[10, 2, 3]
14:42:23nickles*: How would I determine the type of a variable?
14:43:20EXetoCnickles: I think the simplest way is to just do "type(x)" and then look at the error message
14:43:47EXetoCotherwise you have to import typetraits and do x.type.name
14:44:07*willwillson quit (Ping timeout: 256 seconds)
14:47:12vendethielhi Varriount :)
14:48:37nicklesEXetoC: Thanks. How did you find that?
15:04:35*gokr starting to remember why I am not fond of statically typed languages...
15:05:07gokrToday it has mostly felt like I am battling the compiler, no productivity at all.
15:10:07gokr"object constructor needs an object type".hmmm.
15:14:15*jefus joined #nim
15:16:10*jefus_ quit (Ping timeout: 244 seconds)
15:17:57gokrA pity I can't have methods called "and" or "or", "not" etc.
15:20:27BlaXpiritthe text format that the forum uses is absolute garbage
15:21:00BlaXpiritrst by itself is bad, but it's not even rst, just a small broken subset of it!
15:25:09*nickles left #nim (#nim)
15:29:53*repax quit (Quit: repax)
15:31:34*kapil__ quit (Quit: Connection closed for inactivity)
15:34:37EXetoCgokr: are you trying to create a tuple?
15:35:31*jpoirier quit (Quit: Leaving)
15:39:56*bjz quit (Ping timeout: 244 seconds)
15:51:25*noam quit (Ping timeout: 255 seconds)
15:54:42gokreh, no
15:55:16gokrIt seems to me that generics and objects don't mix that well.
15:57:26*Sergio965 joined #nim
15:58:03*kniteli joined #nim
16:01:39*bjz joined #nim
16:02:11*MajorTennis quit (Read error: Connection reset by peer)
16:09:13*darkf quit (Quit: Leaving)
16:17:24*minciue joined #nim
16:19:02EXetoCgokr: some relevant code would be nice
16:21:17gokrEXetoC: Ok, http://pastebin.com/KRPHnsx5
16:22:00gokrSo... this is the current incarnation of some code I am porting from PP. I have gone down several pahts - and I am not that interested in talking "design", but if you try to compile it...
16:22:36gokr...you get "object constructor needs an object type" on line 49
16:23:50gokrThe mixing of generics and objects... well, not sure if I have that code left...
16:25:36EXetoCthis works: Context(...).Success
16:25:43def-Araq: I have a paper deadline next week, so I'm probably too busy to work on repl or idetools
16:25:44gokrHmmm, that code I pasted was old and slightly goofy btw.
16:25:45EXetoCsimply because of the fact that the types are distinct
16:26:14lyroI have another question. The following test code demonstrates a strange behaviour (IMO, of course) for tuples as table keys: http://pastie.org/private/7wdfsu9g0pfqk9hsgoaag
16:26:25gokrEXetoC: Ehm, can you explain that again?
16:26:56lyrofor some reason the compiler seems to forget that the field of the key tuple of q is called 'x' and not 'a'
16:27:03lyroam I doing something wrong?
16:27:10gokrSo... you use "Context" constructor - and then convert type?
16:27:37gokrSo... there is no "Success" constructor... ahhh. eh.
16:27:52EXetoC.eval type T = distinct int; discard T(1)
16:27:55MimbusEXetoC: <no output>
16:28:32EXetoCthere's an implicit constructor introduced by distinct, I guess
16:29:50*MajorTennis joined #nim
16:32:06*bjz quit (Read error: Connection reset by peer)
16:32:47EXetoC.eval type T = distinct int; var x: T = 1
16:32:50MimbusEXetoC: eval.nim(4, 11) Error: type mismatch: got (int literal(1)) but expected 'T'
16:33:02EXetoCgokr: is it more clear now?
16:33:52gokrWell, not sure :)
16:34:03*bjz joined #nim
16:34:48gokrSo a distinct type of a ref object does not get an object constructor. Is that the lesson?
16:35:07gokrI need to borrow perhaps.
16:35:15EXetoCit gets a constructor that takes the target type
16:36:04*khmm quit (Ping timeout: 245 seconds)
16:36:11gokrOh. So its not a ... type conversion we do?
16:36:56*z1y quit (Remote host closed the connection)
16:36:57EXetoC.eval type T = distinct int; var x = T(1); echo x.int
16:37:00MimbusEXetoC: 1
16:37:03*z1y joined #nim
16:37:42gokrI thought the "T(1)" was a type conversion - not a call to a constructor.
16:38:25EXetoCmaybe you're right
16:38:43*jefus_ joined #nim
16:40:09gokrEither way, I am not going to use distinct here, it feels wrong ;)
16:42:51*jefus quit (Ping timeout: 264 seconds)
16:43:28EXetoCsometimes it's better to do something like "type T = object\n handle: U". implicit conversions can be introduced with 'converter' though: "converter toBar(o: Foo): Bar = o.Bar", which should be done sparingly as I've said before
16:47:20*bjz quit (Read error: Connection reset by peer)
16:49:00EXetoCthat last part was about converters, but converters can used for any types
16:49:25EXetoC*type
16:50:40*z1y quit (Quit: Leaving.)
16:52:44*repax joined #nim
16:58:34*z1y joined #nim
16:59:12*z1y quit (Client Quit)
16:59:55*bjz joined #nim
17:02:01*dyu quit (Quit: Leaving)
17:15:25*yglukhov_____ quit (Ping timeout: 264 seconds)
17:16:02*yglukhov_____ joined #nim
17:17:41*willwillson joined #nim
17:21:33*Varriount|Busy joined #nim
17:25:08*Sergio965 quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
17:30:05*bjz quit (Read error: Connection reset by peer)
17:37:30*bjz joined #nim
17:46:41*bjz quit (Read error: Connection reset by peer)
17:48:13*jpoirier joined #nim
17:48:54*Matthias247 joined #nim
17:52:41*Sphax quit (Quit: ZZZZZzzzzz)
17:56:06*chroem joined #nim
17:56:20chroemDoes nim support bitshift operations?
17:56:29chroemThe manual didn't say anything
17:57:39onionhammerhttp://nim-lang.org/system.html#shl,int,int
17:58:11chroemOkay, thanks
17:58:35onionhammeryep
18:02:36*bjz joined #nim
18:07:51chroemOkay, sorry if this is a dumb question, but why is the compiler interpreting the stuff inside shr() as a tuple?
18:07:56chroemmemory[i] = shr(number, num)
18:08:07chroemIt's spitting out a type error
18:11:41onionhammerwhats the error?
18:11:46onionhammerand what are number and num
18:11:50*infrashortfoo quit (Remote host closed the connection)
18:12:01chroemBoth one is a byte, the other is an integer
18:12:09onionhammeralso it's `shr` not shr(), so you should call it like x shr y
18:12:16onionhammermy guess is they have to be the same type
18:12:20chroemOh
18:12:54chroemThere we go
18:12:55chroemThanks
18:13:05onionhammernp
18:13:08chroemNim is cool but it's still pretty new to me
18:13:19onionhammeryeah, completely understandable confusion
18:13:58onionhammerfor future reference if the procs name is proc `x`() as opposed to proc x() it means it's an operator
18:14:24onionhammeryou can still call it like a normal procedure, but you have to use the ``'s, i.e. `shr`(x, y)
18:15:25chroemOkay, great
18:15:30chroemOff to class now
18:17:05*bjz quit (Read error: Connection reset by peer)
18:19:52*chroem quit (Ping timeout: 246 seconds)
18:21:39*bjz joined #nim
18:22:08*MajorTennis quit (Quit: Leaving)
18:34:13*bjz quit (Ping timeout: 265 seconds)
18:36:00*superfunc|busy joined #nim
18:42:09BlaXpiritI haven't seen fowl in like a week
18:44:35*Sphax joined #nim
18:45:14ldleworkhe's been around
18:48:25AraqBlaXpirit: the forum uses our RST parser that's also used for *all* of our docs and the only feature it doesn't support are ascii art tables
18:48:44BlaXpiritAraq, doesn't support combining markup
18:48:51BlaXpiritlike, links inside bold or bold inside links
18:49:25Araqthat might be an oversight or maybe a newer version of RST support that
18:49:49*Puffin joined #nim
18:50:27*bjz joined #nim
18:51:31BlaXpiritoh I'm sorry, Araq, it appears like just yet another limitation of rst
18:51:37*superfunc|busy quit (Ping timeout: 265 seconds)
18:51:54*BitPuffin quit (Ping timeout: 245 seconds)
18:53:13*Puffin is now known as BitPuffin
18:53:45*gokr_ joined #nim
18:55:34BlaXpiritIt might not yet be too late to reconsider markdown :s
18:56:22Araqgimme a native markdown implementation, not regex based with Nim syntax highlighting and I'll consider it
18:56:47BlaXpiritAraq, what do you mean...
18:56:57BlaXpiritmarkdown implementation is not supposed to have syntax highlighting
18:57:02BlaXpiritit should be separate
18:57:19Araqgithub supports ```nimrod ... ```
18:57:40BlaXpiritAraq, in general all that does is mark the <pre> with a class
18:58:30BlaXpiritstackoverflow uses javascript on client side for syntax highlighting
18:58:46BlaXpiritand it is easy to search in HTML for <pre class="nim">
18:58:53BlaXpiritAraq, btw ```nim seems to work too
18:58:55BlaXpiriton github
18:59:02Araqyay
18:59:10Araqso they already updated it, nice
18:59:16BlaXpiritbut didnt rename language
19:00:17Araqhrm JS on the client side for syntax highlighting ... nice idea
19:00:34BlaXpiritsure is...
19:00:59BlaXpiritah but it may be problematic because there definitely are no JS libraries for Nim syntax :p
19:01:19minciueGithub’s code should be reusable, I believe that part of their front-end is open source
19:01:24BlaXpiritGoogle Code Prettify or whatever it's called, claims to be able to highlight any language, but it may not work
19:01:32BlaXpiritminciue, we're talking about Nim implementation
19:01:34BlaXpiritof markdown
19:01:44BlaXpiritthat's the main problem now
19:02:14BlaXpiritI dunno... if there is a C implementation, there shouldn't be a problem actually
19:02:18BlaXpiritand there is
19:02:21*bjz quit (Read error: Connection reset by peer)
19:02:39Araqwell we also have 4062 posts in the old RST based syntax in the database but surely we can teach the forum about 2 different formats
19:03:10AraqBlaXpirit: I don't want a C implementation wrapper though.
19:03:18BlaXpiritI understand
19:03:27BlaXpiritI don't see anyone writing it from scratch though
19:03:44BlaXpiritAraq, it is not that difficult to add a markdown vs rst field in database
19:03:51AraqI know
19:04:24Araqbut then we might as well allow both in the frontend
19:04:32Araqso users can pick their poison
19:05:20BlaXpirit> CommonMark is a rationalized version of Markdown syntax, with a spec and BSD3-licensed reference implementations in C and JavaScript.
19:05:52BlaXpiritif BSD3 is acceptable, a direct rewrite of either of these may be acceptable
19:06:07*NimBot joined #nim
19:10:49BlaXpiritAraq, is c2nim of a C implementation realistic?
19:11:07AraqIMO yes
19:11:24BlaXpiritthen what are we waiting for :p
19:11:26Araqbut I don't think many will agree :P
19:11:45BlaXpiritby the way, I don't think there are many Markdown implementations without regex
19:11:46*rpag joined #nim
19:11:51BlaXpiriteven CommonMark uses regex
19:12:22*Varriount|Busy quit (Ping timeout: 246 seconds)
19:12:44*bjz joined #nim
19:13:07BlaXpirit(btw, I just noticed that re module has reEmail and it's horribly wrong)
19:15:54*superfunc|busy joined #nim
19:17:57onionhammerBlaXpirit there are js syntax highlighting for nim
19:18:04BlaXpirithow
19:18:06onionhammerat least one anyway
19:18:08BlaXpiritwhere
19:19:05onionhammerhttps://gitcandy.com/Repository/Commit/highlight_js/3c7af1af40226d75441bc018cc215aa53568a2f6
19:19:39*infrashortfoo joined #nim
19:20:58BlaXpiritso that's that
19:21:07*VinceAddons quit (Ping timeout: 255 seconds)
19:21:45*rpag quit (Ping timeout: 252 seconds)
19:21:56*VinceAddons joined #nim
19:23:35BlaXpiritI don't understand compiler/llstream.nim(130, 4) Error: undeclared identifier: 'copyMem'
19:24:27BlaXpiritbasically can't get c2nim to work
19:26:41BlaXpiritah commit 18 hours ago?
19:27:19*minciue quit (Quit: minciue)
19:27:52Araqyou have to install nim from devel and don't install it
19:28:03Araqand c2nim from master and don't install it
19:28:15jpoirierI don't understand why I get "array.nim(4, 9) Error: ambiguous identifier: 'array' -- use a qualifier" from "var arr: array[0..2, int] = [1, 2, 3]" because the file name is array.nim
19:28:16Araqand then c2nim compiles. simple. :P
19:28:23BlaXpiritAraq, what do these "and don't install it" mean???
19:28:29BlaXpiritand is devel stable enough?
19:28:41ldleworkjpoirier: because the module is magically a name. \o/
19:29:23Araqldlework: yeah and if you have an idea how to avoid this gotcha I'm all ears
19:30:19AraqBlaXpirit: it means to not install it in /usr/bin. add it to your path instead
19:30:39jpoirierlol, k. i guess i need to do some research; i had a similar problem when I named a file test.nim
19:30:40BlaXpiritthat's... difficult
19:30:48BlaXpiritprobably not gonna do that
19:30:58dtscodeadd it to your path? not that hard. its what i do
19:31:15BlaXpiriti have it in usr bin
19:31:17BlaXpirit....
19:31:47BlaXpiritthe hard part is building it
19:32:05BlaXpiritwell maybe not, i'm just layz
19:32:07BlaXpiritlazy
19:32:10dtscodei just added export PATH=$PATH:~/.mini-bin to my bash rc, then install the Nimrod git repo to there, and make a symbolic link so that bin/nim is in ~/.mini-bin
19:32:28BlaXpiritthat's ok
19:37:54*rpag joined #nim
19:40:29BlaXpiritwhat's result = x.firstName.hash !& x.lastName.hash
19:44:39*gsingh93 joined #nim
19:45:08Araqa hash computation
19:46:19BlaXpirit!& specifically, I can't find it anywhere
19:46:50Araqit's in hashes.nim
19:46:53BlaXpiritoh okay
19:47:05BlaXpiritno idea how to find that out on my own, seriously
19:47:19dtscodein the module asyncdispatch is TAsyncFD a type of socket?
19:47:43Araqoh common on now
19:47:45Araqhttp://nim-lang.org/theindex.html
19:47:51AraqCRTL+F !&
19:48:02Araq--> first and only hit: hashes module
19:49:39BlaXpiritAraq, you're forgetting that theindex.html is a top secret document that nobody knows about, because it is never mentioned
19:50:04Araqhttp://nim-lang.org/documentation.html
19:50:15AraqSearch Options
19:50:17AraqDocumentation Index - The generated index. Index + (Ctrl+F) == Joy
19:50:18BlaXpiritright
19:50:37ldleworkwe should definitely put it as a fourth link in the normal block
19:50:51Araqbut you're right, every document should scream this link
19:50:57ldleworkIts a good one
19:51:20Araqjust like every compilation should shout at you "DEBUG BUILD! FOR PERFORMANCE TESTING USE -d:release"
19:51:34ldleworklol
19:52:06ekarlso-nimble publish < would be a fun command
19:52:14Araqthe only thing we cannot do unfortunately is to bang your head against a wall for you
19:53:21BlaXpiritso... could someone try to run c2nim on CommonMark...
19:54:09ldleworkflaviu: is your name a reference to the Nimrod lore?
19:55:43Araqdtscode: I don't know
19:55:56dtscodealright
19:56:12dtscodeill ask dom96 when he wakes up?
19:56:26Araqyup
19:56:31ldleworkAraq: would you mind a PR to add anchors to the theindex symbol headers?
19:56:40dtscodei didnt to put the question mark :/
19:56:46dtscodeidk why i keep doing that
19:57:08Araqbecause there are no stupid questions, only stupid answers
19:57:34Araqldlework: what do you mean?
19:57:57ldleworkAraq: you know how it eventually starts listing all the API symbols, and all the ambigiguous places its defined?
19:58:01ldlework`$`:
19:58:05dom96dtscode: what's up?
19:58:06ldleworkthen all the $'s in the stdlib
19:58:29Araqldlework: we just need to cut off the wrappers and not build their docs
19:58:29ldleworkAraq: I'd like to make `$`: a link, an anchor
19:59:03ldleworkAraq: I'm thinking more for a documentation bot, so I can do "talmud: `$`"
19:59:10ldleworkand it would link to that anchor in the index
19:59:26dtscodedom96, so im rewriting nimbus in asyncio (as you originally said to :} ) and im reading the asyncdispatch module, I was wondering what exactly TAsyncFD
19:59:26*BlaXpirit_ joined #nim
19:59:28dtscode?
19:59:33Araqldlework: ok go ahead
20:00:35dom96dtscode: I originally suggested that you should use the IRC library, you should still do that.
20:00:36ldleworkI should figure out which commit broke SDL first
20:00:55dom96dtscode: You don't need to worry about TAsyncFD.
20:01:03ldleworkdom96: I would love a small article on how to use the callback/futures style of async programming in Nim
20:01:15ldleworka tiny one!
20:01:18BlaXpirit_re module does not support replacing with a function? T_T
20:01:28dtscodedom96, oh thats right... i looked at it last night though and the poll function had a disclaimer. ummm let me find it
20:01:35dom96ldlework: There is an example here: http://nim-lang.org/asyncnet.html
20:01:45dom96What would you like that article to cover?
20:02:27ldleworkdom96: does Nim's async stuff have the concept of a Deferred?
20:02:28Araqldlework: did I get a bug report from you about devel?
20:02:40ldleworkAraq: that's what I'm saying I'm gonna do right now, before the docs thing
20:02:49*BlaXpirit quit (Ping timeout: 264 seconds)
20:02:50dtscode>a somewhat asynchronous IRC implementation, although it should only be used for simple things for example an IRC bot which does not need to be running many time critical tasks in the background.
20:02:53ldleworkdom96: like when you do some async operation you get back an object you can attach a callback to?
20:03:04dtscodeNimbus will be running quite a few things in the background
20:03:21dom96dtscode: Use NimBot as an example: https://github.com/nim-lang/nimbot/blob/master/src/nimbot.nim
20:03:43ldleworkdom96: I think his concern is that he will be doing lots of background stuff and doesn't want to block the IRC from responding to pings and such
20:03:43dtscodealright dom96. thanks
20:03:58dom96ldlework: Have you read the docs in asyncdispatch?
20:04:06ekarlso-anyone wanna help with packages ? :D
20:04:21ldleworkdom96: Alright, give me a chance to review the stuff and I'll ask for an article again if I just find it perplexing
20:04:51dom96I think it would be better to improve the docs because redirecting everyone to an article will be a pain.
20:05:04dom96I do want to write an article about how the async stuff works though.
20:05:09dom96I've already got it pretty much written.
20:06:17ldleworkdom96: can you give me a yes or no, on the Deferred style of doing things? Is that what asyncdispatch is?
20:06:41ekarlso-hmm, to get packages by tag, do http://foo/packages?tag=foo or http://foo/tags/foo/packages ?
20:06:45ldleworkThis includes a dispatcher, a Future type implementation, and an async macro which allows asynchronous code to be written in a synchronous style with the await keyword.
20:06:48ldleworknm!
20:07:12dom96^^
20:07:13*ldlework huggles dom96
20:07:20dom96:)
20:07:29dom96Let me know if you have any other questions.
20:07:30dom96bbl
20:12:47VarriountAraq: What is it you want me to work on? more of the buildbots? compiler bugs? idetools?
20:13:06Araqidetools
20:13:27dtscodedom96, in nimbot is irclog and irclogrender just meant for logging or does it do anything specifically for the irc part of the bot?
20:13:34dtscodeyes plz ide tools
20:18:41*SplinterOfChaos joined #nim
20:21:52Araqhi SplinterOfChaos welcome
20:22:34SplinterOfChaoshi
20:23:05ldleworkdtscode: lol
20:23:54ekarlso-should we store somekind of download stats of packages ?
20:24:00ekarlso-or is that wrong
20:24:56ldleworkekarlso-: in my experience those numbers are meaningless
20:25:15ekarlso-ldlework: ok by me :p
20:25:28ldlework"Oh look at how many times some bot downloaded my package!"
20:25:31ekarlso-:D
20:25:37ekarlso-a rating maybe ?
20:25:43ekarlso-a'la user +1
20:26:01ldleworkekarlso-: that's far more useful
20:30:52ldleworkhttps://github.com/Araq/Nim/commit/5e4ae8dbb4f5e3ca8cf8c1fb356ca0f500f32746 is the commit that breaks our app
20:33:39ldleworkekarlso-: you should still track downloads though
20:33:44ldleworkbut we shouldn't expose those to end users
20:33:55ldleworkbut they are useful metrics for non-popularity considerations
20:37:28Araqldlework: what does produce with your code? crashes?
20:37:40ldleworkhttps://github.com/Araq/Nim/issues/1899
20:38:50ldleworkSeems like it crashes while compiling rather than running
20:39:03ldleworkno idea tho
20:39:31flaviuekarlso-: Maybe make the download stats only available to package maintainers?
20:40:03ldleworkflaviu: is your name a reference to Nimrod lore?
20:40:08*Nimbus quit (Remote host closed the connection)
20:40:28flaviunope!
20:40:33flaviuIt's actually my name :P
20:41:29ldleworkhttp://en.wikipedia.org/wiki/Nimrod
20:41:35ldleworkCTRL-F flaviu
20:41:37ldlework:)
20:42:14dtscodeflaviu, its your real name?
20:44:13*bjz quit (Ping timeout: 264 seconds)
20:44:27*superfunc|busy quit (Ping timeout: 244 seconds)
20:44:42*Demon_Fox joined #nim
20:44:48flaviuldlework: interesting coincidence.
20:44:53flaviudtscode: yes, it is.
20:44:59dtscodeinteresting
20:45:02Araqldlework: 'koch boot' and try it please so that I havea meaningful stacktrace
20:45:34ldleworkAraq: I built the compiler with "./koch boot -d:release"
20:45:38ldleworkoh
20:45:39*Mimbus quit (Read error: Connection reset by peer)
20:45:41*flaviu quit (Read error: Connection reset by peer)
20:45:52ldleworkbuilding..
20:48:52*flaviu joined #nim
20:52:51*repax quit (Quit: repax)
20:55:38*flaviu quit (Read error: Connection reset by peer)
20:56:12Araqldlework: you know this shouldn't take a year
20:56:45*brson joined #nim
20:57:18ldleworkactually its still building the compiler
20:59:41EXetoCwhat's your hardware? it takes about a minute for me (3.4GHz AMD APU)
21:00:44EXetoC"./koch temp" to generate nim_temp
21:02:11ldleworkI did "./koch boot"
21:02:40EXetoCjust saying. they do almost the same thing
21:03:17ldleworkI don't understand that
21:03:19ldleworkit seems magical
21:03:53*flaviu joined #nim
21:04:19EXetoCbut flaviu recommended release mode but with stack traces. you then have your stack traces, but it shouldn't be that slow
21:07:03Araqldlework: don't use -d:useSysAssert -d:useGcAssert !
21:07:10ldleworkI'm not :(
21:07:48dtscode-d:tripleSpeedWithNoDownsides maybe?
21:08:24ldleworkhaha
21:08:49EXetoCldlework: how long did it take?
21:09:54*Lordovos joined #nim
21:11:22ldleworkAraq: if I use those flags to build once, and the build again without them, do they stick around or something?
21:11:33ldleworkI just recloned and am rebuilding and its going a lot faster
21:11:47Araqno but guess what
21:11:54ldleworkAraq: https://gist.github.com/62855fb88c14bee46304
21:12:00Araqbuilt it once with these and your 'nim' is slow
21:12:01*tinAndi joined #nim
21:12:09ldleworkAh
21:12:16BlaXpirit_"a a".replace(re"a a") == "a a"
21:12:16ldleworkmakes sense
21:12:18BlaXpirit_what am i missing?
21:13:03*shodan45 joined #nim
21:13:34BlaXpirit_why does re"a\ a" work
21:13:52BlaXpirit_OK I see, extended flagson by default
21:25:52dtscodedom96, your tab size is too small
21:30:40*superfunc|busy joined #nim
21:41:57BlaXpirit_I think this is a useful addition to `re` module: https://gist.github.com/BlaXpirit/15ed8ea0bc3f35e973fc
21:42:10BlaXpirit_"Regular expression replacement using results of calling a procedure"
21:42:27BlaXpirit_Python has something like that, anyway
21:42:44BlaXpirit_Araq, would a pull request with such an addition be accepted?
21:44:14AraqBlaXpirit_: flaviu already implement that one
21:44:19BlaXpirit_wha :o
21:44:26Araqneeds review though
21:44:36BlaXpirit_dang it
21:44:53flaviuhttps://github.com/Araq/Nim/pull/1855
21:45:04BlaXpirit_i see now...
21:45:39flaviuIf the previous implementations were correct, then my version is correct too.
21:46:11flaviuI just replaced the by with a function invocation and assert (to reduce user error)
21:47:07BlaXpirit_flaviu, but do consider the differences in my thingy
21:47:13*gokr_ quit (Quit: IRC for Sailfish 0.8)
21:47:33BlaXpirit_first, the array of matches is truncated for convenience (example shows why it's convenient)
21:47:41*gokr_ joined #nim
21:47:45BlaXpirit_and the other version that just takes a proc on a string
21:47:58BlaXpirit_just see the examples basically
21:48:24BlaXpirit_but damn, what are the odds that we did the same thing within 4 days T_T
21:49:38flaviuBlaXpirit_: s/0..MaxSubpatterns-1/MaxSubpatterns
21:49:42*Sergio965 joined #nim
21:50:06BlaXpirit_flaviu, it's not so important. i just wanted to be consistent to the rest of the code
21:50:24flaviuThe rest of the code is old, it was written before that syntax was valid
21:50:31flaviubut fair enough, I suppose
21:50:33BlaXpirit_i guessed so
21:50:41BlaXpirit_flaviu, but what about the ideas?
21:50:54flaviuAlso, IMO add(result -> result.add
21:51:06BlaXpirit_flaviu, again, consistent to the rest of the code
21:51:09jpoirieram i abusing result if I'm doing assignments to fields when the return type is a tuple or "object of TObject", e.g. result.err = , result.dev =, etc.?
21:51:12BlaXpirit_i wouldn't write it like that othwise
21:51:36BlaXpirit_jpoirier, with tuple it probably wouldn't work
21:51:46BlaXpirit_but with object it's totally fine and probably best
21:53:08jpoirierBlaXpirit_: tried it with tuples and it seems to work
21:53:20jpoiriershould it not?
21:53:38BlaXpirit_i dunno, in most languages tuples are immutable, so i thought.....
21:53:44flaviuBlaXpirit_: yeah, it looks good. I don't understand what you mean by "the array of matches is truncated for convenience"
21:53:49BlaXpirit_i don't find tuples particularly useful in nim
21:54:31BlaXpirit_flaviu, it means the opposite of "and accessing a capture index above the number of actual captures is undefined behavior."
21:54:49BlaXpirit_2 captures - you get array of 2 items
21:55:12flaviuBlaXpirit_: Same as seqs, you can modify tuples if you keep them in a `var`.
21:55:25flaviuBlaXpirit_: But out of bounds access *is* undefined behavior
21:55:29BlaXpirit_ok, then the name "tuple" is very misleading
21:55:34BlaXpirit_flaviu, ok, maybe it is xD
21:55:42BlaXpirit_just see my example at the bottom
21:55:55BlaXpirit_it allows iteration over captures
21:56:11flaviuAh, I see.
21:57:02BlaXpirit_flaviu, so yeah, consider that and simpler version that calls proc with just a string
21:57:13BlaXpirit_Python actually calls it with both
21:57:31BlaXpirit_match[0] is the whole string, and match[1...] is captures
21:57:37BlaXpirit_i dunno
21:57:52flaviuBlaXpirit_: clean up the code so it uses modern style, and I'll rescind my PR.
21:58:02flaviuI like your ideas better
21:58:07BlaXpirit_flaviu, no need to use my code though
21:58:11BlaXpirit_you can add to yours
21:59:05BlaXpirit_how do I officially license you to use that gist without limitations? :|
21:59:43BlaXpirit_ahh it may be problematic with your 2nd commit
21:59:54BlaXpirit_because too much performance is lost
22:00:11flaviuWhy would that be?
22:00:50BlaXpirit_well that slice "the array of matches is truncated for convenience" may be too much overhead
22:00:51ekarlso-how can u append to a string ?
22:01:01ldleworkekarlso-: ...
22:01:01BlaXpirit_s.add "x"
22:01:03BlaXpirit_i think
22:01:11BlaXpirit_i just found out xD
22:01:12flaviuBlaXpirit_: Have you benchmarked it? I expect it to be nearly free.
22:01:23BlaXpirit_flaviu, no idea how to do that
22:01:29ldleworkekarlso-: please use the docs for such basic questions
22:01:44ekarlso-ldlework: ya, u be correct
22:01:53BlaXpirit_flaviu, consider that it needs to be done for every single replacement
22:02:03BlaXpirit_including the basic versions of the function, if your 2nd commit passes
22:02:19BlaXpirit_needless overhead
22:02:20*Sergio965 quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
22:02:48ekarlso-so nothing like py's foo += "":(
22:02:53BlaXpirit_make one?
22:03:16BlaXpirit_ekarlso-, &= works
22:04:16flaviuBlaXpirit_: I think I figured out how you could send it to me. `git format-patch devel --stdout` from your patch branch
22:04:25flaviuand then just gist and message me it
22:04:46flaviuYour name appears in the commit logs, and credit is given where it is due.
22:04:50BlaXpirit_flaviu, but it kinda conflicts with your 2nd commit, doesn't it?
22:04:53*gour quit (Quit: Leaving)
22:05:10flaviuWe'll see :)
22:05:16BlaXpirit_...
22:05:24flaviuI'll benchmark it and everything
22:10:36BlaXpirit_flaviu, https://gist.github.com/BlaXpirit/15ed8ea0bc3f35e973fc#file-0001-add-regex-replacement-using-results-of-calling-a-pro-patch
22:10:47BlaXpirit_seems kinda counterproductive to use this code though
22:11:49*gokr_ quit (Ping timeout: 264 seconds)
22:12:05*gokr_ joined #nim
22:12:12ekarlso-how can u iterate over k, v of a stringtable?
22:13:05BlaXpirit_ekarlso-, for k, v in astringtable
22:13:17BlaXpirit_now go read tutorials and manual
22:14:42ekarlso-BlaXpirit_: yea, i should kinda ^^
22:17:52*adam_s joined #nim
22:19:41BlaXpirit_damn, flaviu
22:19:45BlaXpirit_I already need another usecase
22:19:52BlaXpirit_javascript:
22:19:56BlaXpirit_text.replace(/\t/g, function(match, offset) {
22:20:35BlaXpirit_Python's approach is so universal https://docs.python.org/library/re.html#re.MatchObject
22:21:08flaviuYeah, I was thinking similar thoughs
22:21:19flaviualthough I haven't used python's re
22:21:23BlaXpirit_you can get string itself, its span, captures, whatever you want
22:21:26AraqPython's approach doesn't work
22:21:37BlaXpirit_?
22:21:48Araqmatch = re.search(pat, s)
22:21:55Araqif match:
22:22:09Araqelif (match = re.search(pat, s))
22:22:34Araqoh wait, Python doesn't support that so you have to indent the heck out of a match chain
22:22:57BlaXpirit_don't forget return
22:23:12Araqyou cannot always 'return'
22:23:15flaviuI see no arguments against the library design, just against the language syntax.
22:23:34Araqthe library design needs to fit the language
22:23:54flaviuso make a list of (regex, function)
22:23:56BlaXpirit_i get it, but the point is, currently Nim's re library does not fit my needs
22:24:09BlaXpirit_and right now I need a use case that isn't even covered by that patch
22:24:15*infrashortfoo quit (Remote host closed the connection)
22:24:47BlaXpirit_honestly, modeling some of the stuff after javascript might be a reasonable idea
22:25:03BlaXpirit_because i think regex is one of the few things it got right
22:25:12Araqyes, but don't copy anything blindly
22:25:25Araqthat's all I'm saying really
22:26:11BlaXpirit_i just realized using findBounds directly is not so different to what javascript has
22:26:37flaviuBlaXpirit_: Javascript's implementation is non-ideal in several ways
22:27:07flaviubut it also seems to be similar to python
22:27:07gokrHard to keep up with this channel. That's good :)
22:28:07flaviuHonestly, python's API seems nearly perfect.
22:28:36BlaXpirit_if you mean just regex, then yeah, it's quite good
22:29:00BlaXpirit_(performance is abysmal, i expect, but whatever)
22:29:00flaviuI'm looking at MatchObject's API
22:29:04BlaXpirit_yes
22:29:14BlaXpirit_and what does it need? 2 numbers and a reference to string or something
22:29:18BlaXpirit_the rest would be procs
22:29:27flaviuyep, and we could do lazy string slicing!
22:29:45BlaXpirit_so many amazing things can be done in nim
22:29:59flaviu"Don't need this match? Ok, we won't do an allocation for it."
22:30:15BlaXpirit_let's just go ahead and copy python's standard library
22:30:45*saml_ quit (Quit: Leaving)
22:31:01flaviuBlaXpirit_: Ok, you read over man pcreapi :P
22:31:09BlaXpirit_flaviu, why?
22:31:29flaviujust joking, it's extremely long and extensive
22:31:32BlaXpirit_lol ok
22:31:39BlaXpirit_we can copy from existing nim implementation too
22:31:59flaviuIt'll be more fun if we don't.
22:32:09flaviuWe can use the pcre module to save a bit of work tho
22:32:13BlaXpirit_i have a bit different notion of fun
22:32:54BlaXpirit_if everything is done, i don't see why we shouldn't look at it
22:33:44flaviuOk.
22:34:11BlaXpirit_now, how serious are we here?
22:34:24flaviuI'm completely serious.
22:34:56BlaXpirit_so we're planning to implement a library in Nim that follows Python's re
22:35:03BlaXpirit_whatever, i've got time
22:36:38*irrequietus quit ()
22:38:38BlaXpirit_aha, i just realized... what about unicode?
22:39:05*Sphax quit (Read error: Connection reset by peer)
22:39:38*Sphax joined #nim
22:39:58Araqwe have over 350 open issues. do you really think a new re module is what people want?
22:40:07Araqand need the most?
22:40:23BlaXpirit_no
22:40:36*yglukhov_____ quit (Quit: Be back later ...)
22:40:38flaviuAraq: You know that the compiler is scary.
22:40:54Araqflaviu: there are open issues for the stdlib too
22:41:08Araqothers affect the docs
22:41:20Araqwe even have an 'easy' tag
22:42:35BlaXpirit_that MaxSubpatterns tho :|
22:42:49Araqthat is already mostly gone
22:43:07BlaXpirit_reEmail can be so harmful
22:43:31*superfunc|busy quit (Ping timeout: 256 seconds)
22:43:35wtwis it possible that my compiler (0.9.2) doesn't know 'generic' as in type foo = generix x,y?
22:43:49BlaXpirit_0.9.2 is unforgivably old
22:43:57wtwFreeBSD port :/
22:44:17AraqreEmail was added from a blog post about how to match emails, BlaXpirit_
22:44:29wtwor rather package but the source port is equally old
22:44:37BlaXpirit_Araq, okay, but it's completely wrong
22:44:37AraqI didn't came up with it, it seemed a credible source
22:44:58BlaXpirit_list of top-level domains is ever growing
22:45:18flaviuIt's best to let the user to come up with their own stupid regular expressions.
22:45:22Araqnote that it matches realworld email addresses and not the RFC, but yes, it's totally outdated
22:45:30Araq*matched
22:45:40BlaXpirit_doesn't match [email protected]
22:46:08Araqmake a PR, deprecate it
22:46:12Araqlater we'll remove it
22:46:19Araqhow hard can it be?
22:46:35dom96dtscode: My tab size is the Nim convention.
22:46:51dtscodeits still too small
22:46:57BlaXpirit_can't help but agree with dtscode though
22:47:15dtscodealso thanks dom96
22:49:46*yglukhov_____ joined #nim
22:49:46*yglukhov_____ quit (Client Quit)
22:51:45*yglukhov_____ joined #nim
22:52:48*tinAndi quit (Quit: ChatZilla 0.9.91.1 [Firefox 34.0/20141125180439])
22:56:15*yglukhov_____ quit (Ping timeout: 252 seconds)
22:56:51*z1y joined #nim
22:57:23*z1y quit (Remote host closed the connection)
22:57:43*z1y joined #nim
23:00:55*Matthias247 quit (Read error: Connection reset by peer)
23:01:41*hasenj quit (Quit: hasenj)
23:05:46BlaXpirit_omg this is so sad
23:05:58*aw1231 joined #nim
23:06:08BlaXpirit_"1234"[.. 0] == "1"
23:06:12BlaXpirit_s[.. -1] == "1234"
23:07:10aw1231Hi, I'm having some trouble compiling Aporia. I get "Error: unhandled exception: assignment to discriminant changes object branch [Fi eldError]"
23:08:44*Trustable quit (Quit: Leaving)
23:10:45*z1y quit (Quit: Leaving.)
23:13:46*yglukhov_____ joined #nim
23:15:02Araqaw1231: does the compiler say that or aporia?
23:15:10*adam_s quit (Quit: Leaving)
23:15:53aw1231I think it's the compiler. I run "nim c aporia".
23:16:53Araqwhich version of the compiler?
23:17:23aw1231The latest. I use the "devel" branch.
23:27:45Araqtry master please. devel is broken
23:28:47gokrBlaXpirit_: Good work there on nim-csfml!
23:28:56BlaXpirit_ok thanks
23:29:02BlaXpirit_people look at the lib and say it's good
23:29:08BlaXpirit_but has anyone tried to put it to use?
23:29:46gokrIt might come handy for us, not sure yet. Parts of it.
23:32:32*areckizb joined #nim
23:37:30*dapz joined #nim
23:43:29*JinShil joined #nim
23:45:14*Sphax quit (Quit: CYA!!)