00:21:05 | * | abm quit (Quit: Leaving) |
00:33:27 | * | noonien joined #nim |
00:42:39 | FromGitter | <kayabaNerve> Was anyone ever working on a Nim Lint tool to report unused imports? |
00:43:11 | FromGitter | <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:32 | FromGitter | <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:10 | FromGitter | <timotheecour> maybe u can look at `nim genDepend` as a starting point |
01:28:09 | FromGitter | <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:43 | FromGitter | <kayabaNerve> It's not a bad style guide even. It's well written, comprehensive, and I have only a few differencess. |
01:29:42 | FromGitter | <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:42 | FromGitter | <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:19 | FromGitter | <kayabaNerve> I'm just saying that a linter is a huge task when an import checker is a decently sized task. |
01:30:55 | FromGitter | <timotheecour> well we can start a generic linter that just has a single check for now :) |
01:31:20 | FromGitter | <timotheecour> but designing in a way that makes adding lint checks easy |
01:33:16 | * | stefanos82 quit (Remote host closed the connection) |
01:34:06 | FromGitter | <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:43 | FromGitter | <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:44 | FromGitter | <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:42 | FromGitter | <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:43 | leorize | bung87: no |
07:43:09 | * | krux02 joined #nim |
07:43:12 | FromGitter | <bung87> got it, thanks! |
07:43:49 | FromDiscord_ | <demotomohiro> nim nightly build doesn't contain nim-gdb. |
07:44:20 | FromDiscord_ | <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:51 | Araq | demotomohiro: yes, we need to patch installer.ini I think |
08:57:53 | * | floppydh joined #nim |
09:01:02 | * | absolutejam joined #nim |
09:06:39 | Zevv | Why do NimNodes have a father but no mother?! That is so sad... |
09:07:17 | Zevv | And they only have sons, and no daughters |
09:07:31 | narimiran | Zevv: shit, you're onto something! |
09:07:38 | Zevv | :) |
09:08:15 | FromGitter | <alehander42> i didnt even know they have a father honestly |
09:09:01 | Zevv | Well, 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:54 | floppydh | sons: seq[NimNode] ## the node's sons (or children) |
09:09:54 | FromGitter | <alehander42> well you can add a daughter now: that's a loophole! |
09:10:16 | narimiran | we still lack NimNode's drunk uncle |
09:10:21 | Zevv | Ghehe |
09:16:19 | Araq | fun fact: 'children' was too long of a word and 'kids' not part of my active vocabulary |
09:17:36 | Zevv | Is loudAnnoyingAssholesWhoRefuseToCleanTheirRooms too long? |
09:18:09 | Zevv | Oooh, did I just call my own kids assholes? |
09:18:30 | PMunch | Haha :P |
09:18:31 | Araq | I think you did. |
09:19:03 | Zevv | I 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:22 | Zevv | master/slave I believe |
09:19:31 | * | kapil____ quit (Quit: Connection closed for inactivity) |
09:19:43 | Araq | yeah but we don't have this problem, the sons are all black and homo |
09:19:46 | PMunch | Yeah master/slave apparently isn't PC enough any more.. |
09:20:21 | pagnol | what has it been replaced by? |
09:20:37 | PMunch | I think it's something like leader/follower |
09:21:05 | PMunch | In dancing they have switched from calling it the male and female partner, instead opting for leading/follower |
09:21:24 | narimiran | :D :D |
09:21:48 | PMunch | There 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:57 | pagnol | there's still inequality though... |
09:21:57 | PMunch | s/drapped/dropped |
09:21:58 | narimiran | speaking of this theme, why we don't have more female devs in this channel and using nim in general? |
09:21:59 | Araq | Oh I thought was "captain gender studies" and "special snowflake" |
09:21:59 | pagnol | we must do better |
09:22:00 | FromGitter | <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:35 | PMunch | narimiran, didn't you see the previous discussion. NimNodes are all males, so it's a really hostile environment for female programmers |
09:22:40 | pagnol | Araq, I like your proposal |
09:23:11 | Araq | ah no, I confused it with StarWars... |
09:23:20 | PMunch | alehander42, yeah definitely makes sense. Just found it interesting as I just took some swing dancing class and they kept correcting themselves :P |
09:24:11 | Zevv | "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:12 | PMunch | Apparently master/slave has been changed for primary/secondary or primary/replica |
09:25:07 | narimiran | how do we get more nim exposure? somebody just needs to take these chats seriously and write a rant about it :) |
09:26:04 | Araq | don't you dare |
09:26:29 | PMunch | All PR is good PR, isn't that what they say :P |
09:26:52 | PMunch | Have gotten some good feedback for my test-presentation of the FOSDEM talk by the way :) |
09:27:44 | livcd | Why is the koch tool called koch ? |
09:28:04 | PMunch | Koch is the father(?) om Nimrod |
09:28:10 | PMunch | IIRC |
09:28:21 | Araq | omg, lol |
09:28:25 | leorize | livcd: iirc koch = cook |
09:28:28 | Araq | Koch is German for "cook" |
09:29:02 | PMunch | Oh wait, I was thinking of Cush, which was a Nim tool to use it as scripts :P |
09:29:06 | narimiran | PMunch: from those students the other day, or some new group? |
09:29:19 | PMunch | The students and professors from the other day |
09:29:36 | narimiran | so, when will see some new names here? :) |
09:30:03 | PMunch | Haha, good question |
09:30:22 | PMunch | I 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:30 | FromGitter | <alehander42> so glad i started naming my libs with obscure bulgarian words to balance a bit |
09:30:45 | PMunch | But I know there are some people getting interested in it at the university here |
09:30:49 | livcd | my Cmder goes crazy when I am compiling Nim |
09:30:56 | narimiran | PMunch: yeah, that reaction is familiar :) "IRC? what is this, '97?" |
09:31:14 | PMunch | narimiran, it's so good though compared to the alternatives |
09:31:24 | FromGitter | <alehander42> it's just not |
09:31:44 | PMunch | It's better than Gitter.. |
09:31:44 | narimiran | livcd: you shouldn't use "crazy", it is not politically correct :D |
09:31:49 | FromGitter | <alehander42> it's decentralized, this is the best part about it |
09:32:13 | Zevv | I'd *love* a mailing list, but alas, it is no longer '97 indeed |
09:32:23 | livcd | narimiran: my Cmder goes bananas when I am compiling NIm |
09:32:33 | narimiran | livcd: much better :D :D |
09:32:35 | PMunch | Yeah, I can run my own server. Oh Gitter corp. went bankrupt, guess what my IRC server lives on! |
09:32:46 | FromGitter | <alehander42> well the github issue tracker can be accessed similarly to a mailing list through your email |
09:32:53 | Araq | we had a mailing list, Zevv, wasn't used much |
09:34:28 | Zevv | So I heard. I'm just old skool, and already more then happy that there's IRC instead of slack or whatever. |
09:34:35 | PMunch | Plus I really like the idea of being available when I'm online |
09:35:26 | * | Vladar joined #nim |
09:36:05 | livcd | I 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:20 | FromGitter | <alehander42> PMunch: but then somebody asks you a question when you're offline .. and nothing happens? |
09:37:00 | PMunch | No, people don't ask me stuff when I'm offline. Because I'm not there |
09:37:28 | PMunch | The 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:41 | FromGitter | <alehander42> "PMunch i used this lib of yours, and i wonder whats the deal with X" |
09:37:55 | PMunch | Log an issue, or wait until I'm back on-line |
09:38:00 | FromGitter | <alehander42> well, yes, but this person can check in the room and leave a note for you |
09:38:04 | FromGitter | <alehander42> eh ok |
09:38:15 | FromGitter | <alehander42> everybody has its own view i guess |
09:38:19 | livcd | I updated Nim but cant compile falcon hmm |
09:38:26 | PMunch | Sure, use the notify bot on Freenode that will ping me when I get back |
09:38:29 | PMunch | Kinda like voicemail |
09:38:43 | PMunch | https://www.youtube.com/watch?v=11PseWcwfSI <- basically this |
09:39:28 | livcd | Were you guys able to compile falcon on Windows ? |
09:40:04 | FromGitter | <alehander42> PMunch so, now I should remember not just an irc-specific, but a freenode-specific way ;) |
09:40:46 | Araq | https://github.com/nim-lang/Nim/pull/10481 yay or nay? |
09:40:54 | PMunch | Sure, it's an eco-system, not a one stop solution |
09:41:06 | livcd | I am getting the same error as yesterday |
09:41:12 | PMunch | If you don't like the notifier bot, make your own :) |
09:41:50 | narimiran | Araq: at first i was "ok, why not", but your comment changed my mind. `stdin.lines` is clearer |
09:42:10 | Zevv | livecd: 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:09 | Zevv | narimiran, araq: throw it out then, just a personal itch I scratched |
09:43:29 | livcd | Zevv: oh! i said i would try it on mac but did not have the time :/ |
09:44:02 | Zevv | stdin.lines() is more explicit, but also - longer :) |
09:44:19 | Zevv | I'm *so* sick of typing, I'm switching to APL |
09:44:27 | Araq | :D |
09:44:38 | narimiran | Zevv: brainfuck to the rescue |
09:45:07 | narimiran | or J or whatever people used for AoC tasks done in something like 10 characters |
09:45:19 | Araq | for x in lines stdin: is short enough |
09:45:32 | narimiran | and here i am, typing `stdin` like an idiot :D |
09:45:43 | Araq | XD |
09:47:05 | Zevv | you can't put a line in a variable called x |
09:47:09 | Zevv | that's plain dirty |
09:47:15 | Zevv | it's called l, at least |
09:47:54 | Araq | l and 1 look to similar on many fonts |
09:48:22 | Zevv | I'm the (sad?) type of guy that makes his own fonts for exactly that reason :) |
09:48:35 | PMunch | Didn't the Nim compiler use to complain about that? Might still do, and I've just stopped using l :P |
09:48:35 | livcd | I really want to compile falcon on Windows... |
09:48:54 | Araq | PMunch, it used to but I think I removed this warning |
09:49:02 | PMunch | Zevv, I've modified fonts before for similar reasons.. |
09:49:03 | narimiran | PMunch: it did, it does not anymore (thanks for removing that warning) |
09:49:13 | PMunch | :( |
09:49:23 | narimiran | * :) |
09:49:34 | PMunch | Why don't you like it? |
09:49:42 | Zevv | https://zevv.nl/play/code/zevv-peep/. Outdated techology though, everybody wants aliasing and TTF these days |
09:49:57 | narimiran | leave me alone, i have a font where i know the difference between l, I and 1. and between O and 0 |
09:50:12 | narimiran | you're gonna stop me from using `f00`? :P |
09:50:32 | Zevv | I think in Nim you're allowd to use anything utf8, right? |
09:50:38 | PMunch | Yes |
09:50:39 | Araq | does the font also happen to fix underscores to not look like they are not part of the current line? |
09:50:56 | Araq | I hate this so much, lol |
09:50:59 | Zevv | it's an *under*score |
09:51:05 | narimiran | Araq: yes |
09:51:15 | Araq | prove it! screenshot? |
09:51:20 | Zevv | Wow, I see a nice project here. APL macros in nim |
09:52:09 | Zevv | parse this! X[⍋X+.≠' ';] |
09:52:27 | narimiran | Araq: https://i.imgur.com/k510HCc.png |
09:52:55 | leorize | is that Iosevka? |
09:53:07 | narimiran | leorize: you're god damn right!! |
09:53:53 | Araq | impressive. |
09:53:56 | narimiran | it took me half a day to get used to narrowness, now everything else is (unnecessary) too wide |
09:54:02 | PMunch | Inconsolata isn't too bad for that as well |
09:54:18 | PMunch | Puts it like centered on the baseline |
09:54:46 | narimiran | heh, if Araq used Iosevka, maybe preferred style in Nim would have been snake_case :D |
09:55:45 | PMunch | Then you have the mad-men who uses fonts like this: user-images.githubusercontent.com/16634089/37139317-e674ad1a-22c6-11e8-976a-54a1926ca6ad.png |
09:56:01 | FromGitter | <alehander42> oh yeah fira? |
09:56:20 | Araq | PMunch, I like it but the && still sucks |
09:56:20 | narimiran | i've used fira code before discovering iosevka |
09:56:56 | leorize | have they fixed the serif `r`? |
09:56:56 | Araq | I also like special ligatures for {. and .} |
09:57:04 | narimiran | btw, these ligatures are a bit over the top, aren't they? ;) |
09:57:28 | floppydh | iteraters are so nice |
09:57:32 | PMunch | alehander42, that is actually an Inconsolata variant |
09:57:33 | * | absolutejam quit (Ping timeout: 245 seconds) |
09:57:33 | floppydh | iterators* |
09:57:56 | Zevv | So here they are, enough brains to create the next world dominating programming language, discussing *fonts* |
09:58:17 | narimiran | floppydh: are they? they seemed slow to me, i stopped using them long ago |
09:58:28 | floppydh | iterators are slow ??? |
09:58:54 | PMunch | I 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:08 | PMunch | Zevv, don't bash fonts! |
09:59:59 | livcd | so there's a font with ligatures for nim's pragmas?? |
09:59:59 | narimiran | Zevv: well, if we had something like 1300+ open issues, we wouldn't discuss about fonts, but work on those. right? |
10:00:03 | narimiran | oh. wait. |
10:00:23 | Araq | good point. Good bye. |
10:00:48 | narimiran | just drop it to 1299 and you can come back :D |
10:01:29 | * | ng0 joined #nim |
10:02:33 | FromGitter | <alehander42> just open an issue about fonts |
10:03:00 | narimiran | first reply: "how is that a nim problem" |
10:03:18 | narimiran | author replies: "well, you see, when you use nim in combination with this and that...." |
10:03:40 | * | absolutejam joined #nim |
10:04:05 | narimiran | (this is just a fictional scenario, it never ever really happened before) |
10:06:54 | FromGitter | <alehander42> you need a RFC duh |
10:11:08 | narimiran | floppydh: for some stuff i did, they seemed slower than a similar version which used procs |
10:15:08 | * | kapil____ joined #nim |
10:20:32 | PMunch | "Seemed slower" great benchmark :P |
10:22:06 | narimiran | PMunch: ain't nobody got time for that :P |
10:23:10 | Zevv | as long as nim "seems" faster then python, we're all good to go |
10:24:23 | narimiran | Zevv: 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:34 | Zevv | My first project was a nifty waveform/spectrum analasis thingy: https://zevv.nl/div/cor.png |
10:26:58 | Zevv | Only after I properly started reading the docs I found out why my profiler kept hitting memcpy() all the time :) |
10:27:13 | PMunch | Oooh, graps |
10:27:17 | PMunch | graphs* |
10:28:08 | Zevv | Nim does not do pass-by-reference, but pass-by-memcpy |
10:32:52 | leorize | you mean pass-by-value? :P |
10:33:04 | * | dom96_w joined #nim |
10:33:07 | Zevv | that's not what my profiler says |
10:38:50 | * | vlad1777d joined #nim |
10:40:21 | Araq | it's not pass-by-memcpy at all |
10:40:48 | Araq | though the memcpys can show up in profiling, I heard we got move semantics to fight it |
10:49:16 | Zevv | Yeah, I know all about it, just pointing out what can happen to beginners |
10:50:03 | Araq | well 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:43 | Zevv | I'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:32 | Araq | passing them is fine, but don't copy them. And sometimes the items() causes a copy :-( |
11:00:40 | Araq | if you wanna get into compiler development, this one https://github.com/nim-lang/Nim/issues/10478 might be easy |
11:14:03 | narimiran | @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:13 | Zevv | How do you print-debug with PNode's? repr always goes waaay to deep |
11:49:17 | leorize | look at TNode type signature then print out what you need :P |
11:49:22 | leorize | that's my experience so far |
11:52:13 | Zevv | thnkx |
11:54:55 | leorize | nim-gdb is also a great helper |
11:55:10 | leorize | but it's kinda tricky to get right |
11:55:17 | leorize | one wrong move and gdb crashes |
11:57:15 | * | stefanos82 joined #nim |
12:00:03 | leorize | Araq: how would you fix this? http://ix.io/1zv1/nim |
12:00:31 | leorize | my method right now would be to hack the parser to produce separated lineinfos |
12:00:44 | leorize | but 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:48 | FromGitter | <alehander42> Zevv: i use debugTree sometimes, but not sure if it's diff |
12:22:54 | FromGitter | <alehander42> rent |
12:23:10 | * | hoijui joined #nim |
12:53:17 | dom96_w | Zevv: debug() IIRC |
12:56:01 | Zevv | well, I'm not actually sure if I want to go there |
12:56:12 | Zevv | macros 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:57 | Araq | leorize, just analyse the AST a bit |
13:29:21 | dom96_w | Zevv: the compiler is basically just a big AST transformer with some extra metadata :P |
13:32:49 | leorize | sounds like a slightly more complicated macro to me :P |
13:36:15 | Araq | leorize, why is a[i] special though? f(x, y) arguably also spans from '(' to ')' |
13:37:12 | leorize | because `[]` is a proc in this case |
13:37:54 | leorize | nimsuggest highlight by symbols |
13:38:09 | Araq | yeah but it *starts* at the [ |
13:38:24 | Araq | like f() starts at the 'f' |
13:38:34 | Araq | https://www.smbc-comics.com/comic/halting |
13:40:02 | leorize | yep, and the symbol length for `[]` is 2 |
13:40:18 | leorize | it mainly boils down to this: https://github.com/nim-lang/Nim/blob/devel/compiler/suggest.nim#L91 |
13:40:51 | Araq | don't "suggest" [], it's stupid |
13:41:11 | Araq | you never really know if it's not "generic type here" instead |
13:41:26 | Araq | Table[int] vs a[i] |
13:41:43 | livcd | can i only download the pkg with nimble ? |
13:41:58 | leorize | nimsuggest acts on resolved symbols, not node |
13:42:46 | Araq | [] is hardly a "resolved symbol" |
13:44:46 | Araq | but fine, pretend its length is 1 |
13:44:54 | Araq | and do the same for []= |
13:45:05 | Araq | and for {}, {}= |
13:48:48 | livcd | kaushalmodi: do you use aggressive-indentation ? does it work for you with Nim ? |
13:50:47 | * | CcxWrk quit (Ping timeout: 240 seconds) |
13:51:55 | leorize | Araq: then what about the [] in `[]`(a, b)? |
13:52:09 | leorize | highlight just the `[`? |
13:53:14 | * | CcxWrk joined #nim |
13:56:08 | * | pagnol quit (Ping timeout: 250 seconds) |
13:57:13 | dom96_w | livcd: 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:57 | livcd | dom96_w: What I meant is if I can just download the pkg with nimble without really building it. |
14:00:09 | dom96_w | no |
14:00:32 | livcd | ok |
14:04:23 | Araq | leorize, 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:06 | FromGitter | <kaushalmodi> livcd: no, I use the default indentation on Return that comes with nim-mode |
14:36:29 | FromGitter | <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:01 | leorize | Araq: I've looked into this idea: https://irclogs.nim-lang.org/24-01-2019.html#11:10:16 |
15:43:01 | leorize | I've managed to make `[]` highlight correctly using it |
15:43:15 | leorize | but it seems to break the "dirty" file functionality |
15:44:05 | livcd | kaushalmodi: 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:18 | leorize | Araq: actually it broke any different version of the file :/ |
15:48:27 | leorize | http://ix.io/1zvE/diff |
15:48:36 | leorize | ^ can you check out that patch? |
15:49:50 | FromGitter | <iffy> @timotheecour thanks for bisecting |
15:49:59 | * | hoijui joined #nim |
15:52:01 | FromGitter | <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:34 | FromGitter | <kaushalmodi> I'm anyways used to auto indenting whole buffer before saving. |
15:53:27 | * | stefanos82 quit (Remote host closed the connection) |
15:55:36 | FromGitter | <alehander42> is this emacs |
15:59:18 | FromGitter | <kaushalmodi> Yes |
16:01:01 | FromGitter | <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:56 | livcd | kaushalmodi: 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:22 | livcd | kaushalmodi: i need to get better at e-macs :/. I do not really want to write lisp though.. |
16:18:00 | FromGitter | <kaushalmodi> livcd: With nim-mode installed, it correctly sets the indentation level of next line |
16:18:26 | FromGitter | <kaushalmodi> Example: type `proc foo() =` and hit enter |
16:18:50 | FromGitter | <kaushalmodi> The next line will be auto indented by 2 spaces |
16:19:06 | FromGitter | <kaushalmodi> Elisp is beautiful |
16:20:03 | * | PMunch quit (Remote host closed the connection) |
16:20:24 | FromGitter | <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:08 | livcd | kaushalmodi: any idiot friendly tut you can recommend ? maybe we can take this to nim-offtopic |
16:21:49 | FromGitter | <kaushalmodi> Start with elisp x in y minutes (Google that) |
16:22:31 | FromGitter | <kaushalmodi> Then it's jusst learning as you go, reading Stackexchange answers, perusing it's subreddit, etc |
16:24:51 | FromGitter | <kaushalmodi> For emacs chat, you can drop into my Gitter lobby |
16:27:20 | FromGitter | <iffy> The RFC repo says to open a PR, but it seems like everyone just files issues. Which should I do? |
16:29:48 | Araq | depends on the RFC. Small RFCs can be issues, others should follow Python's Enhancement process |
16:29:59 | Araq | bbl |
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:41 | Zevv | Is 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:14 | Zevv | (Not to start a discussion about if this is a Bad Thing To Do) |
17:44:49 | leorize | well, no :P |
17:45:04 | leorize | you can do `var <nameOfParam> = nameOfParam` |
17:45:12 | leorize | it should shadow the param |
17:45:16 | Zevv | oh, right! |
17:45:29 | Zevv | that should do. I hate making up names, and adding '2' or 'new' is nasty |
17:47:02 | Zevv | never knew you could shadow like that |
17:48:16 | FromGitter | <riddl_gitlab> like shadowing wasn't even nastier ;P |
17:48:56 | FromGitter | <kaushalmodi> Zevv: https://nim-lang.github.io/Nim/tut1.html#procedures-parameters |
17:49:26 | Zevv | I 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:01 | Zevv | Funny, I needed this to implement shadowing myself :) |
18:05:07 | * | smitop joined #nim |
18:13:14 | FromGitter | <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:14 | FromGitter | ... --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:30 | ryukoposting | hello lads |
18:21:30 | Zevv | riddl_gitlab: objects are very lightweight already, they map straight to C structs |
18:22:07 | Zevv | these are the way to go |
18:22:24 | Araq | riddl_gitlab: c2nim can translate the C code, you need to tweak it a bit though |
18:22:58 | Zevv | A little elf told me once that named tuples are 'second class citizens', you might want to avoid these |
18:23:21 | ryukoposting | elves are second class citizens, don't listen to them |
18:23:45 | ryukoposting | Zevv does nim reorder objects? I just assumed it did |
18:23:50 | FromGitter | <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:12 | Zevv | ryukoposting: It does not reorder, and it honours C packing |
18:24:28 | ryukoposting | damn, that's nice |
18:24:32 | Zevv | objects are an essential part for interfacing with C code - lots of C api's have structs in their interfaces. |
18:24:55 | FromGitter | <riddl_gitlab> sure, and I assumed tuples are for that purpose |
18:25:31 | Zevv | I had a bad start with tuples myself. Basically I only use them for returning multiple values from procs these days. |
18:26:02 | Zevv | other 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:03 | ryukoposting | that'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:28 | Zevv | ryukoposting: try to interface something like zlib: huge structs with a lots of different types. It's a breeze from nim |
18:26:28 | FromGitter | <riddl_gitlab> ok, so I'm gonna think about tuples just like about c++ std::tuples |
18:26:49 | ryukoposting | I use tuples when I'm too lazy to write a separate object for something lol |
18:27:23 | Zevv | I think that's the main use case. Tuple unpacking is handy also |
18:27:31 | ryukoposting | very true |
18:27:32 | Zevv | https://nim-lang.org/docs/manual.html#statements-and-expressions-tuple-unpacking |
18:28:08 | ryukoposting | how 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:19 | Zevv | araq 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:33 | Zevv | sorry, that was about parallel. Spawn is just fine I believe |
18:29:35 | leorize | parallel only works if you managed to get pass the sem check |
18:29:52 | Araq | I have a better sem'checker in a branch... |
18:29:54 | Zevv | leorize: but sometims I get it past and then it just booms in my face |
18:30:08 | Zevv | that was some time ago, though, things might have improved |
18:30:09 | leorize | spawn is currently not really stable |
18:30:12 | ryukoposting | yeah, I was probably gonna use spawn for it anyway (though parallel is so clean it makes me want to use it desparately) |
18:30:25 | leorize | there's an alternative threadpool implementation that's not yet upstreamed |
18:30:26 | Araq | there is a Nimble package iirc with a better spawn |
18:30:37 | Araq | yeah, what leorize says. Please use that instead. |
18:31:18 | ryukoposting | nice, I'll look into it |
18:31:49 | leorize | https://github.com/yglukhov/threadpools |
18:31:54 | leorize | ^ that's the better threadpool |
18:32:22 | ryukoposting | thanks leorize |
18:33:11 | Zevv | it needs a README :( |
18:33:50 | leorize | @yglukhov: ^ |
18:35:35 | * | kapil____ joined #nim |
18:40:08 | Araq | syntax is spawn foo(args) |
18:40:12 | Araq | what's there to document? :P |
18:43:45 | Araq | Zevv, oh btw, for interfacing with C structs you sometimes need a .bycopy annotation |
18:44:30 | Araq | and 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:35 | FromGitter | <Clyybber> what advantage would reordering fields have? |
18:45:57 | Araq | smaller objects |
18:46:00 | FromGitter | <arnetheduck> @Araq I've been hoping nim would get that - a better abi spec ;) |
18:46:56 | FromGitter | <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:05 | Zevv | clybber: `with` now can shadow |
18:49:09 | FromGitter | <Clyybber> oh nice |
18:49:55 | Zevv | new feature for yet even less readable code |
18:51:19 | Araq | arnetheduck: 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:03 | Araq | but I don't know if it would things worse :-) |
18:53:08 | Araq | *would make |
18:53:24 | * | seni joined #nim |
18:55:16 | * | Marumoto joined #nim |
18:56:40 | FromGitter | <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:40 | FromGitter | ... result-assignment analysis and other such things that can benefit all backends |
18:57:27 | FromGitter | <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:42 | Araq | yeah but designing an IR is hard |
18:58:37 | Araq | the AST is loss-less |
18:59:37 | Araq | and SSA is comparable to a 'let' statement, so if we have a transformation that turns var into let we're almost there |
18:59:50 | Araq | except for the Phi nodes |
18:59:56 | FromGitter | <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:24 | FromGitter | <arnetheduck> there's an interesting IR I've seen that does away with PHI.. I'll dig up a link later |
19:01:34 | FromGitter | <arnetheduck> I know it's hard, but that wasn't your question :) |
19:01:49 | Araq | ok, enjoy your flight |
19:07:34 | * | lritter quit (Quit: Leaving) |
19:14:33 | FromGitter | <riddl_gitlab> `ptr void` is not allowed? Why? |
19:14:43 | leorize | use `pointer` instead |
19:15:36 | leorize | http://nim-lang.github.io/Nim/manual#types-void-type |
19:15:51 | leorize | > 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:37 | FromGitter | <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:05 | leorize | well `void*` is C lingo |
19:19:48 | Araq | void is a misdesign |
19:20:09 | Zevv | take it out already! |
19:20:32 | Araq | must write an RFC first :-) |
19:20:56 | FromGitter | <riddl_gitlab> so, in future we'll just omit a return type to express a call doesnt return anything? |
19:21:11 | leorize | that's how it should always be? |
19:21:11 | Zevv | already so |
19:21:34 | leorize | void in Nim is only useful for generics |
19:22:05 | Zevv | Araq: noone writes RFC's, why should you? |
19:22:15 | Zevv | it's just *too* much work |
19:22:45 | leorize | riddl_gitlab: I think you should read the Manual instead of experimenting :P |
19:25:30 | FromGitter | <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:08 | leorize | I think void was added to supplement generics, but only Araq can verify that :P |
19:27:01 | Araq | the idea was that HashTable[Key, void] is turned into HashSet[Key] |
19:27:03 | FromGitter | <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:07 | FromGitter | <riddl_gitlab> too much assumptions |
19:27:43 | Araq | and we save collection implementations |
19:28:04 | FromDiscord_ | <exelotl> Zevv: nice With improvements!! :D |
19:28:04 | Araq | that didn't work out well and now 'void' is this silly special case in the type system |
19:28:53 | Araq | instead we should have embraced tuple[] with its value () as our Unit type |
19:29:08 | FromGitter | <riddl_gitlab> ok, noted - avoid voids in nim ;) |
19:29:23 | Araq | and then optimize it out in the backend(s) |
19:29:45 | Araq | would have been a much better design. |
19:31:23 | FromGitter | <riddl_gitlab> btw, is a nim/rod name related to https://en.wikipedia.org/wiki/Nimrod_(computer) ? |
19:33:48 | federico3 | https://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:19 | leorize | Araq: this will magically fix all highlighter problems in nimsuggest :P https://github.com/nim-lang/Nim/pull/10496 |
19:36:20 | shashlick | I can be one of the 3 |
19:36:35 | leorize | on a serious note I think my implementation is just horribly inefficient :/ |
19:36:50 | leorize | please comment there if you got any better idea |
19:38:39 | Zevv | Is it by design that strtabs has no del/excl, or is it just that noone cared to put it in yet? |
19:39:19 | Araq | it predates generics, noone cared |
19:39:46 | Zevv | fair enough |
19:40:53 | Zevv | wow, "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:47 | FromGitter | <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:02 | FromGitter | <kaushalmodi> how can I eval Nim code in a string? |
20:50:23 | FromGitter | <zestyr> compile-time or runtime? |
20:50:35 | FromGitter | <kaushalmodi> run time |
20:51:17 | FromGitter | <kaushalmodi> pseudo code: `eval("""echo "Hello"""")` |
20:52:02 | FromGitter | <kaushalmodi> I was reading this post that made me think of this: https://andreaslindh.wordpress.com/2011/11/03/embedpythoninverilogexample/ |
20:52:23 | FromGitter | <kaushalmodi> relevant lines: ⏎ ⏎ ``` PyRun_SimpleString("import emb\n" ⏎ "emb.c_write(0,1)\n");``` [https://gitter.im/nim-lang/Nim?at=5c50bd07ca428b064521c6c9] |
20:52:29 | FromGitter | <zestyr> https://github.com/nim-lang/Nim/blob/devel/tests/compilerapi/tcompilerapi.nim |
20:52:48 | FromGitter | <zestyr> basically `compiler/nimeval` |
20:53:11 | FromGitter | <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:21 | FromGitter | <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:08 | shashlick | @kaushalmodi: compile it with nim into --app:lib and load as a module |
21:00:16 | shashlick | or use nim e and restrict to nimscript |
21:00:31 | shashlick | otherwise nimble approach of pulling entire compiler in |
21:01:11 | FromGitter | <kaushalmodi> I tried this blindly:https://ptpb.pw/TVd8/nim , doesn't work |
21:01:21 | FromGitter | <kaushalmodi> > /home/kmodi/.nimble/pkgs/compiler-#head/compiler/commands.nim(51, 16) Error: cannot open file: ../doc/basicopt.txt |
21:01:39 | FromGitter | <kaushalmodi> I wonder what that doc dir has to do with this |
21:02:30 | FromGitter | <kaushalmodi> shashlick: can you give a minimal example of what can be packaged into a lib? |
21:02:41 | shashlick | see nimterop's getters.nim at the bottom |
21:02:47 | FromGitter | <kaushalmodi> ok |
21:03:10 | shashlick | and see nimble's scriptsupport.nim or something for pulling compiler in |
21:04:28 | FromGitter | <kaushalmodi> btw is this a bug? https://github.com/nim-lang/Nim/blob/dee8e6e98ae868b8d933a718250c8e471bc125ea/compiler/commands.nim#L51 |
21:04:53 | FromGitter | <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:12 | Zevv | Is 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:36 | Zevv | nevermind, got it |
22:00:48 | * | skellock quit (Quit: WeeChat 2.3) |
22:01:10 | * | skellock joined #nim |
22:04:43 | FromDiscord_ | <exelotl> Zevv: oh are you making it work with procedure calls too? |
22:05:24 | FromDiscord_ | <citycide> Zevv: did you find a complete list? I know `converter` would be included in that list |
22:06:13 | FromGitter | <kaushalmodi> my poor man version of eval string passed to nim: https://ptpb.pw/YCec/nim |
22:06:24 | FromGitter | <kaushalmodi> *I didn't understand any of the compiler module code.* |
22:18:18 | FromGitter | <jivank> what would be the cleanest way to unit test code that calls another executable `execCmd("somecommand")` |
22:18:28 | FromGitter | <jivank> or would it be better to put that in a integration test suite |
22:18:50 | FromGitter | <riddl_gitlab> wrap the execmd into an object |
22:18:57 | FromGitter | <riddl_gitlab> and stub it in UT |
22:21:07 | FromGitter | <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:19 | FromGitter | <jivank> but at the moment we dont have ways to mock in nim right? |
22:23:20 | FromGitter | <alehander42> but an integration test wouldn't hurt |
22:23:46 | FromGitter | <jivank> yeah at the end of the day, i need an integration test |
22:24:01 | FromGitter | <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:39 | FromGitter | <jivank> i am just wondering, basically if "somecommand" is just a side effect, its almost like i need when notUnitTest: execCmd |
22:30:27 | FromGitter | <jivank> riddl could you detail a little more about wrapping execcmd into an object |
22:31:46 | FromGitter | <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:01 | FromGitter | <jivank> something like type cmdWrap: cmdToRun , result: string |
22:32:06 | FromGitter | <jivank> alright thanks |
22:47:23 | * | vlad1777d joined #nim |
22:49:07 | * | jxy quit (Quit: leaving) |
22:49:19 | * | jxy joined #nim |
22:53:50 | Araq | jivank: Unclear what you mean, but Nim's "testament" does all these things and much more |
22:57:28 | FromGitter | <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:49 | Araq | ho |
23:02:47 | * | krux02 quit (Remote host closed the connection) |
23:12:15 | FromGitter | <jivank> testament is not documented yet? or can you show a project that is using it |
23:12:20 | FromGitter | <jivank> couldn't find it here https://nim-lang.org/docs/theindex.html |
23:14:07 | FromGitter | <jivank> i think ill just do integration tests, at the end of the day, thats what is needed |
23:15:02 | FromGitter | <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:11 | FromGitter | <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:54 | FromGitter | <riddl_gitlab> any pastebin supports nim? |
23:38:18 | FromGitter | <riddl_gitlab> @jivank https://pastebin.pl/view/cf2fd71f |
23:38:29 | FromGitter | <riddl_gitlab> it is highly lame, not generalized case |
23:38:39 | FromGitter | <riddl_gitlab> but you can see what i meant |
23:41:01 | * | skellock quit (Quit: WeeChat 2.3) |
23:47:45 | FromGitter | <jivank> yes i see |
23:48:10 | * | zachcarter joined #nim |
23:49:11 | FromGitter | <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:12 | FromGitter | <riddl_gitlab> with macros its doable in a more convenient way |
23:49:52 | FromGitter | <riddl_gitlab> well, you need to do some dependency injection to achieve that |
23:50:04 | FromGitter | <riddl_gitlab> OR there is another way |
23:50:08 | FromGitter | <riddl_gitlab> i a UT build |
23:50:12 | FromGitter | <jivank> also check out https://glot.io/new/nim , a runnable pastebin for nim |
23:50:49 | FromGitter | <riddl_gitlab> you can link different implementation for object providing a function that wraps exec |
23:50:49 | FromGitter | <jivank> i see |
23:51:05 | FromGitter | <riddl_gitlab> all depends on how your test are organized |
23:51:20 | FromGitter | <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:39 | FromGitter | <jivank> and use one of the interface libs for nim |
23:52:11 | FromGitter | <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:09 | FromGitter | <riddl_gitlab> have you got your code somewhere public? |
23:53:21 | FromGitter | <riddl_gitlab> I can take a look on that test |
23:53:33 | FromGitter | <jivank> no not yet |
23:53:43 | FromGitter | <jivank> i need to push it |
23:53:55 | FromGitter | <jivank> but i have an early prototype with no tests :) |
23:54:20 | FromGitter | <riddl_gitlab> yeah, TDD is a myth :D |
23:55:31 | * | abm joined #nim |
23:55:37 | FromGitter | <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-server ⏎ https://github.com/jivank/qtinc-cli |
23:56:21 | FromGitter | <jivank> so i am doing a total rewrite |
23:57:12 | FromGitter | <jivank> i basically am aiming to have something like SABNZBd, an executable with webui, that manages the node its running on |
23:58:16 | FromGitter | <riddl_gitlab> never heard about sabnzbd |
23:59:23 | FromGitter | <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:52 | FromGitter | <jivank> which helps for something like a raspberry pi |