<< 05-09-2017 >>

00:00:36*francisl quit (Quit: francisl)
00:01:01*francisl joined #nim
00:01:23*francisl quit (Client Quit)
00:03:41*Pisuke quit (Ping timeout: 240 seconds)
00:07:12*Matthias247 quit (Read error: Connection reset by peer)
00:11:49*Serenit0r joined #nim
00:14:01*Serenitor quit (Ping timeout: 240 seconds)
00:32:27*Serenitor joined #nim
00:33:41*Serenit0r quit (Ping timeout: 240 seconds)
00:35:38*vlad1777d quit (Remote host closed the connection)
00:52:15*Jesin quit (Ping timeout: 248 seconds)
01:03:35def-pri-pubAny good way to make the C compilation step of Nim run faster? I tried `tcc` and there wasn't much of a meaningful speed boost
01:14:21*Jesin joined #nim
01:20:41*def-pri-pub quit (Ping timeout: 240 seconds)
01:41:55*chemist69 quit (Ping timeout: 255 seconds)
01:55:47*chemist69 joined #nim
02:14:07*def-pri-pub joined #nim
02:14:07*def-pri-pub quit (Changing host)
02:14:07*def-pri-pub joined #nim
02:33:20TangerHey guys, does anybody know of a working example using websockets and nim >= 0.17.0
02:37:47def-pri-pubtry this: https://github.com/niv/websocket.nim ?
02:43:45*Kingsquee quit (Quit: https://i.imgur.com/qicT3GK.gif)
02:46:32*yglukhov joined #nim
02:51:12*yglukhov quit (Ping timeout: 260 seconds)
03:11:10*endragor joined #nim
03:22:16*Kingsquee joined #nim
03:25:50*Serenit0r joined #nim
03:29:37*Serenitor quit (Ping timeout: 248 seconds)
03:37:38*Pisuke joined #nim
03:38:35*dddddd quit (Remote host closed the connection)
03:47:58*yglukhov joined #nim
03:52:31*yglukhov quit (Ping timeout: 248 seconds)
04:04:34*def-pri-pub quit (Quit: leaving)
04:05:17*Kingsquee quit (Read error: Connection reset by peer)
04:05:39*Kingsquee joined #nim
04:13:28*haha_ joined #nim
04:14:17FromGitter<Varriount> def-pri-pub: Turn off all optimization?
04:15:05*haha_ quit (Client Quit)
04:18:35*relax joined #nim
04:25:57*BigEpsilon joined #nim
04:47:58Tangerdef-, Sweet, cheers man.
04:59:36*relax quit (Ping timeout: 240 seconds)
05:00:29*miran joined #nim
05:14:27*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
05:23:55*Vladar joined #nim
05:30:39*miran quit (Ping timeout: 248 seconds)
05:38:09*BigEpsilon quit (Ping timeout: 248 seconds)
05:44:12*miran joined #nim
05:44:27*cspar_ quit (Ping timeout: 260 seconds)
05:50:05*cspar_ joined #nim
05:50:21*miran quit (Ping timeout: 240 seconds)
06:05:33*BigEpsilon joined #nim
06:08:08*Serenit0r quit (Quit: Leaving)
06:10:48*nsf joined #nim
06:44:01*filcuc joined #nim
06:50:43*yglukhov joined #nim
06:54:55*yglukhov quit (Ping timeout: 248 seconds)
06:56:58*yglukhov joined #nim
06:57:45*yglukhov quit (Remote host closed the connection)
06:58:13*yglukhov joined #nim
07:04:10*PMunch joined #nim
07:04:17*gokr joined #nim
07:09:10*yglukhov quit (Remote host closed the connection)
07:33:37*claudiuinberlin joined #nim
07:33:43*yglukhov joined #nim
07:38:07*yglukhov quit (Ping timeout: 248 seconds)
07:40:37*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
07:42:07*vlad1777d joined #nim
07:47:03*claudiuinberlin joined #nim
07:51:46*claudiuinberlin quit (Client Quit)
07:55:41FromGitter<Bennyelg> Hey, I want to modify key with new value (table type) how do I do that?
07:55:48FromGitter<Bennyelg> args.mgetOrPut(args, "sql", "tmpTable") not work
07:56:57*nattefrost joined #nim
07:57:35Araqargs["sql"] = "tmpTable"
07:57:47FromGitter<Bennyelg> not working .
07:58:01FromGitter<Bennyelg> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59ae5908ee5c9a4c5f3474b2]
07:58:47FromGitter<Bennyelg> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59ae5937ee5c9a4c5f347551]
08:00:01FromGitter<superfunc_twitter> I think the table is immutable
08:00:11FromGitter<Bennyelg> seems like
08:00:16FromGitter<Bennyelg> but this is very strange lol
08:00:21FromGitter<superfunc_twitter> You'd need `var Table[string, string]`
08:00:26FromGitter<superfunc_twitter> in the type signature
08:00:59FromGitter<Bennyelg> I pass Table from another scope
08:01:06FromGitter<Bennyelg> I just want to add/ modify/delete keys from it
08:01:15FromGitter<Bennyelg> I need to ref to another object?
08:02:36*cspar_ quit (Ping timeout: 252 seconds)
08:03:23FromGitter<superfunc_twitter> if the table being passed in is a var, then you just need to change the type sig
08:05:07*claudiuinberlin joined #nim
08:05:20FromGitter<Bennyelg> how can I pass it as a var just x(var x: Table[..]) ?
08:05:31FromGitter<Bennyelg> how to cast Some() value to string
08:06:12FromGitter<Bennyelg> I tried with the format() but it did not help
08:06:33FromGitter<FridgeSeal> @zacharycarter I (finally) finished my Nim re-write of my Python lambda function and got everything working! I couldn't get the dll/so approach working via Python's CTypes (kept crashing with an uncatchable `out of memory` error, but I got the integration working using the PyMod library (https://github.com/jboy/nim-pymod)
08:06:42FromGitter<superfunc_twitter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59ae5b12ba0f0f6e381a7041]
08:06:59FromGitter<Bennyelg> thanks
08:07:12FromGitter<superfunc_twitter> sorry I apparently dont know how to format lmao
08:15:04*couven92 joined #nim
08:15:22FromGitter<Bennyelg> Did I found A bug? ⏎ I try to replace "some string is now big" using Some("some string") ⏎ "some string is now big".replace(Some("some string") , "") ⏎ noting happend [https://gitter.im/nim-lang/Nim?at=59ae5d1a210ac26920f78c19]
08:16:40*cspar_ joined #nim
08:17:30*Matthias247 joined #nim
08:17:49FromGitter<superfunc_twitter> strutils replace returns a new string, doesn't modify the original
08:19:32FromGitter<Bennyelg> I tried that already not change but let me try again
08:20:15FromGitter<Bennyelg> Not working.
08:21:11FromGitter<Bennyelg> To be clear, this ⏎ ⏎ ``` var x = "Hello world" ⏎ var x2 = x.replace("world", "") ⏎ echo(x2)``` [https://gitter.im/nim-lang/Nim?at=59ae5e77b16f2646420881f6]
08:21:13FromGitter<Bennyelg> is working
08:21:31FromGitter<superfunc_twitter> can you paste the snippet that isnt?
08:21:36FromGitter<Bennyelg> but If you get `Some` type value after nre it, try to replace it and it wont work
08:23:21FromGitter<Bennyelg> contains also return false
08:23:22FromGitter<Bennyelg> lol
08:23:24FromGitter<Bennyelg> this is funny
08:23:50FromGitter<superfunc_twitter> without the failing snippet I'm just shooting in the dark
08:24:16FromGitter<Bennyelg> you don't need snippet try to simulate simple 3 lines
08:24:37FromGitter<superfunc_twitter> lol ok good luck
08:24:54FromGitter<Bennyelg> thanks :-)
08:26:15*yglukhov joined #nim
08:30:53*yglukhov quit (Ping timeout: 255 seconds)
08:31:25*yglukhov joined #nim
08:33:26*yglukhov quit (Remote host closed the connection)
08:33:38*yglukhov joined #nim
08:38:58*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
08:44:37*vlad1777d quit (Quit: Leaving)
08:52:07cremIs ftsf someone on this channel?
08:52:18cremMorning!
08:54:01cremaka Jez Impbox
08:54:56*claudiuinberlin joined #nim
09:01:36*mahmudov quit (Remote host closed the connection)
09:01:55*thomasross_ joined #nim
09:04:06*thomasross quit (Ping timeout: 240 seconds)
09:09:53*dom96|w joined #nim
09:11:41cremWenn ich beider initObj und newObj brauche, was ist die typiche Weise das zu machen? Gibt es eine Weise die Codeduplication zu vermeiden ohne die dritte Function? (z.B. init(self: var Obj), die ist aus beider newObj und initObj geruft wird)
09:17:37FromGitter<mratsim> newObj for ref object, initObj for stack object
09:19:08cremI know that. What if I need both? Sometimes I use object on stack, sometimes on heap. Is there a way to e.g. call initObj from newObj to avoid code duplication?
09:21:05*Arrrr joined #nim
09:21:37cremAnyway, probably that's not needed often.
09:41:58*BitPuffin|osx joined #nim
09:42:50*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
09:53:00*endragor quit (Remote host closed the connection)
09:53:18flyxcrem: instead of a third proc, you can use a template
09:55:03*endragor joined #nim
09:59:29*endragor quit (Ping timeout: 248 seconds)
10:12:13*endragor joined #nim
10:12:14*endragor quit (Remote host closed the connection)
10:15:42*Arrrr quit (Ping timeout: 260 seconds)
10:22:17*endragor joined #nim
10:22:51*haha_ joined #nim
10:24:47*endragor quit (Remote host closed the connection)
10:26:17*ShalokShalom_ joined #nim
10:29:05*ShalokShalom quit (Ping timeout: 240 seconds)
10:30:52*ShalokShalom_ is now known as ShalokShalom
10:51:47*endragor joined #nim
10:52:04*dddddd joined #nim
10:54:34FromGitter<Bennyelg> does nim have pretty print for tables?
10:56:01*gokr quit (Ping timeout: 240 seconds)
10:58:25FromGitter<Grabli66> Why it's not working? https://play.nim-lang.org/?gist=a35a8a0c0148cbdd24b478d5b56a4b39
11:02:56flyxGrabli66: you need to make dosome() a template in order to capture the actual type of this
11:03:47flyxor at least that's what I expect
11:05:12FromGitter<Grabli66> I tried like this: template dosome(this : untyped) : untyped = echo this.type.name
11:05:16FromGitter<Grabli66> Also not works
11:08:19FromGitter<ChristianWitts> `echo this.name` works
11:09:19flyxGrabli66: echo name(this.type)
11:09:30flyxthat works with the proc version
11:10:16FromGitter<Grabli66> Great. It works
11:10:41flyxbut don't ask me why this.type.name does not
11:11:00FromGitter<Grabli66> Why it does not? :)
11:11:06flyxit confuses the compiler
11:11:12flyxI guess
11:14:22*Yardanico joined #nim
11:14:29FromGitter<k0pernicus> Is there any update about interfaces in Nim? I saw interesting blog posts in order to implement them as "user-space features", but is it planned to implement interfaces as a “language feature” level? :-)
11:19:46FromGitter<Bennyelg> no new line echo?
11:19:49FromGitter<Bennyelg> how
11:21:13FromGitter<k0pernicus> Benny: ?
11:21:21FromGitter<Bennyelg> >
11:21:22FromGitter<Bennyelg> ?
11:22:10FromGitter<k0pernicus> I don’t understand your question… You want to print something without new line ending?
11:22:18Araqstdout.write
11:22:20FromGitter<Bennyelg> yea
11:23:30FromGitter<Bennyelg> thanks.
11:24:27*haha_ quit (Quit: haha_)
11:24:43Araqhmm after the VS code update indentation is super fucked up, yay
11:26:16couven92Araq, oh so it's like that with you too? I was wondering whether I had just fucked my settings... :O
11:26:26cremReading others' nim code, it's a bit hard to find meaning of idenfieir defined in different module. It's just not clear where to search. (And I don't have an idea how that could be fixed. Probably using IDEs is good enough, but if it's just a code on github, then it's not simple.)
11:26:43*crem is afraid to sound criticizing again.
11:29:02AraqI heard that a lot and it never made too much sense.
11:29:27Araqvar x: MyObject; x.foo # where does 'foo' come from?
11:30:05Araqanswer: chances are high from where MyObject comes from.
11:30:26Araqthat's the same for every other widespread language out there, Python, Ruby, C#...
11:32:19cremBut where MyObject comes from?
11:32:37AraqMyObject.nim or myobjects.nim
11:32:44Yardanicocrem, "go to definition" ? :)
11:32:48Araqthe jury is still out, most prefer MyObject.nim
11:32:55FromGitter<Bennyelg> how I can multiple string ? for example echo("=" * 10)
11:32:56cremThere's no "go to definition" on github.
11:33:01PMunchHard to do on GitHub Yardanico
11:33:07YardanicoBennyelg: strutils.repeat
11:33:15Yardanicoso like
11:33:16FromGitter<Bennyelg> Thanks
11:33:20Yardanicoecho("=".repeat(10))
11:33:35Araqmaybe github is a primitive environment for code navigation. big surprise
11:34:30FromGitter<Bennyelg> Thanks.
11:35:51PMunchHaha, that's true Araq
11:36:07PMunchAnd I guess the problem here is more to do with people stylistic choices than anything else
11:36:13YardanicoAraq, crem, "go to definition" ? :)
11:36:16FromGitter<Grabli66> Maybe make a special command for compiler to list all procs with module name for some type? Example: nim proclist main.nim MyObject
11:36:16Yardanicooh sorry
11:36:17Yardanicowrong paste
11:36:21YardanicoAraq, https://github.com/Microsoft/vscode/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aopen%20indentation
11:36:22*dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…)
11:36:36Yardanico128 open, 383 closed
11:36:38PMunchIf people chose LongVerboseNamesThatReallyLayItOutForYou then it would be easy to see where that came from
11:37:07PMunchGrabli66 can't nimsuggest do that already?
11:37:15Yardanicoit can
11:37:23Yardanicobut not as a separate cmd afaik
11:37:50FromGitter<Grabli66> It can? Cool. I did not know
11:38:08Yardanicoit definitely can
11:38:13Yardanicobecause nimsuggest uses compiler :)
11:38:21FromGitter<Grabli66> Great
11:38:49FromGitter<Grabli66> Then, there is no problem at all :)
11:39:25*Arrrr joined #nim
11:40:53FromGitter<Grabli66> Hhhm. Nimsuggest is a tool for IDE? I can't use this from console?
11:41:56Yardanicoyou definitely can
11:42:05Yardanicobut yes, it's mostly for IDEs and text editors
11:43:04Yardanicoe.g. you can use it in vim/emacs/vscode/sublime (with nim plugins)
11:43:08Yardanicoalso in notepad++
11:43:19FromGitter<Grabli66> Ok. Tell me how i can get all procs for some type with nimsuggest. I don't see any command for that in nimsuggest
11:43:36Yardaniconimsuggest operates on files
11:44:42Yardanicohttps://nim-lang.org/docs/nimsuggest.html
11:47:25Araqgrabli66: that's 'nim doc2 foo.nim' and then "group by type"
11:50:58YardanicoAraq, are nim docs regenerated after new release?
11:51:01couven92Araq, BTW, editDistance for Unicode is not as simple as you suggested, you cannot easily get the upper or lower triangles (whatever those are) because there is no easily calcultable half of the string
11:51:51FromGitter<Grabli66> Great. I created documentation. But it's not what i want. In my source code, i use a "Request" object. And i want a list of all procedures, with module names that can be used with that object.
11:53:42PMunchcouven92, wouldn't you just handle them separately as glyphs?
11:53:51PMunchOr runes rather
11:54:06YardanicoPMunch, well
11:54:10Yardanicothis is slower
11:54:23couven92PMunch, I would, but Araq won't let be convert the string to runes, since it creates (very much) memory allocation overhead
11:54:38YardanicoI've implemented it with two runes sequences (the most inefficient way), and it was 20x slower than ascii version
11:55:58PMunchAah
11:56:22Yardanicowell it still can be done faster
11:56:25Yardanicobecause I choose the easy way
11:56:40Yardanico(store two seqs of each string runes)
11:56:56FromGitter<Bennyelg> way i cant do this: typeMapping.keys.join(",")
11:57:08AraqGrabli66: so ... and how do you think this can work? nimsuggest compiles any .nim file out there for you to answer that question?
11:57:23AraqtoSeq(typeMapping.keys).join","
11:57:27Yardanicoyeah
11:57:33Yardanicothere's a feature request on github btw
11:57:38Yardanicofor this exact proc
11:57:55Yardanicohttps://github.com/nim-lang/Nim/issues/943
11:58:17Yardanicowell it would be easy to add "keys" proc which will return a seq
11:58:25Yardanicobut I don't know if it would be a good addition to stdlib
11:58:25FromGitter<Bennyelg> @Araq it's not working
11:58:29Yardanicoimport sequtils
11:58:38FromGitter<Bennyelg> undecleard field 'keys'
11:58:40Yardanicoah
11:58:44Yardanicowait
11:58:50Yardanicowhat is your "typeMapping" ?
11:59:09FromGitter<Grabli66> <Araq>, i think that nimsuggest can get all imported files for module, and get all procedures for type :)
11:59:12Yardanicoif you want to have something like a dictionary
11:59:16Yardanicoyou should use tables
11:59:17*Kingsquee quit (Remote host closed the connection)
11:59:32Yardanico{a: b, c: d} is just a syntax sugar for openarray[(value, value)]
11:59:37Yardanicohttps://nim-lang.org/docs/tables.html
11:59:49FromGitter<Bennyelg> typeMapping is a OrederdDict
11:59:54Yardanicoah
12:00:00Yardanicoordered dict?
12:00:00Yardanicowhat
12:00:18Yardanicomaybe ordered table?
12:00:23Araqbut then you already know the modules because you imported them, but yeah, nimsuggest can do that use an editor with nimsuggest support
12:01:20YardanicoAraq, what is the easiest way to make a link which will point to some proc/type in nim-generated docs?
12:01:21FromGitter<k0pernicus> Can we compute, at compile time, a regular expression?
12:01:42Yardanicono, because it requires C ffi
12:01:52Yardanicoand pegs doesn't work at compile-time AFAIK
12:01:53FromGitter<Bennyelg> yea it's ordered table
12:01:54Yardanicomaybe it was fixed
12:02:00FromGitter<Bennyelg> but now How I get only the keys
12:02:02Araqit wasn't
12:02:11FromGitter<k0pernicus> Aaah ok - I understand now the message `cannot 'importc' variable at compile time`
12:02:12AraqtoSeq(foo.keys)
12:02:28Yardanicoimport sequtils
12:02:30Yardanicoimport strutils
12:02:30YardanicotoSeq(foo.keys).join(",")
12:02:36Arrrryou can make a program and call it in compile time
12:02:38Yardanicoif you have "foo" declared
12:02:43FromGitter<Bennyelg> as I said "Undecleared keys"
12:02:51Yardanicoshow full source code please?
12:03:00FromGitter<Grabli66> <Araq>, i use VS code. But i think it can't show me that information, or i don't know how to show it.
12:03:06Yardanicoit can
12:03:09Yardanicowith nim plugin
12:03:18FromGitter<Grabli66> I use nim plugin
12:03:26FromGitter<Bennyelg> function parseTypes(): OrderedTable[string, string] =
12:03:27AraqGlabli66: you need to configure it
12:03:37FromGitter<Bennyelg> var x = parseTypes()
12:03:53FromGitter<Bennyelg> toSeq(x.keys).join(",") not working
12:04:07FromGitter<Grabli66> <Araq>, Is there a documentation how?
12:04:32FromGitter<Grabli66> Ok. I'll try to find
12:04:39YardanicoBennyelg: can you show full source code please
12:04:43Yardanicoe.g. which can compile separately
12:06:00YardanicoAraq, also, if I really know the size of seq, should I divide this size by 1.5? because as you said there's 1.5x of size you've specified
12:06:11Yardanicoah, no
12:06:13Yardanicoit's for "add"
12:07:41Araqyeah
12:10:55Yardanicoyou wouldn't believe this: in comments for two-year old article about Nim someone has left feedback like "nim is python in the javascript programmer's ass". So he thinks that Nim "stole" let/const from JS :D
12:12:17cremThere's no let/const in javascript (at least as of ES5), there are ones in typescript though.
12:12:28Yardanicocrem, there is in ES2015
12:12:50Yardanicocrem, as you speak russian - https://vk.com/groups?w=wall-54530371_156163
12:13:07Yardanicoit's a copy-paste of two-year old article about nim
12:13:22Yardanicowhich was written by the guys from ZEO alliance
12:13:48*endragor quit (Remote host closed the connection)
12:14:16*Snircle joined #nim
12:14:23cremprobably taken from typescript then, which surely had let/const in 2010. That's weird that it's stated as being released in 2012 as I'm sure I read docs about it before 2011.
12:15:38FromGitter<Yardanico> Well anyway this guy said this without any arguments :)
12:16:01FromGitter<Yardanico> And Nim development started in 2004 (if wiki is correct)
12:16:20*arnetheduck joined #nim
12:17:05cremIt's not at all important which language introduced particular feature (or keyword!) first.
12:18:35*Yardanico quit (Ping timeout: 240 seconds)
12:19:10AraqI took 'const' and 'var' from Pascal and 'let' from ML ...
12:19:33AraqTypescript/JS had no influence on Nim's design whatsoever
12:20:09FromGitter<Bennyelg> Any library which check if the import is unused?
12:20:10cremI like that declaring constant variable (which is safer) is not longer than declaring mutable one.
12:21:12AraqBennyelg, use nimsuggest, remove imports until the code stops working or just leave it, nobody gives a fuck about unused imports
12:21:20Araqthey don't cause any harm
12:23:03*claudiuinberlin joined #nim
12:23:11*endragor joined #nim
12:26:17FromGitter<Bennyelg> how do I use nimsuggest :D
12:26:38*endragor quit (Remote host closed the connection)
12:27:21*Yardanico joined #nim
12:28:34YardanicoI actually like the thing that you can easily go to nim stdlib with nimsuggest
12:30:11*rauss quit (Quit: WeeChat 1.9)
12:32:10*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
12:32:25FromGitter<Grabli66> Karax framework is abandoned?
12:32:30Yardanicoit's definitely not
12:32:36Yardanicobecause Araq himself develops Karax
12:32:47Yardanicocheck branches: https://github.com/pragmagic/karax/branches
12:32:52Yardaniconextgen Updated 5 days ago by Araq
12:33:19FromGitter<Grabli66> Ok. Is it ready for production?
12:33:51Yardanicoask Araq, but I think he uses it, or someone from Xored
12:34:30FromGitter<Grabli66> Good. Need to try.
12:35:50Yardanicowait what
12:35:57YardanicoHint: operation successful (19795 lines compiled; 0.121 sec total; 22.422MiB peakmem; Release Build) for compiling todoapp example from nim to JS
12:36:02Yardanicohow it's so fast?
12:36:09Yardanicoah, JS doesn't requires compilation
12:37:48FromGitter<Bennyelg> nimble packages
12:38:00FromGitter<Bennyelg> where can I find a source site like pypi
12:38:27FromGitter<stisa> @Bennyelg https://nimble.directory ?
12:38:29YardanicoWell nimble stores all package entries on github
12:38:32Yardanicobut yeah, use nimble.directory
12:39:06Yardanicowow!
12:39:14YardanicoI didn't knew nimble.directory has this: https://nimble.directory/ci/badges/pylib/nimdevel/output.html
12:40:35*Vladar quit (Remote host closed the connection)
12:41:36*haha_ joined #nim
12:41:44Yardanicomaybe I should make a small feature request to automatically remove ANSI sequences :)
12:41:47Yardanicoor colorize them :P
12:44:41cremIs nimble for nim the same as pip for python? What is koch? What is nake?
12:45:00*Vladar joined #nim
12:45:05Yardanicocrem, nimble is a package manager
12:45:11Yardanicokoch is a tool to build compiler and compiler tools
12:45:16Yardanicoso compiler-related stuff
12:45:31FromGitter<k0pernicus> Crem > https://github.com/nim-lang/Nim :-)
12:45:36Yardaniconake is Makefile-like thing which allows you to write ANY nim code to describe your tasks
12:45:42cremkoch is like bazel, ok.
12:45:48*BitPuffin|osx quit (Ping timeout: 240 seconds)
12:45:48FromGitter<Bennyelg> I want to add new package
12:45:56FromGitter<Bennyelg> I just need to write some tests first
12:46:03YardanicoBennyelg: you can use "nimble publish" or create PR manually
12:46:20Yardanicocrem, also, about nake - nimble with .nims files seems better
12:46:25FromGitter<Bennyelg> nice, i create everything and it's pretty ready
12:46:28Yardanicowell there are different opinions
12:46:31FromGitter<Bennyelg> I'll post you guys this message soon
12:49:50*rokups joined #nim
12:51:53YardanicoBennyelg: don't forget that github is a public thing and we can still find your repo :)
12:52:59FromGitter<Bennyelg> My first Nim program
12:53:01FromGitter<Bennyelg> https://github.com/Bennyelg/csvql
12:53:06*Jesin quit (Ping timeout: 240 seconds)
12:53:19Yardanicowell yeah I found it myself :P
12:53:32FromGitter<Bennyelg> pull requests/stars/ are very welcome
12:53:37Yardanicohttps://github.com/search?q=language%3ANim+created%3A2017-09-05
12:53:52FromGitter<Bennyelg> and of course if its worth to push it no nimble
12:54:33*dom96|w joined #nim
12:54:49FromGitter<Bennyelg> to*
12:57:15couven92do we have an echo with noSideEffects?
12:57:26def-couven92: debugEcho?
12:57:34Yardanicoyeah
12:57:47couven92def-, thanks! :)
12:58:02Yardanicoguys, noSideEffect is used by compiler to remove unused code?
12:58:49def-Not that I know of, but it could be in the future
12:59:08def-I think it's mostly used to check that you don't accidentally call something with side effects inside
12:59:15Yardanicoyeah I know about that
12:59:39*rauss joined #nim
13:02:29FromGitter<Grabli66> Nim programmer should avoid side effects? :)
13:02:50Yardanicono
13:02:58Yardanicoit's just here if programmer wants to know it
13:03:10couven92do we have do-while in Nim?
13:03:18def-couven92: you can make your own
13:03:19Yardanicono, but you can easily implement your do-while :P
13:03:27couven92:)
13:03:36Yardanicoit's pretty straightforward
13:03:37def-https://github.com/def-/nim-unsorted/blob/master/dowhile.nim
13:03:57def-(or use while true: ... if not a: break)
13:05:28FromGitter<Grabli66> Should nim developer avoid "try/catch", for better performance?
13:05:51couven92def-, Yardanico, yeah I know... I was just wondering, it's so rarely used in C#, C, etc., that I did know whether I just hadn't seen any do-whiles or whether it just not exists :)
13:07:57*haha_ quit (Quit: haha_)
13:14:59Yardanicodef-, looking at this - https://github.com/def-/nim-unsorted/blob/master/forest/funMagicForest.nim
13:15:15Yardanicomaybe we should add new proc like filterIt, but which will allow you to write the name of variable you want to use
13:15:22Yardanicoso like
13:16:11Yardanicoor wiat
13:16:13Yardanicoah yes
13:16:33*relax joined #nim
13:17:05Yardanicodef-, https://gist.github.com/Yardanico/186f11984d8c61ad4d275420f45f0635
13:17:30Yardanicooh wait it works actually
13:17:30cremhttps://github.com/ftsf/ld39-minisyn/blob/master/nico/nico.nim how can I find where updateFunc defined is. :-\
13:17:44Yardanicoeasy
13:17:45Yardanicohttps://github.com/ftsf/ld39-minisyn/search?utf8=%E2%9C%93&q=updateFunc&type=
13:17:54Yardanicohttps://github.com/ftsf/ld39-minisyn/blob/b7f695c1e18a37ec7b1fcc522f709ce252c98f37/nico/nico/backends/common.nim#L118
13:18:09Yardanicobut you probably want to search for setUpdateFunc
13:18:22Yardanicohttps://github.com/ftsf/ld39-minisyn/blob/b7f695c1e18a37ec7b1fcc522f709ce252c98f37/nico/nico.nim#L1423
13:19:14Yardanicoand also with nimsuggest this would be VERY easy
13:19:34Yardanicocrem, and also this "nico" is just a copy of this https://github.com/ftsf/nico
13:19:51def-Yardanico: i don't like to use templates too much
13:19:55Yardanicoso ftsf copied it to make distribution easier maybe
13:20:22Yardanicodef-, well, with them you can reduce the need for manually write types everywhere :)
13:21:29def-Yardanico: use the non-functional version instead ;)
13:21:45def-easier to read, faster
13:26:10*relax quit (Ping timeout: 264 seconds)
13:27:56*relax joined #nim
13:31:43*Jesin joined #nim
13:44:08*miran joined #nim
13:54:53*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
14:05:33FromGitter<Bennyelg> Review & comments are welcome :D ⏎ https://github.com/Bennyelg/csvql ⏎ I can say officially after first programming with nim - nim is fun.
14:06:54cremlines 18 and 19 could be merged into one.
14:11:57*relax quit (Ping timeout: 260 seconds)
14:13:22*nattefrost quit (Remote host closed the connection)
14:14:27YardanicoBennyelg: after you will add test I'll be able to change it :0
14:14:31Yardanicowithout breaking something
14:17:06Yardanicobecause I'll try to e.g. replace nre with "pegs", remove many repetitions
14:22:42YardanicoI already see where can I improve it :)
14:23:23*relax joined #nim
14:28:39*PMunch quit (Quit: Leaving)
14:31:13*claudiuinberlin joined #nim
14:31:37FromGitter<k0pernicus> Imagine I have more than 10_000 JSON files than contain three different fields (for example, `first_name`, `last_name` and `characteristics`). ⏎ `first_name` is a string. ⏎ `last_name` is a string. ⏎ `characteristics` is a sequence of string. ⏎ I want, for each of those files, to construct a vector which contains if this file contains a value or not (so, a vector of boolean values). ...
14:31:37FromGitter... [https://gitter.im/nim-lang/Nim?at=59aeb549614889d475c29e4f]
14:32:08*mahsav2 joined #nim
14:32:10FromGitter<k0pernicus> This code works, but the program takes about a minute to perform on less than 10_000 JSON files...
14:32:18FromGitter<Yardanico> did you compile it with -d:release ?
14:32:29FromGitter<k0pernicus> Do you have any idea how to speed up this program please?
14:32:34FromGitter<k0pernicus> HO! I FORGOT!
14:32:37FromGitter<k0pernicus> Thanks @Yardanico
14:32:45FromGitter<Yardanico> try with -d:release and give us results please :)
14:32:52FromGitter<Yardanico> I think IO would be a bottleneck here
14:33:03FromGitter<Yardanico> well it depends if your OS caches this files or nopt
14:33:05*mahsav quit (Ping timeout: 248 seconds)
14:33:19FromGitter<Yardanico> also
14:33:29FromGitter<k0pernicus> Ouch, I don’t know for the OS thing :-/
14:33:35*relax quit (Ping timeout: 240 seconds)
14:34:28FromGitter<Yardanico> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59aeb5f4614889d475c2a32e]
14:34:38FromGitter<Yardanico> You don't need to specify so many types by yourself
14:34:59FromGitter<k0pernicus> True, thanks :-)
14:35:10FromGitter<k0pernicus> So, without `release` flag: ⏎ real 1m6.705s ⏎ user 1m0.678s ⏎ sys 0m4.011s [https://gitter.im/nim-lang/Nim?at=59aeb61e66c1c7c4771995dc]
14:35:36*claudiuinberlin quit (Client Quit)
14:36:29FromGitter<k0pernicus> With `release` flag...
14:36:47FromGitter<k0pernicus> ```real 0m18.719s ⏎ user 0m13.797s ⏎ sys 0m3.811s``` [https://gitter.im/nim-lang/Nim?at=59aeb67f210ac26920f9570b]
14:36:55FromGitter<k0pernicus> JUST-WOW
14:37:05FromGitter<Yardanico> well I don't know if this is fast enough for you :)
14:37:25FromGitter<k0pernicus> If is takes more than 1 second, nop...
14:37:29FromGitter<k0pernicus> (joking :-p)
14:37:40FromGitter<k0pernicus> Yep, it’s good :-)
14:37:46FromGitter<k0pernicus> Thanks a lot @Yardanico :-)
14:37:47Yardanicoalso, why do you need "try" "except" in when isMainModule ?
14:37:57Yardanicoyou're not accessing any keys here
14:38:05Yardanicoyou should add try except in your get_json_nodes
14:38:24Yardanicobecause data will contain nim object
14:38:29Yardanicoso KeyError can't happen here
14:38:35FromGitter<k0pernicus> It’s a mistake actually
14:38:39*claudiuinberlin joined #nim
14:38:49FromGitter<k0pernicus> I forgot to copy that line after the `try` statement: `let data = to(node.get(), FeaturesTemplate)`
14:38:54Yardanicoah
14:38:55Yardanicook :)
14:39:00FromGitter<k0pernicus> Sorry for that :-)
14:39:26FromGitter<k0pernicus> Maybe I can avoid to “translate” my JSON datastructure into an object...
14:39:58Yardanicowell yeah, your program will take a bit less RAM maybe
14:40:00Yardanicoand will be a bit faster
14:40:09FromGitter<k0pernicus> So, instead of `let data = to(node.get(), FeaturesTemplate`, just grab the information I needed...
14:40:22FromGitter<k0pernicus> I will try a new version
14:40:49Yardanicoalso
14:40:55*claudiuinberlin quit (Client Quit)
14:41:21Yardanicoyou may also try to remove regex pattern of files :) well I don't really know if it will speed up or slow down your code
14:41:44YardanicoI mean to replace it with pegs/strscans if applicable
14:41:46Yardanicobut regexs are fine too
14:42:00FromGitter<k0pernicus> Yep, maybe try an `.endsWith(“.json”)` thing
14:42:18Yardanicoah
14:42:32YardanicoI thought you really need that regex to check if filename starts with some word :)
14:42:46FromGitter<k0pernicus> Later yes
14:43:05FromGitter<k0pernicus> But I can experiment without in order to get some speed results
14:43:08FromGitter<k0pernicus> ;-)
14:43:24FromGitter<k0pernicus> `pegs/strscans` -> I will check that
14:43:35FromGitter<k0pernicus> I don’t know anything about those
14:44:37Yardanicowell I don't say they're better :)
14:45:36*Arrrr quit (Quit: Leaving.)
14:45:48*relax joined #nim
14:46:22*cspar_ quit (Ping timeout: 260 seconds)
14:46:35FromGitter<k0pernicus> Do you know how to extract a sequence from a `JsonNode` type?
14:46:47FromGitter<k0pernicus> I see `getStr` to extract a string for example...
14:48:40Yardanicok0pernicus
14:48:57Yardanicohttps://nim-lang.org/docs/json.html#getElems,JsonNode,seq[JsonNode]
14:49:05Yardanicoso you would get seq[JsonNode]
14:49:25Yardanicoand if you iterate over it, you'll able to do "iterval.str"
14:49:44FromGitter<k0pernicus> Oh ok
14:49:58FromGitter<k0pernicus> So, a sequence is actually a seq of JsonNode (string) ?
14:50:24Yardanicowell it's just a seq of JsonNode
14:50:35FromGitter<k0pernicus> Yeah, right
14:50:40Yardanicobecause Nim can't prove that some field in json will be a string or not
14:51:18FromGitter<k0pernicus> Ok, done :-)
14:53:15FromGitter<k0pernicus> Hmmm...
14:53:29FromGitter<k0pernicus> Actually, without “translation”, it’s worth
14:53:54FromGitter<k0pernicus> 3 seconds more for the non-released version, 1 second more the released version
14:54:45Yardanicowell times can differ
14:55:02Yardanico"time" isn't reliable, but if it's slower for you - use "translation" :)
14:55:11*claudiuinberlin joined #nim
14:55:16FromGitter<k0pernicus> I will :-)
15:00:57*Jesin quit (Ping timeout: 260 seconds)
15:01:50*Jesin joined #nim
15:06:38*PMunch joined #nim
15:08:45cremWhy is {.base.} needed?
15:09:41Yardanicocrem, https://nim-lang.org/docs/manual.html#multi-methods
15:11:00cremYes I've seen that.
15:11:04cremSo what does it do?
15:11:25cremOther than "acts as a reminder for the programmer"
15:11:57*Trustable joined #nim
15:13:36*relax quit (Ping timeout: 240 seconds)
15:13:56Yardanicocrem, well I don't actually use methods so I don't know :)
15:14:03YardanicoI don't need runtime dispatching
15:16:17*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
15:20:23FromGitter<k0pernicus> Is there a “Nim way” to get the index of a value, in my sequence?
15:20:43Yardanicoindex proc ? :)
15:20:43FromGitter<k0pernicus> I searched in sequtils, but I didn’t found anything about that...
15:20:50Yardanicoit's in system module
15:20:56Yardanicoso you don't need to import it
15:21:01FromGitter<k0pernicus> Oh ok
15:21:05*arnetheduck quit (Ping timeout: 240 seconds)
15:21:15Yardanicoah sorry
15:21:18Yardanicoit's not "index"
15:21:21Yardanicoit's "find"
15:21:25FromGitter<k0pernicus> ah ah ^^
15:21:27Yardanicohttps://nim-lang.org/docs/system.html#find,T,S
15:21:31FromGitter<k0pernicus> Ok, no problem
15:21:37YardanicoReturns the first index of item in a or -1 if not found.
15:21:43FromGitter<k0pernicus> I searched Cmd+F with “index” so...
15:21:48FromGitter<k0pernicus> Great :-)
15:21:50FromGitter<k0pernicus> Thanks a lot!
15:23:23dom96|wk0pernicus: I guess getting choosenim to compile didn't work out?
15:23:37FromGitter<k0pernicus> It worked
15:23:47FromGitter<k0pernicus> I send you a PR yesterday I think
15:23:48FromGitter<k0pernicus> :-)
15:24:54FromGitter<k0pernicus> I was waiting for your comments/review to start working on new choosenim issues (if you are OK with that)
15:27:06*BigEpsilon quit (Ping timeout: 240 seconds)
15:32:19dom96|wk0pernicus: oh cool, I didn't check for new PRs yesterday so I didn't realise you sent one :)
15:33:02FromGitter<k0pernicus> @dom96 No problem :-) Sorry for the delay
15:43:10*Matthias247 quit (Read error: Connection reset by peer)
15:44:57*ofelas joined #nim
15:45:57FromGitter<k0pernicus> I am trying to store a Table into a JSON file. ⏎ For that, each key in my Table DS is a key in my JSON file, and each associated value (a sequence of string) has to be an associated value in my JSON file.
15:46:53FromGitter<k0pernicus> For that, I have to create a new JsonNode (JArray) type, and to add in “manually” all my values from the Table DS, right?
15:47:22Yardanicok0pernicus: yeah there's no shortcut for that AFAIK
15:47:43FromGitter<k0pernicus> Ok, thanks :-)
15:49:06FromGitter<k0pernicus> And to convert a sequence of string into a JArray type - no easy way neither?
15:50:14Yardanicowell let me try something
15:53:19*claudiuinberlin joined #nim
15:53:26*relax joined #nim
15:55:12Yardanicowell yeah
15:55:25Yardanicoyou'll need to iterater over this sequence
15:55:27Yardanicobut
15:55:30Yardanicothere's another bad way
15:55:44FromGitter<k0pernicus> Ah ah ^^
15:56:25Yardanicook nvm
15:56:32YardanicoI'll give you an example of creating JSON
15:57:00FromGitter<k0pernicus> no problem - I will test the current version of my prototype actually
15:57:11FromGitter<k0pernicus> I will try later to make some experiments with Neo
15:57:58Yardanicowell it's pretty easy
15:58:04Yardanicoto construct json you want
15:58:10Yardanicohttps://gist.github.com/Yardanico/6b0791b1385e2ebf27deafba0210cfa5
15:58:25FromGitter<k0pernicus> Oh!
15:58:31FromGitter<k0pernicus> The `%` is great
15:58:55FromGitter<k0pernicus> I didn’t had a look at this operator in the documentation...
15:58:58FromGitter<k0pernicus> My bad :-(
15:59:24*BigEpsilon joined #nim
16:00:41FromGitter<k0pernicus> Thanks @Yardanico for this snippet 
16:00:49Yardanicodoes it work for you?
16:00:59FromGitter<k0pernicus> I will try in a couple of minutes
16:01:02FromGitter<k0pernicus> (debugging…)
16:03:26PMunchHmm, anyone know if there is a wrapper of https://github.com/baylej/tmx, or any other Tiled parsers for Nim?
16:04:45*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
16:04:52FromGitter<k0pernicus> @Yardanico Got a problem...
16:07:52FromGitter<k0pernicus> This is the ugly code I wrote ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59aecbd88f4427b462d5bb3a]
16:07:58*claudiuinberlin joined #nim
16:09:34FromGitter<Yardanico> what problem?
16:10:18YardanicoPMunch, maybe this can help?
16:10:19Yardanicohttps://github.com/PapaNoah/morriton/blob/dde7d5fdccee23558d7a90d77d41b704034b8d5b/src/map/parser.nim
16:10:57FromGitter<k0pernicus> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59aecc91ba0f0f6e381ce8b9]
16:11:05*mahsav2 quit (Ping timeout: 240 seconds)
16:11:13*yglukhov quit (Remote host closed the connection)
16:11:16FromGitter<k0pernicus> This code reached this error `Error: ordinal type expected`
16:11:24FromGitter<k0pernicus> At line `vectors.add %{file, %current_indexes}`
16:11:30FromGitter<k0pernicus> (so, the last one)
16:12:59PMunchHmm interesting Yardanico. But it seem like he made a simple parser for his own game only.
16:13:06PMunchSo it's not really generic
16:13:11YardanicoPMunch, https://github.com/Tormund/rod_tilemap ?
16:13:16Yardanicowell yeah it's for rod too
16:13:32YardanicoPMunch,
16:13:34YardanicoI found this - https://github.com/jsudlow/nimtmapreader
16:13:51Yardanicowell it doesn't seem to support tmx
16:14:37PMunchAh, Tiled can export to both xml and json
16:14:44FromGitter<k0pernicus> It’s ok, I saw the problem :-)
16:14:48FromGitter<Yardanico> @k0pernicus also
16:14:50FromGitter<Yardanico> for better performance
16:14:54FromGitter<k0pernicus> ‘,’ instead of ‘:'
16:14:56FromGitter<k0pernicus> Yep?
16:15:01FromGitter<Yardanico> Don't use var current_indexes: seq[int] = repeat(0, len_features_vector)
16:15:14FromGitter<Yardanico> use var current_indexes: seq[int] = newSeqint (len_features_vector)
16:15:17FromGitter<Yardanico> oh
16:15:21FromGitter<Yardanico> wait a sec :)
16:15:47FromGitter<Yardanico> @k0pernicus use this: https://gist.github.com/Yardanico/28fc7a75e34eabb694158cb2104fb09f
16:15:50PMunchSo support for .tmx which is the xml format isn't really an issue as you can simply export as json
16:16:04*yglukhov joined #nim
16:16:11FromGitter<Yardanico> and you can use it the same way
16:16:12FromGitter<k0pernicus> Thanks @Yardanico
16:16:17FromGitter<k0pernicus> Default values, like for Go?
16:16:25FromGitter<Yardanico> well they're really "default"
16:16:40FromGitter<Yardanico> so all non-ref types have default values - just binary "0"
16:16:50FromGitter<Yardanico> for int this is 0, for float - 0.0, for bool - false
16:16:53*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
16:16:57FromGitter<Yardanico> for value from enum - 0
16:16:58FromGitter<Yardanico> and so on
16:17:04FromGitter<k0pernicus> I see :-)
16:17:11FromGitter<k0pernicus> I didn’t know!
16:17:15FromGitter<k0pernicus> Thanks a lot
16:17:21FromGitter<Yardanico> https://nim-lang.org/docs/manual.html#statements-and-expressions-var-statement
16:17:26FromGitter<Yardanico> there's a table of default values
16:18:39FromGitter<k0pernicus> Ok
16:20:17*yglukhov quit (Ping timeout: 248 seconds)
16:20:21*filcuc quit (Quit: KVIrc 4.9.2 Aria http://www.kvirc.net/)
16:23:21couven92okay Araq, got editDistance for unicode working now, review: https://github.com/nim-lang/Nim/pull/6301
16:24:40couven92gotta go now though... bbl
16:24:41*couven92 quit (Quit: Client disconnecting)
16:29:28FromGitter<k0pernicus> @Yardanico It seems that `var vectors = newJObject()` does not create a JSON object...
16:30:02FromGitter<k0pernicus> When I try to add an object (`vectors.add %{file: %current_indexes}`), I got `SIGSEGV: Illegal storage access. (Attempt to read from nil?)`
16:30:11Yardanicowait
16:30:28Yardanicowhy did you use newJObject?
16:30:33Yardanicok0pernicus: look at my snippet
16:30:33Yardanicohttps://gist.github.com/Yardanico/6b0791b1385e2ebf27deafba0210cfa5
16:30:43YardaniconewJArray here
16:30:48FromGitter<k0pernicus> Oh right!
16:30:55FromGitter<k0pernicus> But
16:31:10FromGitter<k0pernicus> I will insert the JArray in JObject later, no?
16:31:38FromGitter<Yardanico> you actually don't need to do that
16:31:43FromGitter<k0pernicus> Oh ok
16:31:46FromGitter<k0pernicus> Great
16:31:48FromGitter<Yardanico> [{"6511":[3,2,2,1,4]},{"5":[1,2,3,4,5]}] is a valid json
16:32:01FromGitter<k0pernicus> Ok, pretty cool :-)
16:32:20FromGitter<k0pernicus> Yep, it works 
16:42:04FromGitter<k0pernicus> Python prototype (Using Numpy): ⏎ ⏎ ```real 0m49.777s ⏎ user 0m28.265s ⏎ sys 0m16.725s``` [https://gitter.im/nim-lang/Nim?at=59aed3dcbac826f0548248bf]
16:42:58*PMunch quit (Quit: leaving)
16:43:15FromGitter<couven92> @Yardanico did you have timing tests for editDistance? Or just the simple that I can write in a few seconds?
16:45:09miranguys, any easy way to do a[start:stop:step] in nim?
16:45:19*Sentreen quit (Ping timeout: 248 seconds)
16:45:47miranfor example, i want just odd elements of some sequence
16:47:00Yardanicomiran, yes
16:47:03Yardanicocountup supports step
16:47:29Yardanicocouven92: let me try :)
16:47:42Yardanicocouven92: and araq means - get rid of debugEcho's
16:48:00mirani know about countup, but i cannot just do: `a[countup(0, 10, 2)]`
16:48:06Yardanicomiran, well yeah you can't
16:48:08Yardanicouse "for" loop
16:48:57miranyeah, for loop was my first solution. i thought there might be something more convenient
16:49:03FromGitter<couven92> @Yardanico yeah, I realized that when I stepped into the bus :P will do that immediately once I'm home
16:49:13Yardanicowell I'll try it anyway
16:50:00Yardanicocouven92: also there's some unused variables in your implementation :) but it looks very cool anyway
16:50:16Yardanicotwo unused vars
16:50:19Yardanicolen_chars_a and len_chars_b
16:51:25FromGitter<couven92> Really :O, ah, yes, yeah I'll delete those... apparently it was really time for me to get home if I have been *that* inattentive
16:51:37Yardanicowell you're a legend
16:52:07Yardanicoyou're really a legend! unicode editdistance is only 4x slower (40ns vs 10ns) vs strutils editDistance
16:52:11FromGitter<k0pernicus> *Love is in the air…*
16:52:20FromGitter<couven92> Hmm
16:52:29FromGitter<Yardanico> ===```nim=== ⏎ ⏎ ===GlobalBenchmark relative time/iter iters/s=== ⏎ ⏎ ===GlobalBenchmark 294.84ps 3.39G=== ... [https://gitter.im/nim-lang/Nim?at=59aed64db16f2646420b08af]
16:52:47FromGitter<Yardanico> but strutils is only ascii
16:52:54FromGitter<Yardanico> and your proc is every character from unicode :)
16:53:20FromGitter<Yardanico> also I think maybe *somewhere* in the future we'll make unicode module the default for string operations?
16:53:25FromGitter<Yardanico> or no?
16:53:46FromGitter<couven92> Yeah, it has to iterate through both strings to count runes though...
16:54:15FromGitter<couven92> Ascii doesn't need that
16:54:42YardanicoI think this is a good performance
16:54:58Yardanicolol
16:55:32Yardanicowith gcc and ascii strings your proc is only 2x slower than pure-ascii version
16:55:46Yardanicoand with gcc and unicode string it's only 3.4x slower
16:55:46FromGitter<couven92> I have one more optimization in mind, let's see if that helps
16:58:29def-miran: something like this? https://gist.github.com/def-/b2a308b705865ad182121df0a4688cfd
16:59:11*Sentreen joined #nim
16:59:42mirandef-: something like that :)
17:01:24*couven92 joined #nim
17:02:42mirandef-: but more like this maybe: https://gist.github.com/narimiran/c3b9179b82380e17f0b4b98a1acf0ef2
17:03:05def-sure, i just used the syntax from haskell
17:03:15miranrecognized it :)
17:03:22Yardanicomiran, you may also be interested in this
17:03:23Yardanicohttps://github.com/Yardanico/nimpylib/blob/master/src/pylib/range.nim
17:03:36Yardanicoit's lazy python-like range implementation
17:03:41*xet7 quit (Ping timeout: 240 seconds)
17:03:52Yardanicobut if you want to use it - you should "include" it, not import
17:03:58Yardanicoor change "range" to "pyrange" for example
17:04:08YardanicoI mean type and all template/proc names
17:05:08Yardanicoit has almost the same performance as countup
17:05:24miranthanks Yardanico, will take a look
17:05:34Yardanicobecause it uses the same algorithm as countup for iterating :)
17:05:49YardanicoAnd I ported some code from JS library with python-like range
17:06:03Yardanicoe.g. min, max, contains
17:08:58mirananother quick one - string unpacking is not possible?
17:09:42*yglukhov joined #nim
17:09:45miranfor example: let (a, b, c) = word[i..i+2]
17:11:39FromGitter<cabhishek> Hi! Is any one using https://github.com/zah/nim.vim for vim and got it work? If not then what else is recommended for vim?
17:12:41*BigEpsilon quit (Ping timeout: 240 seconds)
17:13:11couven92@cabhishek: Hmm... PMunch would know... But AFAIK he's having a familiy dinner today...
17:14:32*yglukhov quit (Ping timeout: 260 seconds)
17:14:37couven92@cabhishek: But we discussed the other day, that enabling whitespace rendering is a good idea in indent sensitive languages like Nim, Python and Ruby
17:14:37*haha_ joined #nim
17:15:43FromGitter<couven92> I do this in my `.vimrc` ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59aedbbfba0f0f6e381d3970]
17:15:58*nsf quit (Quit: WeeChat 1.9)
17:16:18*yglukhov joined #nim
17:18:26FromGitter<couven92> oh crap, I meant this: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59aedc62614889d475c37544]
17:20:21*xet7 joined #nim
17:21:52FromGitter<cabhishek> @couven92 does the plugin show errors on file save?
17:22:18FromGitter<cabhishek> I have basic syntax highlighting/indentation working
17:22:31*mahsav joined #nim
17:22:39couven92I don't know... maybe use syntastic?
17:23:08FromGitter<Yardanico> btw I have a slightly *bad* way to consistently check for nim errors in VSCode
17:23:14FromGitter<Yardanico> I've set auto file save delay to 1ms
17:23:26programistocould someone clarify the semantics of returning var variable vs variable froma function?
17:23:38programistois result within the function body var or does tht also have an impact outside of the function
17:24:07Yardanicoprogramisto, if you get a value from table and return it as "var Type", user will be able to modify it
17:24:09couven92you can return var variable? :O
17:24:12Yardanicoand it will be modified in table
17:24:13Yardanicocouven92, yes
17:24:34programistoYardanico: thanks
17:24:54couven92Yardanico, how? why? when? under which circumstances?
17:24:55Yardanicofor example
17:24:59Yardanicocouven92, programisto, https://github.com/nim-lang/Nim/blob/master/lib/pure/collections/tables.nim#L172
17:25:19Yardanicohttps://github.com/nim-lang/Nim/blob/master/lib/pure/collections/tables.nim#L414
17:25:42couven92huh
17:25:52*BigEpsilon joined #nim
17:25:56Yardanicowell it's not needed very often for your own programs
17:26:00Yardanicobut it's needed for stdlib
17:26:01Yardanicoalso
17:26:04Yardanicoyou can return "ref Type"
17:26:09Yardanicoor also you can do this
17:27:03programistocould I tell you guys my secret? nim is kind of addictive
17:27:21programistothat pythonicness combined with mapping so closely to C is fun
17:27:27programistovery easy to understand what's going on
17:27:40Yardanicoprogramisto, also don't forget lisp macros :D
17:28:18programistoyeah wow
17:28:20Yardanicoprogramisto, also not only C, but C++ and ObjC
17:28:22Yardanicoand even JS :P
17:28:32programistokind of feel sorry for those bums getting hyped into stuff like rust
17:28:59programistonim is like the greatest language ever, why is it not more popular
17:29:33programistosorry, it's just fun
17:29:41Yardanicoprogramisto, almost the main thing in the world is money
17:29:59Yardanicorust is backed by mozilla - I doubt it will go somewhere without them
17:30:17Yardanico*would
17:30:26programistoyeah, the dynamkc makes sense
17:30:33*claudiuinberlin joined #nim
17:30:47programistoI think if you sat down 8/10 programmers and had them evaluate nim and rust for the average programs they'd put together, nim is a win almost every time
17:31:02programistoit just has the right combination of expressivenexs and low level acccess
17:31:28programistothat goese for go, maybe even python, though that's more dependent on library access
17:39:11Yardanicowell also about any big rust program: it would still have crashes
17:39:22Yardanicobecause big programs usually interact with something other than rust code
17:39:50Yardanicoalso TIL that Rust doesn't check for out of bounds in compile-time
17:39:53Yardanicoit does that in runtime
17:41:14Yardanicoand I'm not joking here
17:41:21*BigEpsilon quit (Ping timeout: 240 seconds)
17:41:51*xet7 quit (Ping timeout: 248 seconds)
17:46:42*vlad1777d joined #nim
17:47:28*thomasross_ quit (Remote host closed the connection)
17:47:53*thomasross_ joined #nim
17:53:19*Trustable quit (Remote host closed the connection)
17:58:36*xet7 joined #nim
18:03:16Yardanicoguys
18:03:23Yardanicodoes anyone have weird bug on github?
18:03:29Yardanicothere's no styles applied
18:03:47YardanicoI have it, and my friend too
18:03:51FromGitter<Yardanico> image:
18:03:56FromGitter<Yardanico> (https://files.gitter.im/nim-lang/Nim/GpDg/image.png)
18:04:01*xet7 quit (Ping timeout: 240 seconds)
18:06:18FromGitter<ephja> stylesheet 404
18:08:07*Arrrr joined #nim
18:08:07*Arrrr quit (Changing host)
18:08:07*Arrrr joined #nim
18:09:08*relax quit (Ping timeout: 255 seconds)
18:09:23*relax joined #nim
18:09:27Arrrrwhy does github look so ugly
18:10:18*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:11:00*pilne joined #nim
18:11:51*claudiuinberlin joined #nim
18:12:41Arrrrhuh now it works ok
18:12:50Yardanicooh
18:12:51Yardanicofixed
18:13:02*TjYoco joined #nim
18:13:33*xet7 joined #nim
18:20:48*xet7 quit (Ping timeout: 240 seconds)
18:22:16*thomasross joined #nim
18:22:26*francisl joined #nim
18:22:28*thomasross quit (Remote host closed the connection)
18:22:56*thomasross joined #nim
18:23:36*thomasross_ quit (Ping timeout: 240 seconds)
18:25:34*couven92 quit (Read error: Connection reset by peer)
18:27:11*francisl quit (Ping timeout: 248 seconds)
18:28:18*thomasross quit (Read error: Connection reset by peer)
18:28:36*thomasross joined #nim
18:30:17*thomasross quit (Remote host closed the connection)
18:30:32*thomasross joined #nim
18:31:17*francisl joined #nim
18:33:28*thomasross_ joined #nim
18:35:41*francisl quit (Ping timeout: 255 seconds)
18:36:08*thomasross quit (Ping timeout: 255 seconds)
18:38:08*xet7 joined #nim
18:41:48*francisl joined #nim
18:45:06*Vladar quit (Remote host closed the connection)
18:45:16*francisl_ joined #nim
18:46:56*francisl quit (Ping timeout: 248 seconds)
18:46:56*francisl_ is now known as francisl
18:48:01*TjYoco quit (Quit: Page closed)
18:56:14*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
19:05:28*relax quit (Ping timeout: 240 seconds)
19:05:36Yardanicodom96|w, what can be the reason of this? https://gist.github.com/Yardanico/19d8525f8c2bfde21b54e8ebd88e15de
19:06:11Yardanicothis package should be available - https://github.com/nim-lang/packages/commit/c8d4514bb1c4333ae1b5855569681cf57dcddce5
19:14:42*relax joined #nim
19:16:56*haha_ quit (Quit: haha_)
19:17:07*claudiuinberlin joined #nim
19:21:21dom96Yardanico: http://irclogs.nim-lang.org/packages.json takes a while to update
19:21:34Yardanicodom96, I've removed all urls from nimble.ini
19:21:37Yardanicoexcept nim-lang.org one
19:21:51Yardanicostill fails for some reason
19:22:07Yardanicodom96, https://gist.github.com/Yardanico/77f8fb4cafcf210798219c69d893afb3
19:22:09dom96Like I said, that takes a while to update.
19:22:34dom96https://github.com/nim-lang/packages/raw/master/packages.json
19:23:03Yardanicowhy this isn't the default? :)
19:23:49Yardanicobut thanks
19:24:32*nsf joined #nim
19:25:13dom96Pretty sure it is
19:25:17dom96You just had an old nimble.ini
19:25:28Yardanicoah, ok
19:32:11cremwhy is nico not in nimble, while https://github.com/ftsf/nico suggests that it should be
19:32:34*BigEpsilon joined #nim
19:32:34Yardanicocrem, we don't know
19:32:38Yardanicoask ftsf
19:33:50cremif only I knew how to contact him..
19:34:15Yardanicowrite an issue in this repo?
19:34:53YardanicoI don't need to teach you how to use github I think :)
19:36:59*Yardanico quit (Remote host closed the connection)
19:41:07*PMunch joined #nim
19:48:45*rokups quit (Quit: Connection closed for inactivity)
19:51:00*BigEpsilon quit (Ping timeout: 252 seconds)
19:59:29*relax quit (Ping timeout: 248 seconds)
20:04:09FromGitter<Bennyelg> @Yardanico thanks, I'll add tests tomorrow :)
20:14:28*claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com)
20:30:30*Matthias247 joined #nim
20:35:47*francisl quit (Quit: francisl)
20:38:13cremTurned out that there is a youtube video which contains detailed explanation why it is not in the repo.
20:38:36*miran quit (Ping timeout: 240 seconds)
20:40:06*dom96|w quit (Ping timeout: 240 seconds)
20:40:45*rauss quit (Quit: WeeChat 1.9)
20:47:46PMunchHmm, doesn't Nim throw an Overflow/Underflow error when you subtract from a uint?
20:48:45ehmryPMunch: probably not with -d:release
20:48:52*Jesin quit (Quit: Leaving)
20:49:00PMunchHmm
20:49:07PMunchThis is without -d:release
20:49:15ehmryI'm not sure but you can turn those checks off explicitly
20:49:50PMunchBut I was trying to add some simple += -= functions for uint32 and int32, that would detect overflow/underflow and just max or min out the uint value
20:49:54PMunchSo it wouldn't wrap
20:50:13PMunchTried with a try except OverflowError but that didn't seem to do much..
20:51:44*ofelas quit (Quit: shutdown -h now)
20:51:46*vivus joined #nim
21:06:29Araquints are not checked for overflows
21:06:42PMunchWhy not?
21:07:03Araqcause unsigned numbers are idiotic anyway
21:07:27Araqit's just some bit pattern, if you're lucky you can get some meaningful bits
21:13:54PMunchIsn't that true for all data in a computer though? :P
21:15:02PMunchOh well, I'm off to bed now
21:15:08*PMunch quit (Quit: leaving)
21:15:58*pleiosaur joined #nim
21:24:11*relax joined #nim
21:26:56*ipjk joined #nim
21:32:15dom96Unfortunately no matter how idiotic unsigned ints are deemed, there is a use for them and we should probably ensure they throw an error on underflow/overflow.
21:33:14*endragor joined #nim
21:37:35*endragor quit (Ping timeout: 248 seconds)
21:40:49*relax quit (Ping timeout: 248 seconds)
22:02:36*Snircle joined #nim
22:03:38*gokr joined #nim
22:10:47Araqand break compatibility with every hashing algorithm out there?
22:11:00Araqas well as compat with C/C++ were these abound?
22:11:49*mahmudov joined #nim
22:23:53*Arrrr quit (Quit: Leaving.)
22:28:33*cspar_ joined #nim
22:31:24*skrylar joined #nim
22:31:37skrylarwell. there was no response on the rfc3339 thing. so i wrote a module for it
22:31:52skrylardoesn't handle leap seconds yet, but otherwise
22:33:53skrylari think we do have oid's in the stdlib though, can probably change the bson code to use that
22:41:34*nsf quit (Quit: WeeChat 1.9)
22:56:54*vlad1777d quit (Ping timeout: 252 seconds)
23:08:15*gokr quit (Ping timeout: 248 seconds)
23:12:05*def-pri-pub joined #nim
23:12:05*def-pri-pub quit (Changing host)
23:12:05*def-pri-pub joined #nim
23:27:48*RushPL quit (Ping timeout: 240 seconds)
23:33:34*yglukhov quit (Remote host closed the connection)
23:54:18skrylarTIL you can use break inside of templates https://gist.github.com/Skrylar/2b3c52373482d0701746a1a0acdabec6