<< 29-01-2019 >>

00:21:05*abm quit (Quit: Leaving)
00:33:27*noonien joined #nim
00:42:39FromGitter<kayabaNerve> Was anyone ever working on a Nim Lint tool to report unused imports?
00:43:11FromGitter<kayabaNerve> I know it's something a lot of people want and I wouldn't be surprised if nim check had/has that planned or if someone was working on one
00:49:35*vonHabsi joined #nim
00:59:26*zachk quit (Quit: Leaving)
01:12:32FromGitter<timotheecour> @kayabaNerve that’d be great; ideally would be just 1 lint tool that handles lots of checks (but easy to customize via callbacks as done in `nimfind`), and would generalize `nim —styleCheck`
01:14:10FromGitter<timotheecour> maybe u can look at `nim genDepend` as a starting point
01:28:09FromGitter<kayabaNerve> I would like a generic linter, however, I think styles vary too much. It could be configured against NEP 1 yet I think NEP 1 is one of the worst things about Nim.
01:28:43FromGitter<kayabaNerve> It's not a bad style guide even. It's well written, comprehensive, and I have only a few differencess.
01:29:42FromGitter<timotheecour> > I think styles vary too much ⏎ ⏎ just configure what needs to be configured in the linter; doens’t mean it can't be just 1 tool for all lint checks
01:29:42FromGitter<kayabaNerve> However, the Nim community has taken it beyond a Nim Compiler style guide. Most Nim projects use 2 spacing, which is fine, except for the fact many devs back their decision by quoting NEP 1.
01:30:19FromGitter<kayabaNerve> I'm just saying that a linter is a huge task when an import checker is a decently sized task.
01:30:55FromGitter<timotheecour> well we can start a generic linter that just has a single check for now :)
01:31:20FromGitter<timotheecour> but designing in a way that makes adding lint checks easy
01:33:16*stefanos82 quit (Remote host closed the connection)
01:34:06FromGitter<timotheecour> the extra work of adding more lint checks down the line is negligible, most of the computation time will be spent in running the compiler-as-a-library on nim sources
01:56:18*vlad1777d quit (Ping timeout: 245 seconds)
02:05:53*ng0_ joined #nim
02:08:57*ng0 quit (Ping timeout: 256 seconds)
02:10:56*leorize quit (Ping timeout: 240 seconds)
02:16:46*ng0_ quit (Quit: Alexa, when is the end of world?)
02:31:38*Tyresc quit (Quit: WeeChat 2.4-dev)
02:36:26*zachcarter quit (Ping timeout: 240 seconds)
03:02:22*banc quit (Quit: Bye)
03:23:41*banc joined #nim
03:27:05*dddddd quit (Remote host closed the connection)
04:03:46*nsf joined #nim
04:45:02*leorize joined #nim
04:51:52*kapil____ joined #nim
05:16:28*darithorn joined #nim
05:21:43FromGitter<timotheecour> @iffy i’ll try to reduce ur memory leak https://github.com/timotheecour/vitanim/pull/6 ; in the meantime could you bisect to find the nim commit that introduced the potential GC-leak bug ?
05:22:44FromGitter<timotheecour> (by reduce i meant more minimal example)
05:51:31*darithorn quit (Quit: Leaving)
05:53:58*Marumoto quit (Ping timeout: 244 seconds)
05:56:36*narimiran joined #nim
06:05:29*zachcarter joined #nim
06:25:42FromGitter<bung87> https://github.com/nim-lang/RFCs/issues/19 is there a workaround currently?
06:38:50*pagnol joined #nim
07:02:25*lritter joined #nim
07:11:56*pagnol quit (Ping timeout: 246 seconds)
07:16:43leorizebung87: no
07:43:09*krux02 joined #nim
07:43:12FromGitter<bung87> got it, thanks!
07:43:49FromDiscord_<demotomohiro> nim nightly build doesn't contain nim-gdb.
07:44:20FromDiscord_<demotomohiro> Is it bug?
08:10:46*absolutejam joined #nim
08:29:07*narimiran quit (Remote host closed the connection)
08:30:11*narimiran joined #nim
08:37:06*PMunch joined #nim
08:47:27*absolutejam quit (Ping timeout: 240 seconds)
08:52:28*pagnol joined #nim
08:55:51Araqdemotomohiro: yes, we need to patch installer.ini I think
08:57:53*floppydh joined #nim
09:01:02*absolutejam joined #nim
09:06:39ZevvWhy do NimNodes have a father but no mother?! That is so sad...
09:07:17ZevvAnd they only have sons, and no daughters
09:07:31narimiranZevv: shit, you're onto something!
09:07:38Zevv:)
09:08:15FromGitter<alehander42> i didnt even know they have a father honestly
09:09:01ZevvWell, actually they don't have a father - which is what I need here, but that is a different thing. But then there is still `proc add(father, child: NimNode)`
09:09:54floppydhsons: seq[NimNode] ## the node's sons (or children)
09:09:54FromGitter<alehander42> well you can add a daughter now: that's a loophole!
09:10:16narimiranwe still lack NimNode's drunk uncle
09:10:21ZevvGhehe
09:16:19Araqfun fact: 'children' was too long of a word and 'kids' not part of my active vocabulary
09:17:36ZevvIs loudAnnoyingAssholesWhoRefuseToCleanTheirRooms too long?
09:18:09ZevvOooh, did I just call my own kids assholes?
09:18:30PMunchHaha :P
09:18:31AraqI think you did.
09:19:03ZevvI forgot what it was, but I rember something fairly recent where they had to change something in the Python code base for politically-correct reasons
09:19:22Zevvmaster/slave I believe
09:19:31*kapil____ quit (Quit: Connection closed for inactivity)
09:19:43Araqyeah but we don't have this problem, the sons are all black and homo
09:19:46PMunchYeah master/slave apparently isn't PC enough any more..
09:20:21pagnolwhat has it been replaced by?
09:20:37PMunchI think it's something like leader/follower
09:21:05PMunchIn dancing they have switched from calling it the male and female partner, instead opting for leading/follower
09:21:24narimiran:D :D
09:21:48PMunchThere was also fantastic tongue-in-cheek commit to the Linux kernel as well that replaced all "fuck"s in various comments to "hug" after their Code of Conduct drapped
09:21:57pagnolthere's still inequality though...
09:21:57PMunchs/drapped/dropped
09:21:58narimiranspeaking of this theme, why we don't have more female devs in this channel and using nim in general?
09:21:59AraqOh I thought was "captain gender studies" and "special snowflake"
09:21:59pagnolwe must do better
09:22:00FromGitter<alehander42> which makes sense, because e.g. in swing groups often you can have more females than males and then you do need female dance leaders
09:22:35PMunchnarimiran, didn't you see the previous discussion. NimNodes are all males, so it's a really hostile environment for female programmers
09:22:40pagnolAraq, I like your proposal
09:23:11Araqah no, I confused it with StarWars...
09:23:20PMunchalehander42, yeah definitely makes sense. Just found it interesting as I just took some swing dancing class and they kept correcting themselves :P
09:24:11Zevv"yeah but we don't have this problem, the sons are all black and homo" o_O :) I saved this for later use
09:24:12PMunchApparently master/slave has been changed for primary/secondary or primary/replica
09:25:07narimiranhow do we get more nim exposure? somebody just needs to take these chats seriously and write a rant about it :)
09:26:04Araqdon't you dare
09:26:29PMunchAll PR is good PR, isn't that what they say :P
09:26:52PMunchHave gotten some good feedback for my test-presentation of the FOSDEM talk by the way :)
09:27:44livcdWhy is the koch tool called koch ?
09:28:04PMunchKoch is the father(?) om Nimrod
09:28:10PMunchIIRC
09:28:21Araqomg, lol
09:28:25leorizelivcd: iirc koch = cook
09:28:28AraqKoch is German for "cook"
09:29:02PMunchOh wait, I was thinking of Cush, which was a Nim tool to use it as scripts :P
09:29:06narimiranPMunch: from those students the other day, or some new group?
09:29:19PMunchThe students and professors from the other day
09:29:36narimiranso, when will see some new names here? :)
09:30:03PMunchHaha, good question
09:30:22PMunchI talked to some people afterwards and they just looked at me in confusion when I told them to join our IRC room :P
09:30:30FromGitter<alehander42> so glad i started naming my libs with obscure bulgarian words to balance a bit
09:30:45PMunchBut I know there are some people getting interested in it at the university here
09:30:49livcdmy Cmder goes crazy when I am compiling Nim
09:30:56narimiranPMunch: yeah, that reaction is familiar :) "IRC? what is this, '97?"
09:31:14PMunchnarimiran, it's so good though compared to the alternatives
09:31:24FromGitter<alehander42> it's just not
09:31:44PMunchIt's better than Gitter..
09:31:44narimiranlivcd: you shouldn't use "crazy", it is not politically correct :D
09:31:49FromGitter<alehander42> it's decentralized, this is the best part about it
09:32:13ZevvI'd *love* a mailing list, but alas, it is no longer '97 indeed
09:32:23livcdnarimiran: my Cmder goes bananas when I am compiling NIm
09:32:33narimiranlivcd: much better :D :D
09:32:35PMunchYeah, I can run my own server. Oh Gitter corp. went bankrupt, guess what my IRC server lives on!
09:32:46FromGitter<alehander42> well the github issue tracker can be accessed similarly to a mailing list through your email
09:32:53Araqwe had a mailing list, Zevv, wasn't used much
09:34:28ZevvSo I heard. I'm just old skool, and already more then happy that there's IRC instead of slack or whatever.
09:34:35PMunchPlus I really like the idea of being available when I'm online
09:35:26*Vladar joined #nim
09:36:05livcdI dont think it matters as long as you dont need some super secure registration tied to your github/gmail/facebook/with triple FA
09:36:20FromGitter<alehander42> PMunch: but then somebody asks you a question when you're offline .. and nothing happens?
09:37:00PMunchNo, people don't ask me stuff when I'm offline. Because I'm not there
09:37:28PMunchThe same way you wouldn't ask a question to someone who wasn't in the room with you, you'd wait for them to get back.
09:37:41FromGitter<alehander42> "PMunch i used this lib of yours, and i wonder whats the deal with X"
09:37:55PMunchLog an issue, or wait until I'm back on-line
09:38:00FromGitter<alehander42> well, yes, but this person can check in the room and leave a note for you
09:38:04FromGitter<alehander42> eh ok
09:38:15FromGitter<alehander42> everybody has its own view i guess
09:38:19livcdI updated Nim but cant compile falcon hmm
09:38:26PMunchSure, use the notify bot on Freenode that will ping me when I get back
09:38:29PMunchKinda like voicemail
09:38:43PMunchhttps://www.youtube.com/watch?v=11PseWcwfSI <- basically this
09:39:28livcdWere you guys able to compile falcon on Windows ?
09:40:04FromGitter<alehander42> PMunch so, now I should remember not just an irc-specific, but a freenode-specific way ;)
09:40:46Araqhttps://github.com/nim-lang/Nim/pull/10481 yay or nay?
09:40:54PMunchSure, it's an eco-system, not a one stop solution
09:41:06livcdI am getting the same error as yesterday
09:41:12PMunchIf you don't like the notifier bot, make your own :)
09:41:50narimiranAraq: at first i was "ok, why not", but your comment changed my mind. `stdin.lines` is clearer
09:42:10Zevvlivecd: I gave it a quick test, but it borked on the very first file. I guess it takes some love to get it to work :/
09:43:09Zevvnarimiran, araq: throw it out then, just a personal itch I scratched
09:43:29livcdZevv: oh! i said i would try it on mac but did not have the time :/
09:44:02Zevvstdin.lines() is more explicit, but also - longer :)
09:44:19ZevvI'm *so* sick of typing, I'm switching to APL
09:44:27Araq:D
09:44:38narimiranZevv: brainfuck to the rescue
09:45:07narimiranor J or whatever people used for AoC tasks done in something like 10 characters
09:45:19Araqfor x in lines stdin: is short enough
09:45:32narimiranand here i am, typing `stdin` like an idiot :D
09:45:43AraqXD
09:47:05Zevvyou can't put a line in a variable called x
09:47:09Zevvthat's plain dirty
09:47:15Zevvit's called l, at least
09:47:54Araql and 1 look to similar on many fonts
09:48:22ZevvI'm the (sad?) type of guy that makes his own fonts for exactly that reason :)
09:48:35PMunchDidn't the Nim compiler use to complain about that? Might still do, and I've just stopped using l :P
09:48:35livcdI really want to compile falcon on Windows...
09:48:54AraqPMunch, it used to but I think I removed this warning
09:49:02PMunchZevv, I've modified fonts before for similar reasons..
09:49:03narimiranPMunch: it did, it does not anymore (thanks for removing that warning)
09:49:13PMunch:(
09:49:23narimiran* :)
09:49:34PMunchWhy don't you like it?
09:49:42Zevvhttps://zevv.nl/play/code/zevv-peep/. Outdated techology though, everybody wants aliasing and TTF these days
09:49:57narimiranleave me alone, i have a font where i know the difference between l, I and 1. and between O and 0
09:50:12narimiranyou're gonna stop me from using `f00`? :P
09:50:32ZevvI think in Nim you're allowd to use anything utf8, right?
09:50:38PMunchYes
09:50:39Araqdoes the font also happen to fix underscores to not look like they are not part of the current line?
09:50:56AraqI hate this so much, lol
09:50:59Zevvit's an *under*score
09:51:05narimiranAraq: yes
09:51:15Araqprove it! screenshot?
09:51:20ZevvWow, I see a nice project here. APL macros in nim
09:52:09Zevvparse this! X[⍋X+.≠' ';]
09:52:27narimiranAraq: https://i.imgur.com/k510HCc.png
09:52:55leorizeis that Iosevka?
09:53:07narimiranleorize: you're god damn right!!
09:53:53Araqimpressive.
09:53:56narimiranit took me half a day to get used to narrowness, now everything else is (unnecessary) too wide
09:54:02PMunchInconsolata isn't too bad for that as well
09:54:18PMunchPuts it like centered on the baseline
09:54:46narimiranheh, if Araq used Iosevka, maybe preferred style in Nim would have been snake_case :D
09:55:45PMunchThen you have the mad-men who uses fonts like this: user-images.githubusercontent.com/16634089/37139317-e674ad1a-22c6-11e8-976a-54a1926ca6ad.png
09:56:01FromGitter<alehander42> oh yeah fira?
09:56:20AraqPMunch, I like it but the && still sucks
09:56:20narimirani've used fira code before discovering iosevka
09:56:56leorizehave they fixed the serif `r`?
09:56:56AraqI also like special ligatures for {. and .}
09:57:04narimiranbtw, these ligatures are a bit over the top, aren't they? ;)
09:57:28floppydhiteraters are so nice
09:57:32PMunchalehander42, that is actually an Inconsolata variant
09:57:33*absolutejam quit (Ping timeout: 245 seconds)
09:57:33floppydhiterators*
09:57:56ZevvSo here they are, enough brains to create the next world dominating programming language, discussing *fonts*
09:58:17narimiranfloppydh: are they? they seemed slow to me, i stopped using them long ago
09:58:28floppydhiterators are slow ???
09:58:54PMunchI was actually looking for an editor that would allow me to specify fonts based on syntax. So all variables would use one font, function names another. Just for fun
09:59:08PMunchZevv, don't bash fonts!
09:59:59livcdso there's a font with ligatures for nim's pragmas??
09:59:59narimiranZevv: well, if we had something like 1300+ open issues, we wouldn't discuss about fonts, but work on those. right?
10:00:03narimiranoh. wait.
10:00:23Araqgood point. Good bye.
10:00:48narimiranjust drop it to 1299 and you can come back :D
10:01:29*ng0 joined #nim
10:02:33FromGitter<alehander42> just open an issue about fonts
10:03:00narimiranfirst reply: "how is that a nim problem"
10:03:18narimiranauthor replies: "well, you see, when you use nim in combination with this and that...."
10:03:40*absolutejam joined #nim
10:04:05narimiran(this is just a fictional scenario, it never ever really happened before)
10:06:54FromGitter<alehander42> you need a RFC duh
10:11:08narimiranfloppydh: for some stuff i did, they seemed slower than a similar version which used procs
10:15:08*kapil____ joined #nim
10:20:32PMunch"Seemed slower" great benchmark :P
10:22:06narimiranPMunch: ain't nobody got time for that :P
10:23:10Zevvas long as nim "seems" faster then python, we're all good to go
10:24:23narimiranZevv: well, when i just started with nim, there were situations where i managed to write slower nim than the python version of the same code :D
10:26:34ZevvMy first project was a nifty waveform/spectrum analasis thingy: https://zevv.nl/div/cor.png
10:26:58ZevvOnly after I properly started reading the docs I found out why my profiler kept hitting memcpy() all the time :)
10:27:13PMunchOooh, graps
10:27:17PMunchgraphs*
10:28:08ZevvNim does not do pass-by-reference, but pass-by-memcpy
10:32:52leorizeyou mean pass-by-value? :P
10:33:04*dom96_w joined #nim
10:33:07Zevvthat's not what my profiler says
10:38:50*vlad1777d joined #nim
10:40:21Araqit's not pass-by-memcpy at all
10:40:48Araqthough the memcpys can show up in profiling, I heard we got move semantics to fight it
10:49:16ZevvYeah, I know all about it, just pointing out what can happen to beginners
10:50:03Araqwell but please be precise, argument passing does not produce memcpy, nim uses passing by 'const&' in C++ lingo unless it's of a small size
10:51:43ZevvI'll go through that code again to see what the culprit was. Passing large seqs of several MB
10:58:11*vonHabsi quit (Quit: Lost terminal)
10:59:32Araqpassing them is fine, but don't copy them. And sometimes the items() causes a copy :-(
11:00:40Araqif you wanna get into compiler development, this one https://github.com/nim-lang/Nim/issues/10478 might be easy
11:14:03narimiran@zetashift i think i just saw one improved error message (you mentioned that yesterday), about passing immutable stuff to proc which expects `var`
11:30:29*abm joined #nim
11:45:13ZevvHow do you print-debug with PNode's? repr always goes waaay to deep
11:49:17leorizelook at TNode type signature then print out what you need :P
11:49:22leorizethat's my experience so far
11:52:13Zevvthnkx
11:54:55leorizenim-gdb is also a great helper
11:55:10leorizebut it's kinda tricky to get right
11:55:17leorizeone wrong move and gdb crashes
11:57:15*stefanos82 joined #nim
12:00:03leorizeAraq: how would you fix this? http://ix.io/1zv1/nim
12:00:31leorizemy method right now would be to hack the parser to produce separated lineinfos
12:00:44leorizebut that's quite a load of work so I'm wondering if you got any better way
12:19:10*Snircle joined #nim
12:20:50*dddddd joined #nim
12:22:48FromGitter<alehander42> Zevv: i use debugTree sometimes, but not sure if it's diff
12:22:54FromGitter<alehander42> rent
12:23:10*hoijui joined #nim
12:53:17dom96_wZevv: debug() IIRC
12:56:01Zevvwell, I'm not actually sure if I want to go there
12:56:12Zevvmacros is fun and all, but compiler internals is something completely different
13:07:47*zachcarter quit (Ping timeout: 240 seconds)
13:13:55*kapil____ quit (Quit: Connection closed for inactivity)
13:23:57Araqleorize, just analyse the AST a bit
13:29:21dom96_wZevv: the compiler is basically just a big AST transformer with some extra metadata :P
13:32:49leorizesounds like a slightly more complicated macro to me :P
13:36:15Araqleorize, why is a[i] special though? f(x, y) arguably also spans from '(' to ')'
13:37:12leorizebecause `[]` is a proc in this case
13:37:54leorizenimsuggest highlight by symbols
13:38:09Araqyeah but it *starts* at the [
13:38:24Araqlike f() starts at the 'f'
13:38:34Araqhttps://www.smbc-comics.com/comic/halting
13:40:02leorizeyep, and the symbol length for `[]` is 2
13:40:18leorizeit mainly boils down to this: https://github.com/nim-lang/Nim/blob/devel/compiler/suggest.nim#L91
13:40:51Araqdon't "suggest" [], it's stupid
13:41:11Araqyou never really know if it's not "generic type here" instead
13:41:26AraqTable[int] vs a[i]
13:41:43livcdcan i only download the pkg with nimble ?
13:41:58leorizenimsuggest acts on resolved symbols, not node
13:42:46Araq[] is hardly a "resolved symbol"
13:44:46Araqbut fine, pretend its length is 1
13:44:54Araqand do the same for []=
13:45:05Araqand for {}, {}=
13:48:48livcdkaushalmodi: do you use aggressive-indentation ? does it work for you with Nim ?
13:50:47*CcxWrk quit (Ping timeout: 240 seconds)
13:51:55leorizeAraq: then what about the [] in `[]`(a, b)?
13:52:09leorizehighlight just the `[`?
13:53:14*CcxWrk joined #nim
13:56:08*pagnol quit (Ping timeout: 250 seconds)
13:57:13dom96_wlivcd: yes, nimble downloads packages
13:58:49*krux02 quit (Remote host closed the connection)
13:59:56*hoijui quit (Ping timeout: 240 seconds)
13:59:57livcddom96_w: What I meant is if I can just download the pkg with nimble without really building it.
14:00:09dom96_wno
14:00:32livcdok
14:04:23Araqleorize, don't highlight [] at all, it's rather special
14:18:10*pagnol joined #nim
14:24:05*ng0 quit (Quit: Alexa, when is the end of world?)
14:36:06FromGitter<kaushalmodi> livcd: no, I use the default indentation on Return that comes with nim-mode
14:36:29FromGitter<kaushalmodi> aggressive-indent-mode doesn't work most of the times, and is too performance intensive too
14:41:40*stefanos82 quit (Remote host closed the connection)
14:43:55*stefanos82 joined #nim
14:55:14*skellock joined #nim
15:23:38*tiorock joined #nim
15:23:38*tiorock quit (Changing host)
15:23:38*tiorock joined #nim
15:23:38*rockcavera quit (Killed (cherryh.freenode.net (Nickname regained by services)))
15:23:38*tiorock is now known as rockcavera
15:28:06*nsf quit (Quit: WeeChat 2.3)
15:35:27*pagnol quit (Ping timeout: 268 seconds)
15:39:50*krux02 joined #nim
15:42:01leorizeAraq: I've looked into this idea: https://irclogs.nim-lang.org/24-01-2019.html#11:10:16
15:43:01leorizeI've managed to make `[]` highlight correctly using it
15:43:15leorizebut it seems to break the "dirty" file functionality
15:44:05livcdkaushalmodi: it works flawlessly most of the time for the langs i use. With what langs did you have an issue with ?
15:44:38*darithorn joined #nim
15:48:18leorizeAraq: actually it broke any different version of the file :/
15:48:27leorizehttp://ix.io/1zvE/diff
15:48:36leorize^ can you check out that patch?
15:49:50FromGitter<iffy> @timotheecour thanks for bisecting
15:49:59*hoijui joined #nim
15:52:01FromGitter<kaushalmodi> livcd: it works, but your editing will be snappier if you disable it. I edit a lot of Elisp, and after using it for few months, found myself better without having aggressive indent do the edit.
15:52:34FromGitter<kaushalmodi> I'm anyways used to auto indenting whole buffer before saving.
15:53:27*stefanos82 quit (Remote host closed the connection)
15:55:36FromGitter<alehander42> is this emacs
15:59:18FromGitter<kaushalmodi> Yes
16:01:01FromGitter<kaushalmodi> livcd: this is one of the things where there isn't a correct answer. While that aggressive indenting might work for one, it might not for another. And that's fine :)
16:04:45*pagnol joined #nim
16:10:15*hoijui quit (Ping timeout: 264 seconds)
16:11:56livcdkaushalmodi: yeah I was just interested where it did not work for you. To me the Nim code was the first one that did not really work :-/. Also what do you mean by auto indenting ?
16:15:22livcdkaushalmodi: i need to get better at e-macs :/. I do not really want to write lisp though..
16:18:00FromGitter<kaushalmodi> livcd: With nim-mode installed, it correctly sets the indentation level of next line
16:18:26FromGitter<kaushalmodi> Example: type `proc foo() =` and hit enter
16:18:50FromGitter<kaushalmodi> The next line will be auto indented by 2 spaces
16:19:06FromGitter<kaushalmodi> Elisp is beautiful
16:20:03*PMunch quit (Remote host closed the connection)
16:20:24FromGitter<kaushalmodi> Once you taste the drug of being able to do anything to any buffer using Elisp (with instant feedback), there's no going back.
16:21:08livcdkaushalmodi: any idiot friendly tut you can recommend ? maybe we can take this to nim-offtopic
16:21:49FromGitter<kaushalmodi> Start with elisp x in y minutes (Google that)
16:22:31FromGitter<kaushalmodi> Then it's jusst learning as you go, reading Stackexchange answers, perusing it's subreddit, etc
16:24:51FromGitter<kaushalmodi> For emacs chat, you can drop into my Gitter lobby
16:27:20FromGitter<iffy> The RFC repo says to open a PR, but it seems like everyone just files issues. Which should I do?
16:29:48Araqdepends on the RFC. Small RFCs can be issues, others should follow Python's Enhancement process
16:29:59Araqbbl
16:30:32*absolutejam quit (Ping timeout: 246 seconds)
16:37:34*druonysus joined #nim
16:37:34*druonysus quit (Changing host)
16:37:34*druonysus joined #nim
16:46:18*stefanos82 joined #nim
16:59:54*dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
17:07:17*vlad1777d quit (Ping timeout: 246 seconds)
17:13:05*Trustable joined #nim
17:27:33*pagnol quit (Ping timeout: 245 seconds)
17:37:16*dom96_w joined #nim
17:43:41ZevvIs there an idiomatic way to reassign to a non-var proc argument without explicitly copying it into a var with a different name first? I often miss the C behaviour where I can just change a function argument on the fly.
17:44:14Zevv(Not to start a discussion about if this is a Bad Thing To Do)
17:44:49leorizewell, no :P
17:45:04leorizeyou can do `var <nameOfParam> = nameOfParam`
17:45:12leorizeit should shadow the param
17:45:16Zevvoh, right!
17:45:29Zevvthat should do. I hate making up names, and adding '2' or 'new' is nasty
17:47:02Zevvnever knew you could shadow like that
17:48:16FromGitter<riddl_gitlab> like shadowing wasn't even nastier ;P
17:48:56FromGitter<kaushalmodi> Zevv: https://nim-lang.github.io/Nim/tut1.html#procedures-parameters
17:49:26ZevvI always look in the manual, not in the tutorials :/
17:55:35*dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
17:56:01ZevvFunny, I needed this to implement shadowing myself :)
18:05:07*smitop joined #nim
18:13:14FromGitter<riddl_gitlab> Hello there, I've just started playing with nim for the very first time. ⏎ I find reading long tutorials not very efficient way of learning new things so I decided to jump into coding right away. ⏎ Got a bunch of C code I'm hoping to port entirely to nim. I've managed to break it into pieces and produce static library that I'm linking with a nim main part. ⏎ I'm reimplementing piece by piece. Thanks to
18:13:14FromGitter... --nimcache:PATH and --genScript I learned a bit how nim compiler works, and what c code is generated for a particular piece of nim. ⏎ Now I've to interface with a code that uses such C structure: ... [https://gitter.im/nim-lang/Nim?at=5c5097ba78e1ed4103acb1b6]
18:15:10*nsf joined #nim
18:16:11*elrood joined #nim
18:20:23*ryukoposting joined #nim
18:20:30ryukopostinghello lads
18:21:30Zevvriddl_gitlab: objects are very lightweight already, they map straight to C structs
18:22:07Zevvthese are the way to go
18:22:24Araqriddl_gitlab: c2nim can translate the C code, you need to tweak it a bit though
18:22:58ZevvA little elf told me once that named tuples are 'second class citizens', you might want to avoid these
18:23:21ryukopostingelves are second class citizens, don't listen to them
18:23:45ryukopostingZevv does nim reorder objects? I just assumed it did
18:23:50FromGitter<riddl_gitlab> I read aobut c2nim, but the case here is that I'm not familiar with this C code. By rewriting, I'm learning how it works
18:24:12Zevvryukoposting: It does not reorder, and it honours C packing
18:24:28ryukopostingdamn, that's nice
18:24:32Zevvobjects are an essential part for interfacing with C code - lots of C api's have structs in their interfaces.
18:24:55FromGitter<riddl_gitlab> sure, and I assumed tuples are for that purpose
18:25:31ZevvI had a bad start with tuples myself. Basically I only use them for returning multiple values from procs these days.
18:26:02Zevvother things with tuples are a bit funny. If you 'expr' an object you get the names, but if you 'expr' a named tuple it shows Field0, Field1, etc as the field names
18:26:03ryukopostingthat's actually really nice. There's a lot of embedded code that relies on C struct packing (provides a really clean abstraction over special function registers)
18:26:28Zevvryukoposting: try to interface something like zlib: huge structs with a lots of different types. It's a breeze from nim
18:26:28FromGitter<riddl_gitlab> ok, so I'm gonna think about tuples just like about c++ std::tuples
18:26:49ryukopostingI use tuples when I'm too lazy to write a separate object for something lol
18:27:23ZevvI think that's the main use case. Tuple unpacking is handy also
18:27:31ryukopostingvery true
18:27:32Zevvhttps://nim-lang.org/docs/manual.html#statements-and-expressions-tuple-unpacking
18:28:08ryukopostinghow stable is parallel/spawn? I'm working on a gopher browser and I want to spin my render engine off into a separate thread
18:29:19Zevvaraq should know the details, but for me it only worked with basic "calculating" stuff. I believe the compiler tries to deduce how safe all the code within the `parallel` block is, and that probably goes haywire as soon as you do too much complicated stuff in there
18:29:33Zevvsorry, that was about parallel. Spawn is just fine I believe
18:29:35leorizeparallel only works if you managed to get pass the sem check
18:29:52AraqI have a better sem'checker in a branch...
18:29:54Zevvleorize: but sometims I get it past and then it just booms in my face
18:30:08Zevvthat was some time ago, though, things might have improved
18:30:09leorizespawn is currently not really stable
18:30:12ryukopostingyeah, I was probably gonna use spawn for it anyway (though parallel is so clean it makes me want to use it desparately)
18:30:25leorizethere's an alternative threadpool implementation that's not yet upstreamed
18:30:26Araqthere is a Nimble package iirc with a better spawn
18:30:37Araqyeah, what leorize says. Please use that instead.
18:31:18ryukopostingnice, I'll look into it
18:31:49leorizehttps://github.com/yglukhov/threadpools
18:31:54leorize^ that's the better threadpool
18:32:22ryukopostingthanks leorize
18:33:11Zevvit needs a README :(
18:33:50leorize@yglukhov: ^
18:35:35*kapil____ joined #nim
18:40:08Araqsyntax is spawn foo(args)
18:40:12Araqwhat's there to document? :P
18:43:45AraqZevv, oh btw, for interfacing with C structs you sometimes need a .bycopy annotation
18:44:30Araqand that's becoming Nim's way of saying "be 100% compatible with C", maybe. In the longer run we would like to reorder fields :-)
18:45:35FromGitter<Clyybber> what advantage would reordering fields have?
18:45:57Araqsmaller objects
18:46:00FromGitter<arnetheduck> @Araq I've been hoping nim would get that - a better abi spec ;)
18:46:56FromGitter<arnetheduck> basically, ABI-freedom, except when interacting with foreign ABI's (network, C, compiler-specific, etc)
18:47:41*stefanos82 quit (Remote host closed the connection)
18:48:05Zevvclybber: `with` now can shadow
18:49:09FromGitter<Clyybber> oh nice
18:49:55Zevvnew feature for yet even less readable code
18:51:19Araqarnetheduck: since you're here. I've been thinking about adding backend-specific node kinds to slowly migrate the backend logic into an AST-to-AST optimizer/codegen
18:53:03Araqbut I don't know if it would things worse :-)
18:53:08Araq*would make
18:53:24*seni joined #nim
18:55:16*Marumoto joined #nim
18:56:40FromGitter<arnetheduck> hm, what would help me most of all would be a mid-complexity IR - basically an ast that makes clear what nodes arrive at the backend, with some transformations and simplifications already done - basically, something that's guaranteed to be type-checked, sem-checked, macro-expanded and with redundancies like for loops etc expanded.. then, I'd love to see a battery of mid-level transformations - for example the RVO,
18:56:40FromGitter... result-assignment analysis and other such things that can benefit all backends
18:57:27FromGitter<arnetheduck> ideally, it would also be in SSA form, so that assignments, LHS/RHS aliasing and all that stuff was taken care of
18:57:42Araqyeah but designing an IR is hard
18:58:37Araqthe AST is loss-less
18:59:37Araqand SSA is comparable to a 'let' statement, so if we have a transformation that turns var into let we're almost there
18:59:50Araqexcept for the Phi nodes
18:59:56FromGitter<arnetheduck> and finally, it would be sane from a type perspective, so that expressions added up, from a type pov, with explicit `Conv` nodes all over (basically, so that C backend could work without all those `(NI)` casts), so as to be clear on int-promotion rules etc.. but right now, I have to jump on a plane - will be in EU for 2 weeks, maybe we can chat about it then
19:00:24FromGitter<arnetheduck> there's an interesting IR I've seen that does away with PHI.. I'll dig up a link later
19:01:34FromGitter<arnetheduck> I know it's hard, but that wasn't your question :)
19:01:49Araqok, enjoy your flight
19:07:34*lritter quit (Quit: Leaving)
19:14:33FromGitter<riddl_gitlab> `ptr void` is not allowed? Why?
19:14:43leorizeuse `pointer` instead
19:15:36leorizehttp://nim-lang.github.io/Nim/manual#types-void-type
19:15:51leorize> The void type is only valid for parameters and return types; other symbols cannot have the type void.
19:16:55*aguspiza joined #nim
19:18:37FromGitter<riddl_gitlab> I guess its matter of taste, `pointer` is just a `void*`, thats why I assumed its allowed to put `ptr void` members. still thanks for clarifying that
19:19:05leorizewell `void*` is C lingo
19:19:48Araqvoid is a misdesign
19:20:09Zevvtake it out already!
19:20:32Araqmust write an RFC first :-)
19:20:56FromGitter<riddl_gitlab> so, in future we'll just omit a return type to express a call doesnt return anything?
19:21:11leorizethat's how it should always be?
19:21:11Zevvalready so
19:21:34leorizevoid in Nim is only useful for generics
19:22:05ZevvAraq: noone writes RFC's, why should you?
19:22:15Zevvit's just *too* much work
19:22:45leorizeriddl_gitlab: I think you should read the Manual instead of experimenting :P
19:25:30FromGitter<riddl_gitlab> don't get me wrong, i'm reading it. I dont want to bother you with stuff that I can read about. However reading that "void" can be used in a such way or another does not say anything about WHY ;)
19:26:08leorizeI think void was added to supplement generics, but only Araq can verify that :P
19:27:01Araqthe idea was that HashTable[Key, void] is turned into HashSet[Key]
19:27:03FromGitter<riddl_gitlab> im coming from C++ world so if I see `void` and `ptr` I assume ok, i can handle a pointer to anything just by `ptr void` ;)
19:27:07FromGitter<riddl_gitlab> too much assumptions
19:27:43Araqand we save collection implementations
19:28:04FromDiscord_<exelotl> Zevv: nice With improvements!! :D
19:28:04Araqthat didn't work out well and now 'void' is this silly special case in the type system
19:28:53Araqinstead we should have embraced tuple[] with its value () as our Unit type
19:29:08FromGitter<riddl_gitlab> ok, noted - avoid voids in nim ;)
19:29:23Araqand then optimize it out in the backend(s)
19:29:45Araqwould have been a much better design.
19:31:23FromGitter<riddl_gitlab> btw, is a nim/rod name related to https://en.wikipedia.org/wiki/Nimrod_(computer) ?
19:33:48federico3https://docs.travis-ci.com/user/languages/community-supported-languages anyone wants to add Nim support to Travis CI?
19:34:17*skellock quit (Ping timeout: 246 seconds)
19:36:19leorizeAraq: this will magically fix all highlighter problems in nimsuggest :P https://github.com/nim-lang/Nim/pull/10496
19:36:20shashlickI can be one of the 3
19:36:35leorizeon a serious note I think my implementation is just horribly inefficient :/
19:36:50leorizeplease comment there if you got any better idea
19:38:39ZevvIs it by design that strtabs has no del/excl, or is it just that noone cared to put it in yet?
19:39:19Araqit predates generics, noone cared
19:39:46Zevvfair enough
19:40:53Zevvwow, "predates generics". That sounds like trilobites and dinosaurs
19:44:05*aguspiza quit (Ping timeout: 246 seconds)
19:44:24*zachcarter joined #nim
19:54:47FromGitter<Varriount> Araq: How would I go about making a member of a generic type exist, only when a static bool that is passed in is true?
19:55:56*Sembei quit (Ping timeout: 240 seconds)
19:58:43*Tyresc joined #nim
20:00:21*nsf quit (Quit: WeeChat 2.3)
20:05:11*Marumoto quit (Remote host closed the connection)
20:07:00*absolutejam joined #nim
20:14:20*floppydh quit (Quit: WeeChat 2.3)
20:15:31*ng0 joined #nim
20:26:32*zachk joined #nim
20:29:26*aguspiza joined #nim
20:41:32*narimiran quit (Remote host closed the connection)
20:42:44*zachk quit (Read error: Connection reset by peer)
20:43:08*zachk joined #nim
20:50:02FromGitter<kaushalmodi> how can I eval Nim code in a string?
20:50:23FromGitter<zestyr> compile-time or runtime?
20:50:35FromGitter<kaushalmodi> run time
20:51:17FromGitter<kaushalmodi> pseudo code: `eval("""echo "Hello"""")`
20:52:02FromGitter<kaushalmodi> I was reading this post that made me think of this: https://andreaslindh.wordpress.com/2011/11/03/embedpythoninverilogexample/
20:52:23FromGitter<kaushalmodi> relevant lines: ⏎ ⏎ ``` PyRun_SimpleString("import emb\n" ⏎ "emb.c_write(0,1)\n");``` [https://gitter.im/nim-lang/Nim?at=5c50bd07ca428b064521c6c9]
20:52:29FromGitter<zestyr> https://github.com/nim-lang/Nim/blob/devel/tests/compilerapi/tcompilerapi.nim
20:52:48FromGitter<zestyr> basically `compiler/nimeval`
20:53:11FromGitter<zestyr> from the 0.19.0 changelog: The compiler/nimeval API was rewritten to simplify the “compiler as an API”. Using the Nim compiler and its VM as a scripting engine has never been easier. See tests/compilerapi/tcompilerapi.nim for an example of how to use the Nim VM in a native Nim application.
20:54:21FromGitter<kaushalmodi> hmm, I don't understand any of this: https://github.com/nim-lang/Nim/blob/devel/tests/compilerapi/tcompilerapi.nim#L25-L38
21:00:08shashlick@kaushalmodi: compile it with nim into --app:lib and load as a module
21:00:16shashlickor use nim e and restrict to nimscript
21:00:31shashlickotherwise nimble approach of pulling entire compiler in
21:01:11FromGitter<kaushalmodi> I tried this blindly:https://ptpb.pw/TVd8/nim , doesn't work
21:01:21FromGitter<kaushalmodi> > /home/kmodi/.nimble/pkgs/compiler-#head/compiler/commands.nim(51, 16) Error: cannot open file: ../doc/basicopt.txt
21:01:39FromGitter<kaushalmodi> I wonder what that doc dir has to do with this
21:02:30FromGitter<kaushalmodi> shashlick: can you give a minimal example of what can be packaged into a lib?
21:02:41shashlicksee nimterop's getters.nim at the bottom
21:02:47FromGitter<kaushalmodi> ok
21:03:10shashlickand see nimble's scriptsupport.nim or something for pulling compiler in
21:04:28FromGitter<kaushalmodi> btw is this a bug? https://github.com/nim-lang/Nim/blob/dee8e6e98ae868b8d933a718250c8e471bc125ea/compiler/commands.nim#L51
21:04:53FromGitter<kaushalmodi> it looks for "../doc/.." so I cannot make that tcompilerapi example portable
21:05:23*NimBot joined #nim
21:10:01*darithorn quit (Quit: Leaving)
21:10:23*Cthalupa quit (Ping timeout: 268 seconds)
21:11:51*Cthalupa joined #nim
21:12:40*kapil____ quit (Quit: Connection closed for inactivity)
21:14:32*absolutejam quit (Quit: WeeChat 1.9.1)
21:17:26*aguspiza quit (Ping timeout: 240 seconds)
21:20:28*Cthalupa quit (Ping timeout: 245 seconds)
21:21:49*Cthalupa joined #nim
21:29:20*skellock joined #nim
21:43:12ZevvIs there a complete list of NimNode types that can declare new symbols? I have const, let, var, proc, iterator, method, any more?
21:46:57*pagnol joined #nim
21:47:25*elrood quit (Remote host closed the connection)
21:52:14*platoff joined #nim
21:57:02*Trustable quit (Remote host closed the connection)
21:59:36Zevvnevermind, got it
22:00:48*skellock quit (Quit: WeeChat 2.3)
22:01:10*skellock joined #nim
22:04:43FromDiscord_<exelotl> Zevv: oh are you making it work with procedure calls too?
22:05:24FromDiscord_<citycide> Zevv: did you find a complete list? I know `converter` would be included in that list
22:06:13FromGitter<kaushalmodi> my poor man version of eval string passed to nim: https://ptpb.pw/YCec/nim
22:06:24FromGitter<kaushalmodi> *I didn't understand any of the compiler module code.*
22:18:18FromGitter<jivank> what would be the cleanest way to unit test code that calls another executable `execCmd("somecommand")`
22:18:28FromGitter<jivank> or would it be better to put that in a integration test suite
22:18:50FromGitter<riddl_gitlab> wrap the execmd into an object
22:18:57FromGitter<riddl_gitlab> and stub it in UT
22:21:07FromGitter<riddl_gitlab> if a function logic is related to how "somecommand" is created, you should use a mock instead of simple stub, and validate your expectations
22:23:19FromGitter<jivank> but at the moment we dont have ways to mock in nim right?
22:23:20FromGitter<alehander42> but an integration test wouldn't hurt
22:23:46FromGitter<jivank> yeah at the end of the day, i need an integration test
22:24:01FromGitter<riddl_gitlab> you can implement a simple mock yourself, just use a collection to save arguments of that call and check it afterwards
22:26:26*zachcarter quit (Ping timeout: 240 seconds)
22:27:23*kapil____ joined #nim
22:29:39FromGitter<jivank> i am just wondering, basically if "somecommand" is just a side effect, its almost like i need when notUnitTest: execCmd
22:30:27FromGitter<jivank> riddl could you detail a little more about wrapping execcmd into an object
22:31:46FromGitter<riddl_gitlab> in a second, maybe i am, once again, doing too much assumptions basing on c++ ;) i will try to code it, brb
22:32:01FromGitter<jivank> something like type cmdWrap: cmdToRun , result: string
22:32:06FromGitter<jivank> alright thanks
22:47:23*vlad1777d joined #nim
22:49:07*jxy quit (Quit: leaving)
22:49:19*jxy joined #nim
22:53:50Araqjivank: Unclear what you mean, but Nim's "testament" does all these things and much more
22:57:28FromGitter<riddl_gitlab> oh dear, its so mind blowing to figure out how to implement such thing like google mock in nim without methods that are defined in object context
23:00:49Araqho
23:02:47*krux02 quit (Remote host closed the connection)
23:12:15FromGitter<jivank> testament is not documented yet? or can you show a project that is using it
23:12:20FromGitter<jivank> couldn't find it here https://nim-lang.org/docs/theindex.html
23:14:07FromGitter<jivank> i think ill just do integration tests, at the end of the day, thats what is needed
23:15:02FromGitter<jivank> i am writing a wrapper for tinc vpn, so i call its executable to have it generate pub/priv key pairs
23:15:38*vlad1777d quit (Ping timeout: 272 seconds)
23:16:11FromGitter<jivank> i created a temp directory but of course the executable isn't going to use that. so ill just make it all integration
23:18:09*pagnol quit (Ping timeout: 244 seconds)
23:30:34*Vladar quit (Remote host closed the connection)
23:36:48*abm quit (Ping timeout: 250 seconds)
23:36:54FromGitter<riddl_gitlab> any pastebin supports nim?
23:38:18FromGitter<riddl_gitlab> @jivank https://pastebin.pl/view/cf2fd71f
23:38:29FromGitter<riddl_gitlab> it is highly lame, not generalized case
23:38:39FromGitter<riddl_gitlab> but you can see what i meant
23:41:01*skellock quit (Quit: WeeChat 2.3)
23:47:45FromGitter<jivank> yes i see
23:48:10*zachcarter joined #nim
23:49:11FromGitter<jivank> so i guess what i'd like to know is. when running unit tests, what is the cleanest way to have Mocked run instead of the actual one
23:49:12FromGitter<riddl_gitlab> with macros its doable in a more convenient way
23:49:52FromGitter<riddl_gitlab> well, you need to do some dependency injection to achieve that
23:50:04FromGitter<riddl_gitlab> OR there is another way
23:50:08FromGitter<riddl_gitlab> i a UT build
23:50:12FromGitter<jivank> also check out https://glot.io/new/nim , a runnable pastebin for nim
23:50:49FromGitter<riddl_gitlab> you can link different implementation for object providing a function that wraps exec
23:50:49FromGitter<jivank> i see
23:51:05FromGitter<riddl_gitlab> all depends on how your test are organized
23:51:20FromGitter<jivank> i was trying to follow this, but i am not too familiar with go. https://sendgrid.com/blog/when-writing-unit-tests-dont-use-mocks/
23:51:39FromGitter<jivank> and use one of the interface libs for nim
23:52:11FromGitter<riddl_gitlab> cleanet way is to inject proper implementation, real one for product build, and stubbed in a testcase
23:52:26*zachcarter quit (Ping timeout: 240 seconds)
23:53:09FromGitter<riddl_gitlab> have you got your code somewhere public?
23:53:21FromGitter<riddl_gitlab> I can take a look on that test
23:53:33FromGitter<jivank> no not yet
23:53:43FromGitter<jivank> i need to push it
23:53:55FromGitter<jivank> but i have an early prototype with no tests :)
23:54:20FromGitter<riddl_gitlab> yeah, TDD is a myth :D
23:55:31*abm joined #nim
23:55:37FromGitter<jivank> i am just trying to clean up the code, separate the REST api from the logic than configures tinc vpn ⏎ https://github.com/jivank/qtinc-serverhttps://github.com/jivank/qtinc-cli
23:56:21FromGitter<jivank> so i am doing a total rewrite
23:57:12FromGitter<jivank> i basically am aiming to have something like SABNZBd, an executable with webui, that manages the node its running on
23:58:16FromGitter<riddl_gitlab> never heard about sabnzbd
23:59:23FromGitter<jivank> its a newsgroup nzb downloader. but basically it doesnt use any gui frameworks like Qt. it just launches a website when you click its icon which is running on localhost
23:59:52FromGitter<jivank> which helps for something like a raspberry pi