<< 21-07-2019 >>

00:00:01*junland quit (Quit: %ZNC Disconnected%)
00:00:42*junland joined #nim
00:16:11*shomodj joined #nim
00:33:46FromGitter<Varriount> shashlick: Hm, You somehow need to turn the NimNode into a type, and feed that to sizeof()
00:48:50shashlickwell, the thing i keep struggling with is that i need to generate code for runtime - i cannot do anything in the macro itself
00:59:19*al_ joined #nim
00:59:37*al_ quit (Client Quit)
01:02:23FromGitter<awr1> @shashlick i see your neighbor's kid is a burgeoning perl programmer
01:04:38shashlickhe should have known better, this is #nim
01:04:58*theelous3 quit (Ping timeout: 272 seconds)
01:05:15shashlickwell, i should have known better too and kept my computer locked
01:09:22FromGitter<JasperJenkins> Have you tried https://nim-lang.github.io/Nim/macros.html#getSize%2CNimNode?
01:11:47FromGitter<awr1> @shashlick `typeInst = sizeof(typeName.bindSym().getTypeInst())`
01:12:01FromGitter<awr1> you may need `{.experimental: "dynamicBindSym".}` for that one
01:13:17FromGitter<awr1> or well, the thing Jasper said
01:19:48*theelous3 joined #nim
01:22:45shashlickoh nice thanks!
01:48:12FromGitter<dawkot> Is there anything like `componentDidMount` in Karax?
02:02:46leorize[m]sschwarzer: that one is unmaintained, the current one is maintained by PMunch. Your PR and issues should go there
02:02:51*aexoxea joined #nim
02:04:45leorize[m]@dawkot: it's recommend to not use karax components system
02:05:15leorize[m]setRenderer have a postRender callback that you could use
02:39:30*chimez joined #nim
02:54:21*mipri joined #nim
03:00:37*chimez quit (Quit: chimez)
03:04:07*lritter quit (Ping timeout: 244 seconds)
03:05:12*lritter joined #nim
03:11:18FromGitter<dawkot> I ended up using something like this to mimic `componentDidMount`: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5d33d7d6a0351b1a8c6db8d3]
03:13:38leorizebut why do you need that?
03:15:36leorize@dawkot: also, if you like react-style components checkout karax's VComponent
03:16:50leorizeVComponent's onAttach should do what componentDidMount do I think
03:17:27FromGitter<dawkot> @FromIRC it's useful to be able to run some code every time a modal is shown, for example
03:17:58FromGitter<dawkot> but not every time a rerender happens
03:18:17FromGitter<dawkot> if what I did works and VComponents are discouraged then I guess I'll stick to what I have :)
03:19:24leorizediscouraged because according to Araq: "it works as designed but no one understand what it does"
03:19:46leorizeif you have experience with react's component system then maybe you can use it
03:27:53*theelous3 quit (Ping timeout: 244 seconds)
03:40:07FromGitter<dawkot> `cannot use symbol of kind 'var' as a 'param'
03:40:10FromGitter<dawkot> wut
03:40:30FromGitter<dawkot> in place of `mounted`: ⏎ ⏎ ```template component(mounted = true, body): untyped =``` [https://gitter.im/nim-lang/Nim?at=5d33deaec89880134735ad4f]
03:45:14leorizefor some reason it doesn't appear on my gitter :/
03:45:29leorizeoh, guess you deleted it
03:45:34FromGitter<dawkot> I deleted it, stupid mistake
03:46:19*dddddd quit (Remote host closed the connection)
03:57:05FromGitter<dawkot> Why does invoking the overloaded version make `componentDidMount` no longer reachable via `{.inject.}`? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5d33e291f9af9a44ed626937]
03:59:07leorize`{.inject.}` injects the symbol to the current scope
03:59:53FromGitter<dawkot> The thing is, I can access it from `body` when using the first template, but not when calling the second one
04:00:00FromGitter<dawkot> Even if the `body` argument is exactly the same
04:00:04leorizeyour overloaded template probably gensym-ed those {.inject.} instead
04:00:33leorizemark the overload with {.dirty.}
04:01:21FromGitter<dawkot> didn't work
04:03:43leorizeweird, but why `block:` though?
04:03:53leorizeyou don't need that
04:04:45FromGitter<dawkot> to make componentId isolated
04:04:55FromGitter<dawkot> probably could be done another way
04:05:30FromGitter<dawkot> otherwise it would not compile because every id would have the same identitfier in the global scope
04:06:17leorizewould you like to access componentId from body?
04:06:19FromGitter<dawkot> oh, I could put the `const` into the function body
04:06:32leorizeif not just remove `{.inject.}`
04:06:49FromGitter<dawkot> I'm was using it for debugging before
04:07:15leorizeputting it in the function seems fine
04:07:27leorizeyou wouldn't need the parens though
04:07:56leorizeI'd say VComponent works much better for this
04:08:22leorizeit's integrated with karax's dom creator, so the attach event will always be correct
04:09:26FromGitter<dawkot> sure, but I would like to finish the experiment because it seems like a trivial problem
04:09:43FromGitter<dawkot> then I could compare VComponents to what I make
04:11:27FromGitter<dawkot> I changed it a little bit, but it's the same problem: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5d33e5eff9af9a44ed627eae]
04:16:00leorize@dawkot: works here though https://play.nim-lang.org/#ix=1P23
04:16:05leorizeare you on devel?
04:27:27FromGitter<dawkot> it's the same on both devel and stable (0.20.2)
04:45:47leorizedoes that snippet work?
04:48:29*chimez joined #nim
04:51:51*chimez quit (Client Quit)
05:47:31*solitudesf joined #nim
06:08:26*laaron quit (Remote host closed the connection)
06:11:28*laaron joined #nim
06:15:16skrylar[m]finished post-processing the zim file for nim's docs
06:20:54skrylar[m]also heh, saw work stealing mentioned in chat
06:21:04skrylar[m]ran in to some talks on that in the rust community
06:24:16*Summertime quit (Quit: Sunsetting.)
06:24:46*Summertime joined #nim
06:28:18skrylar[m]dhall looks neat but the syntax also kind of looks like sigil soup
06:29:44*vlad1777d joined #nim
06:41:53*vlad1777d quit (Ping timeout: 268 seconds)
06:43:10skrylar[m]will have to mess withi t
06:55:05*nsf joined #nim
07:00:00*gmpreussner quit (Quit: kthxbye)
07:04:40*gmpreussner joined #nim
07:11:17*gmpreussner quit (Ping timeout: 245 seconds)
07:14:16*absolutejam2 joined #nim
07:21:49*sagax joined #nim
07:40:18*absolutejam2 quit (Ping timeout: 248 seconds)
07:50:13*shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
08:32:50*ng0 joined #nim
08:56:13*zyklon quit (Quit: Konversation terminated!)
09:21:35*uvegbot joined #nim
09:25:02*actuallybatman quit (Ping timeout: 245 seconds)
09:26:36*nsf quit (Quit: WeeChat 2.4)
09:29:46*krux02 joined #nim
09:31:33FromDiscord_<kodkuce> "Auth.nim(110, 27) Error: undeclared identifier: 'crypto_pwhash_str'" << WTF , let hash_password = crypto_pwhash_str(inputed{"password"}.getStr, alg=phaDefault) , https://github.com/FedericoCeratto/nim-libsodium/blob/master/libsodium/sodium.nim line 760 there is crypto_pwhash_str, and ofc i did do nimble install libsodium, wierd stuff
09:32:47leorizeI don't think federico3 have released a newer libsodium version
09:33:16leorizeso you'd need to depend on `libsodium@#head`
09:33:18leorize^ nimble install that
09:35:36FromDiscord_<kodkuce> ty it worked
09:38:12leorizealso if you're using the default algorithm you don't have to specify it
09:45:20*shomodj joined #nim
09:45:40*aexoxea quit (Quit: Goodbye!)
09:46:47*hoijui joined #nim
09:47:52*aexoxea joined #nim
09:52:44FromDiscord_<kodkuce> /bin/ld: cannot find -lcrypto
09:53:01leorizedo you have openssl installed?
09:53:03FromDiscord_<kodkuce> hmm i know i solved this last time, just frogot how xD ,
09:53:35FromDiscord_<kodkuce> i have libressl i guess i did a symbolic link, just for what file is -lcrypto looking
09:54:25leorizeok, have you installed the development headers for libressl yet?
09:55:02FromDiscord_<kodkuce> or meybe its that i dont have devheaders installing now
09:55:56FromDiscord_<kodkuce> ok now it works
09:56:00FromDiscord_<kodkuce> sorry my bad
10:00:51federico3I'll make a release
10:10:05*stefanos82 joined #nim
10:16:09FromDiscord_<kodkuce> https://hastebin.com/oxewisotor.cs
10:16:48leorizeit's from jester?
10:16:57leorizeit's just a debugging hint
10:17:18leorizeyou can suppress it with --hint[Pattern]:off
10:17:30FromDiscord_<kodkuce> duno if i dont get it, or this hint just isent for my use case, can i shomhow suppress it, am just using asynchttpserver whitout jester
10:17:45FromDiscord_<kodkuce> ty
10:18:27leorizehint's are usually harmless
10:20:02FromDiscord_<kodkuce> yep i got that part, anyway will probbaly not use this hintPattern:off and just train my eys to ignore it 😃
10:21:22*Vladar joined #nim
10:23:27*hoijui quit (Ping timeout: 264 seconds)
10:24:11*absolutejam2 joined #nim
10:32:07Zevvleorize: nim.nivm go-to-def: is ctrl-] not the right key to map instead of gd?
10:33:30leorizeit's for ctags
10:33:55leorize`gd` has "better" definition in the docs :p
10:34:17Zevvgd is local, but jumps to other files
10:34:22Zevvand it breaks gd :)
10:34:33leorize:P
10:34:39Zevvimho c-] is for exteral tools doing the work - ctags, cscope, nimsuggest
10:34:56leorizeyea, but I can't just break everyone habits now :P
10:35:02Zevv:)
10:35:07federico3leorize: released! Thanks for the contributions!
10:35:09ZevvI'll remap
10:35:30leorizefederico3: np :)
10:36:04leorizeZevv: that's a little design oversight it seems
10:36:18leorizeand I do know how to implement it to follow `gd`...
10:38:53Zevvnmap <C-]> <Plug>NimGoToDefBuf
10:38:54Zevv?
10:39:10leorizeyea
10:39:32ZevvAh I though you didn't know how to do that :)
10:40:31federico3TIL https://github.com/samuelroy/coco
10:40:31leorizethere's already special cased code for that scenario :P
10:41:01leorizeZevv: I could add a NimGoToDefBufLocal if you'd like
10:41:29Zevvhm I guess the default vim should do - its just doing a generic string match I guess
10:41:50leorizecan it do style insensitivity?
10:41:54Zevvit's just that c-] is in my fingers
10:42:07Zevvand I kind of don't like plugins to do remappings for me
10:42:14Zevvbut hey, i'm not complaining :)
10:42:59leorizenp :P feel free to do a g:nim_no_map PR if that bugs you
10:43:40leorizenim.nvim is mostly designed for me, so I put whatever is convenient in
10:44:09Zevvyeah, that's how it always starts
10:44:26Zevvand then you're supporting your stuff for years. I have a few of those lingering projects I don't care for, but still support
10:46:15leorizeI'd say nim.nvim design is perfect for this
10:46:23leorizeeverything is reliant on nimsuggest
10:46:29leorizeif there's any bug, blame the compiler :P
10:48:26Zevvnope, I blame you, that's easier
10:49:17leorizethat works :p
10:49:48leorizeasyncfutures is not prepared for un-copyable objects :/
10:55:55*hoijui joined #nim
10:58:52*dddddd joined #nim
11:00:29*absolutejam2 quit (Ping timeout: 244 seconds)
11:04:02Zevvelaborate?
11:04:36leorizehttps://github.com/nim-lang/Nim/issues/11808
11:09:00leorizeZevv: do you have experience in writing vimdoc?
11:09:15leorizeI can't find any reference to them
11:09:24*shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
11:09:34ZevvI never tried, so that should be no problem
11:11:29Zevvsilently cleaning out the future might not be not the right thing to
11:18:57leorizeZevv: I can disable folding by default, but that would affect all of our current users :/
11:19:28Zevvfff baaaad excuse ;)
11:19:50leorize:P
11:25:41leorizeZevv: wontfix :)
11:25:53Zevvbwah good for you
11:25:58leorizeneovim have foldenable set to on by default, you should probably toggle that instead
11:26:08Zevvow is that it
11:26:26leorizenow that I figured that's the culprit, g:nim_fold is going out :P
11:27:11Zevvsee, I did help you here
11:27:11leorizethe illusion is caused by the fact that most language plugins don't support folding
11:27:25Zevvthe illusion is that folding is a good thing
11:27:27leorize:P
11:28:18leorizenarimiran: g:nim_fold is going out now, so `set nofoldenable` if you don't want folding instead
11:28:36ZevvI just did that, anticipating
11:44:28*absolutejam2 joined #nim
11:52:15*aexoxea quit (Ping timeout: 264 seconds)
11:54:01*aexoxea joined #nim
11:56:36Zevvleorize: was it you doing all the asciinema recordings?
11:56:42leorizeyea
11:56:52Zevvcan I make these things into animated gifs?
11:57:08leorizefeel free to, if it's possible
11:57:21Zevvno I mean, do you know how to do that :)
11:57:45leorizehttps://github.com/asciinema/asciicast2gif
11:57:55Zevvwell well
11:58:29ZevvI just plugified my vim plugins as well
11:59:01leorizethat tool I just sent is of pure evil
11:59:22Zevvyeah, I found that, but it is nasty
11:59:34Zevvnah I'll just put up some static images
12:00:19leorizeor you can record your own screen playing the asciinema and turn that into a gif
12:04:33Zevvhttps://github.com/zevv/rcdiff
12:04:37Zevvhttps://github.com/zevv/buftabs
12:10:15leorize[m]nice
12:10:43leorize[m]you should give the autocmds an augroup though
12:22:17*absolutejam2 quit (Ping timeout: 268 seconds)
12:31:44ZevvPR :)
12:33:53*SenasOzys joined #nim
12:36:59*krux02 quit (Remote host closed the connection)
12:43:31*skelett quit (Quit: WeeChat 2.4)
12:48:05*nsf joined #nim
12:54:54FromGitter<mratsim> @dom96 @coffeepots a conference in London about alternative programming language to solve problems: https://www.codemesh.io/conferences/code-mesh-ldn/
12:55:27FromGitter<mratsim> it's full of Erlang speakers :p
12:56:14Zevv"Call for talks for Code Mesh LDN closed on 10 July"
12:58:05FromGitter<mratsim> there is also next years, and other cities
12:58:11FromGitter<mratsim> always*
12:58:57*sealmove joined #nim
13:01:21sealmoveHi~ say we have a proc with a parameter that has a default value, is it possible to properly determine (in the proc body) if an argument was provided for that parameter, or can you only check if it equals the default value?
13:02:28sealmoveIf it's possible then I can improve the iterator in parseopt module.
13:03:03disruptekimpossible is a strong word, but the general answer is that it's impossible (an equally strong word).
13:03:39disrupteks/impossible/possible/ somewhere in there until it makes sense.
13:04:20sealmovethanks for the answer :)
13:05:20*lritter quit (Quit: Leaving)
13:08:29Zevvsealmove: what is the proc signature you're trying to do that with?
13:08:38FromGitter<mratsim> btw @zah are VTable still on the table?
13:11:03sealmoveZevv: iterator getopt(cmdline: seq[TaintedString] = commandLineParams(); .........
13:11:32sealmovebasically if you call it with an empty seq, then it grabs commandLineParams()
13:11:56sealmoveI think that's not intended behaviour, or at least it's unintuitive
13:13:36sealmovePassing nothing should be different than passing an empty seq, right?
13:13:40Zevvhmm I was thinking of making a little trampoline template, but these args are not easily varargsed
13:14:01Zevvsealmove: sure, that's something different
13:14:12sealmoveYeah I realized it's different than my original question
13:14:14sealmoveSorry
13:14:23Zevvnp
13:20:37ZevvI guess the default used to be nil, but that got changed when seqs were no longer allowed to be nil
13:20:42Zevvthis losing the distinction
13:21:26sealmoveI see...
13:21:58sealmovemaybe we can make a custom internal type for that?
13:23:00Zevvyou could make a very improbably default { "somerandomstring" }
13:24:01sealmoveyes I considered that
13:24:18sealmovebut who likes hacks :P
13:24:36ZevvI'd rather have a one line hack with a little comment saying what is happening
13:24:45Zevvthen adding stuff like custom types
13:25:09sealmovesimplicity vs correctness
13:25:46Zevvtrue
13:29:30*shomodj joined #nim
13:37:03*shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
13:39:22*solitudesf quit (Ping timeout: 268 seconds)
13:43:08disrupteklife would be pretty empty without hacks.
13:44:25disruptekwhat do you use when what you want is a string set?
13:45:20dom96use the sets module
13:46:17disrupteki swear i was just looking at this yesterday but i guess i didn't read it. :-P
13:46:20disruptekthanks, dom96
13:46:28*hoijui quit (Quit: Leaving)
13:51:18sealmoveis there a nice way to skip only the first loop of an iteration?
13:52:26*shomodj joined #nim
13:52:58disruptekmaybe put up a sign?
13:53:19sealmovesign? like a bool?
13:53:56disruptekno, like, "if this is your first time here, please leave and come back later"
13:54:13disruptekwait, would a bool work?
13:54:43sealmovethis works:
13:54:47sealmove var isFirstIter = true
13:54:48sealmove for kind, key, val in getopt():
13:54:50sealmove if isFirstIter:
13:54:52sealmove isFirstIter = false
13:54:54sealmove continue
13:55:34disruptekdid you even try the sign?
13:55:54sealmovewhat do you mean sign?
13:57:54disrupteki'm just messin' with you, boss, sorry. :-P
13:58:43sealmovelol, was just wondering if there was a nicer way like iter().skip(1) or something like that
13:59:20sealmovemyiter.skip(1) *
13:59:31disruptekyou can advance iterators manually, if that's what you want.
14:06:16*shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
14:08:41*aexoxea quit (Quit: Goodbye!)
14:24:36*solitudesf joined #nim
14:32:35Araqvar i = 0
14:32:45Araqfor x in iter():
14:32:53Araq if i == 0: continue
14:32:55Araq body
14:32:58Araq inc i
14:33:04Araqthere is no better way
14:33:08dom96Araq, hey, I just remembered, you need to export your twitch streams
14:33:16dom96otherwise they'll be gone by the time you're back from holidays
14:33:35Araqok... that's going to be tough
14:33:42dom96Why?
14:33:47Araqthe wifi here is hardly usable
14:33:54dom96It's just a couple of clicks
14:34:00Araqok
14:42:19shashlickHey Araq - I was trying to write the shared deep copy we discussed but am wondering what's the point
14:42:31Araqlol
14:42:59shashlickAny operation on that object (if cast into one) would introduce gc memory again
14:43:00Araqthe point is that you like 0.19 and --newruntime is useful in 0.20 and stable(ish) in 0.21
14:44:13shashlickFurther, when I getTypeImpl, if I run into a ptr or ref object, the ast doesn't recurse into it
14:44:25shashlickSo I don't have enough detail to do anything
14:44:28Araqthat's a feature...
14:44:49Araqyou need to call getType again, the VM cannot give you an infinite tree that is not lazy...
14:45:16shashlickDo I call it on the refty or sym
14:46:11shashlickI am calling getTypeImpl recursively but don't see anything there
14:52:03lqdev[m]I know this is pedantry beyond what anyone can imagine, but choosenim pretends to show download progress in millibits (`mb`, a unit which does not exist) and not megabytes (`MB`)
14:52:19AraqI don't know, check the examples, shashlick
14:52:35Araqyay 1024 bytes/s
14:52:49Araqif that's not download speed then I don't know what is :P
15:05:50Araqmratsim: https://github.com/nim-lang/Nim/issues/11797 has NOTHING to do with 'generics'
15:05:56AraqI know it's your favourite label
15:06:02Araqbut it doesn't apply.
15:07:01stefanos82lovely, like the good ol' dialup days; it brings back so many memories ;(
15:08:53*shomodj joined #nim
15:09:31*shomodj quit (Client Quit)
15:09:32*nsf quit (Quit: WeeChat 2.4)
15:09:51*nsf joined #nim
15:10:33*shomodj joined #nim
15:24:37*SenasOzys quit (Ping timeout: 245 seconds)
15:26:17FromGitter<mratsim> I don't know, there was a seq and a generic part
15:27:58disruptekholiday, araq. :-P
15:30:45*chimez joined #nim
15:32:33*solitudesf quit (Ping timeout: 245 seconds)
15:42:27*theelous3 joined #nim
15:43:22*chimez quit (Ping timeout: 245 seconds)
15:46:11*solitudesf joined #nim
15:54:29dom96oooh, we *need* this for Nim https://help.github.com/en/articles/navigating-code-on-github
15:55:36stefanos82they even wrote an article why they chose Haskell to implement semantic project
15:55:52stefanos82I thought it was supposed to be a flag you turn on within your project(s)
15:56:01stefanos82I still have no idea to use it
15:56:11stefanos82*how to
15:57:37*shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
16:05:34*sealmove quit (Quit: WeeChat 2.5)
16:31:36disruptekwhy do we keep making multicore architectures if our talent for exploiting them is so underdeveloped?
16:33:58leorizebecause we can develop that part?
16:34:18leorizeand even while underdeveloped it's already proven itself to be worth it
16:34:29disruptekyeah, i was joking. ;-)
16:34:34FromGitter<Varriount> Because it's easier for hardware manufacturers to improve performance via multiple cores, than it is to make more performance cores
16:35:00disruptekit's just, sometimes, you have to look at all the bs you're wading through and wonder who put it there. :-D
16:35:24*nsf quit (Quit: WeeChat 2.4)
16:36:53disrupteki'm finally readin' this D-borrowing article and rehashing the problem domain over and over just gets tiresome.
16:41:40FromDiscord_<kodkuce> https://hastebin.com/opajahadic.bash
16:41:55FromDiscord_<kodkuce> hmm duno if i am doing something dumb again or what
16:43:27disruptekit looks like you're shadowing pid with a json(?) node's getInt()
16:43:30lqdev[m]you're converting the resulting int to a string using the `$` operator
16:44:15disruptekoh, that's from a separate piece of code?
16:44:17*solitudesf quit (Remote host closed the connection)
16:45:17disruptekyeah, remove the $s and also call claims["role"].node.getStr instead of accessing the str value directly.
16:46:10FromDiscord_<kodkuce> oh my bad , ty
16:50:09*solitudesf joined #nim
16:54:22*actuallybatman joined #nim
16:56:48disruptekyay, i found a use for npeg, Zevv. <3
16:57:26Zevvsweet, tell me about it
16:58:17disrupteki need to parse "path templates" eg. /foo/bar/{variable}/bif/{baz} and then perform substitutions for those variables. :-)
16:58:33Zevvthat's a pretty nice fit I guess, good for you :)
16:58:42Zevvbetter then parsing YAML surely
16:59:21disruptekit's in the yaml, but yaml->json isn't a primary goal of this tool, so meh.
16:59:43disruptekdid you look at the pegex to see if it could clear up the ambiguities of yaml for you?
16:59:58Zevvit isnt complete, it's only doing a subset
17:00:11disruptekah, that's disappointing.
17:00:23Zevv(my guess, that is, as it is way to small compared to the spec)
17:00:43disruptekthe author is the author of yaml, isn't he?
17:00:55Zevvoh, than I'm surely mistaking :)
17:01:49disruptekiirc, he wrote the firt yaml parser in perl and then wrote a pegex that he preferred to the original impl. but, i could be all wet on this.
17:02:52Zevvwell, actually, I dropped out when I saw this line in his parser: ".rgx" : "(\\|\\r?\\nXXX|\\>\\r?\\nXXX|\"[^\"]*\"|'[^']*'|(?![&\\*\\#\\{\\}\\[\\]%`\\@]).+?(?=:\\s|\\r?\\n|\\z)):(?:\\ +|\\ *(?=\\r?\\n))"
17:03:04disruptekbadass.
17:03:24disrupteki mean, why wouldn't you want that?
17:03:50Zevvsurely you're joking mr disruptek
17:03:56disrupteklol
17:04:15FromGitter<kayabaNerve> Genius or insanity?
17:04:45disruptekwhat i will never understand is that THAT intermediate description is what we actually pass around and handle as a string -- as if it was somehow less prickly thusly.
17:04:55disruptek^why THAT, i should say
17:05:45Zevvlets put a regex in my PEG, that will make things much better
17:07:42Zevvbut then again: that yaml.pgx.json thing seems to be missing stuff. What is 'block_indent', it's not part of the PEG
17:08:25disruptekit's far easier to read in yaml.pgx.yaml :-D
17:08:51disruptektoo bad he didn't write any comments. 🙄
17:08:59Zevvhaha :)
17:20:20*carkh joined #nim
17:23:29disrupteknpeg works in js, right?
17:26:29carkhhi, i haven't touched a "compile to native" language for like 15 years... my goal is to make a windows specific program that parses the full command line, not your regular extract args, i need the full thing... So i'm starting from getCommandLineW in winlean and it's returning WideCString. Do I need to take special care of this return value ? allocate memory, or free it afterwards ?
17:27:13*actuallybatman quit (Ping timeout: 246 seconds)
17:27:23Araqcheck the Win API documentation from MS
17:27:31carkhok
17:27:57*absolutejam2 joined #nim
17:33:08FromGitter<awr1> MSDN is not specific on that so I'm guessing it's just preallocated at program init
17:33:12carkhthey don't say anything, i guess the string already exists and should be left alone
17:33:38FromGitter<awr1> my guess: don't free it, copy it/nim-stringify it "if you want to"
17:33:53carkhthanks
17:33:56FromGitter<zacharycarter> (https://files.gitter.im/nim-lang/Nim/0R3A/terrain.png)
17:34:00FromGitter<zacharycarter> heyyyyyy got terrain rendering
17:34:26FromGitter<awr1> 👍
17:34:39FromGitter<awr1> using bgfx?
17:34:54FromGitter<zacharycarter> yup
17:35:57FromGitter<awr1> you should take a look at this if you're trying to do terrain rendering
17:35:58FromGitter<awr1> https://victorbush.com/2015/01/tessellated-terrain/
17:36:36FromGitter<zacharycarter> I'm making an old-school rts so I'm aiming for flat shaded tiled terrain
17:36:44FromGitter<awr1> which may or may not be appropiate for w/e you're doing
17:36:47FromGitter<awr1> ah ok
17:37:34FromGitter<zacharycarter> I think there's about to be a tessellated terrain demo for bgfx though
17:37:41FromGitter<zacharycarter> a guy was posting screenshots for it in the bgfx gitter the other day
17:40:02*absolutejam2 quit (Ping timeout: 245 seconds)
17:50:05FromDiscord_<kodkuce> https://hatebin.com/ponqgefdpq do i need some kind of locks for this, am confused little about threadvars
17:55:31Zevvdisruptek: yes, it does, 'nimble test' runs the tests on node
17:55:42disruptekbrilliant, thanks. :-)
17:56:10*elrood joined #nim
17:56:34Zevvzacharycarter: what's your end goal for this project?
17:57:16FromGitter<zacharycarter> Zevv: a 3d rts of some sort
17:57:24Zevv"of some sort" :)
17:57:40FromGitter<zacharycarter> well - I plan on collaborating with a game designer from work on it
17:57:52Calinouread your Discord notifications already :P
17:57:53*Calinou hides
17:58:20FromGitter<zacharycarter> but I mean, for the most part, I know what features the game needs to support
17:58:47Zevvjust wondering, but I though noone makes games from scratch these days
17:58:50*actuallybatman joined #nim
17:59:15disruptekhandmadehero.org
17:59:15FromGitter<zacharycarter> Calinou: who are you referring to?
17:59:21CalinouI mean, on your screenshot
17:59:24FromGitter<zacharycarter> IMO using a pre-made engine is boring
17:59:26FromGitter<zacharycarter> oh haha
17:59:30FromGitter<zacharycarter> :P
17:59:45Zevvzacharycarter: sure, doing it yourself is much more fun
17:59:52Zevvdo you have prior GL experience?
18:00:10FromGitter<zacharycarter> yeah, I've been through a few graphics programming rodeos
18:00:20Zevvcool
18:00:25FromGitter<zacharycarter> I've also used bgfx before but never delved much into 3d with it - mostly 2d
18:00:41FromGitter<zacharycarter> but I mean - it's not that different from opengl / directx - just need to figure out how to translate API call from A to B
18:02:05ZevvMy only experiance is ancient OpenGL1.0 and modern GLES, but I have no clue how that compares to metal or direct3D
18:02:24ZevvI need to get started with vulkan on the short term, so that's something new for me
18:02:27FromGitter<zacharycarter> that's why using bgfx is nice :)
18:02:45FromGitter<zacharycarter> I'm not too keen on jumping into vulkan
18:03:04FromGitter<zacharycarter> but if you want to play with the bleeding edge - it's fine I guess
18:03:19FromGitter<zacharycarter> Calinou: they're most likely all people complaining about the soft launch of our game at work :P
18:04:15FromGitter<Varriount> @zacharycarter @zevv My shell is back up to 80% of it's original functionality. :D
18:04:28FromGitter<zacharycarter> O.o
18:04:39FromGitter<Varriount> It has pipes!
18:04:40FromGitter<zacharycarter> nice!
18:04:42Zevv\o/
18:04:45FromGitter<zacharycarter> \o/
18:04:48Zevvurl?
18:05:39*shomodj joined #nim
18:05:53FromGitter<Varriount> https://github.com/Varriount/commandant
18:06:22FromGitter<Varriount> No nimble file - you'll need Zevv's awesome npeg library if you want to compile it
18:07:09ZevvI'll rename it to nlex :)
18:07:48FromGitter<Varriount> :P
18:08:18ZevvVarriount: should it run with nim devel?
18:08:25*ikan-keli_ quit (Quit: ZNC 1.8.x-git-125-e415d9f5 - https://znc.in)
18:08:48FromGitter<Varriount> Yes
18:09:02Zevvok, I'll give it a spin
18:09:12*ikan-keli_ joined #nim
18:10:10*Amun_Ra quit (Ping timeout: 248 seconds)
18:10:19Zevvah wait, you're relying npegs capture-data branch, right?
18:10:34FromGitter<Varriount> Hm, am I?
18:10:58FromGitter<Varriount> Ah, yes, I am.
18:11:06FromGitter<Varriount> I use it for line/position information
18:11:08ZevvOk, I never merged that :)
18:11:25Zevvlet me look into that. I just released 0.12 last week to fix araqs breakage, but that doesnt matter
18:11:50FromGitter<Varriount> Zevv: After this shell project is over, I'd like to look into making improvements to npeg
18:11:58Zevvhooray!
18:13:13*CookieCutter joined #nim
18:13:18*shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:13:26*CookieCutter is now known as dgreen
18:13:48dgreenIs @mratsim around?
18:13:56FromGitter<mratsim> yes
18:14:13dgreenI've got a question about SGD with momentum, if you have a second
18:14:49FromGitter<mratsim> no problem
18:15:35dgreenI've implemented both nesterov momentum and the learning rate decay factor
18:15:48dgreenThe pytorch implementation however has a "dampening" factor (see: https://github.com/pytorch/pytorch/blob/5911cb8e5cdc24218f57480b6647d37d86e77620/torch/optim/sgd.py#L51-L52)
18:16:14dgreenI'm honestly not sure what it does, and I haven't been able to find any reference to it in the original SGD paper nor the one that introduced momentum nor the Nesterov paper
18:16:21*Amun_Ra joined #nim
18:16:21dgreenDo you want me to figure it out and implement it as well?
18:16:47*Hinkarn joined #nim
18:17:22dgreenAlso as a side note, where, if anywhere, do you want me to write tests for SGDMomentum/SGD with Nestrov?
18:18:50*absolutejam2 joined #nim
18:19:48FromGitter<mratsim> dampening is probably legacy from the old Torch codebase: https://github.com/pytorch/pytorch/issues/6
18:19:57FromGitter<mratsim> issue 6 on PyTorch, :p
18:20:45*Hinkarn quit (Remote host closed the connection)
18:20:52dgreenOh yeah I found this issue while looking it up, they just set the default to 0 and never really explain why. But since it seems to be legacy I think I can ignore it?
18:21:03FromGitter<mratsim> yes
18:21:12FromGitter<mratsim> for the tests you can put them here: https://github.com/mratsim/Arraymancer/tree/master/tests/nn
18:21:47ZevvVarriount: in that branch the injected capture[] type changed from string to object, so that is an API change. I do think it is for the good so I'll just merge, assuming that noone is actually using capture[n] instead of $n. Should I add an `$` to give a bit of backwards compatibilty?
18:21:47FromGitter<mratsim> I've only added the rosenbrock function, to compare the results with PyTorch implementation but never went to implement an optimizer test
18:22:07FromGitter<mratsim> Adam fails spectacularly on rosenbrock for both PyTorch and Arraymancer :p
18:22:22dgreenAlright, do you want me to write a test_optimizers.nim in that file?
18:22:33dgreenOh brilliant, I wonder why it's so spectacularly bad lol
18:22:40FromGitter<mratsim> sounds good
18:23:00FromGitter<mratsim> the acceleration/momentum makes Adam miss the very narrow optimized valley
18:23:12dgreenAh that makes sense actually
18:23:23dgreenWell hopefully my impl of SGDMomentum doesn't do the same...
18:23:24FromGitter<Varriount> Zevv: Perhaps not yet? Unless someone files an issue.
18:23:37FromGitter<Varriount> Would I need to change my code?
18:23:59Zevvno, you're the only one not having to change his code, this is just for you :)
18:24:18FromGitter<mratsim> it's fine, it's an easy way to compare with PyTorch, I don't think I have the full testing code though, it's laying around on my laptop
18:24:59FromGitter<mratsim> see here: https://github.com/pytorch/pytorch/blob/a4b2f3e21316461598fbebfdeb97259d2bbf29fa/test/optim/test.py
18:25:45dgreenPerfect thanks. Worst case I can write some new pytorch code, I'm pretty well versed in pytorch
18:28:25dgreenOr at least, I like to think I am
18:29:42ZevvVarriount: it is now in 0.13.0, let me know if this works for you
18:30:27FromGitter<Varriount> @Zevv: Yep, it works
18:30:28Zevvmratsim: so, what did you learn today with your 300 lines of resources?
18:30:45Zevvvarriount: sweet. I doubt anyone else used capture[], so this should be fine
18:30:47FromGitter<mratsim> That I don't have enough time :P
18:31:43FromGitter<mratsim> I'm back to do some optimized convolution since there was some changes in Nim OpenMP that was blocking me, and it should be pretty quick. THen I'm back to working on my compiler.
18:32:12Zevvmratsim: right. Time!
18:32:15FromGitter<mratsim> I did find an excellent paper on channel-based workstealing that would probably fit with Nim model.
18:33:46ZevvI'm a bit ambivalent about this stuff. The past has taught me that I'm far not smart enough to do these kind of things and I better shy away from it. but I do find it intriging and interesting.
18:33:49FromGitter<mratsim> Might be interesting for @Araq and @yglukhov, https://epub.uni-bayreuth.de/2990/1/main_final.pdf maybe if I find some time I'll try to implement part of it. It comes with lots of details
18:34:29FromGitter<mratsim> look page 45 and don't tell me it's too hard :P
18:34:50*shomodj joined #nim
18:35:12FromGitter<Varriount> @mratsim I've said it before, and I'll say it again: You're a wonder
18:35:18FromGitter<mratsim> also the only way to have a better brain (or muscles) is to use and exercise them
18:35:21Zevvwhich page 45, the pdf 45 or the pagenr 45
18:35:29FromGitter<mratsim> of the pdf
18:36:10FromGitter<mratsim> (https://files.gitter.im/nim-lang/Nim/iAoU/DeepinScreenshot_select-area_20190721203543.png)
18:36:12FromGitter<mratsim> thanks @Varriount :)
18:38:17Zevvwell it looks easier then the YAML spec, that is for sure
18:42:02disruptekZevv: when i capture in npeg, do i need to create a block to issue side-effects of the capture (against, eg. $[0-9]) or will captures always pass through to the MatchResult.captures()?
18:42:23*Cthalupa quit (Ping timeout: 244 seconds)
18:42:51Zevvcaptures in code blocks are eaten and do not end up in .captures()
18:43:48*absolutejam2 quit (Ping timeout: 245 seconds)
18:44:05disruptekah, thanks.
18:44:08Zevvinternally there's a capture stack, and doing a code block capture rewinds the stack up the the last closed capture
18:48:07dgreen@mratsim is there anything in particular in want in the documentation for the optimizers?
18:50:18FromGitter<mratsim> no, didn't think about it at the moment :)
18:50:20disruptekZevv: i think Print isn't working for me; i'm expecting it to match any printable character, including whitespace.
18:50:38dgreenOk :)
18:53:27Zevvonly space (32), not other whitespace (\t,\r,\n)
18:53:39Zevv"Print": {'\x21'..'\x7e',' '},
18:54:09ZevvNot sure if that makes sense, but I didn't make these up, these are the posix character classes :)
18:54:52disrupteki get it, but i don't even think i have spaces in here. it doesn't seem to match on '/' or '.' and i feel it should.
18:55:24Zevv-d:npegTrace is your friend
18:55:38Zevvalthough the output is a bit overkill sometimes
18:55:57Zevv@mratsim: excellent paper with a lot of background info, thanks for that
18:58:01FromGitter<deech> What happened to `quote` in `macro`?
19:06:15disruptekZevv: it's working fine; i was missing a negative match. great stuff!
19:07:47Zevvgood
19:10:56FromGitter<Varriount> disruptek: Whatcha working on?
19:11:15disruptekopenapi codegen
19:13:00FromGitter<Varriount> disruptek: ooh, nice
19:13:21FromGitter<Varriount> disruptek: Are you going to use npeg for tokenization only, or for both tokenization and AST building?
19:13:41disruptekhow do i use it for ast building?
19:16:15FromGitter<Varriount> disruptek: You would add the logic for building the AST with the tokenization/capture logic
19:16:50FromGitter<Varriount> It's possible (and possibly more efficient), but harder to implement
19:17:21FromGitter<Varriount> Zevv: Were you able to build the shell?
19:17:22FromGitter<deech> hrm, forgot to `import macros`.
19:17:42disruptekprobably not, because i think i need broader perspective. unless you mean parsing more broadly. but, we consume json at the moment, so i'm only planning to use npeg to omit a reliance on a regexp lib.
19:18:40ZevvVarriount: yeah, not problem. I played a bit with it, but it died when I typed 'help' :)
19:18:43disruptekhttps://github.com/disruptek/openapi -- added some links.
19:19:03FromGitter<Varriount> Zevv: oh, yeah. I haven't re-enabled builtins yet
19:19:21FromGitter<Varriount> And everything is on "one wrong move and you die" mode
19:20:27disrupteki'm in that mode all the time.
19:20:30Zevvabout the AST building: I'm looking for ways to make that easier. State is part of the problem (not possible to pass state through a parser), and I feel I need hooks for pre/post matches, but I can't get my finger on it yet.
19:20:57FromGitter<Varriount> Zevv: Nah, its fine
19:21:21Zevvnot quite
19:21:29FromGitter<Varriount> Zevv: To be honest, I feel like AST building is easier when done manually.
19:22:01Zevvyeah, but everytime I try to, I feel I'm doing too much of the same work over and over again
19:22:09Zevvwhich is usually a hint something is amiss there
19:22:43FromGitter<Varriount> Yeah, but for AST building, you need some way to (not only) transform the tokens into a tree structure, but also a way to add extra information onto those nodes
19:23:07Zevvand to pass them up to the call tree instead of stashing them somewhere and finding them later.
19:23:14FromGitter<Varriount> Yeah
19:23:52Zevvthat's much easier in lpeg, due to the duck typing.
19:24:04FromGitter<Varriount> If there is one, perhaps the solution is not to bundle tokenization and AST building together, but to just make AST building easier?
19:24:40FromGitter<Varriount> For example, one DSL for tokenization, and one for node building
19:25:08Zevvyeah but for efficiency you really want to do that in the same pass, not storing the whole world somewhere and later doing the transformation to the AST
19:26:08FromGitter<Varriount> Yeah, but tokenization can be done in a streaming fashion, so that part isn't really "storing the whole world"
19:26:24Zevvhmm true.
19:35:53FromGitter<awr1> @dom96 RE: the semantic thing https://github.com/github/semantic/issues/132
19:36:22FromGitter<awr1> in an "ideal world" supposedly nimsuggest could be retooled to be compatible with some API that github uses for this jumping to code thing
19:36:34FromGitter<awr1> but it seems from this that they don't really want to allow external tools
19:36:41*krux02 joined #nim
19:40:10FromGitter<awr1> so if anyone wants to write a nim parser for tree-sitter...
19:47:05*absolutejam2 joined #nim
19:49:30*PMunch joined #nim
19:55:51FromGitter<zacharycarter> if there's a `const` defined in a nimble module I'm using - can I override its assigned value by `-d:key=value` or just re-declare it or something?
19:58:02Zevvnot without .intdefine., afaik
19:58:06Zevvor similar
20:00:40FromGitter<zacharycarter> hmm - okay - I guess it's not a big deal since I forked the original code anyway
20:01:07FromGitter<zacharycarter> I need to make other changes / additions as well so whatever, I don't really care too much if I have my own version of nim-glm
20:02:17disruptekis this what people call `defensive programming`? because it's annoying.
20:03:03FromGitter<zacharycarter> what's that?
20:03:18*clyybber joined #nim
20:06:03disruptekprogramming style designed not to permit bugs, which often has a side-effect of not permitting enhancements.
20:06:46FromGitter<zacharycarter> I think instead of declaring the flag as a const it should have been `when defined()`
20:06:56FromGitter<zacharycarter> but instead it's a const and I don't see a way to change it :/
20:07:26FromGitter<zacharycarter> https://github.com/stavenko/nim-glm/blob/master/glm/globals.nim#L1
20:07:41FromGitter<zacharycarter> but this is also a pretty old module - I've used this module in several projects since I started w/ Nim really
20:08:00FromGitter<zacharycarter> but using it w/ bgfx - I require a left handed coordinate system
20:08:15FromGitter<zacharycarter> but I also need to handle homogeneous native device coordinates - so I'll need to make other changes to the library as well
20:08:19FromGitter<zacharycarter> which others probably won't need
20:09:05Zevv@Varriount: still here?
20:23:01FromDiscord_<kodkuce> https://hatebin.com/ponqgefdpq do i need some kind of locks for this, am confused little about threadvars , Reposing with hope 😃
20:33:07FromDiscord_<kodkuce> so threadvar, is variable in local thread, right?
20:33:47FromDiscord_<kodkuce> i am guessing this is something simple, but duno in my head its easyer to understend shared memory with locks then this
20:37:29*disruptek left #nim (#nim)
20:39:13*disruptek joined #nim
20:43:47*snuffdtek quit (Remote host closed the connection)
20:46:44*mipri quit (Quit: Lost terminal)
20:56:03FromDiscord_<kodkuce> where are magick helpers when you need them
20:56:34*Vladar quit (Remote host closed the connection)
20:58:40PMunchDamn it, tried to run a regular update of the playground server, and now it's down..
21:04:02PMunchHmm, the problem seems to be with docker..
21:10:12FromDiscord_<kodkuce> anyone sees my msgs 😃
21:10:26PMunchI see your messages kodkuce
21:11:14FromDiscord_<kodkuce> 😃
21:11:24lqdev[m]kodkuce: anyone's happy to respond as long as they know the solution
21:11:42PMunchWell what are you wondering about?
21:11:47PMunchthreadvars?
21:14:06*krux02 quit (Remote host closed the connection)
21:14:16FromDiscord_<kodkuce> yes
21:14:38FromDiscord_<kodkuce> so my guess this async dispatch is using threads so it can handle more requests
21:15:17FromDiscord_<kodkuce> and now i have a threadvar seq where i store playerid and itsconnection
21:16:51FromDiscord_<kodkuce> so example i can then process requests, example p1 wants to send msg to p2 , it goes to that list checks where is p2 and sends msg to its connection
21:17:09*dgreen quit (Remote host closed the connection)
21:17:35PMunchAh, you seem to maybe misunderstand a couple of things
21:18:05PMunchAsync doesn't use threads, and threadvar is used to create thread local variables, not global variables
21:18:45FromDiscord_<kodkuce> but my issue is if that all heppeing in across threads wouldet example 1 player disconnection, while other player sending msg to him result with a crash cuz he dosent exist
21:19:54*gmpreussner joined #nim
21:20:37FromDiscord_<kodkuce> "Async doesn't use threads"- Oh "threadvar is used to create thread local variables, not global variables" -hmm then why i am using threadvar if its all running under same thread, cant i just use global var?
21:21:02PMunchOkay, playground is back up now
21:21:28PMunchYes you can
21:22:11PMunchI don't know why you're using threadvar..
21:22:20FromGitter<awr1> @zacharycarter if your build script is in nimscript
21:22:21FromGitter<awr1> https://nim-lang.org/docs/nimscript.html#patchFile%2Cstring%2Cstring%2Cstring
21:22:39FromGitter<awr1> maybe? and then patch `GLM_LEFT_HAND`
21:22:43FromDiscord_<kodkuce> duno i think last time when i was asking , i think dom told me to use threadvar cuz threads
21:25:00FromDiscord_<kodkuce> np will try revrite all whiout threads
21:25:07FromDiscord_<kodkuce> *threadvars
21:25:25PMunchOh well, I'm off to bed
21:25:32*PMunch quit (Remote host closed the connection)
21:25:59FromDiscord_<kodkuce> good night
21:33:52*clyybber quit (Quit: WeeChat 2.5)
21:46:33*solitudesf quit (Ping timeout: 258 seconds)
21:47:21Zevv@varriount: I think I know how to effectively support AST building and better recursive handling of matches.
21:48:37ZevvParsers can be made instantiated with a generic type T, that propagates through the PEG code block captures. A code block consumes its closed captures and then returns a value of type T. This value/result is then placed back onto the capture stack, and is later available for code block captures down the stack.
21:49:00ZevvSo a code block gets either string captures found in the subject, or value captures which were already processed up the tree.
21:50:01ZevvI'll drop a proof of concept one of these days
21:50:03Zevvfirst Zzzz
22:00:23*Jesin joined #nim
22:27:05*shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
22:27:39*shomodj joined #nim
22:27:54*shomodj quit (Client Quit)
22:41:25*shomodj joined #nim
22:59:52*elrood quit (Remote host closed the connection)
23:23:32*absolutejam2 quit (Ping timeout: 258 seconds)
23:32:31*Cthalupa joined #nim
23:32:38*arecaceae quit (Remote host closed the connection)
23:32:57*arecaceae joined #nim
23:33:20FromGitter<Varriount> Zzzzev 😴:P
23:42:26*ng0 quit (Quit: Alexa, when is the end of world?)
23:48:07FromGitter<brentp> anyone have a float16 module for nim?