<< 07-10-2018 >>

00:36:41*zurs joined #nim
00:36:48*zurs quit (Client Quit)
00:51:17FromGitter<zacharycarter> I'm not from a CS background - and I find there are far too many terms to describe the same underlying term
00:52:00FromGitter<zacharycarter> ```In computer science, a tagged union, also called a variant, variant record, choice type, discriminated union, disjoint union, or sum type, is a data structure```
00:52:11FromGitter<zacharycarter> I recognize a few of those names, but jesus...
00:53:06FromGitter<zacharycarter> also - Rust seems to have wikipedia entries now
00:53:11FromGitter<zacharycarter> makes me think / wonder
01:09:56FromDiscord_<exelotl> is there a way to tell nimsuggest to ignore a symbol? (particularly this could be useful to hide exported procedures that are only used in macro-generated code)
01:12:40FromGitter<zacharycarter> not sure - would probably have to dig into the nimsuggest src to find out
01:12:46FromGitter<zacharycarter> https://github.com/ValveSoftware/GameNetworkingSockets - looks like valve just renamed this repo
01:12:53FromGitter<zacharycarter> would be nice to get bindings around this
01:13:23FromGitter<zacharycarter> looks like there's a C interface too - https://github.com/ValveSoftware/GameNetworkingSockets/blob/master/include/steamnetworkingsockets/isteamnetworkingsockets.h
01:24:24*vlad1777d quit (Ping timeout: 252 seconds)
01:42:28shashlickI had tried to nimgen steamworks a while back
01:42:48shashlickNeed to try again with the newer capabilities
01:47:31*Tortice quit (Remote host closed the connection)
01:57:40*tefter quit (Remote host closed the connection)
02:04:20*banc quit (Quit: ZNC - http://znc.in)
02:20:04*banc joined #nim
02:30:17FromGitter<zacharycarter> deep learning idea - create app to let people upload pictures of spiders / snakes / other creepy crawlies to identify them
03:11:39*rockcavera joined #nim
03:15:59FromGitter<zacharycarter> https://hugoam.github.io/mud-io/
03:16:01FromGitter<zacharycarter> is very cool
03:19:30*chemist69 quit (Ping timeout: 252 seconds)
03:20:16*chemist69 joined #nim
03:27:11*kapil____ joined #nim
03:29:19*rockcavera quit (Ping timeout: 246 seconds)
03:31:08*Guest20712 joined #nim
03:41:34*chemist69 quit (Ping timeout: 240 seconds)
03:43:48*chemist69 joined #nim
04:11:25*dddddd quit (Remote host closed the connection)
04:56:11*tefter joined #nim
05:20:40*voice_ftp quit (Read error: Connection reset by peer)
05:30:12*narimiran joined #nim
05:35:54*endragor joined #nim
05:40:09FromGitter<Bennyelg> @zacharycarter reminds me Blender
05:56:14*rlr joined #nim
06:16:24*voiceftp joined #nim
06:30:50*rockcavera joined #nim
06:30:50*rockcavera quit (Changing host)
06:30:50*rockcavera joined #nim
06:33:51*Guest20712 quit (Ping timeout: 260 seconds)
06:36:01*erihelyR joined #nim
06:36:23*erihelyR quit (K-Lined)
06:49:12*darithorn quit ()
06:59:59*moshenMF joined #nim
07:01:51*moshenMF quit (Remote host closed the connection)
07:07:22*rockcavera quit (Ping timeout: 246 seconds)
07:47:37narimiranaaaand hacktoberfest done! :)
07:49:33FromGitter<7sDream> #9235, the doc generator bug I meet yesterday night…
07:52:08*Sembei quit (Ping timeout: 245 seconds)
07:52:11*MyMind joined #nim
07:59:08*pietroppeter joined #nim
08:03:36*gmpreussner joined #nim
08:03:49*pietroppeter quit (Ping timeout: 256 seconds)
08:04:12*gmpreussner_ quit (Ping timeout: 252 seconds)
08:04:48narimiran@7sDream what do you use for html preview? is that some plugin or is it built-in?
08:11:53*Vladar joined #nim
08:12:54*stefanos82 joined #nim
08:14:36FromGitter<7sDream> Just for screenshot, I use chrome to open it too, same result
08:18:30narimiranbut i'm interested in exactly that — how do you preview html in vscode?
08:19:38FromGitter<7sDream> oh, is a extension
08:19:52FromGitter<7sDream> https://marketplace.visualstudio.com/items?itemName=tht13.html-preview-vscode
08:20:30narimiranthanks
08:21:46FromGitter<7sDream> not a very great extension, but for small html file, it’s not bad
08:26:05FromGitter<7sDream> https://marketplace.visualstudio.com/items?itemName=searKing.preview-vscode ⏎ This one is better, better render result
08:26:10*shpx joined #nim
08:28:15FromGitter<7sDream> (https://files.gitter.im/nim-lang/Nim/12sW/1538900882211.jpg)
08:28:46FromGitter<7sDream> And, anyone know where is the doc comment str in type define section’s ast tree?
08:29:58FromGitter<7sDream> I wan’t auto generate docstring for some type generated by macro, and have no idea where to put the CommentStmtNode
08:30:46FromGitter<7sDream> (https://files.gitter.im/nim-lang/Nim/pWlc/image.png)
08:32:35narimiran@7sDream if the comment is above `type` then it is shown in the tree, don't know if that does it for you?
08:33:31FromGitter<7sDream> Thx, let me try~
08:35:47FromGitter<7sDream> (https://files.gitter.im/nim-lang/Nim/CkT6/1538901332639.jpg)
08:36:00FromGitter<7sDream> Emmm, it will not in the generated doc
08:36:20narimiranyeah, i thought it wouldn't :(
08:39:28narimiranin the stdlib comments which are shown in the documentation are written as `type Foo = object ## comment here`, but i cannot see that comment when i do `dumpTree`
08:41:25FromGitter<7sDream> yes, in the same line or below the line both works in doc generate, but not shown in ast tree
08:56:18*SenasOzys joined #nim
09:06:00*endragor quit (Remote host closed the connection)
09:20:07*endragor joined #nim
09:24:42*endragor quit (Ping timeout: 252 seconds)
10:06:10*kapil____ quit (Quit: Connection closed for inactivity)
10:46:26*SenasOzys quit (Quit: Leaving)
10:49:38*narimiran quit (Ping timeout: 245 seconds)
10:51:51*elrood joined #nim
11:09:43*dddddd joined #nim
11:22:14*vlad1777d joined #nim
11:27:00*hzx joined #nim
11:27:07*gb00s joined #nim
11:33:32*alexnask joined #nim
12:39:53FromGitter<zacharycarter> @Bennyelg really? in what way?
12:40:33FromGitter<zacharycarter> btw - I installed test pilot in firefox - and the side view (split screen tab) functionality - is amazing
13:00:36FromGitter<zacharycarter> TheLemonMan: regarding - https://github.com/nim-lang/Nim/issues/9232 - is your suggestion to add another branch to the case statement?
13:00:41FromGitter<zacharycarter> like - `of '%': add(result, "%25")` ?
13:00:52FromGitter<zacharycarter> if so - I can put a PR up after I add a test
13:07:33FromGitter<zacharycarter> I have a feeling I'm over-simplifying what needs to be done though
13:11:04*nsf joined #nim
13:15:59*PMunch joined #nim
13:33:36*PMunch quit (Ping timeout: 272 seconds)
13:33:55*PMunch joined #nim
13:41:59*narimiran joined #nim
13:52:15*PMunch quit (Ping timeout: 252 seconds)
14:04:52*TheLemonMan joined #nim
14:06:08TheLemonManzacharycarter, I commented on that ticket before my morning coffee, the links are working fine
14:06:12TheLemonManat least they work for me
14:06:22FromGitter<zacharycarter> yeah - they are for me too
14:06:44FromGitter<zacharycarter> I was slightly confused by that fact - but figured maybe this needs to be addressed anyway? I don't know
14:07:00FromGitter<zacharycarter> I'm just trying to particpate in hacktoberfest this year
14:08:22TheLemonManAraq's gonna be pleased by the huge queue of PRs to review :)
14:09:46FromGitter<zacharycarter> hahaha
14:09:57FromGitter<zacharycarter> nothing like coming back from vacation to a mountain of review work
14:11:28FromGitter<zacharycarter> I need to find an issue that doesn't already have a pending PR / someone's fork with commits already attached haha
14:12:42TheLemonMan#8408 maybe?
14:12:45FromGitter<zacharycarter> bleh - maybe I'll just work on game engine stuff today or my website - need to work on something and stop reading hackernews haha
14:13:40FromGitter<zacharycarter> I'll look at that one and see if I think I can handle it
14:13:48FromGitter<zacharycarter> thanks!
14:13:57TheLemonManyou could also work on nimble if compiler work doesn't tickle your fancy
14:14:59FromGitter<zacharycarter> that's a good idea too!
14:15:25FromGitter<zacharycarter> I do need to learn more about the compiler and how to hack on it though - so this is a perfect opportunity for that too
14:16:36*vlad1777d_ joined #nim
14:17:06*vlad1777d quit (Ping timeout: 252 seconds)
14:18:07TheLemonManif you need help wrt the compiler feel free to ask
14:18:48FromGitter<zacharycarter> thank you!
14:22:20narimiranbtw, is dom on vacation too? last commit to devel was 3.5 days ago
14:23:21TheLemonManmaybe they're the same person
14:24:35narimiranthat would be a really nice plot-twist :D
14:25:48narimirani feel very proud: 50% of all closed issues in the last three days were because of my comments!
14:28:51mastermhey. another n00b question: I have a C function like this: some_func(char* buf, int bufsize); <- this returns a string in buf (truncated to bufsize). what is the idiomatic way to wrap this in Nim?
14:30:07FromGitter<zacharycarter> lolol @ same person comment
14:30:29FromGitter<zacharycarter> man - I was just thinking back to a conversation I had with a co-worker back in April - ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bba1884e65a63433698febd]
14:31:15TheLemonManmasterm, allocate a string of length bufsize and pass its address to buf
14:31:53leorizeconvert it to cstring then pass it to be precise
14:32:08leorizeAraq made me do that for one of my PR
14:33:38mastermTheLemonMan: should I just choose some arbitrary bufsize value that should be "large enough" and then return the resulting string? so that the wrapper function is: proc some_func_nim(): string?
14:34:02mastermleorize: arent's strings implicitly cast to cstrings?
14:34:23leorizeyea, that's the idea, not passing `addr string`
14:35:08TheLemonManmasterm, it depends, if your heuristic catches 99% of the cases go for it
14:35:26TheLemonManotherwise let the user override it and provide the bufSize themselves
14:36:09leorizemasterm: https://github.com/nim-lang/Nim/blob/269b957e2968345a4c9a5037ab97ab726135a921/lib/pure/os.nim#L1484 here's an example in stdlib for a proc like that
14:36:20FromDiscord_<smitop> How do I do malloc in Nim?
14:36:52leorizealloc()
14:37:12TheLemonMansmitop, allocShared
14:37:13mastermTheLemonMan: got it
14:37:26TheLemonManalloc/alloc0 gets you memory from the thread-local heap
14:37:46mastermleorize: so if I understand correctly in this particular example I can just pass a string to pathBuffer and it will get properly resized to bufferSize before being written to?
14:37:59TheLemonManallocShared gets you memory from the "global" heap (and is jsut a thin wrapper around malloc)
14:38:28leorizemasterm: no, a string of appropriate size must be created beforehand
14:38:37leorizesee the first line of that function
14:38:48FromDiscord_<smitop> okay, thanks
14:39:02mastermleorize: ah yes. sorry got it wrong. you're right of course.
14:41:22mastermso how do I create an empty string value that has an appropriate internal buffer capacity? is there a call like C++'s reserve()?
14:41:41TheLemonMannewString
14:42:15leorizewell it's in, uh, the first line of that example :P
14:42:57mastermoof. I need a coffee or something :D
14:43:36mastermanywa, thanks guys! :)
14:46:28*gb00s quit (Quit: The Lounge - https://thelounge.github.io)
14:47:14*Trustable joined #nim
14:51:53*lukd joined #nim
14:54:31*vlad1777d_ quit (Remote host closed the connection)
14:56:26*vlad1777d joined #nim
14:57:11voiceftpIs it safe to fetch and install random package using nimble? Nimble files are interpreted using NimScript, and there may be arbitrary (and possible malicious) code in .nimble file.
14:57:56*PMunch joined #nim
15:01:00*wildlander joined #nim
15:11:23FromGitter<tim-st> This is a nim bug? https://github.com/pragmagic/vscode-nim/issues/99#issuecomment-427658155
15:12:50FromDiscord_<smitop> \n represents a newline
15:12:58TheLemonMancompiles just fine here
15:13:28FromGitter<tim-st> The question was, why is '\n' marked in a red color?
15:13:38FromGitter<tim-st> The answer was, it comes from nim compiler
15:14:23narimiranwell, `\n` gets some underline, but it is not the same underline like when you have some error
15:15:02FromGitter<tim-st> '\n' gets the color for "something is inside '...' that is not allowed" although it is allowed
15:15:22FromGitter<tim-st> try '\t' this has a good color
15:15:40narimiranyeah, i've seen that underline in my code, but i have just ignored it
15:16:18FromGitter<tim-st> I ignored it too, I just wondered if that really comes from nim compiler?
15:16:31FromGitter<tim-st> I thought there is a grammar definition in vscode
15:17:23narimirannow i've tried to have more than one character inside of the single quotes: it is the same color/underline, but only for even number of characters
15:18:11FromGitter<tim-st> yes, there I have seen this too, so there is a bug in vscode plugin or nim compiler; the auhor says it comes from nim, so I'm wondering
15:23:40*PMunch quit (Remote host closed the connection)
15:27:28FromGitter<tim-st> Latest nim-vscode update from today supports code formatting using nimpretty :)
15:38:32FromGitter<tim-st> I thought about the following: add `r'...'` syntax to `unicode` module, so a Rune can be created like a char without always using "...".runeAt(0); would this work for char syntax too?
15:39:23leorizeafaik that syntax only work for strings
15:39:50FromGitter<tim-st> and for regex with re"" so maybe also for char
15:40:01FromGitter<tim-st> would be really cool
15:40:01*edcragg quit (Quit: ZNC - http://znc.in)
15:40:31*edcragg joined #nim
15:41:07leorizetim-st: I think you can just add a space between `r` and `'...'`
15:41:16leorizeexploit the command calling syntax ;)
15:41:57FromGitter<tim-st> no that wouldnt work, because inside '..' only 0..255 is allowed while Rune allows 0..0x10ffff
15:42:18FromGitter<tim-st> (uint8 vs int32)
15:43:05FromGitter<tim-st> so compiler change would be needed or "" intead of ''
15:55:15leorizeit will never happen
15:55:22leorizenim source it utf-8 only
15:55:35leorizes/it/is/
15:56:14leorizeso if you want to write some big char you'll still need strings
15:57:58FromDiscord_<treeform> error: "could not load: kernel32" There is no kernel32 on linux right? Its a windows thing? How did it get here?
15:58:36FromGitter<tim-st> leorize: `const c = '\256'` doesnt work
16:07:20*alexnask_ joined #nim
16:08:51*tefter quit (Read error: Connection reset by peer)
16:09:10*alexnask quit (Ping timeout: 246 seconds)
16:24:13*alexnask_ is now known as alexnask
16:30:48FromGitter<7sDream> narimiran, #9237 is the issue of CommentStmtNode we discussed, if you want follow it :)
16:34:20narimiran@7sDream thanks for the mention/link!
16:40:35*shpx quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
16:45:25*shpx joined #nim
16:50:11narimiranwhat does the pragma `extern: "nsuParseInt"` mean? where can i find that "nsuParseInt"?
16:51:51TheLemonManit's an "extern" directive, it prevents the compiler from doing its usual name mangling business
16:52:53narimiranoh, i see, thanks!
17:10:59FromDiscord_<smitop> What are the problems of using asyncnet on windows? The docs mention something with select, but don't elaborate
17:16:11*rockcavera joined #nim
17:20:31FromGitter<kayabaNerve> smitop: I've never had a problem :thinking:
17:21:23TheLemonManiirc the main one is the fixed numbers of fds it can listen on
17:21:52FromGitter<kayabaNerve> asyncnet has 4 layers. One of these layers has limited powers on Windows, so although you can talk to any layer, you can only safely talk to every layer on non-Windows platforms.
17:22:36FromGitter<kayabaNerve> Because a single layer has limited capabilities on Windows.
17:23:55*darithorn joined #nim
17:25:06FromGitter<kayabaNerve> TLM's comment may also be an issue. The issue listed in the docs is Window's lack of epoll/kqueue.
17:25:33*smitop joined #nim
17:29:49*smitop quit (Quit: Mutter: www.mutterirc.com)
17:31:28*shpx quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
17:44:52*smitop joined #nim
17:48:30*chemist69_ joined #nim
17:48:51*chemist69 quit (Ping timeout: 252 seconds)
17:49:48*smitop quit (Quit: Mutter: www.mutterirc.com)
17:53:10*RushPL quit (Ping timeout: 252 seconds)
17:54:27*RushPL joined #nim
17:58:30*alexnask_ joined #nim
18:01:16*mcc_ joined #nim
18:02:07*mcc_ quit (Client Quit)
18:02:16*mcc_ joined #nim
18:02:39*mcc_ left #nim (#nim)
18:02:42*alexnask quit (Ping timeout: 268 seconds)
18:04:31*alexnask_ quit (Ping timeout: 260 seconds)
18:07:24*endragor joined #nim
18:10:21*McSoFake joined #nim
18:12:06*endragor quit (Ping timeout: 260 seconds)
18:16:24*Tortice joined #nim
18:32:27FromGitter<kdheepak> @TheLemonMan can you take a look at https://github.com/nim-lang/Nim/pull/9191 when you get the chnace
18:33:37*abm joined #nim
18:59:03*hzx quit (Quit: Going offline, see ya! (www.adiirc.com))
19:12:38mastermis there a way to have varargs of different types? I need to wrap a C varargs function that takes string/value pairs
19:21:32*tdc joined #nim
19:22:59*a_b_m joined #nim
19:27:35*abm quit (Ping timeout: 276 seconds)
19:30:48FromGitter<zetashift> coercing varargs?
19:32:07mastermhm... it might work if I coerce by casting everything to uint
19:32:15mastermI'll try that :)
19:33:39TheLemonMankdheepak, please squash all the commits into a single one, beside that I fear you'll have to wait for Araq to pop up sometimes soon
19:35:12*a_b_m quit (Ping timeout: 252 seconds)
19:54:33*shadwick joined #nim
20:09:54*Trustable quit (Remote host closed the connection)
20:28:25*shadwick quit (Ping timeout: 256 seconds)
20:30:01*shpx joined #nim
20:43:12*nsf quit (Quit: WeeChat 2.2)
20:47:09*kungtotte quit (Remote host closed the connection)
20:47:21*shpx quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
20:47:45*flaviu joined #nim
20:48:02*TheLemonMan quit (Quit: "It's now safe to turn off your computer.")
20:51:38*McSoFake quit (Quit: Konversation terminated!)
20:56:49flaviuI've posted a long response to "Removal of nre and improvement of re" at https://github.com/nim-lang/Nim/issues/7278#issuecomment-427682084 and I'd like to have a discussion on how the Nim regular expression story could be improved, either there or more informally here
21:14:23*narimiran quit (Quit: Konversation terminated!)
21:24:11*Vladar quit (Remote host closed the connection)
21:44:42*nif quit (Ping timeout: 268 seconds)
21:50:44FromGitter<timotheecour> @flaviu I just replied tehre
21:51:17*nif joined #nim
21:51:52*wildlander quit (Quit: Konversation terminated!)
22:02:15flaviutimotheecour: I've replied in that thread. it's hard to post long responses in IRC
22:04:16flaviubut re. everything should be an iterator: that'd be nice, but I don't think nim is the place for it. the concepts of inline & closure iterators really complicate things.
22:07:05flaviuhaskell can do stuff like this because "pure" and "sufficiently smart compiler"; python can do stuff like this because performance doesn't matter and everything is a closure iterator, but for Nim, which focuses heavily on performance, this would be quite a bit harder
22:11:35FromGitter<timotheecour> it could operate on 1st match only, and use an extra index to indicate start of position at which we’re interested in matching/replacing
22:14:14FromGitter<timotheecour> actually ya, that’s something weird with nre API: we have find/findAll but somehow just replace which actually means replaceAll
22:17:46FromGitter<timotheecour> also, all these API’s (not just nre) would become a lot cleaner if/once we have string slices (I built these based on nim-range), which would avoid the need for `start` index as well as `captureBounds` vs `captures`: it’d be as efficient as can be while having a cleaner, simpler API.
22:19:53flaviutimotheecour: re. slices: agreed. I was actually thinking about exactly that while writing my response about orthogonality. The slice visited is an orthogonal concern to actually performing the operation, so it could be cleanly separated into an independent component.
22:21:27flaviuand the find/findAll/replace/replaceAll is an interesting point. I'll admit that I haven't thought about that
22:22:02flaviuhow everyone else does it is so embedded in my mind that I didn
22:22:06FromGitter<timotheecour> the funny thing is it’s not even hard to do write this sliced string; the only tricky part is all the stdlib would have to be adapted to take advantage of it (wherever string is taken) maybe a proof of concept could be done as a nimble package to showcase efficiency gains.
22:22:17flaviu't even consider the asymetry. like look at JS's find/replace
22:23:07FromGitter<timotheecour> i think replaceFirst would be an “ok” workaround.
22:23:50flaviuyup. I'd even go as far as deprecating replace & find in favor of replaceAll and findFirst
22:24:11flaviuare concepts usable in Nim? I haven't kept up recently. Could we have a string concept?
22:24:33FromGitter<timotheecour> so long u can enforce compiler error it could be ok; but I’m not sure we can enforce that
22:24:46FromGitter<timotheecour> yes
22:31:52FromGitter<timotheecour> actually string is not a keyword so one could imagine redefining `string` as a concept in some modules
22:34:33flaviuwell, string* {.magic: String.}
22:35:11*smitop joined #nim
22:36:28FromGitter<timotheecour> what I meant is it can be redefined in a module; but ya, probably best to give string concept a different name.
22:38:58FromGitter<timotheecour> a practical solution would be: ⏎ ⏎ 1) keep string as is ⏎ 2) introduce a string slice concrete type as dstring (or whatever other name) ⏎ 3) introduce a String concept equal to string|dstring ... [https://gitter.im/nim-lang/Nim?at=5bba8b02c08b8b3067ea4e2b]
22:41:18*smitop quit (Ping timeout: 264 seconds)
22:42:53flaviuhmm. I have to step away now, but yeah, that'd be cool to explore. I'll take a look at that at some point.
22:55:07*tobbez joined #nim
22:57:50FromGitter<kdheepak> @FromIRC Great!
22:58:04FromGitter<kdheepak> @TheLemonMan great!
22:59:15*rlr quit (Quit: -)
23:01:06*chemist69_ quit (Ping timeout: 264 seconds)
23:01:46*chemist69 joined #nim
23:05:09*rlr joined #nim
23:37:10*rockcavera quit (Ping timeout: 272 seconds)
23:46:58*elrood quit (Quit: Leaving)