<< 04-09-2017 >>

00:01:34*vlad1777d quit (Remote host closed the connection)
00:02:11*Matthias247 quit (Read error: Connection reset by peer)
00:05:51*Jesin quit (Ping timeout: 248 seconds)
00:13:54*Jesin joined #nim
00:28:42*relax joined #nim
00:52:27*cspar_ joined #nim
01:02:30FromGitter<FridgeSeal> I have a noob question: is there any guide/rule for when I should use the `result` variable, and when I should just `return` something normally?
01:06:41*mahmudov quit (Ping timeout: 248 seconds)
01:23:39*mahmudov joined #nim
01:33:17*dddddd quit (Read error: Connection reset by peer)
01:37:37*gangstacat quit (Quit: Leaving)
01:39:05*pilne joined #nim
01:43:16*chemist69 quit (Ping timeout: 246 seconds)
01:52:11*francisl quit (Quit: francisl)
01:52:37*francisl joined #nim
01:54:44*def-pri-pub quit (Quit: leaving)
01:55:10*arnetheduck quit (Ping timeout: 240 seconds)
01:57:05*francisl quit (Ping timeout: 240 seconds)
01:57:38*chemist69 joined #nim
02:24:45TangerFromGitter, https://nim-lang.org/docs/nep1.html#introduction-coding-conventions
02:24:46FromGitterTanger, I'm a bot, *bleep, bloop*. I relay messages between here and https://gitter.im/nim-lang/Nim
02:25:13FromGitter<FridgeSeal> Ha, managed to miss that completely, thanks for that! :)
02:32:17*relax quit (Ping timeout: 260 seconds)
02:47:36*SusWombat joined #nim
02:49:47*SusWombat_ quit (Ping timeout: 260 seconds)
02:53:27*SusWombat_ joined #nim
02:54:42*SusWombat quit (Ping timeout: 252 seconds)
03:01:29*relax joined #nim
03:06:08*onionhammer joined #nim
03:13:33*endragor joined #nim
03:45:44skrylari feel for everyone writing client facing code x.x
03:45:58skrylarjust watched someone go "how do i do a thing" when it straight up said "to do the thing, press this button"
04:05:08*idonob joined #nim
04:15:30*ludocode quit (Quit: No Ping reply in 180 seconds.)
04:18:12*ludocode joined #nim
04:18:27*pilne quit (Quit: Quitting!)
04:22:31*ludocode quit (Ping timeout: 246 seconds)
04:23:00*BigEpsilon joined #nim
04:30:46*ShalokShalom joined #nim
05:01:22skrylaranyone know off the top of their head if we already have rfc3339 date/times
05:01:32skrylarlooking in to that toml4 thing someone requested and it needs them
05:07:48*relax quit (Ping timeout: 252 seconds)
05:12:01*mahmudov quit (Remote host closed the connection)
05:19:03*gokr joined #nim
05:38:37*BigEpsilon quit (Ping timeout: 240 seconds)
06:01:02*nsf joined #nim
06:04:48*BigEpsilon joined #nim
06:10:18*rauss quit (Quit: WeeChat 1.9)
06:13:39*Vladar joined #nim
06:19:14*vlad1777d joined #nim
06:22:32*skrylar quit (Remote host closed the connection)
06:25:21FromGitter<Grabli66> Hi. Is there a way to make a readonly field in object, that can be initialized only in "constructor" proc? ⏎ May be like this https://play.nim-lang.org/?gist=2084d4989b90d66049f1301f430cfd8c
06:32:02*cspar_ quit (Ping timeout: 260 seconds)
06:38:59*Pisuke quit (Ping timeout: 246 seconds)
06:41:19*Pisuke joined #nim
06:49:14*cspar_ joined #nim
06:53:19livcdreadm.txt on nim-0.17.0._x64 for windows points you to install.txt but there's nothing like that inside the zipfile
07:02:13Araqok thanks for reporting
07:06:14*PMunch joined #nim
07:18:41*claudiuinberlin joined #nim
07:20:42*claudiuinberlin quit (Client Quit)
07:32:14*claudiuinberlin joined #nim
07:32:39*yglukhov joined #nim
07:35:21*Arrrr joined #nim
07:36:11*Yardanico joined #nim
07:50:35*Yardanico quit (Remote host closed the connection)
07:54:52*endragor quit (Ping timeout: 260 seconds)
07:56:37*claudiuinberlin quit (Ping timeout: 240 seconds)
07:58:56*endragor joined #nim
08:02:38*endragor quit (Read error: Connection reset by peer)
08:02:53*endragor joined #nim
08:19:23*peanut joined #nim
08:25:25yglukhovdom96: ping
08:26:55peanutwhen using osproc, is using process.inputStream.writeLine("test") the same as echo "test" | subcommand ?
08:27:24peanutCan't get it working, even when using "/bin/echo" as the subcommand
08:33:07FromGitter<ephja> I'll try it myself
08:33:41peanutactually nevermind, a really simple example works with /bin/echo
08:35:53cremMorgen.
08:39:24def-peanut: you might also want to flush
08:42:38peanutdef-: thanks, is that something stream specific?
08:43:05peanutI think I've narrowed down the issue. How can I send EOF to the processes inputStream?
08:43:39def-by closing it I guess
08:44:06def-Well, when you write to anything, you can tell the OS that you want it to be actually flushed to the output
08:44:24def-(or the internal buffer implementation)
08:44:34peanutdef-: Ok, will try that, thanks! :)
08:54:09*peanut quit (Ping timeout: 260 seconds)
08:56:19*idonob quit (Quit: host lost)
08:57:17FromGitter<Grabli66> Does anybody seen job vacancies with knowledge of "Nim" language? :)
09:01:28*thomasross quit (Remote host closed the connection)
09:01:53*thomasross joined #nim
09:03:56*BitPuffin|osx joined #nim
09:07:31VladarGrabli66, I saw one =)
09:07:44Vladarnot vacancy, just one-time job
09:08:25FromGitter<Grabli66> Where?
09:08:54Vladarupwork
09:09:41*Matthias247 joined #nim
09:12:39*peanut joined #nim
09:12:47*dom96|w joined #nim
09:13:10FromGitter<Grabli66> It's strange, i found none. Why nim is not mainstream?
09:14:13cremdosens of reasons
09:14:52Vladarnow of course there's none. I took that one jobe half-year ago )
09:15:35cremnim doesn't even have code formatter!
09:16:01Vladarcode formatter?
09:16:24cremYes, all proper languages have code formatter nowadays. :)
09:17:03VladarOh, nim has one, it usually could be found between the chair and the keyboard =)
09:17:40cremIt takes longer for that one to do the formatting.
09:18:03yglukhovGrabli66: we're using Nim fulltime, but not looking for Nim developers, because its pretty hard to find those =)
09:18:44*BitPuffin|osx quit (Remote host closed the connection)
09:18:54yglukhovdom96: ping
09:19:02yglukhovgot 10 mins?
09:19:26yglukhovregarding https://github.com/nim-lang/nimble/pull/401
09:22:34dom96|wNot right now. Maybe in 2 hours or so?
09:25:15*dom96|w quit (Read error: Connection reset by peer)
09:28:37*BitPuffin|osx joined #nim
09:30:30*thomasross_ joined #nim
09:30:50*thomasross quit (Read error: Connection reset by peer)
09:42:01FromGitter<BigEpsilon> Hi, I'm trying to run nim compiler tests on my machine, but get error at tests/cpp/tasync_cpp.nim : "cannot open jester"
09:42:05FromGitter<BigEpsilon> any idea ?
09:43:06FromGitter<BigEpsilon> and other tests fail with "cannot open zip/zlib"
09:43:28FromGitter<BigEpsilon> and cannot open zip/zipfiles and opengl
09:43:39FromGitter<BigEpsilon> I'm on devel
09:47:15FromGitter<ephja> all of those are packages that you can install with nimble
09:57:31FromGitter<BigEpsilon> Ok I didn't except to need installing external packages for the test suite
09:57:37FromGitter<BigEpsilon> thanks
09:57:51*tankfeeder joined #nim
09:57:57tankfeederhi all
09:58:30tankfeederi've got number from random generator, how to write to stdout as binary raw data ?
09:58:31FromGitter<BigEpsilon> hi
10:01:36*adamchainz joined #nim
10:03:35*BigEpsilon quit (Ping timeout: 255 seconds)
10:08:32flyxtankfeeder: something along the lines of newFileStream(stdout).write(myNum)
10:11:07euantortankfeeder: By "binary raw data", do you mean the bytes making up the number (which I assume is an int32 or int)?
10:11:19tankfeedereuantor: yea
10:12:05*Kingsquee quit (Quit: https://i.imgur.com/qicT3GK.gif)
10:12:11euantorIf so, you can cast the value to a byte array (so long as you know the size). If it's an `int32` something like this: `let numBytes = cast[array[4, byte]](num)`
10:12:43euantorThen you can either use `repr(numBytes)` or you can build a string by looping through the bytes and appending them (I don't think `$` is implemented for arrays - it wasn't a while back)
10:13:42euantorhttps://play.nim-lang.org/?gist=fc9857cc7aa0209ef02061586b28829c
10:14:01euantorObviously `int64` would be an 8 byte array, etc.
10:16:53tankfeederhttps://pastebin.com/C4VdCg3M
10:17:12tankfeedernow it prints int64 bit number as should
10:20:04tankfeedermaybe cast random number to array[8] and writeBuffer helps
10:21:12Araqtests/stdlib/thttpclient.nim failed
10:26:10*ShalokShalom_ joined #nim
10:29:33*ShalokShalom quit (Ping timeout: 252 seconds)
10:37:22*arnetheduck joined #nim
10:37:58cremI thought community survey results were always announced on September 3rd.
10:47:31*Xe quit (Ping timeout: 246 seconds)
10:50:24*haha_ joined #nim
11:02:58*Yardanico joined #nim
11:04:15*haha_ quit (Quit: haha_)
11:05:44*haha_ joined #nim
11:09:09*gokr quit (Ping timeout: 252 seconds)
11:11:12*pwntus quit (Ping timeout: 246 seconds)
11:11:28*haha_ quit (Quit: haha_)
11:11:51*gokr joined #nim
11:13:07*dddddd joined #nim
11:18:04Yardanicohi guys
11:18:21cremhi
11:43:16FromGitter<k0pernicus> Hello world! ⏎ Is anybody here worked /is working on PDF parsers? :-)
11:44:11Yardanicoyes
11:44:20Yardanicok0pernicus: https://github.com/jangko/nimpdf
11:44:36*dom96|w joined #nim
11:45:05FromGitter<k0pernicus> WOW! AWESOME!
11:45:12FromGitter<k0pernicus> Thanks @Yardanico
11:45:12YardanicoxD
11:45:24dom96|wyglukhov: here now if you want to discuss, but I'd prefer if we just discussed on GitHub
11:45:27Yardanicohttps://github.com/jangko/nimpdf/blob/master/demo/demo.pdf
11:46:37livcdIs there any docu / pkg for a windows service ?
11:46:45Yardanicolivcd, windows service?
11:47:57livcdYes
11:48:24YardanicoI doub there's, you should find docs for c/c++
11:48:32Yardanicoand then use same winapi functions in nim
11:48:44livcdAh
11:48:44livcdok
11:48:58yglukhovdom96: i just wanted to say that i could not understand your case. in your issue you were using nim to compile nimble, so thats a different problem, imo
11:50:13dom96|wyglukhov: Yes, but your patch encourages these kind of imports which will fail as soon as you use nim to compile.
11:50:47dom96|wwhy can't you import using the syntax I suggested?
11:55:31yglukhovdom96: relative paths are trickier to maintain, imo. if i want to move the referring file to another location, relative imports should likely be modified as well.
11:55:53yglukhovnot that it is critical in any way. just feels more right to me.
11:56:44tankfeedertesting buildin rng's by "practically random" software
11:57:17tankfeedermersenne pass, xoro failed, quite the same code in generating numbers.
11:58:03dom96|wyglukhov: okay, we should discuss how to solve my issue then. But let's do that on GitHub, can't talk much right now.
11:58:15tankfeedermy own implementation of xoroshiro128+ on PicoLisp passed tests even without seeding.
12:03:34*BigEpsilon joined #nim
12:04:59*BigEpsilon quit (Client Quit)
12:08:34YardanicoAraq, I found out that I need to change it somewhere in types.nim
12:08:48Yardanicobut there's already a thing that checks that
12:09:06Yardanicoof tyRef: if kind == skConst: result = t
12:11:29YardanicoI'm not sure why it doesn't work
12:12:58Yardanicoah, because this isn't a "ref", but an object
12:14:30FromGitter<xmonader> https://gist.github.com/xmonader/10cd5ccbc7f24b35910010e0dccca71a I tried it on ubuntu 16.04 and it completes unlike on my archlinux machine
12:15:01FromGitter<xmonader> however it always return false for the link checks for the async part
12:15:32*m712 quit (Quit: bye-nyan!)
12:16:22YardanicoAraq, ah
12:16:35YardanicoI only need to add "if kind == skConst and t.sons[0].kind == tyRef: return t" to tySequence branch
12:16:55Yardanicobut
12:17:02Yardanicoit would still fail for tyArray for example
12:21:32*m712 joined #nim
12:33:55*kunev quit (Ping timeout: 246 seconds)
12:35:28*kunev joined #nim
12:46:08*cspar_ quit (Ping timeout: 246 seconds)
12:57:24*sz0 joined #nim
13:01:00*yglukhov quit (Remote host closed the connection)
13:01:56*yglukhov joined #nim
13:03:23*haha_ joined #nim
13:03:40*yglukhov quit (Remote host closed the connection)
13:03:54*yglukhov joined #nim
13:16:48*haha_ quit (Quit: haha_)
13:18:35Araqyardanico: that's not how things work, that proc is recursive and invalid 'ref' type bubbles up
13:20:12*haha_ joined #nim
13:23:11YardanicoAraq, but why "if kind == skConst: result = t" check doesn't work then?
13:23:15Yardanicoin this proc
13:23:22Yardanico of tyRef: if kind == skConst: result = t
13:32:31*Snircle joined #nim
13:35:33YardanicoWhen was first Nim version released?
13:35:59cremThere's no nim in debian/ubuntu distro, is there?
13:37:37Yardanicocrem, there is
13:37:43tankfeedernow my xoro implementation dont pass tests too, its ok
13:37:52Yardanicocrem, https://tracker.debian.org/pkg/nim
13:37:59Yardanicoin testing/unstable
13:38:05Yardanico0.16.0 in stable thought
13:38:09tankfeederfound in changelog of software
13:38:23tankfeedernon-recommended
13:38:23tankfeeder added xoroshiro128plus
13:38:32tankfeederso it should fail. issue closed.
13:38:39Yardanicocrem, and also https://launchpad.net/ubuntu/+source/nim 0.17.0 in the artful aardvark
13:38:52Yardanicocrem, use choosenim for easy installation :)
13:39:39*yglukhov quit (Remote host closed the connection)
13:39:54Yardanicowell they have older nim versions in older distro versions
13:40:15Yardanicobut this is normal for distributives with separate releases
13:43:14*rauss joined #nim
13:43:30cremI'm not sure I'm allowed it on work machine, it's not listed in our approved repo. (which is based on ubuntu 14)
13:44:26Yardanicocrem, you can statically compile binary
13:44:30Yardanicoand that's it :)
13:44:39Yardanicoso you will be able to use it almost on any linux
13:45:15Yardanicoah you want nim compiler itself
13:45:22Yardanicowhy you don't want to compile it from the source?
13:45:32Yardanicoif you have gcc - you can use nim
13:45:34Yardanicoor clang
13:45:40cremI'm sure I can run it, I don't know whether it's allowed. It's not in the list of pre-allowed software, and for the rest I should manually inspect it, which I'm lazy to do (and there's probably too much code to inspect).
13:46:31Yardanicocrem, what do you mean by "inspect" ? are you working for government ? :P
13:47:53cremNot really. But still for example if software sends some (usage) stats back to somewhere, it's usually not allowed to use.
13:48:10Yardaniconim doesn't send anything
13:48:11cremDo you know when it appeared in ubuntu repos?
13:48:23Yardanicocrem, I doubt it's in ubuntu 14.04 repos
13:48:50Yardanicobut really, nim doesn't send any data
13:48:55Yardanicoat all
13:49:03FromGitter<Grabli66> But why? :)
13:49:11Yardanicobecause it doesn't need to
13:49:28Yardanicowhy do you want COMPILER to send something to some server?
13:49:49cremLike crash reports for debugging.
13:49:57crem(compiler crash reports)
13:49:58Yardanicoit doesn't
13:50:15Yardanicocrem, can you give an example compiler which does that?
13:50:20cremIt was the answer to a question "why would you do that"
13:50:32YardanicoI doubt there's open-source compilers with stuff like that
13:50:39euantordotnet's CLI does
13:50:44euantor(it's open source)
13:50:50Yardanicoeuantor, microsoft? :)
13:50:53euantorOn by default, with an opt out
13:50:55euantorYep
13:51:00Yardanicolol
13:51:05Yardanicowell it's microsoft :P
13:51:40cremSometimes random things do send some stats. For example some of sublime text's plugins. Altough "why would they do that".
13:51:44*ShalokShalom_ is now known as ShalokShalom
13:51:53*aziz joined #nim
13:51:57cremSo anyway, keeping nim to be home only for now. Too much to bother.
13:52:07*aziz quit (Client Quit)
13:53:37*yglukhov joined #nim
13:55:43*gokr quit (Ping timeout: 248 seconds)
13:56:38*gokr joined #nim
13:56:51*PMunch quit (Quit: Leaving)
13:59:35*tankfeeder left #nim (#nim)
14:03:43dom96|wNote: choosenim may start doing that
14:03:46dom96|wbut it will be opt-in
14:04:01*vlad1777d quit (Ping timeout: 240 seconds)
14:04:05dom96|wwell, it will ask you during installation and force you to give an answer :)
14:06:38Yardanicodom96|w, what stats will it send?
14:06:53dom96|wmainly crash logs
14:07:00dom96|wbut also OS stats
14:07:43Yardanicodom96|w, how will it be able to do that?
14:07:44Yardanicoah
14:07:49Yardaniconim is a proxy exe, forgot about that
14:07:54Yardanico(in choosenim installation)
14:07:58Yardanicowell I'm fine with that
14:08:05dom96|wYes, but mainly choosenim will do it
14:08:10dom96|wThe proxyexe might collect some data
14:08:13dom96|wbut it won't ever send anything
14:08:22Yardanicobut I don't use choosenim because I really don't want to download nim repo again on every devel update :)
14:08:24euantorYeah, I would only expect it to send when choosenim itself runs
14:08:29*Xe joined #nim
14:09:52dom96|wYardanico: Yeah, I will likely make that scenario easier to work with,]
14:10:08FromGitter<BigEpsilon> Does any body know why thttpclient.nim is failing in the tests ?
14:10:42*BigEpsilon joined #nim
14:11:25euantorWhich tests? What's the rrror?
14:12:17FromGitter<BigEpsilon> comipler tests on appVeyor
14:13:13euantorHave you tried running that test manually?
14:13:14FromGitter<BigEpsilon> I made a PR which is not related and it is failing, I think Araq mensioned it this morning if I'm not mistaken
14:13:25FromGitter<BigEpsilon> I'm doing that now
14:13:59AraqbigEpsilon: Either way, reorderings for 'var' seem overkill
14:14:21FromGitter<BigEpsilon> https://ci.appveyor.com/project/dom96/nim/build/252
14:14:27Araqvar and let are imperative statements, please do not reorder these
14:14:41Araqtype and const sections are fine to split up though
14:14:56FromGitter<BigEpsilon> Yes I hesitated doing that
14:15:10FromGitter<BigEpsilon> ok I'll do that then
14:15:16Araqbtw you need to merge the type sections back afterwards or else it's still not sufficient
14:15:55FromGitter<BigEpsilon> all the type sections or only the ones that I splited ?
14:16:30FromGitter<BigEpsilon> In what case not joining them can cause a problem ?
14:16:52gokrJoe Armstrong just twittered and mentioned that he was perhaps looking at Nim. I invited him :)
14:17:07gokrDo invite him you guys too: https://twitter.com/joeerl
14:23:18cremLooks more that he just says that he's overwhelmed with requests to "look at <some language>".
14:30:59*Matthias247 quit (Read error: Connection reset by peer)
14:31:55Arrrrlol
14:34:38cremOn the other hand, nim community is pretty mediocre. :)
14:35:29Yardanicocrem, you mean "small" ?
14:36:31cremNope, I was trying to joke. :)
14:37:13FromGitter<BigEpsilon> @Araq , nevermind my 2 questions about sections. Now I understand.
14:38:16ArrrrJokes and conversations about transpilers are a tabu here, be careful.
14:39:54Araqyou can transfinitecompile all you want, it's just not a word with any rationale meaning
14:40:24AraqI can *compile* high level C to lower level C and it's still a "compilation"
14:40:38YardanicoAraq, don't worry, Arrrr just said this as an example
14:40:39cremIs decompilation a compilation?
14:40:54federico3Arrrr: noo, you triggered the automated ranting device
14:40:56*def-pri-pub joined #nim
14:41:03Yardanicocrem, no
14:41:10Yardanico"de" means opposite :D
14:41:31Yardanicopls don't do too many jokews
14:41:55cremWhat wasn't a joke, it was a deep philosophical question.
14:42:36Yardanicocrem, there's #nim-offtopic btw
14:42:59*peanut quit (Ping timeout: 260 seconds)
14:43:39cremThat was pretty silent last time I checked. But I'll join, now that I've switched from irssi to weechat and large number of channels is more manageable.
14:43:57*PMunch joined #nim
14:44:06ArrrrWe were talking about you
14:44:07Yardanicocrem, well it is pretty silent
14:45:04FromGitter<BigEpsilon> @Araq , In fact no :/ I still don't see it
14:45:07FromGitter<BigEpsilon> "@BigEpsilon ⏎ all the type sections or only the ones that I splited ? ⏎ In what case not joining them can cause a problem ?"
14:45:28Araqall that you can
14:45:44Yardanico"Mutually recursive types are only possible within a single type section." maybe this?
14:46:50FromGitter<BigEpsilon> hmmm yes that's it i think
14:47:31Araqtype A = int; const x = 4; type B = type(x) # can't merge these
14:49:31FromGitter<BigEpsilon> yes I see
14:49:49FromGitter<BigEpsilon> I'll modify my PR then when I finish
14:51:09*yglukhov quit (Remote host closed the connection)
14:51:47*yglukhov joined #nim
14:52:10FromGitter<BigEpsilon> thanks
14:53:27gokrcrem: Ah, perhaps I didn't read too closely, sorry.
14:54:49*Trustable joined #nim
14:57:02*yglukhov quit (Ping timeout: 246 seconds)
14:58:34*endragor quit (Remote host closed the connection)
14:59:20*nsf quit (Quit: WeeChat 1.9)
15:00:37*endragor_ joined #nim
15:04:41*endragor_ quit (Ping timeout: 240 seconds)
15:06:37*yglukhov joined #nim
15:10:43*arnetheduck quit (Ping timeout: 246 seconds)
15:11:32*dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…)
15:14:32*dom96|w joined #nim
15:17:05*def-pri-pub quit (Ping timeout: 240 seconds)
15:26:21*gokr quit (Ping timeout: 240 seconds)
15:52:02*def-pri-pub joined #nim
15:52:02*def-pri-pub quit (Changing host)
15:52:02*def-pri-pub joined #nim
15:56:35*def-pri-pub quit (Client Quit)
15:57:04*sz0 quit (Quit: Connection closed for inactivity)
15:59:13*TjYoco joined #nim
16:02:11TjYocoIs it possible to make a proc like setConent? Its throwing an error rn: https://pastebin.com/63fpFkhr
16:02:30*dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…)
16:03:48def-TjYoco: you have to use new to initialize a ref
16:04:30def-ah, you don't mean an exception
16:04:40def-you need to use compiletime when
16:05:38def-when content is string: ...
16:05:50TjYocoahhhh okay, thank you
16:05:53def-but you can also just overload setContent and have 3 different procs
16:06:17TjYocoI had that at first but I wanted try out this method
16:07:02def-and then you can assert the kind
16:10:07*ShalokShalom quit (Ping timeout: 248 seconds)
16:19:05*ShalokShalom joined #nim
16:19:10*yglukhov quit (Remote host closed the connection)
16:20:39*yglukhov joined #nim
16:26:37*yglukhov quit (Ping timeout: 255 seconds)
16:29:28*couven92 quit (Ping timeout: 246 seconds)
16:34:22*yglukhov joined #nim
16:36:32*haha_ quit (Quit: haha_)
16:38:57*yglukhov quit (Ping timeout: 248 seconds)
16:41:34*nsf joined #nim
16:41:43*def-pri-pub joined #nim
16:42:51*Trustable quit (Remote host closed the connection)
16:46:25FromGitter<Bennyelg> hey do we have any aws integration ?
16:51:38FromGitter<Bennyelg> Open an in-memory sqlite ?
16:51:49FromGitter<Bennyelg> let db = open("localhost", "user", "password", "dbname") ⏎ let db = open(":memory:")
16:52:28YardanicoI don't think so
16:52:54FromGitter<Bennyelg> I found it
16:52:55FromGitter<Bennyelg> let theDb = open(":memory:",nil,nil,nil)
16:53:09Yardanicowell yeah
16:53:17Yardanicosqlite is just a wrapper for sqlite library
16:54:45FromGitter<xmonader> So it's bit frustrating :D :D
16:59:45*loc8 quit (Quit: WeeChat 1.9)
17:02:51*endragor joined #nim
17:06:45FromGitter<Bennyelg> casting string to int or string to float
17:06:54FromGitter<Bennyelg> not working int(element)
17:07:00FromGitter<xmonader> parseInt ?
17:07:04def-strutils.parseInt
17:07:07*endragor quit (Ping timeout: 240 seconds)
17:07:23def-and int(element) is a type conversion, cast[int](element) is a cast
17:10:48FromGitter<Bennyelg> How Do I implement something like this
17:10:55FromGitter<Bennyelg> ```proc castIt(element: string): string | float | int ⏎ ``` [https://gitter.im/nim-lang/Nim?at=59ad891fee5c9a4c5f313b84]
17:11:15def-you can't overload based on return type
17:12:04FromGitter<Bennyelg> :( any way to return something like "untyped"
17:12:12FromGitter<xmonader> auto i guess
17:12:25def-Nim is a statically typed programming language, what you're trying to do would make sense in Python
17:12:35def-but in Nim you wouldn't solve it that way
17:12:45FromGitter<Bennyelg> oh
17:12:46FromGitter<Bennyelg> hehe I know
17:12:59FromGitter<Bennyelg> I still need to get ride of my old meners :D
17:14:18FromGitter<xmonader> Can't you do an auto return?
17:14:22def-no
17:14:32FromGitter<xmonader> I'm sure i saw it in the stdlib code
17:15:26def-Sure, you can return auto, when the type is obvious from some "result = 123"
17:15:37def-but not in this case where it will be determined at runtime
17:15:49*nattefrost joined #nim
17:16:12*miran joined #nim
17:16:39FromGitter<k0pernicus> Generic return type?
17:16:40*miran quit (Remote host closed the connection)
17:17:01*miran joined #nim
17:18:23def-yeah, you can do proc castIt[T: string | float | int](element: string): T =
17:18:35def-and then use castIt[float](...)
17:18:39FromGitter<k0pernicus> Yep
17:19:21FromGitter<xmonader> @dom96 How do i reset the download code in choosenim? as it's not a git repo?
17:20:16Yardanicowhat do you mean by "reset"?
17:20:33FromGitter<k0pernicus> I didn’t understand “reset” neither...
17:20:45FromGitter<xmonader> I mean i tinkered a bit with the code in the toolchain nim#devel
17:21:02FromGitter<xmonader> and i want to reset it as in `git reset` except it's not really a git repo
17:22:09FromGitter<k0pernicus> If you don’t need your modifications, and if the devel branch is a toolchain, remove the toolchain and reinstall this one
17:22:39FromGitter<xmonader> I don't have that great internet it may take 15 mins :(
17:22:45FromGitter<k0pernicus> Aoutch...
17:22:52*BigEpsilon quit (Ping timeout: 255 seconds)
17:23:04FromGitter<xmonader> maybe i can just copy the raw files from github, that should work
17:23:42FromGitter<k0pernicus> Just copy the original files where you made some modifications
17:23:46FromGitter<k0pernicus> Replace them
17:23:47FromGitter<Bennyelg> How do i get the variable type name
17:24:06FromGitter<xmonader> @k0pernicus yupp
17:24:45YardanicoBennyelg: why do you want to get it?
17:24:51Yardanicoyou can do that in the macro
17:25:08FromGitter<k0pernicus> @Bennyelg my_var.type.name ?
17:25:19FromGitter<Bennyelg> Im pretty newibe to nim do know macros yet
17:25:44FromGitter<Bennyelg> undeclared field: 'name'
17:25:46*gokr joined #nim
17:25:51Yardanicok0pernicus no
17:26:04YardanicoBennyelg: why do you want to get it in the first place?
17:26:29FromGitter<xmonader> I found very annoying problem with nim http client
17:26:37FromGitter<Bennyelg> Im trying to parse csv file get the types and put it into database
17:26:44FromGitter<Bennyelg> by creating the apropirate types
17:26:55YardanicoBennyelg: you can use
17:27:25Yardanicowell you can;'t
17:27:32Yardanicowell you want to have a macro
17:27:36Yardanicoyou can't define new types at runtime
17:27:45FromGitter<xmonader> in python ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ If I do same requests in nim i get moved to https://www.google.com.eg [https://gitter.im/nim-lang/Nim?at=59ad8d108f4427b462d02d8f]
17:27:57Yardanicodisable redirects?
17:28:18FromGitter<Yardanico> client.maxRedirects = 0
17:28:18*Serenitor joined #nim
17:28:25FromGitter<Yardanico> if your http client is named "client"
17:28:27FromGitter<k0pernicus> Oh, actually, `my_var.type.name` works if you import `typetraits`
17:28:36FromGitter<xmonader> Yardanico let me try
17:28:56FromGitter<Bennyelg> thx
17:28:58FromGitter<Bennyelg> your are hero
17:29:24FromGitter<xmonader> @Yardanico ```asynclinkschecker.nim(28, 25) Error: attempting to call undeclared routine: 'maxRedirects='```
17:29:44Yardanicocan you show full code?
17:29:50FromGitter<xmonader> sure
17:30:42FromGitter<Bennyelg> I did it
17:30:46FromGitter<Bennyelg> OMG I love you all :)
17:31:29*thomasross_ is now known as thomasross
17:31:54*ofelas joined #nim
17:33:10FromGitter<xmonader> https://gist.github.com/
17:33:14Yardanicowell
17:33:33FromGitter<xmonader> I think my changes in the toolchain were needed :(
17:33:46FromGitter<xmonader> because now it keeps hanging again, dammit
17:33:52FromGitter<Yardanico> @xmonader ah sorry
17:34:45FromGitter<xmonader> It was basically supporting DONT_WAIT flag in socketflags
17:34:56FromGitter<Yardanico> ah
17:34:59FromGitter<Yardanico> wait
17:35:05FromGitter<Bennyelg> format("c_%d", ind) formatting anyone? :)
17:35:19FromGitter<Yardanico> @Bennyelg "c_" & $ind ?
17:35:41FromGitter<xmonader> cant u use # in the format @Bennyelg ?
17:35:46FromGitter<Yardanico> @xmonader initialise client like this: ```nim ⏎ var client = newAsyncHttpClient(maxRedirects = 0) ⏎ ⏎ `````` [https://gitter.im/nim-lang/Nim?at=59ad8ef2b16f264642054436]
17:35:55FromGitter<Yardanico> @xmonader # ?
17:36:02FromGitter<Yardanico> ah
17:36:05FromGitter<Yardanico> you mean $
17:36:12FromGitter<Bennyelg> sample
17:36:14FromGitter<Yardanico> @Bennyelg yeah you also can use "format" from strutils
17:36:18FromGitter<Yardanico> like this:
17:36:38FromGitter<Bennyelg> this is what I do now: ⏎ format("c_$1", ind)
17:36:50FromGitter<Yardanico> yeah that's nice
17:37:30FromGitter<xmonader> @Yardanico as a variable placeholder same as in python {}
17:37:31FromGitter<Yardanico> @xmonader also, why do you use "poll"?
17:37:34FromGitter<Yardanico> no
17:38:32FromGitter<Yardanico> ah
17:38:35FromGitter<Yardanico> you mean $var
17:38:35FromGitter<xmonader> I'm afraid i really need the DONTWAIT socket flag
17:39:16FromGitter<Yardanico> @xmonader why?
17:39:25FromGitter<xmonader> @dom96 is that missing from socket library? maybe if so it could be my first nim contribution :D
17:39:50FromGitter<Yardanico> you can also add a timeout
17:40:14FromGitter<Yardanico> and also it's better to create different http client for each website
17:40:31FromGitter<Yardanico> yes
17:40:33FromGitter<Yardanico> it works for me
17:40:50FromGitter<Yardanico> without any DONT_WAIT
17:40:59FromGitter<Bennyelg> optional argument pass to function?
17:41:05FromGitter<xmonader> my god i'm really getting frustrated with this
17:41:06FromGitter<Bennyelg> f(x, f=None)
17:41:11FromGitter<Yardanico> @Bennyelg ???
17:41:20FromGitter<xmonader> why creating a special http client for each site?
17:41:21FromGitter<Yardanico> @Bennyelg myProc(x, f = myThing)
17:41:32FromGitter<Yardanico> @xmonader because http clients holds a connection to one website
17:41:40FromGitter<Yardanico> and it's better to create each http client for each website :)
17:41:44FromGitter<Yardanico> also this solves the deadlock
17:42:21FromGitter<xmonader> really!!! I didn't know that how about the cost of creating lots of httpclients?
17:42:30FromGitter<Yardanico> well
17:42:34FromGitter<Yardanico> I benchmarked it a while ago
17:42:46FromGitter<Yardanico> you can create 2 million instances of httpclient in one seconds
17:42:52FromGitter<Yardanico> I mean just object creation
17:42:56*Sentreen quit (Ping timeout: 246 seconds)
17:43:00FromGitter<xmonader> Interesting
17:43:07FromGitter<Yardanico> well you wouldn't have any performance problems
17:43:15FromGitter<Yardanico> because your code still would be IO bound :)
17:43:41FromGitter<xmonader> That's is supposed to be fixed with async ... which doesn't work for me :(
17:43:55FromGitter<Yardanico> do you have any performance problems?
17:43:59*Matthias247 joined #nim
17:44:58FromGitter<xmonader> @Yardanico I've the weirdest issues with it. As you know that code hangs on my archlinux machine, works on my ubuntu and apparently works on dom's machine and urs :D
17:45:10FromGitter<Yardanico> well no
17:45:12FromGitter<Yardanico> I changed the code a bit
17:45:19FromGitter<Yardanico> and I use antegros (basically arch)
17:46:46FromGitter<Yardanico> @xmonader https://gist.github.com/Yardanico/a5b860ec7eaf59f9f2f33ba2bee97a73
17:46:56FromGitter<Yardanico> I added "result" because it's more idiomatic in Nim :)
17:47:14FromGitter<Yardanico> try this
17:47:41FromGitter<Yardanico> it gives "False" for google because it returns non-200 http code
17:47:44FromGitter<Yardanico> because it redirects
17:47:59FromGitter<Yardanico> and in this code nim doesn't follow redirects
17:48:18FromGitter<Yardanico> oh wait
17:48:19FromGitter<Yardanico> sorry
17:48:34FromGitter<Yardanico> Check gist again, I fixed the code :)
17:48:44FromGitter<Yardanico> or no
17:48:45FromGitter<Yardanico> :D
17:48:59FromGitter<Yardanico> ah yes, I did
17:49:19FromGitter<Yardanico> So this would work 100% - https://gist.github.com/Yardanico/a5b860ec7eaf59f9f2f33ba2bee97a73. Sorry for spamming so much messages
17:49:55FromGitter<xmonader> I get ``` ⏎ SIGSEGV: Illegal storage access. (Attempt to read from nil?) ⏎ Error: execution of an external program failed: '/tmp/async2 '```
17:50:07FromGitter<Yardanico> I fixed it
17:50:10FromGitter<Yardanico> check the gist again
17:50:11FromGitter<xmonader> it's okay let me retry that again
17:50:19*yglukhov joined #nim
17:51:26FromGitter<xmonader> @Yardanico amazing works like a charm
17:51:58FromGitter<xmonader> But why u needed to convert asyncLinksChecker to async pragma? because in the testcases provided for nim the calling function doesn't need to be async
17:52:31FromGitter<Yardanico> well it feels better for me
17:52:34FromGitter<Yardanico> you can change it back
17:52:36FromGitter<Yardanico> it would work
17:52:43FromGitter<Yardanico> it didn't work because you had only one http client
17:52:47FromGitter<Yardanico> that's probablt the reason
17:53:28FromGitter<xmonader> I really didn't know that is that documented anywhere? to have 1 httpclient per connection?
17:53:40FromGitter<Yardanico> well I think it isn't
17:53:52FromGitter<Yardanico> but look: httpclient holds a socket
17:53:57FromGitter<Yardanico> which is connected to one website
17:54:02FromGitter<Yardanico> and you're trying to connect to another website
17:54:07FromGitter<Yardanico> and coroutines are executed separately
17:54:32FromGitter<Yardanico> well you can still use one http client for many http clients
17:54:42FromGitter<xmonader> by spawning u mean?
17:54:58*yglukhov quit (Ping timeout: 264 seconds)
17:55:02FromGitter<xmonader> because that's what i used for the threaded one, but no wonder it was bit slow
17:55:04FromGitter<Yardanico> you cna still use one http client but only if you're sure you're not using the same client somewhere else
17:55:13FromGitter<Yardanico> no, not by spawning
17:56:13*Sentreen joined #nim
17:57:06FromGitter<xmonader> Okay what would be the effect in spawning? no multiplexing allowed?
17:57:21FromGitter<Yardanico> I don't really know
17:57:27FromGitter<Yardanico> I don't use threads
17:57:56FromGitter<Yardanico> and if you try to use spawn - you will be not able to do it
17:58:03FromGitter<Yardanico> well you probably will be able
17:58:12FromGitter<Yardanico> because http client will probably be just deeply copied to your procedure
17:58:17FromGitter<xmonader> I did, but i noticed it's bit slow
17:58:20*xet7 quit (Read error: Connection reset by peer)
17:58:29def-pri-pubzacharycarter: sorry for being a pest, but I've found another issue or two and I'm starting to get blocked on more progress. I really want to address the origin/coordinate issue ASAP, as well as timing
17:58:44*yglukhov joined #nim
17:58:50def-pri-pubI also submitted a PR that adds in rudimentary animation of the sprites, but I don't consider it done yet.
17:58:58*haha_ joined #nim
17:59:57FromGitter<xmonader> What's the difference between await/waitFor ?
18:00:10FromGitter<Yardanico> big difference
18:00:12*mahmudov joined #nim
18:00:23FromGitter<xmonader> are the testcases for nim not updated? because i see in it they use waitFor
18:00:28FromGitter<Yardanico> they ARE updated
18:00:30FromGitter<Yardanico> as I said
18:00:35FromGitter<Yardanico> you CAN use waitFor in your code
18:00:50FromGitter<Yardanico> the issue was that you've used one http client for all requests
18:01:05FromGitter<Yardanico> waitFor is used in non-async procs whose want to call async procs
18:01:12FromGitter<Yardanico> it waits for specific future to complete
18:01:17FromGitter<Yardanico> and "await" is used in async procs
18:01:28FromGitter<xmonader> uha that's why it worked for asyncLinksChecker with no async pargma
18:01:50FromGitter<xmonader> maybe that's what i mixed the two from my source code reading
18:01:53FromGitter<Yardanico> if you don't really want to use await
18:01:54FromGitter<Yardanico> https://gist.github.com/Yardanico/f8cc9a715461def8ba775b1105224bf4
18:02:22FromGitter<xmonader> i updated the code thank you. that was enlightening
18:04:01*def-pri-pub quit (Ping timeout: 240 seconds)
18:06:12*Serenit0r joined #nim
18:08:46*Serenitor quit (Ping timeout: 255 seconds)
18:11:41FromGitter<xmonader> Okay now i'm curious a bit ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59ad975cc101bc4e3a8c704d]
18:15:46*xet7 joined #nim
18:16:44FromGitter<Yardanico> 1) 01 seconds for me
18:16:50FromGitter<Yardanico> in async
18:16:50FromGitter<Yardanico> in release mode :)
18:17:06FromGitter<xmonader> oh maybe debug is the reason?
18:17:26*haha_ quit (Quit: haha_)
18:17:56FromGitter<Yardanico> yes
18:18:02FromGitter<Yardanico> why you test speed in debug mode?
18:18:02FromGitter<Yardanico> lol
18:18:08*vlad1777d joined #nim
18:19:41FromGitter<xmonader> even if debug it should be faster than sequential no?
18:19:46Yardanicono
18:20:02FromGitter<xmonader> i used release mode -d:release ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59ad9952c101bc4e3a8c7791]
18:20:06FromGitter<xmonader> Not cool
18:20:24FromGitter<Yardanico> well it's something weird with your internet connection or your pc :)
18:20:28FromGitter<xmonader> problem is I can see sequential taking time, but it's logged as the best of them
18:20:33FromGitter<Yardanico> can you share the code?
18:20:41FromGitter<Yardanico> for this "benchmark"
18:21:05*taaperotassu joined #nim
18:21:34FromGitter<xmonader> https://gist.github.com/xmonader/fdbecbe01cb5ff349d994bc92dcc5945
18:21:50FromGitter<xmonader> Maybe I'm doing smething wrong don't know
18:24:19*BigEpsilon joined #nim
18:29:50*vlad1777d quit (Ping timeout: 255 seconds)
18:30:05*haha_ joined #nim
18:30:13FromGitter<Yardanico> they all have the same time for me
18:30:32FromGitter<Yardanico> ```code paste, see link``` ⏎ ⏎ Almost the same time :) [https://gitter.im/nim-lang/Nim?at=59ad9bc8c101bc4e3a8c8319]
18:30:57cremI'm trying to use Table[string, MyObjRef not nil], it complains that it cannot prove it's initialized. :(
18:31:02FromGitter<Yardanico> yes
18:31:09FromGitter<Yardanico> not nil isn't bug-free yet
18:31:41*der joined #nim
18:32:11FromGitter<xmonader> @Yardanico How is that possible
18:32:16FromGitter<Yardanico> and I don't think CPU time is reliable
18:32:24FromGitter<Yardanico> it's "cpu time"
18:32:28FromGitter<Yardanico> not real time
18:33:16FromGitter<xmonader> okay how can i measure it? because in docs they say cpuTime - prev time
18:34:34*beatmox_ joined #nim
18:34:35FromGitter<Yardanico> ===```nim=== ⏎ ⏎ ===GlobalBenchmark relative time/iter iters/s=== ⏎ ⏎ ===GlobalBenchmark 294.84ps 3.39G=== ... [https://gitter.im/nim-lang/Nim?at=59ad9cbb210ac26920f48c5c]
18:34:54FromGitter<Yardanico> and sometimes "async" is even faster
18:35:08FromGitter<Yardanico> so it's something weird on your side really
18:35:25FromGitter<xmonader> maybe, it's a very old machine i'm using
18:35:39FromGitter<xmonader> I'll try it on my workmachine
18:35:50FromGitter<xmonader> but yes, you got more reasonable results
18:37:06*thomasross quit (Remote host closed the connection)
18:37:24*thomasross joined #nim
18:37:35*beatmox quit (*.net *.split)
18:37:36*niv quit (*.net *.split)
18:37:36*joshbaptiste_ quit (*.net *.split)
18:37:37*ehmry quit (*.net *.split)
18:37:37*byteflame quit (*.net *.split)
18:37:37*derlafff quit (*.net *.split)
18:37:40*beatmox_ is now known as beatmox
18:39:31*thomasross quit (Read error: Connection reset by peer)
18:39:38*Yardanico_ joined #nim
18:39:42*Yardanico_ quit (Client Quit)
18:39:49*BigEpsilon quit (Ping timeout: 255 seconds)
18:40:01*thomasross joined #nim
18:41:35cremThere's no server-side doc search, is there? I wanted to have a chrome search shortcut like with any other search engine. (and if it's possible, it would be nice to have it auto-added).
18:41:48*def-pri-pub joined #nim
18:41:48*def-pri-pub quit (Changing host)
18:41:48*def-pri-pub joined #nim
18:42:03*Yardanico quit (Remote host closed the connection)
18:42:38*def-pri-pub quit (Client Quit)
18:42:48cremIt may still be client-side, but if only there were a way to specify search term in URL (z.B. after '#')
18:44:17*niv joined #nim
18:44:58*Yardanico joined #nim
18:45:23*joshbaptiste_ joined #nim
18:45:42*Nikky quit (Quit: WeeChat 1.9)
18:45:55Yardanicocrem, sadly no
18:46:20FromGitter<ephja> the index might be the next best thing
18:46:30FromGitter<Yardanico> well it doesn't contain proc comments
18:46:59*claudiuinberlin joined #nim
18:47:14FromGitter<ephja> right
18:48:42*ehmry joined #nim
18:48:42*byteflame joined #nim
18:49:04cremWhat is "nimsuggest" and how to install it? There is an aur pkg for it in arch, but maybe I should use some nimble (whatever it is). Or "Setup nimsuggest" menu item in sublime's nimlime should work?
18:49:11FromGitter<Yardanico> nonononoono
18:49:16FromGitter<Yardanico> how did you install nim?
18:49:26cremfrom aur.
18:49:29Yardanicocrem, ah
18:49:39Yardanicothen you should install nimsuggest from aur too
18:49:48*Nikky joined #nim
18:49:49Yardaniconimsuggest is a tool (mainly for IDEs) which allows IDEs to query nim compiler for autocompletion
18:50:01Yardanicoso IDEs don't need to implement their own autocompletion
18:50:08Yardanicoand it's integrated with the compiler so it know everything
18:50:11*Nikky quit (Client Quit)
18:50:41Yardanicocrem, if you don't hate GUI IDEs - use VSCode with nim plugin
18:50:53Yardanicoif you prefer console IDEs - try emacs or vim
18:50:57cremactually not from aur but from proper arch repo.
18:50:59Yardanicothey have nim plugins too
18:51:35cremI use Sublime, it it's nimlime is good, i just feel that there's something more that I miss.
18:51:38FromGitter<k0pernicus> VSCode is the must for GUI IDEs
18:51:50Yardanicocrem, yes, nimlime can use nimsuggest
18:51:52FromGitter<k0pernicus> The NIM plugin is really great also
18:52:26*Nikky joined #nim
18:52:38cremSo fetching nimsuggest from aur
18:52:41Yardanicok0pernicus: install "vscode-icons" extension to get a lot more file icons :)
18:52:50Yardanicoand there's also .nim file icon :)
18:53:12FromGitter<Yardanico> like this:
18:53:13FromGitter<Yardanico> (https://files.gitter.im/nim-lang/Nim/cErt/image.png)
18:53:28FromGitter<Yardanico> https://marketplace.visualstudio.com/items?itemName=robertohuertasm.vscode-icons
18:53:51FromGitter<k0pernicus> @Yardanico Already done ;-)
18:54:02cremarrrr it cannot compile nimsuggest for some reason.
18:54:12cremwhy cannot it just work. :-\
18:54:18Yardanicobecause it's aur
18:54:25Yardanicoit works if you compile nim yourself :)
18:54:33Yardanicoand compiling nim yourself is very easy
18:54:47FromGitter<k0pernicus> @crem Compiling nim yourself is super-easy
18:54:50FromGitter<Yardanico> https://github.com/nim-lang/Nim ⏎ ⏎ all commands in readme
18:54:53FromGitter<Yardanico> and ./koch tools
18:55:01FromGitter<xmonader> @Yardanico so epochTime not cpuTime works for me
18:55:04FromGitter<Yardanico> to compile nimsuggest, nimble, and some other tools
18:55:26cremIf I compile everything manually, I need to manually update and recompile things. That's not what I want to do.
18:56:08Yardanicocrem, well it's not our fault that aur package doesn't work
18:56:26FromGitter<k0pernicus> Crem choosenim?
18:56:29Yardanicoyeah
18:56:31Yardanicoalso +1
18:56:36Yardanicocrem, https://github.com/dom96/choosenim
18:56:41Yardanicocurl https://nim-lang.org/choosenim/init.sh -sSf | sh
18:56:43FromGitter<k0pernicus> choosenim is really super-cool
18:56:46Yardanicoto install chooseni
18:56:47Yardanicochoosenim
18:56:55Yardanicoit's nim version manager
18:57:07cremThere's no pkg for it in aur, I'll wait for it. :)
18:57:10FromGitter<k0pernicus> Coming from Rust, choosenim is the `rustup` for Nim
18:57:16FromGitter<k0pernicus> crem ?
18:57:23cremok, I don't need nimsuggest that much actually
18:57:24FromGitter<k0pernicus> Just a command and it’s done
18:57:37Yardanicocrem, I use arch too, but I don't think it's really NEEDED to have packages for every file in your system :)
18:57:42FromGitter<k0pernicus> No AUR need for that...
18:59:02FromGitter<k0pernicus> Just a simple command (`curl https://nim-lang.org/choosenim/init.sh -sSf | sh`), it’s done :-)
18:59:04Yardanicoand aur is "user" repository
18:59:09cremyes, running it
18:59:39Yardanicoand then you'll need to add ~/.nimble/bin to path
18:59:52Yardanicodon't say "why I should do this manually?" because it's really needed to let user do it manually
19:00:05Yardanicothe amount of different shells on linux is.... big
19:00:13cremok ok :)
19:00:16FromGitter<k0pernicus> @Yardanico An issue about that has been created :-)
19:00:17*xet7 quit (Ping timeout: 248 seconds)
19:00:23Yardanicoeven rust requires you to add it to path
19:00:28FromGitter<k0pernicus> Soon, choosenim will update your `PATH` itself
19:00:35FromGitter<k0pernicus> @Yardanico true
19:00:38Yardanico*rustup
19:00:44Yardanicowell yeah it lets you choose
19:00:56FromGitter<k0pernicus> Yep
19:01:04FromGitter<k0pernicus> It’s planned
19:01:46Yardanicodom96, why it's named "Araq's wishlist" ? :) https://github.com/dom96/choosenim/milestone/1
19:02:08Yardanicoso this is what Araq wants to be implemented?
19:03:44*TjYoco quit (Ping timeout: 260 seconds)
19:07:40*Nikky quit (Quit: WeeChat 1.9)
19:08:26*Nikky joined #nim
19:14:26*nsf quit (Quit: WeeChat 1.9)
19:17:49cremStill looking where to add PATH to. :)
19:17:58Yardanicocrem, .bashrc, .zshrc
19:18:01cremProbably need to create some .xsessionrc...
19:18:04Yardanicocrem,
19:18:04Yardanicono
19:18:17Yardanicocrem, PATH is added to your shell config file
19:18:21cremnope, I also want it outside of terminal
19:18:27cremoutside of shell
19:18:29Yardanicocrem, /etc/profile then
19:18:33cremin sublime
19:18:40crem/etc/profile is for all users
19:18:44Yardanicocrem, https://wiki.archlinux.org/index.php/Environment_variables#Globally
19:19:47cremyeah, it says .xinitrc, and in another place it tells that it's actually wrong and I should use xsessionrc
19:20:12cremxprofile.. Will give it a try!
19:21:48cremI wonder if i should chmod +x it and add a shebang line..
19:21:54cremWill find out!
19:22:05Yardanicocrem, I don't know why your system is so complicated
19:22:21FromGitter<k0pernicus> (me neither actually…)
19:22:37YardanicoI've just set my PATH in /etc/profile to this
19:22:38YardanicoPATH="/usr/local/sbin:/usr/local/bin:/usr/bin:/home/tiber/nim/bin:/home/tiber/.nimble/bin"
19:23:09Yardanicoin /etc/profile file
19:24:54cremit works with .xprofile.
19:25:02YardanicoI don't know what .xprofile is :)
19:26:24cremThat's the recommended place to add things to PATH. I probably should have created symlinks from ~/bin though. If I'd need to add something in PATH for all kinds of software, it would quickly become unmanageable.
19:26:57Yardanicowell I don't need to add some software to global system path
19:27:12Yardanicobecause I mostly use all software in console (because on linux almost everything is a terminal command)
19:27:15cremlike programming languages
19:28:12*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
19:28:54crem"not nil" doesn't work if type defined later (in the same type block), is it intended?
19:29:03*haha_ quit (Quit: haha_)
19:29:35Yardanicocrem, can you give an example?
19:30:01*claudiuinberlin joined #nim
19:30:16cremhttps://pastebin.com/M5udzUi4
19:30:33Yardanicowell yeah
19:30:36Yardanicoyou can't do that AFAIK
19:31:05FromGitter<mratsim> On Arch I create a package for everything, it’s part of the Arch philosophy I think :p. Every single python package I find on git/pip I create an Arch package for it. Pacman is just too nice
19:31:18Yardanicowell I'm lazy
19:31:27Yardanicocrem, and also consider posting your code to gist maybe :) pastebin is really not the best thing for code pasting
19:31:37Yardanicoads/many JS scripts
19:31:52cremI was trying to rememeber what was that thingy that you recommended but couldn't
19:32:11Yardanicowell gist is quite popular
19:32:13Yardanicogist.github.com
19:32:24Yardanicoso gist takes 1.7 sec to load for me FULLY with disabled browser cache
19:32:45Yardanicoand pastebin takes 4 seconds (with adblock enabled) or 7 seconds with adblock disabled
19:33:18crempastebin takes 2.1s for me, not that different :)
19:33:23Yardanicowell it's just a suggestion
19:33:30Yardanicocrem, did you check with disabled browser cache?
19:33:37cremok, i'll try to remember it
19:34:12cremyes, now it's 1.9 :)
19:34:28Yardanicowell pastebin is just not very nice
19:34:29cremah, it was disabled and I've just enabled it
19:35:01crembecause I did some typescipt/angular dev last month.
19:35:47cremtypescript is well, that yet another transpieler like nim :-P
19:35:59Yardanicocrem, no jokes like this pls :D
19:37:31crembut back to https://pastebin.com/M5udzUi4 it's not entirely obvious for me why the last example is impossible but first two possible.
19:38:04*ipjk quit (Quit: Leaving)
19:38:14Yardanicocrem, second example isn't possible too
19:38:20Yardanicoah wait sorry
19:38:23Yardanicoit works too
19:40:40*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
19:40:48Arrrrhttps://github.com/nim-lang/Nim/commit/8ce42738648e70e562e7f1bbe925257cddf0b392
19:40:54ArrrrUjj, this is going to break a lot of things
19:41:05ArrrrFor example, https://nim-lang.org/docs/ospaths.html#DirSep
19:41:07Yardanicooh yes
19:41:22Yardanicowhy DirSep?
19:41:31Yardanicoehm
19:41:41*claudiuinberlin joined #nim
19:41:48YardanicoArrrr, you're quite wrong
19:41:54Yardanicoos imports and exports ospaths
19:42:00Yardanicoand it was previously also including it
19:42:05Yardanicohttps://github.com/nim-lang/Nim/commit/8ce42738648e70e562e7f1bbe925257cddf0b392#diff-2fd1cb6fa2de35053b75e69dcddfd419R29
19:42:10FromGitter<adamrezich> i'm having trouble calling a proc that takes both a type generic parameter and a static[int], as well as other regular parameters https://pastebin.com/mTVKjJiF what am I missing here?
19:42:14ArrrrYou are right. Then everythig is ok
19:43:17Yardanicoadamrezich: can you provide some example with full code?
19:43:33ArrrrI said DirSep because sometimes i import os just for DirSep, CurDir, etc, and i thought i'd need to replace the imports
19:43:53YardanicoArrrr, well I quite like / proc
19:43:55Yardanicofor paths
19:46:54FromGitter<adamrezich> @Yardanico: I'm making a complex game engine with an entity-component system, and my `register()` function registers a component with the system. right now I'm not using the `static[int]` in my code here https://github.com/rezich/nch/blob/master/src/nch.nim#L188 and it works just fine, but I'd like to include a `static[int]`so the user who's making a game with the engine can specify at compile-time how many component
19:46:54FromGitter... instances fit in a "page" (static array) of memory (when you allocate more than the "expected" number, it makes another page, but for performance reasons you ideally want all instances of the same component to fit in the same page)
19:47:21Yardanicowhy make it static int?
19:47:52YardaniconewSeq just uses int for specifying seq size (how many will be allocated)
19:48:06cremHow to properly use "not nil"? https://gist.github.com/mooskagh/58369a034b165a795a69a69d487a5ef9
19:48:08cremwell
19:48:12cremno need to answer that
19:48:30Yardanicocrem, not nil is still buggy sadly
19:49:00FromGitter<adamrezich> @Yardanico I don't want to use seqs, I used them initially but then I switched over to the page system to avoid reallocating. I'd really like to use static arrays
19:49:11Yardanicoah
19:49:30*Vladar quit (Quit: Leaving)
19:49:52*TjYoco joined #nim
19:50:02FromGitter<adamrezich> I'm just confused by the syntax, why does it want me to stick the static[int] both in the square brackets and as a regular parameter?
19:50:33Yardanicoadamrezich: https://nim-lang.org/docs/manual.html#special-types-static-t
19:51:02Yardanicoor the purposes of code generation, all static params are treated as generic params - the proc will be compiled separately for each unique supplied value (or combination of values).
19:52:17FromGitter<adamrezich> I get that, and I see now also that part of my problem is I didn't get that you use semicolons to separate generic parameters, that makes sense
19:52:25FromGitter<adamrezich> I just don't get why I have to stick it in both places?
19:52:45Yardanicobecause it's like a generic param
19:53:25YardanicoI think you'll able to implement the thing that you want with runtime ints
19:53:46Yardanicoand btw
19:54:02Yardanicoseq internally is an object (struct) like (len, arrayOfData)
19:54:17*couven92 joined #nim
19:54:47FromGitter<adamrezich> sure but when you expand it, everything gets copied over into a new buffer, right?
19:55:03FromGitter<k0pernicus> Is it possible to « deconstruct » a couple like that ? ⏎ ⏎ ```let info, path = res_from_walkdir``` [https://gitter.im/nim-lang/Nim?at=59adaf979acddb24070115a4]
19:55:18Yardanicoyes
19:55:26Yardanicoif this proc returns a tuple
19:55:33Yardanicoyou can do let (info, path) = res_from_walkdir
19:55:35Yardanicoor if this is a tuple
19:56:05*Arrrr quit (Ping timeout: 240 seconds)
19:56:18FromGitter<k0pernicus> Ah yeah, I forgot parenthesis arount my new variables, sorry for that...
19:56:23FromGitter<k0pernicus> Thanks @Yardanico :-)
19:57:56Araqadamrezich: seqs copy when the capacity cannot hold e
19:57:59Araqanother element
19:58:25Araqthe capacity is multiplied with a factor of 1.5
19:58:31FromGitter<adamrezich> right, they're basically analogous to std::vector, right?
19:58:35Araqyes
19:58:48*couven92 quit (Client Quit)
20:00:15FromGitter<adamrezich> yeah so I get that, but I want to avoid that, I want to use this "pages of memory" system instead (page = static array with a pointer to another page in case of overflow). I've got it all implemented and working just fine, but now I want to change the system from having one global "pagesPerComp" constant into having a constant per component type, which means passing a static[int] through various procs
20:00:31FromGitter<adamrezich> and I'm just confused as to why I have to specify the value both in the [] and in the ()
20:00:51FromGitter<adamrezich> *compsPerPage
20:01:33Yardanicowell static[int] works without [] for me in simple cases
20:02:15cremWhat does 'm' stand for in mgetOrPut?
20:02:28Yardanico"modify"
20:02:45Yardanicoit's actually in doc comment
20:02:50Yardanicohttps://nim-lang.org/docs/tables.html#mgetOrPut,Table[A,B],A,B
20:02:53Yardanicoretrieves value at t[key] or puts val if not present, either way returning a value which can be modified.
20:03:18Yardanicoso you can modify value returned from this proc, and it will be changed in table
20:03:33TjYocoWhat's the proper way to assign a value to a field of an object that's contained within a seq[T] of another object? One way I got a list where each object was a copy of the last object I tried adding to the list and the other way I get an error saying I can't assign a value to it. Sorry if I worded this poorly..
20:03:58TjYocoI think I'm just very confused about ref objects
20:04:02YardanicoTjYoco, best wording would be the code you're trying to ged running :)
20:04:03Yardanico*get
20:04:43TjYocoone sec! Im sure this will be embarrassing for me
20:05:15Araquse 'param: var T' instead of 'param: T'
20:05:32Araqif you need to modify it
20:10:31cremThere's not way to "init Table" when the variable already there, only assign a new "inited Table", right?
20:11:23cremif I have var x: Table[string, MyObj], the only thing I can do is x = initTable[string, MyObj](), right?
20:11:46cremIs there a way to avoid need of typing [string, MyObj] twice?
20:11:51Yardanicocrem, yes -_-?
20:11:59Yardanicovar x = initTable[string, MyObj]()
20:12:00Yardanicoor
20:12:10TjYocohere's my issue from earlier: https://pastebin.com/eB5ABWnD . Sorry, <Araq> I'm not sure where that would go.
20:12:14Yardanicovar x: auto
20:12:21Yardanicox = initTable[string, MyObj]()
20:12:24Yardanicobut first one is better
20:12:37cremx is object field actually
20:12:47Yardanicoah
20:13:59cremso no way to avoid typing [string, MyObj] twice?
20:14:21Yardanicocrem, well I don't really see bad things here
20:14:34Yardaniconim greatly removes a lot of boilerplate already
20:14:36Yardanicowith templates/macros
20:14:53Yardanicowell you can always make a feature request
20:14:54cremThat's the most frequent answer on #go-lang too!
20:15:11Yardanicocrem, well because making compiler overly smart would make it slower and harder to maintain
20:15:11crem"I don't see a problem here, that's by design!"
20:16:12cremI don't buy that argument too. Compiler and development complexity is a tradeoff, we don't optimize just for compiler simplicity.
20:16:33Araqok, patch the compiler to allow that then
20:16:51cremI need to learn nim basics first :)
20:16:57Araqcan't be hard since you don't "buy that argument"
20:17:04Yardanicocrem, well nim already does almost the best compiler complexity / developer speed
20:17:05FromGitter<k0pernicus> crem you know, you can propose an RFC ;-)
20:17:24*xet7 joined #nim
20:17:30Yardanicoalso program performance to development speed ratio
20:18:02FromGitter<k0pernicus> (true - coming from Rust to Nim - better compiler complexity/developer speed EVER)
20:18:12Yardanicohow many KLOC does Rust compiler have?
20:18:36FromGitter<k0pernicus> Wow
20:18:38FromGitter<k0pernicus> I don’t know
20:18:41cremAraq: Well, if you told me that particular feature is not there because it makes compiler too complex, I would buy it. But Yardanico says that argument not the first time, and it's not obvious for me that in that particular cast that is the reason it's done one way and not another.
20:18:43FromGitter<k0pernicus> I will check
20:19:02crems/cast/case
20:19:02Araqactually I find this annoying too
20:19:17Araqand I know it's not that hard to implement :P
20:19:31Araqbut I cannot see a syntax for it
20:19:32FromGitter<Bennyelg> there is a built in "magic" variable on golang called result?
20:19:52AraqBennyelg: no.
20:19:57FromGitter<k0pernicus> @Bennyelg don’t think so
20:20:13*xet7 quit (Read error: Connection reset by peer)
20:20:25FromGitter<k0pernicus> But I know they plan to implement this feature with generics...
20:20:30FromGitter<k0pernicus> ( :-) )
20:20:39FromGitter<Bennyelg> :D
20:20:55FromGitter<Bennyelg> what is the best argparse library out there?
20:21:00FromGitter<Bennyelg> I need something
20:21:06*xet7 joined #nim
20:21:06Araqobj.field: initTable[?, ?]()
20:21:33Yardanicowait what?
20:21:49cremobj.field.init() ? :)
20:21:51FromGitter<Bennyelg> cli arg parser
20:22:06AraqI use parseopt
20:22:16YardanicoBennyelg: if you want something more python-like https://github.com/docopt/docopt.nim
20:22:21cremOr maybe some notion of constructors... hm...
20:22:28Yardanicobecause it's a port of docopt to Nim :D
20:22:35FromGitter<Bennyelg> what is the different between parseopt2 and parseopt lol
20:22:41FromGitter<Bennyelg> thanks Yardanico I'll see now
20:22:50Araqcrem: Java has constructors and yet the same problem. stop pretending it's about constructors when it's clearly not.
20:23:01Araqparseopt2 will die
20:23:24YardanicoAraq, it will be renamed to parseopt?
20:23:39Yardanicoah I see
20:23:46AraqI said 'die', not 'renamed'
20:23:55Yardanicoparseopt2 is a higher-level implementation
20:24:21FromGitter<Bennyelg> docopt looks fantastic
20:24:28FromGitter<Bennyelg> I 'll take it :p
20:24:31crembut if initObj were methods rather then factories, it would work. They wouldn't be able to be used in object initialization though..
20:24:57Araqhow so? it doesn't work in Java either
20:25:07Araqor C#
20:25:45AraqI guess I jsut don't understand you. construction by definition cannot use "method"
20:25:46cremI mean if it was proc init(self: var Obj)
20:25:47*Yardanico quit (Remote host closed the connection)
20:25:49Araq(dynamic binding)
20:26:09cremvar x: Obj; x.init()
20:26:19cremvar x: Table[string,string]; x.init()
20:26:41Araqthat only works for vars which have no problem
20:26:47Araqit fails for object fields
20:27:06Araqvar x = initTable[string, string]()
20:27:34Araqcan you imagine this has been discussed already and guys like you lost the argument?
20:27:48Araqit was discussed to death, in fact.
20:28:30*vlad1777d joined #nim
20:29:01cremOk, I'm not trying to convince anyone, I don't know why it always ends up looking like that! I only wanted to know whether something was possible or not, and what's the most correct way to do something.
20:30:41cremI mean usually I try something (incorrectly), it fails for me, and I'm asking why this doesn't work.
20:32:30cremlike if I have "not nil" field in Obj, I seem to not being able to use new(result) in newObj(). I suppose I'm supposed to do return Obj(all fields listed) instead.
20:32:35*miran quit (Ping timeout: 240 seconds)
20:33:55*nsf joined #nim
20:34:13FromGitter<Yardanico> Do you use new result in a non-ref object?
20:34:30*claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com)
20:34:35FromGitter<Yardanico> If your object is "object", you don't need new
20:34:56FromGitter<Yardanico> You can directly assign to your object like
20:35:04FromGitter<Yardanico> result.field = 1
20:35:06cremnewObj() returns ref Obj.
20:35:38FromGitter<Yardanico> Ah, you mean with not nil
20:36:15Araqcrem: yeah, pretty much
20:36:23Araqhow else would it work?
20:38:32cremif newObj() was some kind of special function, like "constructor", those not nil could be enforced only at it return point. :) In the middle of the "constructor" the object is considered not fully constructed, so some restrictions may be relaxed. Also immutable fields (are there those?) could be mutable, for example.
20:42:08Araqyeah that's completely not how such an analysis would work
20:42:49Araq1. you need to prevent 'x.field' from being read before written (or not read at all in a constructor)
20:43:07Araq2. you need to ensure every control flow path sets x.field (or forbid control flow)
20:43:35Araq3. you need to ensure x.field is not passed to a proc by 'var T' because that could read it before writing it
20:43:54FromGitter<Bennyelg> anyone has something with fetching arugments from script run
20:44:05Araq4. you need to ensure that 'addr x.field' cannot do harm
20:44:13FromGitter<Bennyelg> x.nim --file /path/to_file/...
20:44:31Araqx.nim --file:/path/to_file/...
20:44:49cremfine, so there is a plan of what should be done. :-P
20:46:53AraqI prefer my own plans that are not based on "oh, nice Fata Morgana here, how refreshing"
20:48:23*ofelas quit (Quit: shutdown -h now)
20:54:31*vlad1777d quit (Remote host closed the connection)
20:54:35*mahmudov quit (Ping timeout: 240 seconds)
20:56:16*vlad1777d joined #nim
20:57:33*Kingsquee joined #nim
20:58:32cremhttps://gist.github.com/mooskagh/66a7f80bb8869fadadaee2ca50d99694 is it ok to create throwaway Tables with initTable (like in variant 1). Variant 2 is much more verbose (and also it has two lookups per key, which I don't like).
21:06:13FromGitter<Bennyelg> hey, zipping list any easy way?
21:06:38TjYocois there an easy way to set a ref object
21:06:54TjYocoobjects fields to the same as a corresponding object
21:08:15TjYocolike var r: refObj = new o
21:08:32TjYocowhere o has already been set as an Obj
21:09:18FromGitter<Yardanico> @Bennyelg use zip? From sequtils
21:13:15FromGitter<Bennyelg> what I am missing ⏎ ⏎ ```var elements = map(s, proc(i: int, x: string): = i mod 2 == 0)``` [https://gitter.im/nim-lang/Nim?at=59adc1ebb16f264642061be1]
21:13:31FromGitter<Bennyelg> I want to take all the even places from the list and put it on new list elements
21:18:40FromGitter<Yardanico> Firstly - use mapIt if you want to construct new sequence
21:19:13FromGitter<Bennyelg> anyone can share some code example (but good one) with nim argparse
21:19:36FromGitter<Yardanico> Well no, you can still use map
21:19:43FromGitter<Yardanico> But mapIt is nicer
21:19:47FromGitter<Yardanico> E.g
21:19:57*PMunch quit (Quit: leaving)
21:20:13FromGitter<Yardanico> var elements = data.mapIt(it mod 2 == 0)
21:21:35*Sentreen quit (Ping timeout: 240 seconds)
21:22:24FromGitter<Yardanico> Ah sorry
21:22:30FromGitter<Yardanico> You don't want to use map
21:22:43FromGitter<Yardanico> Use keepIfIt
21:23:28FromGitter<Yardanico> "anyone can share some code example (but good one) with nim argparse" you mean parseopt?
21:34:02*gangstacat joined #nim
21:34:47*Sentreen joined #nim
21:42:20*SerenityStyle joined #nim
21:45:41*Serenit0r quit (Ping timeout: 240 seconds)
21:49:47*Serenit0r joined #nim
21:52:41*SerenityStyle quit (Ping timeout: 240 seconds)
21:54:12*vlad1777d quit (Remote host closed the connection)
21:55:55*vlad1777d joined #nim
21:56:09*relax joined #nim
21:59:15*francisl joined #nim
21:59:52*endragor joined #nim
22:04:01*endragor quit (Ping timeout: 240 seconds)
22:09:26FromGitter<abijahm> guys any reason why this fails ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59adcf169acddb2407019349]
22:15:09FromGitter<abijahm> in nim 0.17.1 ⏎ the error is ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59add06dbac826f0547da320]
22:15:53FromGitter<abijahm> but it works in a non async
22:18:28*Serenitor joined #nim
22:20:48*Serenit0r quit (Ping timeout: 248 seconds)
22:21:38*Kingsquee quit (Remote host closed the connection)
22:22:03*Kingsquee joined #nim
22:24:50*Ven joined #nim
22:25:13*Ven is now known as Guest88896
22:28:35FromGitter<abijahm> using sequence works, did not see this https://github.com/nim-lang/Nim/issues/2361
22:31:05*gokr quit (Ping timeout: 240 seconds)
22:38:05*nsf quit (Quit: WeeChat 1.9)
22:44:05*relax quit (Ping timeout: 240 seconds)
22:45:58*TjYoco quit (Quit: Page closed)
22:53:18*Guest88896 quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
22:55:20*cspar_ joined #nim
23:08:24*mahmudov joined #nim
23:09:29*thomasross quit (Remote host closed the connection)
23:09:56*thomasross joined #nim
23:14:14*gmpreussner quit (Ping timeout: 255 seconds)
23:15:25*gmpreussner joined #nim
23:33:35*BitPuffin|osx quit (Ping timeout: 255 seconds)
23:36:57*def-pri-pub joined #nim
23:36:57*def-pri-pub quit (Changing host)
23:36:57*def-pri-pub joined #nim
23:42:23*yglukhov quit (Remote host closed the connection)
23:48:32*nattefrost quit (Remote host closed the connection)