<< 18-10-2019 >>

00:20:16*krux02 joined #nim
00:27:13*xace quit (Quit: leaving)
00:32:49*xace joined #nim
00:48:56*Hideki_ quit (Ping timeout: 240 seconds)
00:50:09*krux02 quit (Remote host closed the connection)
02:26:29FromGitter<xmonader> ```code paste, see link``` ⏎ ⏎ anyone faced that before? sounds like new thing [https://gitter.im/nim-lang/Nim?at=5da922d5894dee56e5616925]
02:26:50disrupteksometimes i wish i could read gitter.
02:27:58leorizesounds like a bug to me
02:28:00FromGitter<xmonader> i think maybe the problem that i'm trying to use join on seq[string] instead of on openArray[string] ?
02:28:23leorizehow can an operator for `string` matches `seq[string]`
02:28:38leorizecan you try to switch to devel and see if it works?
02:29:17FromGitter<xmonader> but the thing is i don't think it's an operator for string it should be operator for bodyLines which should be seq[string]
02:31:24FromGitter<xmonader> ```code paste, see link``` ⏎ ⏎ now more weird things not sure why my installatin see httpclient from nim 0.19 [https://gitter.im/nim-lang/Nim?at=5da923fcdbf67667347bcbbf]
02:31:48disruptekbecause choosenim.
02:33:14FromGitter<xmonader> @disruptek? How I just installed choosenim 4 days ago https://github.com/dom96/choosenim/issues/142
02:33:55disrupteki never have these issues. also, i never use choosenim.
02:34:24FromGitter<xmonader> is there another alternative or just manual compilation with some makefiles?
02:34:47disruptekyou mean `sh build_all.sh`?
02:35:18disruptekit takes <9s for me to build nim.
02:35:46FromGitter<xmonader> ah i confused choosenim and nimble all together my bad
02:36:02shashlickchoosenim works great for me
02:38:16disrupteki guess you could have a converter at play.
02:40:02*nif quit (Quit: ...)
02:40:13*nif_ joined #nim
02:42:40disruptekreproduced it with a converter.
02:43:45disruptekconverters are dangerous.
02:44:19disrupteki used them in the beginning, now, not so much.
02:45:36disruptekhttps://play.nim-lang.org/#ix=1Z26
02:46:33FromGitter<xmonader> pfff @disruptek thank you so much
02:46:40FromGitter<xmonader> i know where is the problem, it's in jester.
02:47:42leorizewhy would jester export a converter?
02:48:05FromGitter<xmonader> it's not exported i'm trying somethings internally in there
02:52:25disruptekfor Araq's birthday next year, i think we should all read the manual.
02:54:19*laaron- joined #nim
02:54:41FromGitter<xmonader> I'm limiting myself to a small subset of nim already can't do the manaul
02:55:22*laaron- quit (Client Quit)
02:55:38disruptekrelax, i don't think his birthday is for many months.
02:56:00*laaron- joined #nim
02:56:31FromGitter<xmonader> hahahahaha, I wrote a book and didn't manage to complete the manual :D
02:58:08*laaron- quit (Client Quit)
02:58:50*laaron- joined #nim
03:05:09jkenlmariscal, I got imgui loading the shared object using the c backend!
03:05:54disruptekjken: congrats; what was the issue?!
03:06:31jkenhttps://github.com/nimgl/imgui/blob/master/src/imgui.nim#L36
03:06:45jkenThat line needs to be changed to use "libcimgui.so" and not "cimgui.so"
03:07:21jkenI compiled cimgui.so, and dropped it in /usr/lib, but I had to rename it to "libcimgui.so" for ldd to see it
03:07:29disruptekomg of course.
03:07:45jkenI still don't see lbcimgui.so in the output of `ldd ./myBinary`
03:07:47jkenbut it works
03:07:54disruptekhow did it ever create the binary, though?
03:08:04jkenstill a valid question.
03:08:07disruptekthat's nuts, congrats.
03:10:35jkenI am guessing I don't see it in ldd because its loaded dynamically at runtime and not linked at compile time? but I have no idea how
03:11:51disruptekyou have libdl.so in your `ldd` output?
03:12:02jkenYes, I do.
03:12:15jkenLet me guess, "dynamic load"?
03:12:42disruptekyeah.
03:14:01*laaron- quit (Quit: ZNC 1.7.4 - https://znc.in)
03:14:25*laaron- joined #nim
03:18:26leorizenim dynlib basically uses dlopen :P
03:18:42leorizebecause Araq don't want people to install development packages
03:21:40disruptekah, you can only have one setter regardless of signature.
03:21:51disrupteki knew there would be some kinda gotcha that would kill setters for me.
03:22:18leorizesounds like a bug tbh
03:22:18disruptekbad enough that they behave different, albeit as documented, outside the module in which they are defined.
03:22:29*laaron- quit (Quit: ZNC 1.7.4 - https://znc.in)
03:23:02*laaron- joined #nim
03:23:24leorizeif you want to have setters working in the defined module, change the field name in object declaration
03:23:52disrupteki don't want to have to guess at the semantics.
03:24:14disrupteki know that's absolutely bananas of me.
03:25:11*chemist69 quit (Ping timeout: 276 seconds)
03:26:31leorizeiirc the only reason it behaves like so is because that's the best way to make sure that `something=` setter won't recurse forever because it's setting a field of the same name
03:26:48leorizethe other ways just make you guess more
03:27:00*chemist69 joined #nim
03:40:25FromGitter<xmonader> i think i found a bug ⏎ https://play.nim-lang.org/#ix=1Z2j
03:52:59FromDiscord<demotomohiro> I think it is not a bug
03:53:00FromDiscord<demotomohiro> https://nim-lang.org/docs/manual.html#types-procedural-type
03:55:07FromDiscord<demotomohiro> calling convention of `myproc` is closure but calling convention of `proc1` and `proc2` is nimcall.
03:57:48FromGitter<xmonader> @demotomohiro not following, I added {.closure.} pragma and it doesn't work still?
04:01:59*theelous3 quit (Ping timeout: 265 seconds)
04:02:37FromDiscord<demotomohiro> @xmonader I added {.closure.} pragma to `proc1` and `proc2` to your code, then it worked.
04:03:32FromGitter<xmonader> ah wait i need to added to the procs themselves not to the the `type` ?
04:03:40FromDiscord<demotomohiro> Or adding {.nimcall.} pragma to `myproc` work
04:04:24FromGitter<xmonader> i really need to read a bit on that
04:04:29FromGitter<xmonader> what if i want to have named functions?
04:06:11FromDiscord<demotomohiro> According to this:
04:06:12FromDiscord<demotomohiro> https://nim-lang.org/docs/manual.html#types-procedural-type
04:06:12FromDiscord<demotomohiro> nimcall is the default convention used for a Nim proc.
04:06:36FromDiscord<demotomohiro> closure
04:06:37FromDiscord<demotomohiro> is the default calling convention for a procedural type that lacks any pragma annotations.
04:07:00*theelous3_ joined #nim
04:07:25FromGitter<xmonader> thank you so much
04:19:57FromDiscord<demotomohiro> https://play.nim-lang.org/#ix=1Z2s
04:20:08FromDiscord<demotomohiro> This code might help
04:20:44FromGitter<me7> Hi all and @dom96, quick question: I want to ask that Jester support template or not? (something like jinja2). I search through Jester repo but not found any mention on it
04:21:35FromGitter<me7> If Jester not support template, what's work around for me? What I want is just simple like query from db then put in html template
04:23:09*laaron- quit (Quit: ZNC 1.7.4 - https://znc.in)
04:24:11*laaron- joined #nim
04:28:37*rockcavera quit (Ping timeout: 240 seconds)
04:29:20*rockcavera joined #nim
04:29:20*rockcavera quit (Changing host)
04:29:20*rockcavera joined #nim
04:33:50*laaron- quit (Quit: ZNC 1.7.4 - https://znc.in)
04:34:27*laaron- joined #nim
04:35:29FromDiscord<juan_carlos> https://nim-lang.github.io/Nim/filters.html
04:36:35FromDiscord<treeform> also https://nimble.directory/pkg/nwt
04:36:46FromDiscord<juan_carlos> Karax
04:41:14*rockcavera quit (Ping timeout: 276 seconds)
04:44:06FromGitter<me7> @treeform @juan Thank you, nwt looks good for me.
04:45:50*nsf joined #nim
05:02:19*rockcavera joined #nim
05:02:19*rockcavera quit (Changing host)
05:02:19*rockcavera joined #nim
05:12:43*laaron- quit (Quit: ZNC 1.7.4 - https://znc.in)
05:13:55*laaron- joined #nim
05:14:47*laaron- quit (Client Quit)
05:15:44*laaron- joined #nim
05:15:47*laaron- quit (Remote host closed the connection)
05:28:10*rockcavera quit (Killed (orwell.freenode.net (Nickname regained by services)))
05:28:30*tiorock joined #nim
05:28:30*tiorock is now known as rockcavera
05:29:54*rockcavera quit (Remote host closed the connection)
05:37:01*rockcavera joined #nim
06:19:04*lritter joined #nim
06:30:56*PMunch joined #nim
06:58:26*theelous3_ quit (Ping timeout: 240 seconds)
06:59:09*EvilKhaosKat joined #nim
07:00:00*gmpreussner_ quit (Quit: kthxbye)
07:04:48*letto quit (Quit: Konversation terminated!)
07:04:52*gmpreussner joined #nim
07:06:07*letto joined #nim
07:14:47PMunchnarimiran[m], just saw that you created an epub version of your nim starter tutorial. You dont want to create an interactive tour version as well? https://github.com/PMunch/nimtours
07:29:30*Vladar joined #nim
07:37:56*filcuc joined #nim
07:56:13*dddddd quit (Remote host closed the connection)
07:56:57alexander92Async procedure (test) yielded `nil`, are you await'ing a `nil` Future?
07:57:00alexander92what does this mean
07:57:02PMunchHmm, using c2nim on a file containing this: http://ix.io/1Z3g gives me an error that "empty" is not expected
07:57:25PMunchalexander92, well, it means just that
07:57:28alexander92but
07:57:30alexander92i just return
07:57:34alexander92in a {.async.}
07:57:38alexander92i expect to return future void
07:57:46PMunchSnippet?
07:57:47*ng0 joined #nim
07:57:47alexander92ok, i return in a quote in a macro
07:57:59PMunchHmm
07:58:24*couven92 joined #nim
07:59:41alexander92mm
07:59:56alexander92ix.io/1Z3h
08:00:29PMunchYeah..
08:00:38PMunchThat's an issue with async
08:00:51Mister_Magister!eval echo("doot doot")
08:00:54NimBotdoot doot
08:01:00Mister_Magister:3
08:01:18PMunchIt reads through the body of the procedure and rewrites "return" to something else IIRC
08:01:35alexander92oooh
08:01:42PMunchBut since you don't have return in the body it doesn't work..
08:01:47alexander92but
08:01:50alexander92ohyeah
08:01:53PMunchIt's, uhm, hard to fix
08:01:55alexander92so i need a dirty template
08:02:56*gmpreussner quit (Ping timeout: 240 seconds)
08:03:27PMunchNope, still won't work I think
08:03:29PMunchhttp://ix.io/1Z3i
08:03:34alexander92nah the same
08:03:37alexander92ye
08:03:44*gmpreussner joined #nim
08:03:45PMunchIf you look at this example, and then use --expandMacro:async when you compile
08:03:51PMunchYou will see what is happening
08:04:24PMunchThe first body comes out as: http://ix.io/1Z3j
08:04:35PMunchAs you can see the return statement is added into the body
08:04:57PMunchHowever in the second example it comes out as: http://ix.io/1Z3k
08:05:29PMunchHere you can see that asyncdispatch has rewritten the return statement to complete the future that has been created and then return nil to exit the future
08:26:26PMunchThis is why I don't like to traverse a regular Nim code tree to do look for certain things
08:26:46PMunchIt completely breaks down with templates and macros
08:28:28PMunchWe had this exact same problem with jester, but it was looking for resp which was easy enough to just turn into a template instead
08:28:45PMunchBut since `return` is a codeword it can't be over-ridden..
08:37:10*Hideki_ joined #nim
08:58:16*tklohna_ quit (Ping timeout: 265 seconds)
08:59:29PMunchHmm, I've been seeing this error a lot while building various dev versions of Nim, what is it? /home/peter/Projects/nim/nim/lib/system.nim(207, 11) Error: undeclared identifier: 'is'
09:04:54*EvilKhaosKat quit (Quit: Leaving)
09:05:43*EvilKhaosKat joined #nim
09:08:01*EvilKhaosKat quit (Client Quit)
09:08:21*EvilKhaosKat joined #nim
09:08:24*evilkhaoskat_ joined #nim
09:08:32*evilkhaoskat_ quit (Client Quit)
09:08:42*EvilKhaosKat quit (Client Quit)
09:09:01*EvilKhaosKat joined #nim
09:26:31PMunchBy the way alexander92, if you want a workaround: https://play.nim-lang.org/#ix=1Z3P
09:26:44*Hideki_ quit (Remote host closed the connection)
09:28:37PMunchOh wait..
09:28:43PMunchThat doesn't work with await..
09:28:45*Hideki_ joined #nim
09:30:30PMunchWhat you can do is wrap your proc body in a named block, and then in your template break to that block
09:31:42PMunchLike so: https://play.nim-lang.org/#ix=1Z3R
09:32:59*asymptotically joined #nim
09:33:56PMunchOr if you need to return a value: https://play.nim-lang.org/#ix=1Z3S
09:36:52FromGitter<alehander42> thank you
09:37:13*asymptotically quit (Remote host closed the connection)
09:37:46PMunchNo problem
09:38:36PMunchI wish there was a good way to systematically solve this in Nim, I've seen errors like these crop up with almost every macro that tries to rewrite a tree of actual Nim code..
09:55:20FromDiscord<krab4t> well this regex ` findAll(s, re("(\".*?\"|\\S+)")) ` takes 50% of parser time, without it on windows cpu's time in average ` 0.015 ` and ubuntu(vmware) ` 0.030486051 `
09:57:59FromDiscord<krab4t> and with regex on ubuntu from 0.38 - 0.42, vs windows' 0.28 - 0.32
09:59:11FromDiscord<krab4t> and with regex on ubuntu from 0.038 - 0.042, vs windows' 0.028 - 0.032, fixed
10:02:04FromGitter<zetashift> Reading that FOSDEM thread on the forum brings joy to my heart
10:02:39FromGitter<zetashift> well played PMunch and anyone else who helped!
10:03:01alexander92pmunch thank you <3
10:03:06alexander92for the return thing
10:03:16alexander92i dont really need it maybe in the case
10:03:24alexander92because i realized i dont need to stop
10:03:36alexander92basically reimplementing something similar to simple unittest
10:03:39alexander92dsl
10:03:46alexander92i can just continue with the next check
10:03:56alexander92but it would be good to have a solution like that
10:10:12AraqPMunch: there are solutions to the problem
10:11:08Araqproc detectMe() = discard
10:11:16Araqtemplate keywordLike = detectMe()
10:11:26Araqmacro m(x: typed) =
10:11:39Araq ... iterate over the AST and detect 'detectMe'
10:12:36*Hideki_ quit (Remote host closed the connection)
10:13:10*Hideki_ joined #nim
10:14:20*Hideki_ quit (Remote host closed the connection)
10:14:36*Hideki_ joined #nim
10:15:11Araqany opinions? https://github.com/nim-lang/Nim/pull/12454
10:18:52FromGitter<zetashift> following the linked issue in that PR https://github.com/msys2/MINGW-packages/issues/21 I think it might be worth it
10:25:01PMunchzetashift, well we aren't done yet :) Still need to get speakers!
10:25:52PMunchAraq, ah because with typed it will be run after everything has been expanded?
10:26:53PMunchThat should really be implemented within the async macro..
10:27:44Araqhint: it's hard
10:27:58PMunchIt is?
10:28:09Araqmaybe not in theory but in practice
10:28:18Araqwho knows what it'll break
10:28:52PMunchHmm
10:33:05*tklohna_ joined #nim
10:38:02*krux02 joined #nim
10:41:31*EvilKhaosKat quit (Quit: This computer has gone to sleep)
10:49:46alexander92i have to finish
10:49:54alexander92that port of the chronos await as template pr
10:49:57alexander92as well
10:50:08alexander92it enables to use await in macros etc at least
10:50:17alexander92but i had some weird type errors that i just couldnt understand
10:50:34alexander92which seemed like expected A but not A
10:50:51alexander92i managed to fix it by cast[A](thing that is A)
10:50:55alexander92iirc
10:51:23*FromGitter quit (Read error: Connection reset by peer)
10:51:41*FromGitter joined #nim
10:53:02PMunchAraq, problem with passing it in as "typed" that triggers the error that await is used outside of an async context..
10:58:03*couven92 quit (Quit: Client disconnecting)
10:59:42PMunchUgh..
10:59:57PMunchYeah with await as a template it might be possible
11:02:19*Hideki_ quit (Remote host closed the connection)
11:03:06*Hideki_ joined #nim
11:07:48*Hideki_ quit (Ping timeout: 265 seconds)
11:18:36*Hideki_ joined #nim
11:24:55Araqalexander92: er...
11:25:09Araqbetter fix the compiler instead
11:28:21FromDiscord<krab4t> ` dumpbin /dependents ` on Windows show ` LINK : fatal error LNK1328: missing string table ` its normal?
11:34:52FromGitter<geotre> To pass a Nim JsonNode to a javascript function expecting a js object, I need to convert to JSObject right? I can't find a way to do that in the json module
11:36:58Araqcast[JSObject](x) might do this trick
11:39:09FromGitter<geotre> @Araq thanks for the idea, doesn't seem to work though I'm afraid
11:39:35FromGitter<geotre> Someone must have done this for other wrapped js libs, I'll try to find one
11:41:04alexander92hmm
11:41:12alexander92why do you want to pass a JsonNode
11:41:22alexander92i usually just use native json parse
11:41:27alexander92and directly cast it to a nim type
11:41:39FromGitter<geotre> I want to construct a json object in nim code that is used as a config for a js function
11:41:42alexander92for the javascript backend
11:42:02alexander92ok, but you can use
11:42:04alexander92JsObject
11:42:14alexander92JsObject{a: 2, b: 4}
11:42:17alexander92etc
11:42:50alexander92maybe it would be better to have jsonnode support for the javascript backend, but it seems easier to me for now to just cast otherwise the result of Json.parse
11:43:06alexander92maybe i dont understand your case tho !
11:43:16FromGitter<geotre> Doing that doesn't seem to work for arbitrary object structure though
11:43:40FromGitter<geotre> There isn't a `%*` equivalent for JsObject
11:44:22FromGitter<geotre> With json.parse you mean I should create my object as a cstring in nim and then parse it for the js function?
11:44:39FromGitter<xmonader> pfff can't believe it wrote a webframework in < 750 lines
11:45:16*EvilKhaosKat joined #nim
11:45:35PMunchxmonader, it?
11:46:07FromGitter<xmonader> @PMunch i meant I did :D
11:46:37PMunchHaha, nice
11:46:41PMunchPublished?
11:46:48FromGitter<xmonader> https://github.com/xmonader/nim-servy/blob/master/src/servy.nim#L631
11:47:26FromGitter<xmonader> I'm preparing day 18 on that, but it tackles some points that aren't in jester like middlewares on the app or on specific routes
11:47:59FromGitter<xmonader> i took httpcodes from http pure in nim and http headers wrappers from jester
11:50:48PMunchHmm, interesting
11:50:59PMunchI'm writing my own little web framework as well :P
11:51:10PMunchOr rather toying around with some ideas
11:51:33FromGitter<xmonader> interesting like what?
11:52:01PMunchIt's just interesting to see what different people implement :)
11:52:29FromGitter<xmonader> indeed, lucky there're lots of code out there to learn from
11:57:38FromGitter<xmonader> @PMunch do u support chunked responses in ur framework?
11:57:54FromGitter<xmonader> I'd like to find a good idea instead of passing the socket around
11:57:55PMunchSo far my "framework" is ~130 lines
11:57:58PMunchSo no :P
11:58:15Zevv"Ha! Mine is smaller then yours"
11:58:20FromGitter<xmonader> i bet it's lots of macro vodoo that exapnds to 1300 lines xD
11:58:31PMunchWell, not yet :P
11:59:22FromGitter<geotre> @alexander92 I understand what you were saying now, thanks. I've got something working
12:03:27*crem quit (Ping timeout: 250 seconds)
12:04:41*crem joined #nim
12:05:57PMunchHmm, in Jester parseUrlQuery is marked as deprecated saying "use stdlib", which procedure in stdlib does it mean?
12:06:19FromGitter<xmonader> I've no idea i was wonder about that too!
12:06:46FromGitter<xmonader> and also I think there's a bug in the existing code already
12:06:54PMunchdom96, any insight?
12:07:48alexander92geotre good
12:12:16AraqPMunch: uri.parseUri ?
12:14:16PMunchWell, that just parses the query into a single string
12:14:32PMunchBut I found cgi.decodeData appears to do what I need
12:19:29*theelous3 joined #nim
12:27:32*Kaivo joined #nim
12:37:04*EvilKhaosKat quit (Quit: Leaving)
12:44:41jkenlmariscal, do you accept PRs on nimgl/imgui?
12:56:42PMunchHmm, in a generic macro is there a way to peek at T?
13:00:18PMunchie. in this example to read the fields in the tuple: https://play.nim-lang.org/#ix=1Z54
13:02:13AraqI don't know :-)
13:02:43PMunchWell that can't be good :P
13:04:33*theelous3 quit (Ping timeout: 250 seconds)
13:14:27*dddddd joined #nim
13:20:04*FromGitter quit (Remote host closed the connection)
13:20:23*FromGitter joined #nim
13:24:57FromGitter<alehander42> why
13:25:00FromGitter<alehander42> do you need that
13:25:21FromGitter<alehander42> also, can you pass
13:25:26FromGitter<alehander42> the type as first typed argument
13:25:30FromGitter<alehander42> makes it even for better dsl
13:30:35FromGitter<alehander42> yes
13:30:40FromGitter<alehander42> https://play.nim-lang.org/#ix=1Z5h
13:32:45FromDiscord<willyboar> @xmonader this will be day 18?
13:34:18PMunchalehander42, that is exactly what I ended up doing :P
13:34:46PMunchI need it to create an overloadable deserialiser
13:35:07PMunchThey will all take a string, but can return different types
13:46:54*theelous3 joined #nim
13:47:43*solitudesf joined #nim
13:53:33FromGitter<xmonader> @Willyboar yesthat's the plan :D but i think it'll be bit long
13:53:55FromGitter<Willyboar> never mind. I cant wait to read it :)
13:54:21FromGitter<xmonader> thank you hope it'll be up to the expectation ^_^
13:55:17FromGitter<Willyboar> Well, i am new to nim and web is my main target
13:56:21FromGitter<Willyboar> Yesterday i proposed to @Kiloneie to rec your days projects
13:56:24FromGitter<Willyboar> :)
13:56:50FromGitter<xmonader> there was that great introduction to karax
13:57:00FromGitter<xmonader> that's sno nice of you! I'm sure that will be so amazing
13:57:00PMunchUp to a bit over 200 lines now xmonader
13:57:35FromGitter<xmonader> @Pmunch u need to with macro expansions or without :P
13:59:34PMunchThat is before expansions
13:59:58PMunchBut I don't have any crazy macros right now
14:00:06FromGitter<xmonader> i'm curious can i take a look?
14:00:07PMunchJust a little rewrite there, a touch of logic there
14:00:38PMunchHmm, you're on Gitter so I can't PM you
14:01:01FromGitter<xmonader> if u r on the telegram channel i can!
14:02:58PMunchPM'ed you on gitter :)
14:04:20PMunchThe goal is to have something where you are able to automatically generate API documentation
14:04:40PMunchAnd have a type-safe API
14:04:57*PMunch quit (Remote host closed the connection)
14:06:39FromGitter<xmonader> generate API documentation or generate code from API documentation ?
14:12:55*Romanson joined #nim
14:23:03FromGitter<alehander42> PMunch i love web frameworks
14:24:01FromGitter<alehander42> hope you make an interesting one :P, for me seamless but very typesafe routing (api / graphql) <=> validations => db
14:24:06FromGitter<alehander42> is most interesting
15:05:11Araqprogress: https://www.sciencealert.com/mathematicians-have-discovered-an-astonishing-new-way-to-multiply-large-numbers
15:05:46lqdev[m]shashlick: uh? `/home/daknus/Coding/Nim/rapid/src/rapid/lib/sdl/sdl_video.nim(16, 1) Error: request to generate code for .compileTime proc: cSkipSymbol`
15:07:47lqdev[m]also, for some reason, every cImport takes a painfully long amount of time. is cImport not cached at all?
15:10:14FromDiscord<Rika> is it possibly to deepcopy a nimnode
15:13:49AraqcopyTree
15:15:04Araqah what I'm doing is completely wrong
15:15:18Araqtime to abandon the araq-gc-destructors branch I guess
15:16:09Araqneed to jog/sleep over it, bbl
15:17:32lqdev[m]nvm, cSkipSymbol needs to be in a `static:` block
15:24:38*nif_ quit (Quit: ...)
15:24:48*nif joined #nim
15:24:58lqdev[m]I'm getting this error again https://termbin.com/6g0v
15:25:20lqdev[m]except, this time it destroys the whole compilation
15:25:37lqdev[m]s/compilation/`nim check` run/
15:26:40disruptekAraq: yikes.
15:27:19lqdev[m]https://nimterop.github.io/nimterop/types.html#wchar_t oh.
15:27:19lqdev[m]shashlick: this is a problem, `wchar_t` as it's defined here ↑ is `nim cpp` only
15:28:00*NimBot joined #nim
15:28:05lqdev[m]because `<cwchar>` is a C++ STL header
15:28:47lqdev[m]where can I get a wchar_t in C?
15:30:02lqdev[m]or, in Nim?
15:30:41disrupteki have three of them i can send you for the right price.
15:31:22lqdev[m]lol
15:31:23leorizelqdev[m]: import from wchar.h
15:31:23disrupteksee /usr/include/wchar.h
15:32:02leorizefor every c<something>, there's a <something>.h :P
15:32:13disruptekyer blowin' my mind right now.
15:32:25lqdev[m]oh wait, nimterop/types only defines wchar_t if Nim is older than 0.19.9, wtf
15:32:42leorizebut Nim has widestr so there has to be one somewhere already
15:33:46shashlickhey just catching up
15:34:10lqdev[m]I'm still wondering why is cImport so slow with nim check
15:34:24shashlickare you disabling caching?
15:34:29lqdev[m]it's perfectly fine when running `nim c`
15:34:37lqdev[m]no
15:35:34*tklohna_ quit (Ping timeout: 265 seconds)
15:36:25lqdev[m]leorize: widestrs doesn't have wchar_t, it defines its own wchar type which is Linux-incompatible afaict
15:36:52shashlickwchar_t is defined for > 0.19.9 also in the else
15:37:15shashlickhttps://github.com/nimterop/nimterop/blob/master/nimterop/types.nim#L20
15:37:24lqdev[m]oh, I see
15:37:47lqdev[m]it's not present in `nim check` for some reason
15:38:02FromGitter<awr1> hello
15:38:06lqdev[m]well I just define it myself
15:38:34shashlickso i need an else?
15:38:45*Trustable joined #nim
15:39:00shashlicktry adding an else on line 35
15:39:14lqdev[m]shashlick: likely
15:39:18disrupteki don't use `nim check` since it's not always the same as a proper compile. bummer, that.
15:39:21lqdev[m]hello, @awr1
15:40:06lqdev[m]disruptek: tell that to the VS Code plugin's author
15:40:17lqdev[m]I don't use it too, the VS Code plugin uses it for error highlighting
15:41:46lqdev[m]I wonder how good the Sublime Text 3 plugin is
15:41:50shashlickokay let's fix it then
15:41:57shashlickwhat's your latest wrapper look like
15:42:56lqdev[m]shashlick: https://github.com/liquid600pgm/rapid/tree/sdl2/src/rapid/lib/sdl
15:44:06shashlickwhich file should I test
15:44:37lqdev[m]sdl_base.nim
15:45:46shashlickhow come git clone doesn't get the sdl directory
15:45:49FromGitter<awr1> i used vs code for a week and then went back to emacs
15:46:09FromGitter<awr1> also i think you have to clone the whole repo
15:46:34krux02awr1: I used vs code for a day, saw that it doesn't have proper keyboard support, and went back to emacs.
15:46:43FromGitter<awr1> @shashlick https://stackoverflow.com/a/600189
15:47:10FromGitter<awr1> VS Code looks nice if you're coming from sublime/atom/etc.
15:48:02*Trustable quit (Remote host closed the connection)
15:48:10lqdev[m]shashlick: it's a branch
15:48:16krux02I really like to rant about web technology.
15:49:03FromGitter<awr1> i would very much be interested in a modern emacs/vim like editor (neovim, kakoune don't quite cut it) but for now i am the most productive in emacs. and that's with a weird modal vim-like editing mode, mind you
15:49:05shashlickokay missed that
15:49:24shashlick@awr1 which OS
15:49:37FromGitter<awr1> i use linux and windows
15:50:09shashlickokay then check out feud on windows
15:50:17FromGitter<awr1> i have been meaning to
15:50:25krux02I would really really like, if emacs would be fixed in a way that it would never ever split my windows or replace the buffers I've put into a window..
15:51:02krux02temporary contest should be popup
15:51:18krux02not change the state of my editor. I really really hate that in emacs.
15:51:19disruptekpfft you have org mode and a proper lisp; your complaints are meaningless here. 😝
15:51:27krux02Apart from that I really like a lot in that editor.
15:52:15krux02I am not really a fan of modal editing.
15:52:18shashlickhow do you check if we are in `nim check` mode
15:52:26shashlickwhen defined(check) isn't working
15:52:48krux02The leader key in the vim world is fine, but modal editing isn't really worth it in my opinion.
15:53:01disrupteknext time i have some code that passes check but not compile, we'll turn it into a boolean test for ya.
15:53:20krux02I don't want to say it's bad, because a lot of people like it, but I think pretending that it would improve productivity is a big overstatement.
15:53:52shashlickwithout scientific testing, every statement is an subjective
15:54:42disruptekit's hacktober, someone write me a password generator that takes keyboard heatmap into account.
15:54:54disruptekplease and thank you.
15:55:05lqdev[m]any ideas on why NimLime doesn't check any errors?
15:55:47disruptekit's a shame you cannot use vim; leorize's plugin works quite well and it sees a lot of active support.
15:57:15lqdev[m]disruptek: I just don't get vim. it's weird to use
15:57:40disruptekhonestly, i would find a way to use emacs.
15:57:53disrupteki really think it affords the most dividends long-term.
15:58:04disrupteki think i may just be too old to switch, or i'd be there.
15:58:32shashlick@lqdev - oky fixed the wchar_t issue
15:58:36shashlicknim check is also very fast
15:58:43shashlickwhat all should i try
15:59:06disrupteklmdb
15:59:34*Hideki_ quit (Remote host closed the connection)
16:00:09lqdev[m]shashlick: try compiling src/rapid/gfx/window/window_lowlevel
16:00:18lqdev[m]or, running nim check on it
16:00:23*Hideki joined #nim
16:00:23*nsf quit (Quit: WeeChat 2.6)
16:01:14shashlicknim c = 6 seconds
16:01:23shashlicknim chec = 1.5 seconds
16:01:42disruptekwrong answers are always faster to arrive.
16:01:42jkendisruptek, turns out I was wrong yesterday about the naming of my cimgui.so being the issue.
16:01:50jkennim only checks /usr/lib64
16:01:56jkenand skips ldconfig entirely
16:02:07disruptekwow, but it checks two names?
16:02:45jkenI said to dynload libcmgui.so
16:02:50jkenand these are all the open calls in a strace looking for it: https://paste.debian.net/1108046/
16:03:17jkenIgnores /usr/lib entirely
16:03:24jkenwhich I guess is sane on a 64 bit system?
16:03:47jkenbut not using ldconfig is definitely confusing
16:03:47disruptekit's not even looking for .so
16:04:20*NimBot joined #nim
16:04:37*Hideki quit (Ping timeout: 240 seconds)
16:04:41jkendisruptek, sorry that is my bad, I left .so off of the string in the code
16:04:59disruptekthat makes more sense. 😁
16:05:26jkenbut it also does not check the current path either
16:05:28disrupteki'm not sure how sane that is.
16:05:49jkenso even shipping a .so alongside my binary won't work out of the box
16:06:02jkenthere might be way to tell nim where to look that I don't know about?
16:06:03disruptekmaybe you'd need to compile differently to enable 32-bit loads?
16:06:25disruptekis your project oss?
16:06:33lqdev[m]shashlick: it looks like toast takes a long time (approx. 0.2s) to start
16:06:46lqdev[m]that's what slows compilation down
16:06:50jkendisruptek, no but I could give you access, its nothing secret
16:07:10disrupteki'm just curious and i'd like to build it on my machine.
16:07:23disruptekbut i know you're made some tweaks to get as far as you have.
16:07:33shashlick@lqdev - can you check if it is compiled with -d:danger
16:07:36disrupteki've been interested in imgui, i just haven't used it myself.
16:07:50jkenJust use the git version of imgui, not the one you get from nimble,
16:07:51lqdev[m]shashlick: how can I check that?
16:08:02shashlickwas it nimble install'd?
16:08:06disruptekjust clone nimgl?
16:08:06jkenthis one: https://github.com/nimgl/imgui
16:08:18jkendisruptek, its seperate from nimgl, as I don't use nimgl in my project
16:08:25disruptekalrighty.
16:08:40shashlick@lqdev - also, toast shouldn't run unless the headers are changed
16:08:48shashlickit should load from cache
16:09:14disruptekand i run the test with -d:something?
16:09:16jkendisruptek, whats your github username?
16:09:27disruptekget yourself a pen and paper; it's complicated.
16:09:34jkendisruptek, if you mean the lmgui test, just make sure you use the c backend
16:09:37disruptek`disruptek`
16:09:40jkenlol
16:09:57disruptekyeah, i'm from the states.
16:10:01jkenI did search for that before asking, must have typoed
16:10:13jkeninvited you to my repo
16:10:34disruptekyou don't need nimgl but you do need nimgl/opengl?
16:10:54jkenTheir test uses nimgl..
16:10:59jkenmy repo does not, I use the raw opengl package
16:11:08disruptekah, okie.
16:11:24disrupteknow i'm seeing errors like you saw yesterday. should go faster from here. 😁
16:11:34jkenYou'll probably want to clone and nimble develop the nimgl repo for their test
16:14:16jkenoh, and to get cimgui.so, clone https://github.com/cimgui/cimgui and make
16:14:51disruptekand there's some kinda git submodule thing?
16:15:08disruptekis that just the cimgui stuff?
16:15:34disrupteki was never actually privy to what you did to fix that.
16:15:54jkengit submodule update --recursive --remote --init .
16:16:42jkenthe imgui repo pulls in imgui as a submodule and compiles it when using nims cpp backend, but looks for the shared object on the c backend
16:16:50disruptekthanks, that worked.
16:16:52jkennimgl uses submodules for their stuff too
16:16:53jkennp
16:17:58disrupteki thought the vulcan.c missing was due to -d:imguiDll needing defined?
16:19:36jkenI don't recall specifically.
16:20:01jkenAre you getting that when building the imgui tests/test.nim?
16:20:07disruptekyeah.
16:20:26disruptekmaybe i need to do this gen thing first.
16:20:51jkenbuilds for me without -d:imguiDll
16:22:05disruptekdo you have src/private/glfw?
16:22:16jkenyes, it came in as a submodule
16:22:37shashlick@lqdev - pushed a wchar_t fix to head
16:22:38disruptekodd, not for me.
16:22:46jkenits a submodule of nimgl, not imgui
16:22:51disruptekah
16:23:02jkenkind of confusing
16:23:05disruptekbingo. 😀
16:23:58disruptekokay, now i'm at that "can't find it" point.
16:24:10jkenwelcome :)
16:24:16disruptek😁
16:24:38disrupteki have like 30 libs linked into this thing, maybe more.
16:24:57disruptek34
16:25:09jkenldd ./test |wc -l
16:25:09jken20
16:25:15jken20 for me
16:25:16lmariscaljken yes I do accept PRs, and so your comment on he change from cimgui.so to libcimgui.so will be pushing a commit later
16:25:26jkenlmariscal, turns out that was a red hearing
16:25:42jkenand its more about where nim looks for libs then about their names
16:26:12disrupteki set my LD_LIBRARY_PATH and it worked.
16:26:17lmariscaloh, so how did you fixed it in you end?
16:26:40jkenlmariscal, I think i got a false positive by importing imgui but not actually calling my ig methods..
16:26:49lqdev[m]shashlick: yeah, I just ran `nimble install nimterop@#head`
16:27:21disrupteklmariscal: how do we get our binaries to find the library? you don't have a linux box, right?
16:27:22jkendisruptek, oh really? Did you set it to the pwd?
16:27:26shashlickI'm not sure if nimble uses danger by default or release
16:27:30lmariscalhmm, so the issue still occures but it seems like disruptek has it working?
16:27:45disruptekwhen you set it, did you export your LD_LIBRARY_PATH? are you using bash?
16:27:50lqdev[m]hm, now it's faster
16:27:50jkenWe are in the midst of figuring that out :P
16:28:02lqdev[m]1.013 sec total
16:28:02lmariscaldisruptek sorry a little lost here, what do you mean by getting the binaries?
16:28:11jkenI set it in the same line as my invocation of the binary. trying again
16:28:24disruptekoh, that should work, too, in bash.
16:28:37disrupteklmariscal: i mean, we're building programs that cannot find the library.
16:28:42*Hideki joined #nim
16:28:51jkenoh wtf,
16:28:54disruptekwe need a way to set the search path for the dl.
16:28:57jkenLD_LIBRARY_PATH=$(pwd) ./test
16:29:00jkenthat works for me ^
16:29:06jkenwith cimgui.so in the same dir as my binary
16:29:31*Hideki quit (Remote host closed the connection)
16:29:37disruptekyeah, but we want a way to encode that into the binary.
16:30:40lmariscalI could pass the L flag at compile time to locate the library location
16:30:47shashlickThen compile the binary with full path to the so
16:30:49jkenyeah, I won't be in control of how my binary is invoked
16:30:50disruptek--rpath seems to be the only one.
16:31:10*filcuc quit (Ping timeout: 252 seconds)
16:31:25*Hideki joined #nim
16:32:28lqdev[m]shashlick: you're saying toast is ran again if the processed header is changed?
16:32:39lqdev[m]well it seems like it runs whenever any of my Nim source files are changed
16:32:48lmariscaldo you think that the dl name should be libcimgui.so or cimgui.so?
16:33:12jkenIf I clone cimgui and `make`, it produces cimgui.so
16:33:36jkenbut ldconfig uses the lib prefix for libs in /usr/lib
16:33:38lqdev[m]lmariscal: according to unix conventions, the format is lib$1.so
16:33:45disruptekthis.
16:35:32lmariscalI will open an issue later in cimgui to discuss a change in the name
16:35:40shashlick@lqdev - if the nim file being compiled has changed, it will rerun toast
16:36:19shashlicksorry no, if the h file being cImported has changed, it will rerun toast
16:36:20*Hideki quit (Ping timeout: 268 seconds)
16:36:49shashlickhttps://github.com/nimterop/nimterop/blob/master/nimterop/cimport.nim#L169
16:36:53shashlickuses gorgeEx caching
16:37:07shashlickor if the command line changes somehow
16:37:22shashlickunless you use -f which will force rerun
16:38:31lqdev[m]shashlick: right, but the slowdown occurs whenever I modify my Nim source code
16:38:56lqdev[m]and it seems to get stuck for a brief amount of time on each `# Importing …` message
16:39:11lqdev[m]which suggests that it re-runs toast
16:39:41shashlickhow can i recreate what you are seeing
16:39:58jkendisruptek, so how does rpath work?
16:40:10disruptekit doesn't.
16:40:28jkenoh. :P
16:40:39disruptekLD_RUN_PATH doesn't seem to work, either.
16:40:44lmariscalbut I will look into passing into the compiler the `L` flag
16:40:51disruptekthat didn't work, either.
16:41:04disrupteki don't think i'm using rpath right.
16:42:50lmariscalthe L flag didnt work?
16:42:57disruptekno.
16:43:02disruptekshashlick knows how to do this.
16:43:05disruptekdude.
16:43:22disruptekhow do we tell nim to search path X for a dl'd .so?
16:43:47*solitudesf quit (Remote host closed the connection)
16:43:56*solitudesf joined #nim
16:45:02disrupteklemme see see the linker command he uses.
16:45:43FromGitter<awr1> @jken did you use passL
16:45:46FromGitter<awr1> and not passC
16:46:18FromGitter<awr1> i think i brought this up yesterday, had to look back at some old code i had which did something similar
16:46:48disruptekwhy can't i make rpath work?
16:46:48lqdev[m]shashlick: try to modify window_lowlevel.nim, run `nim check`, take note of the time, run `nim check` again, take note of the time
16:46:52*xace quit (Quit: leaving)
16:47:17lqdev[m]it doesn't even have to be window_lowlevel.nim, it can be any of the sdl_*.nim files
16:48:07disruptekthe word `path` does not appear on the linker options page for gcc.
16:48:23jkenawr1, imgui uses {.push dynlib: imgui_dll, cdecl, discardable.}
16:48:33jkenwhere imgui_dll is "cimgui.so"
16:49:28disrupteki fixed it!
16:49:47disruptek"--passL:-Xlinker -rpath $THE_DIR"
16:49:48shashlick@lqdev - with -f, it takes 1.8 seconds, without -f it takes 1.4 seconds
16:50:36shashlickprobably what's going on is that gorgeEx caching doesn't do anything in check mode
16:51:38lqdev[m]that's likely
16:52:40shashlickif nim check doesn't create a folder in ~/.cache/nim then there is nothing cached
16:52:59jkendisruptek, are you passing that to nim c?
16:53:08disruptekyeah
16:53:25shashlickyep, there's no sdl_ directory created for nim check
16:53:36disruptekhaven't figured out how to make it search the cwd though.
16:54:01disruptekoh, maybe i have and i'm just dumb.
16:54:21jkenI just get command line(1, 2) Error: argument for command line option expected: '-p'
16:54:27disruptekyep, it works.
16:54:46disrupteknim c "--passL:-Xlinker -rpath ." test/test.nim
16:54:56jkenah, quotes.
16:55:06disruptekyes, whatfer space reasons.
16:55:18lqdev[m]shashlick: anything I can do about it, or is it a Nim issue?
16:55:31shashlickprobably just how nim check works
16:55:39shashlickit is only checking so really nothing to save
16:55:49shashlicki am using gorgeEx for caching
16:55:52disruptekthis is a workaround, though; i feel like there should be an in-nim way to add a searchpath.
16:58:07lqdev[m]for me, nim c and nim check both finish at about 1s
16:59:32jkendisruptek, I agree, especially if nim is only going to check /usr/lib64 by default rather than query the platforms provider (ldconfig in this case)
17:00:00disruptekhttps://github.com/nim-lang/Nim/issues/2408
17:01:05jkeneek,
17:01:26disruptekyeah, this attitude bothers me.
17:03:14jkenwell, that issue is tagged hacktoberfest
17:03:15disruptekhttps://github.com/nim-lang/RFCs/issues/58
17:06:28jkenso sounds like dynlibOverride is our best bet until something changes in nim?
17:07:00disruptekwell, i'm not keen on specifying 35 libraries in a command-line option.
17:07:24jkenah right, you solution is best then.
17:07:45jkenIs there a mechanism to add compiler flags to nimble build?
17:07:57jkenOr do I need to stop using nimble to build my stuff.
17:08:18jken(not overly important just curious)
17:08:18disrupteki'm sure there is, or you can just put it in your code. passL is a pragma.
17:08:25jkenah. awesome.
17:09:11disrupteki wish this was just a little bit better.
17:09:32disruptekjust give us a way to search the location of our executable.
17:10:28jken{.passL: "-Xlinker -rpath .".} in my code works
17:10:59disruptekyes, as long as your run your binaries from wherever they live on your filesystem. 🙄
17:11:06jkenoh.. right.
17:11:28jkenI hadn't considered that
17:13:55disruptekwell, we can still use LD_LIBRARY_PATH, so i guess it's not totally nuts.
17:14:46jkenI am still way ahead of where I was yesteday, so its a win
17:14:48jkenThank you for your help
17:14:52disrupteknice to have this working, i will have to play with imgui. thanks for getting me setup. 😀
17:15:01disruptekhappy to help.
17:15:23jkenMoving on to getting imgui working with sdl2, looks like lmariscal only added a glfw renderer
17:20:16lmariscalyeah sorry about that, it is still in the todo list
17:20:31lmariscaljken but you can create the renderer from https://github.com/ocornut/imgui/blob/master/examples/imgui_impl_sdl.cpp
17:20:42jkenno worries, wasn't calling you out, if I get it working ill send a P
17:20:44jkenPR*
17:21:14lmariscalthanks! I would really appreciate it
17:21:45disruptekthanks for your work on this stuff, lmariscal; it's pretty awesome. 👍
17:22:29lmariscalthank you for using it, the project still has room to grow so let me know anything that could improve
17:23:01jkenhonestly not sure why I am hacking together opengl + sdl2 + imgui when you've put so much work into nimgl
17:23:25jkenstarted off as a project so I could just learn opengl
17:24:08disrupteki just realized the test window magically appears as a modal in my compositor. weird.
17:25:00disrupteki guess 'cause it's not resizeable, maybe. anyway, full fun ahead!
17:30:46disrupteki guess i'm also not getting framerate.
17:32:54disrupteki would have to update it in a loop, right?
17:38:20*lritter quit (Ping timeout: 265 seconds)
17:39:26*Romanson quit (Quit: Connection closed for inactivity)
17:39:26*Hideki joined #nim
17:42:31*xace joined #nim
17:53:37*Hideki quit (Ping timeout: 240 seconds)
17:57:40jkenlmariscal, is imgui/impl_opengl intended to require nimgl?
18:06:50*nsf joined #nim
18:13:40*NimBot joined #nim
18:46:07lqdev[m]wow, `nim check` is actually faster after switching to SDL
18:46:11lqdev[m]it was painfully slow previously
18:51:17lqdev[m]nvm I take that back
18:51:32lqdev[m]I just had my imports broken
18:53:32disruptekdid you catch the bastard's license plate numble?
18:53:38disrupteknumber, either?
18:54:17disruptekit's hacktober, someone make us a rainbow-colored debug macro to spite zevv.
18:54:20disruptekplease and thank you.
19:16:52*clyybber joined #nim
19:35:52Zevveh I do colors right
19:50:21disruptekoh, it's just code that has to be monochromatic?
20:06:51Zevvas long as it looks like the matrix
20:21:23*paxis quit (Quit: Client exiting)
20:30:20*Joey joined #nim
20:30:51*Joey quit (Client Quit)
20:35:17lmariscaljken, for the moment yes as they are examples but for the sdl and others it would have different requirements
20:38:42*adeohluwa joined #nim
20:40:22*drewr joined #nim
20:44:41lqdev[m]I just realized that splitting the SDL wrapper into multiple cImports was probably a very bad idea
20:46:28disrupteki don't even see the code anymore; it's just blonde, brunette, redhead...
20:49:51*adeohluwa quit (Remote host closed the connection)
20:54:06*nsf quit (Quit: WeeChat 2.6)
21:00:48Zevvaand thats 0.20, so next should really be 1.0 then I guess. because traditions matter
21:01:40disruptekeh?
21:02:18*alexander92 quit (Ping timeout: 265 seconds)
21:14:18ZevvI jst tagged v0.20 of my stuff. Given Nims history 1.0 is due next
21:14:42disrupteki think you need 0.20.99 first.
21:14:52disruptekonly 99 more bugfixes to go.
21:15:12Zevvoh right. first Ill have to make 99 bugs then
21:17:22disrupteki have one for you if you want.
21:17:43shashlick@lqdev what's the issue
21:18:21Zevvdisruptek: give it to my, I can always act as if I didnt hear you
21:18:27lqdev[m]shashlick: `nim check` times
21:18:33disruptekhttps://github.com/disruptek/openapi/blob/master/src/openapi/paths.nim#L51
21:18:33lqdev[m]it slows me down a lot
21:18:59disruptekit yields `Error: cannot evaluate at compile time: segments` under js.
21:19:29disruptekactually, under c too.
21:19:38disruptekhmm.
21:21:08Zevvcloned, how do I run?
21:21:15Zevvso i get your problem
21:21:56disruptekholdon, this is new to me.
21:25:43disruptekmight be a nim regression.
21:27:05Zevvlast time I got that, it was
21:27:34disruptekman, i really need to finish golden.
21:27:39disruptekthis is ridonkulous.
21:32:25Zevvhave you tryed turning it off and on again?
21:32:42disrupteki just realized that i was still attempting to js stuff.
21:32:49disruptekso, rolling up to head to try in c.
21:32:59disruptekokay, head works.
21:33:11*FromGitter quit (Remote host closed the connection)
21:33:16disruptekso i need to make you a test.
21:33:30*FromGitter joined #nim
21:33:44Zevvnim 1 or nim devel?
21:34:02Zevvoh I can reproduce already
21:34:04disruptekdevel; prior versions don't have the support for ct js
21:34:24disruptekthat newGrammar error you used to get...
21:34:44Zevvits probably a regression - I get it in my own code now, which I believe worked before on js. investigating
21:35:08disruptekwell, lemme try a later npeg first, i guess.
21:35:43disrupteki was used 0.14 or something.
21:36:19Zevvdon't think that matters, but please do
21:36:28disruptekyeah, doesn't work in .20
21:36:40shashlick@lqdev even separate?
21:36:45Zevvthis "cannot evaluate at compile time" is a pretty common complaint on #nim
21:37:01disruptekokay, now 0.20 breaks in c. lemme try 0.18; i think that works fine.
21:37:24disrupteki guess maybe i'm doing something wrong: imble/pkgs/npeg-0.20.0/npeg/capture.nim(158, 5) Error: unhandled exception: Capture out of range [NPegException]
21:37:34Zevvthat's something different
21:37:41Zevvwhat does your typical input string look like?
21:37:53disruptekahh, my tests don't work in 0.20.
21:38:00disruptekso, that helps. openapi/tests/tests.nim
21:38:21disrupteki thought it was silly to write those. jokes on me!
21:38:28Zevvha!
21:38:28disruptekjoke's, too.
21:39:15Zevvso those broke from 0.18 to 0.19, interesting
21:39:26disruptekyeah.
21:39:45disruptekit's probably me.
21:40:26Zevvthere was a tiny little API change, but I didn't think that would affect anyone, it never touched any of my tests - so I missed something :)
21:42:00disrupteki have some kinda special ability to uncover shit like this.
21:42:26disrupteklmdb is broken for me, but _only_ in -d:danger, and only when setting the numble of db readers.
21:42:29disruptekgo figure.
21:42:31Zevvha
21:42:38disruptekdamn numbles.
21:42:42disruptekget me every time.
21:42:46Zevvyeah, well, you check length of capture[]
21:42:49Zevvno one ever does that :)
21:43:06Zevvthat changed
21:43:16disruptekwhy do i do that?
21:43:19Zevvcapture[0] and $0 now always exist, those are the total capture that is passed to the code block
21:43:33Zevvcapture[1] and $1 and higher are the explicit string captures *inside* that match
21:43:46Zevvso you do that to check if something is captured at all - makes sense
21:43:50disruptekhow can i see if $1'll make sense?
21:44:10disruptekit's 'cause it might be a variable, i guess.
21:44:15Zevvcapture[].len > 1
21:44:20Zevvinstead of 0
21:44:33Zevvbecause there is always the total capture in capture[0] aka $0
21:44:45disrupteki gotcha.
21:44:51ZevvThis is part of my last-thing-I-must-fix-but-need-help
21:44:56disruptekthat works great.
21:45:05Zevvthis code running inside parsers needs a proper API to interact with the parser itself
21:45:08Zevvit is too ad-hoc now
21:45:14disruptekright.
21:45:15Zevvsome vars, some procs, some peeking into internal state
21:45:44*Vladar quit (Quit: Leaving)
21:45:46disruptekwho is a heavy use of npeg?
21:45:50disruptekuser, too
21:45:53Zevvnoone :)
21:46:20ZevvI think there's a handful of snippets floating around of people using it
21:46:25disruptekthen i guess i'd leave it alone until an obvious criticism informs a decision.
21:46:41Zevvthat was my current solution, yes
21:47:12ZevvI guess its pretty usable. It parses Rod now, and only 3 times slower then the native parser
21:47:20disruptekwell, for starters, this suggests you might want a way to get the existence or number of actual captures.
21:47:29disrupteksince that value is now overloaded.
21:47:34Zevvwhich is capture[].len, but that sucks to type
21:47:54disrupteki couldn't deref it, btw.
21:48:07Zevvotoh, your captures come in `capture[]`, so using it's .len does make sense
21:48:44disrupteki didn't ask for 0 and i don't want it!
21:49:01ZevvI know. But having $1 being capture[0] was evil
21:49:04disruptekoh, 0 is like the regexp match without ()?
21:49:11Zevvyes
21:49:15disrupteki see.
21:49:27disrupteki guess that's useful an might even be easier to explain.
21:49:31Zevvwhich often makes sense - i found my self regularly make a capture-inside-a-capture
21:49:36disruptekassuming people understand regexp.
21:50:01disruptekhonestly, having it be more explicit is probably best.
21:50:26disruptekyou could make {0}, {1} do something, too, if you want operators.
21:50:46Zevvhow is that better then $0, $1?
21:50:53*Hideki joined #nim
21:51:12disruptekcapture.group{Everything} could work as well as capture.group{1, 2, 3}
21:51:21disruptekjust overload `{}`
21:51:27Zevvoh right, sure
21:52:17Zevvit's always a tradeoff. Explicit is good, but often consice is nice too. And if Nim gets away with abusing % for serializing to Json (wtf), then I can get away with abusing $1
21:52:48disruptekoh, i'm fine with the shorter vars, i mean more to solve the .len problem.
21:53:12Zevvoh, but then I don't understand you yet
21:53:33disrupteki think since 0 is always there, you may as well have len ignore it and only count "group" captures.
21:53:57disruptekno one said the $ stuff had to be indices.
21:54:04disrupteksome regexp libs start at 1.
21:54:12Zevvno, but this 1-off also stinks
21:54:14disruptekiirc python does, actually, right?
21:54:29Zevvcould be, I don't know
21:54:32*solitudesf quit (Ping timeout: 268 seconds)
21:54:55Zevvthat's your fix anyway :) http://ix.io/1Z88
21:54:58disruptekthe index only matters if you're going to try to index it.
21:55:16disruptekthanks; i'll commit this and i guess bump the req to npeg 0.20
21:55:41Zevvthere was this other dude the other day, he has been working on a parser for some game script code or something, he also was having these optional captures
21:55:50Zevvso I guess it makes sense to handle that
21:56:02*Hideki quit (Ping timeout: 276 seconds)
21:56:14disrupteki dunno, maybe there's a better way to write my pattern.
21:56:15ZevvI always make my grammars more predictive: optionals go into their own rule and capture from there. If the rule matches, the code runs
21:58:24Zevvbut still, cool to see you using it!
21:59:00disrupteknow i'm back to segments not being evaluat-able in js backend.
21:59:07Zevvright
21:59:23disrupteki like forcing people to install and update npeg.
21:59:34disruptekwe'll get this library to replace pegs in nim. 😁
21:59:51Zevvpleease don't. Then I have to sit on my hands before I type all of the time :)
22:00:05disrupteklol
22:00:08Zevvhm your testcases run fine in js
22:00:11disrupteki never let that hold me back.
22:00:43disruptekhmm, so maybe it's my impl.
22:01:26disruptekthe code that generates amazon/google/azure apis isn't public because i don't want to support people generating their own versions of those apis until, at least, the compiler doesn't need to be changed just to do so.
22:01:45Zevvwhat change would that be
22:02:01disruptekthose tests don't run at compile-time, though.
22:02:12Zevvno I figured
22:02:15disruptekthe vm needs more iterations in order to build those larger apis.
22:03:20Zevvoh right I ran into that a few times
22:03:41disrupteki think the default is like 2MM and i'm running, idk, 10MM or something.
22:04:11Zevvdude
22:04:47disruptekwhat can i say?
22:04:52disrupteki'm hung like a horse.
22:05:13disrupteki mean, i literally own bigdickdigital.com. need i say more?
22:05:25disruptekrollin' 10MM deep.
22:06:09Zevvjust confirmed that parseTemplate runs just fine @ compiletime
22:07:45Zevvif I was bored I'd now register bigdickanalogue or something like that
22:08:17disrupteki registered that one in 1981.
22:08:22Zevvha
22:08:44ZevvNo match for "BIGDICKANALOGUE.COM".
22:09:01disruptekit's ANALOG is US parlance.
22:09:09disrupteks/is/in/
22:09:20Zevvoh well :)
22:09:32Zevvproc foo(): bool = echo parseTemplate("/foo")
22:09:33Zevvconst a = foo()
22:09:34Zevvthat runs
22:09:42disruptekso changing the name doesn't help, neither does init'ing the seq.
22:10:43Zevvmake your templates consts
22:10:57Zevvthey don't exist otherwise @ ct
22:11:03Zevvunless you mark them {.compileTime.}
22:11:20disruptekthe templates are loaded from json.
22:11:42Zevvoh right
22:12:40Zevvhow do I reproduce again?
22:13:28disrupteki guess follow the example on the main page?
22:13:40Zevvpfff that's just silly
22:13:42disruptekhow is it that the tests work?
22:13:55disrupteki mean, how did you run them at compile-time?
22:14:20Zevvno I did proc foo(): bool = echo parseTemplate("/foo") at compiletime
22:14:33Zevvjust to make sure it was not the parser breaking
22:14:34disruptektry that with "{name}"
22:14:53disruptekyou did that in `nim js` backend?
22:15:10Zevvlet me retest
22:15:15disruptekbecause now i'm thinking maybe it's using a cstring or something crazy.
22:15:52Zevvok, {foo} breaks it
22:15:53disruptekjust to remind you, i've never actually seen this work. i picked npeg for this reason, but it couldn't have worked before the recent fix.
22:15:53Zevvmet me see
22:16:04disruptekfix to nim, i mean.
22:16:33disruptekyes, because only {foo} would pass the isTemplate predicate.
22:17:06Zevvyeah
22:17:30disruptekit does seem to be something in npeg, because it crashes in match.
22:17:53disruptekso the peg macro works, at least.
22:18:22Zevvyeah, that works. But if I do a `segments.add` outside the parser its ok
22:18:46*clyybber quit (Quit: WeeChat 2.6)
22:19:16disrupteksome kinda closure issue.
22:21:00*al_ joined #nim
22:21:22Zevvlet me find the issue I filed on nim1.0, that broke npeg in a similar way on js just a day before the 1.0 release
22:21:33disruptekyou evil man.
22:21:41Zevvhm no that was different
22:21:48Zevv"Error: request to generate code for .compileTime proc"
22:22:51*alexander92 joined #nim
22:25:07Zevvgot it
22:25:13Zevvmark your proc .compileTime.
22:25:21Zevvproc parseTemplate*(path: string): TemplateParse {.compileTime.} =
22:25:25disrupteksweet.
22:26:31Zevvsounds like a bug
22:27:09lqdev[m]shashlick: separate what?
22:27:17Zevviirc .compileTime.s only function is to *not* generate run time code for a proc
22:28:06disrupteki can't make the tests work now.
22:28:18Zevvchange them to compile time too
22:28:34disrupteki'm trying, captain!
22:28:44Zevv:)
22:28:50Zevvwe should file this anyway
22:29:08Zevvbut its not a nice minimal snippet if we rely on npeg showing the bug
22:29:46disrupteki'll see if i can shrink it once i patch this.
22:31:12Zevvyeah I found one of those dark cornercases yesterday too. Something with 'when' blocks messing up when used in a .computedGoto. while loop
22:31:20Zevvwho makes that up
22:32:09disrupteka fuzzer.
22:32:14disruptekthat's all npeg is.
22:32:19Zevvha :)
22:38:50Zevvanyway, I'm off for my nap
22:38:58disruptekenjoy; thanks, zevv.
22:39:09Zevvtomorrow's a new day. good luck!
22:42:23disruptekoh, here's a js bug. if you `var foo: seq[string]` inside a loop, it doesn't get emptied on the next iteration. js only.
22:46:03disruptekoh, i guess that's a compile-time only "feature" of both backends.
22:46:15*Hideki joined #nim
22:49:24disruptekhttps://play.nim-lang.org/#ix=1Z8l
22:54:55*krux02 quit (Remote host closed the connection)
22:56:02*ng0 quit (Quit: Alexa, when is the end of world?)
23:13:34*Hideki quit (Disconnected by services)
23:14:14*Hideki_ joined #nim
23:16:27disruptekkrab4t huh, i guess lmdb is supported on windows. did you try it?
23:46:09*fanta1 joined #nim
23:49:08*Hideki_ quit (Ping timeout: 276 seconds)
23:50:46*Willyboar joined #nim
23:50:50*test12316 joined #nim
23:57:40*letto quit (Quit: Konversation terminated!)
23:58:07*letto joined #nim
23:59:28*test12316 left #nim (#nim)