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:29 | FromGitter | <xmonader> ```code paste, see link``` ⏎ ⏎ anyone faced that before? sounds like new thing [https://gitter.im/nim-lang/Nim?at=5da922d5894dee56e5616925] |
02:26:50 | disruptek | sometimes i wish i could read gitter. |
02:27:58 | leorize | sounds like a bug to me |
02:28:00 | FromGitter | <xmonader> i think maybe the problem that i'm trying to use join on seq[string] instead of on openArray[string] ? |
02:28:23 | leorize | how can an operator for `string` matches `seq[string]` |
02:28:38 | leorize | can you try to switch to devel and see if it works? |
02:29:17 | FromGitter | <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:24 | FromGitter | <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:48 | disruptek | because choosenim. |
02:33:14 | FromGitter | <xmonader> @disruptek? How I just installed choosenim 4 days ago https://github.com/dom96/choosenim/issues/142 |
02:33:55 | disruptek | i never have these issues. also, i never use choosenim. |
02:34:24 | FromGitter | <xmonader> is there another alternative or just manual compilation with some makefiles? |
02:34:47 | disruptek | you mean `sh build_all.sh`? |
02:35:18 | disruptek | it takes <9s for me to build nim. |
02:35:46 | FromGitter | <xmonader> ah i confused choosenim and nimble all together my bad |
02:36:02 | shashlick | choosenim works great for me |
02:38:16 | disruptek | i guess you could have a converter at play. |
02:40:02 | * | nif quit (Quit: ...) |
02:40:13 | * | nif_ joined #nim |
02:42:40 | disruptek | reproduced it with a converter. |
02:43:45 | disruptek | converters are dangerous. |
02:44:19 | disruptek | i used them in the beginning, now, not so much. |
02:45:36 | disruptek | https://play.nim-lang.org/#ix=1Z26 |
02:46:33 | FromGitter | <xmonader> pfff @disruptek thank you so much |
02:46:40 | FromGitter | <xmonader> i know where is the problem, it's in jester. |
02:47:42 | leorize | why would jester export a converter? |
02:48:05 | FromGitter | <xmonader> it's not exported i'm trying somethings internally in there |
02:52:25 | disruptek | for Araq's birthday next year, i think we should all read the manual. |
02:54:19 | * | laaron- joined #nim |
02:54:41 | FromGitter | <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:38 | disruptek | relax, i don't think his birthday is for many months. |
02:56:00 | * | laaron- joined #nim |
02:56:31 | FromGitter | <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:09 | jken | lmariscal, I got imgui loading the shared object using the c backend! |
03:05:54 | disruptek | jken: congrats; what was the issue?! |
03:06:31 | jken | https://github.com/nimgl/imgui/blob/master/src/imgui.nim#L36 |
03:06:45 | jken | That line needs to be changed to use "libcimgui.so" and not "cimgui.so" |
03:07:21 | jken | I 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:29 | disruptek | omg of course. |
03:07:45 | jken | I still don't see lbcimgui.so in the output of `ldd ./myBinary` |
03:07:47 | jken | but it works |
03:07:54 | disruptek | how did it ever create the binary, though? |
03:08:04 | jken | still a valid question. |
03:08:07 | disruptek | that's nuts, congrats. |
03:10:35 | jken | I 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:51 | disruptek | you have libdl.so in your `ldd` output? |
03:12:02 | jken | Yes, I do. |
03:12:15 | jken | Let me guess, "dynamic load"? |
03:12:42 | disruptek | yeah. |
03:14:01 | * | laaron- quit (Quit: ZNC 1.7.4 - https://znc.in) |
03:14:25 | * | laaron- joined #nim |
03:18:26 | leorize | nim dynlib basically uses dlopen :P |
03:18:42 | leorize | because Araq don't want people to install development packages |
03:21:40 | disruptek | ah, you can only have one setter regardless of signature. |
03:21:51 | disruptek | i knew there would be some kinda gotcha that would kill setters for me. |
03:22:18 | leorize | sounds like a bug tbh |
03:22:18 | disruptek | bad 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:24 | leorize | if you want to have setters working in the defined module, change the field name in object declaration |
03:23:52 | disruptek | i don't want to have to guess at the semantics. |
03:24:14 | disruptek | i know that's absolutely bananas of me. |
03:25:11 | * | chemist69 quit (Ping timeout: 276 seconds) |
03:26:31 | leorize | iirc 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:48 | leorize | the other ways just make you guess more |
03:27:00 | * | chemist69 joined #nim |
03:40:25 | FromGitter | <xmonader> i think i found a bug ⏎ https://play.nim-lang.org/#ix=1Z2j |
03:52:59 | FromDiscord | <demotomohiro> I think it is not a bug |
03:53:00 | FromDiscord | <demotomohiro> https://nim-lang.org/docs/manual.html#types-procedural-type |
03:55:07 | FromDiscord | <demotomohiro> calling convention of `myproc` is closure but calling convention of `proc1` and `proc2` is nimcall. |
03:57:48 | FromGitter | <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:37 | FromDiscord | <demotomohiro> @xmonader I added {.closure.} pragma to `proc1` and `proc2` to your code, then it worked. |
04:03:32 | FromGitter | <xmonader> ah wait i need to added to the procs themselves not to the the `type` ? |
04:03:40 | FromDiscord | <demotomohiro> Or adding {.nimcall.} pragma to `myproc` work |
04:04:24 | FromGitter | <xmonader> i really need to read a bit on that |
04:04:29 | FromGitter | <xmonader> what if i want to have named functions? |
04:06:11 | FromDiscord | <demotomohiro> According to this: |
04:06:12 | FromDiscord | <demotomohiro> https://nim-lang.org/docs/manual.html#types-procedural-type |
04:06:12 | FromDiscord | <demotomohiro> nimcall is the default convention used for a Nim proc. |
04:06:36 | FromDiscord | <demotomohiro> closure |
04:06:37 | FromDiscord | <demotomohiro> is the default calling convention for a procedural type that lacks any pragma annotations. |
04:07:00 | * | theelous3_ joined #nim |
04:07:25 | FromGitter | <xmonader> thank you so much |
04:19:57 | FromDiscord | <demotomohiro> https://play.nim-lang.org/#ix=1Z2s |
04:20:08 | FromDiscord | <demotomohiro> This code might help |
04:20:44 | FromGitter | <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:35 | FromGitter | <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:29 | FromDiscord | <juan_carlos> https://nim-lang.github.io/Nim/filters.html |
04:36:35 | FromDiscord | <treeform> also https://nimble.directory/pkg/nwt |
04:36:46 | FromDiscord | <juan_carlos> Karax |
04:41:14 | * | rockcavera quit (Ping timeout: 276 seconds) |
04:44:06 | FromGitter | <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:47 | PMunch | narimiran[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:57 | alexander92 | Async procedure (test) yielded `nil`, are you await'ing a `nil` Future? |
07:57:00 | alexander92 | what does this mean |
07:57:02 | PMunch | Hmm, using c2nim on a file containing this: http://ix.io/1Z3g gives me an error that "empty" is not expected |
07:57:25 | PMunch | alexander92, well, it means just that |
07:57:28 | alexander92 | but |
07:57:30 | alexander92 | i just return |
07:57:34 | alexander92 | in a {.async.} |
07:57:38 | alexander92 | i expect to return future void |
07:57:46 | PMunch | Snippet? |
07:57:47 | * | ng0 joined #nim |
07:57:47 | alexander92 | ok, i return in a quote in a macro |
07:57:59 | PMunch | Hmm |
07:58:24 | * | couven92 joined #nim |
07:59:41 | alexander92 | mm |
07:59:56 | alexander92 | ix.io/1Z3h |
08:00:29 | PMunch | Yeah.. |
08:00:38 | PMunch | That's an issue with async |
08:00:51 | Mister_Magister | !eval echo("doot doot") |
08:00:54 | NimBot | doot doot |
08:01:00 | Mister_Magister | :3 |
08:01:18 | PMunch | It reads through the body of the procedure and rewrites "return" to something else IIRC |
08:01:35 | alexander92 | oooh |
08:01:42 | PMunch | But since you don't have return in the body it doesn't work.. |
08:01:47 | alexander92 | but |
08:01:50 | alexander92 | ohyeah |
08:01:53 | PMunch | It's, uhm, hard to fix |
08:01:55 | alexander92 | so i need a dirty template |
08:02:56 | * | gmpreussner quit (Ping timeout: 240 seconds) |
08:03:27 | PMunch | Nope, still won't work I think |
08:03:29 | PMunch | http://ix.io/1Z3i |
08:03:34 | alexander92 | nah the same |
08:03:37 | alexander92 | ye |
08:03:44 | * | gmpreussner joined #nim |
08:03:45 | PMunch | If you look at this example, and then use --expandMacro:async when you compile |
08:03:51 | PMunch | You will see what is happening |
08:04:24 | PMunch | The first body comes out as: http://ix.io/1Z3j |
08:04:35 | PMunch | As you can see the return statement is added into the body |
08:04:57 | PMunch | However in the second example it comes out as: http://ix.io/1Z3k |
08:05:29 | PMunch | Here 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:26 | PMunch | This is why I don't like to traverse a regular Nim code tree to do look for certain things |
08:26:46 | PMunch | It completely breaks down with templates and macros |
08:28:28 | PMunch | We 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:45 | PMunch | But 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:29 | PMunch | Hmm, 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:31 | PMunch | By 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:37 | PMunch | Oh wait.. |
09:28:43 | PMunch | That doesn't work with await.. |
09:28:45 | * | Hideki_ joined #nim |
09:30:30 | PMunch | What you can do is wrap your proc body in a named block, and then in your template break to that block |
09:31:42 | PMunch | Like so: https://play.nim-lang.org/#ix=1Z3R |
09:32:59 | * | asymptotically joined #nim |
09:33:56 | PMunch | Or if you need to return a value: https://play.nim-lang.org/#ix=1Z3S |
09:36:52 | FromGitter | <alehander42> thank you |
09:37:13 | * | asymptotically quit (Remote host closed the connection) |
09:37:46 | PMunch | No problem |
09:38:36 | PMunch | I 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:20 | FromDiscord | <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:59 | FromDiscord | <krab4t> and with regex on ubuntu from 0.38 - 0.42, vs windows' 0.28 - 0.32 |
09:59:11 | FromDiscord | <krab4t> and with regex on ubuntu from 0.038 - 0.042, vs windows' 0.028 - 0.032, fixed |
10:02:04 | FromGitter | <zetashift> Reading that FOSDEM thread on the forum brings joy to my heart |
10:02:39 | FromGitter | <zetashift> well played PMunch and anyone else who helped! |
10:03:01 | alexander92 | pmunch thank you <3 |
10:03:06 | alexander92 | for the return thing |
10:03:16 | alexander92 | i dont really need it maybe in the case |
10:03:24 | alexander92 | because i realized i dont need to stop |
10:03:36 | alexander92 | basically reimplementing something similar to simple unittest |
10:03:39 | alexander92 | dsl |
10:03:46 | alexander92 | i can just continue with the next check |
10:03:56 | alexander92 | but it would be good to have a solution like that |
10:10:12 | Araq | PMunch: there are solutions to the problem |
10:11:08 | Araq | proc detectMe() = discard |
10:11:16 | Araq | template keywordLike = detectMe() |
10:11:26 | Araq | macro m(x: typed) = |
10:11:39 | Araq | ... 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:11 | Araq | any opinions? https://github.com/nim-lang/Nim/pull/12454 |
10:18:52 | FromGitter | <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:01 | PMunch | zetashift, well we aren't done yet :) Still need to get speakers! |
10:25:52 | PMunch | Araq, ah because with typed it will be run after everything has been expanded? |
10:26:53 | PMunch | That should really be implemented within the async macro.. |
10:27:44 | Araq | hint: it's hard |
10:27:58 | PMunch | It is? |
10:28:09 | Araq | maybe not in theory but in practice |
10:28:18 | Araq | who knows what it'll break |
10:28:52 | PMunch | Hmm |
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:46 | alexander92 | i have to finish |
10:49:54 | alexander92 | that port of the chronos await as template pr |
10:49:57 | alexander92 | as well |
10:50:08 | alexander92 | it enables to use await in macros etc at least |
10:50:17 | alexander92 | but i had some weird type errors that i just couldnt understand |
10:50:34 | alexander92 | which seemed like expected A but not A |
10:50:51 | alexander92 | i managed to fix it by cast[A](thing that is A) |
10:50:55 | alexander92 | iirc |
10:51:23 | * | FromGitter quit (Read error: Connection reset by peer) |
10:51:41 | * | FromGitter joined #nim |
10:53:02 | PMunch | Araq, 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:42 | PMunch | Ugh.. |
10:59:57 | PMunch | Yeah 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:55 | Araq | alexander92: er... |
11:25:09 | Araq | better fix the compiler instead |
11:28:21 | FromDiscord | <krab4t> ` dumpbin /dependents ` on Windows show ` LINK : fatal error LNK1328: missing string table ` its normal? |
11:34:52 | FromGitter | <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:58 | Araq | cast[JSObject](x) might do this trick |
11:39:09 | FromGitter | <geotre> @Araq thanks for the idea, doesn't seem to work though I'm afraid |
11:39:35 | FromGitter | <geotre> Someone must have done this for other wrapped js libs, I'll try to find one |
11:41:04 | alexander92 | hmm |
11:41:12 | alexander92 | why do you want to pass a JsonNode |
11:41:22 | alexander92 | i usually just use native json parse |
11:41:27 | alexander92 | and directly cast it to a nim type |
11:41:39 | FromGitter | <geotre> I want to construct a json object in nim code that is used as a config for a js function |
11:41:42 | alexander92 | for the javascript backend |
11:42:02 | alexander92 | ok, but you can use |
11:42:04 | alexander92 | JsObject |
11:42:14 | alexander92 | JsObject{a: 2, b: 4} |
11:42:17 | alexander92 | etc |
11:42:50 | alexander92 | maybe 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:06 | alexander92 | maybe i dont understand your case tho ! |
11:43:16 | FromGitter | <geotre> Doing that doesn't seem to work for arbitrary object structure though |
11:43:40 | FromGitter | <geotre> There isn't a `%*` equivalent for JsObject |
11:44:22 | FromGitter | <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:39 | FromGitter | <xmonader> pfff can't believe it wrote a webframework in < 750 lines |
11:45:16 | * | EvilKhaosKat joined #nim |
11:45:35 | PMunch | xmonader, it? |
11:46:07 | FromGitter | <xmonader> @PMunch i meant I did :D |
11:46:37 | PMunch | Haha, nice |
11:46:41 | PMunch | Published? |
11:46:48 | FromGitter | <xmonader> https://github.com/xmonader/nim-servy/blob/master/src/servy.nim#L631 |
11:47:26 | FromGitter | <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:59 | FromGitter | <xmonader> i took httpcodes from http pure in nim and http headers wrappers from jester |
11:50:48 | PMunch | Hmm, interesting |
11:50:59 | PMunch | I'm writing my own little web framework as well :P |
11:51:10 | PMunch | Or rather toying around with some ideas |
11:51:33 | FromGitter | <xmonader> interesting like what? |
11:52:01 | PMunch | It's just interesting to see what different people implement :) |
11:52:29 | FromGitter | <xmonader> indeed, lucky there're lots of code out there to learn from |
11:57:38 | FromGitter | <xmonader> @PMunch do u support chunked responses in ur framework? |
11:57:54 | FromGitter | <xmonader> I'd like to find a good idea instead of passing the socket around |
11:57:55 | PMunch | So far my "framework" is ~130 lines |
11:57:58 | PMunch | So no :P |
11:58:15 | Zevv | "Ha! Mine is smaller then yours" |
11:58:20 | FromGitter | <xmonader> i bet it's lots of macro vodoo that exapnds to 1300 lines xD |
11:58:31 | PMunch | Well, not yet :P |
11:59:22 | FromGitter | <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:57 | PMunch | Hmm, in Jester parseUrlQuery is marked as deprecated saying "use stdlib", which procedure in stdlib does it mean? |
12:06:19 | FromGitter | <xmonader> I've no idea i was wonder about that too! |
12:06:46 | FromGitter | <xmonader> and also I think there's a bug in the existing code already |
12:06:54 | PMunch | dom96, any insight? |
12:07:48 | alexander92 | geotre good |
12:12:16 | Araq | PMunch: uri.parseUri ? |
12:14:16 | PMunch | Well, that just parses the query into a single string |
12:14:32 | PMunch | But 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:41 | jken | lmariscal, do you accept PRs on nimgl/imgui? |
12:56:42 | PMunch | Hmm, in a generic macro is there a way to peek at T? |
13:00:18 | PMunch | ie. in this example to read the fields in the tuple: https://play.nim-lang.org/#ix=1Z54 |
13:02:13 | Araq | I don't know :-) |
13:02:43 | PMunch | Well 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:57 | FromGitter | <alehander42> why |
13:25:00 | FromGitter | <alehander42> do you need that |
13:25:21 | FromGitter | <alehander42> also, can you pass |
13:25:26 | FromGitter | <alehander42> the type as first typed argument |
13:25:30 | FromGitter | <alehander42> makes it even for better dsl |
13:30:35 | FromGitter | <alehander42> yes |
13:30:40 | FromGitter | <alehander42> https://play.nim-lang.org/#ix=1Z5h |
13:32:45 | FromDiscord | <willyboar> @xmonader this will be day 18? |
13:34:18 | PMunch | alehander42, that is exactly what I ended up doing :P |
13:34:46 | PMunch | I need it to create an overloadable deserialiser |
13:35:07 | PMunch | They will all take a string, but can return different types |
13:46:54 | * | theelous3 joined #nim |
13:47:43 | * | solitudesf joined #nim |
13:53:33 | FromGitter | <xmonader> @Willyboar yesthat's the plan :D but i think it'll be bit long |
13:53:55 | FromGitter | <Willyboar> never mind. I cant wait to read it :) |
13:54:21 | FromGitter | <xmonader> thank you hope it'll be up to the expectation ^_^ |
13:55:17 | FromGitter | <Willyboar> Well, i am new to nim and web is my main target |
13:56:21 | FromGitter | <Willyboar> Yesterday i proposed to @Kiloneie to rec your days projects |
13:56:24 | FromGitter | <Willyboar> :) |
13:56:50 | FromGitter | <xmonader> there was that great introduction to karax |
13:57:00 | FromGitter | <xmonader> that's sno nice of you! I'm sure that will be so amazing |
13:57:00 | PMunch | Up to a bit over 200 lines now xmonader |
13:57:35 | FromGitter | <xmonader> @Pmunch u need to with macro expansions or without :P |
13:59:34 | PMunch | That is before expansions |
13:59:58 | PMunch | But I don't have any crazy macros right now |
14:00:06 | FromGitter | <xmonader> i'm curious can i take a look? |
14:00:07 | PMunch | Just a little rewrite there, a touch of logic there |
14:00:38 | PMunch | Hmm, you're on Gitter so I can't PM you |
14:01:01 | FromGitter | <xmonader> if u r on the telegram channel i can! |
14:02:58 | PMunch | PM'ed you on gitter :) |
14:04:20 | PMunch | The goal is to have something where you are able to automatically generate API documentation |
14:04:40 | PMunch | And have a type-safe API |
14:04:57 | * | PMunch quit (Remote host closed the connection) |
14:06:39 | FromGitter | <xmonader> generate API documentation or generate code from API documentation ? |
14:12:55 | * | Romanson joined #nim |
14:23:03 | FromGitter | <alehander42> PMunch i love web frameworks |
14:24:01 | FromGitter | <alehander42> hope you make an interesting one :P, for me seamless but very typesafe routing (api / graphql) <=> validations => db |
14:24:06 | FromGitter | <alehander42> is most interesting |
15:05:11 | Araq | progress: https://www.sciencealert.com/mathematicians-have-discovered-an-astonishing-new-way-to-multiply-large-numbers |
15:05:46 | lqdev[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:47 | lqdev[m] | also, for some reason, every cImport takes a painfully long amount of time. is cImport not cached at all? |
15:10:14 | FromDiscord | <Rika> is it possibly to deepcopy a nimnode |
15:13:49 | Araq | copyTree |
15:15:04 | Araq | ah what I'm doing is completely wrong |
15:15:18 | Araq | time to abandon the araq-gc-destructors branch I guess |
15:16:09 | Araq | need to jog/sleep over it, bbl |
15:17:32 | lqdev[m] | nvm, cSkipSymbol needs to be in a `static:` block |
15:24:38 | * | nif_ quit (Quit: ...) |
15:24:48 | * | nif joined #nim |
15:24:58 | lqdev[m] | I'm getting this error again https://termbin.com/6g0v |
15:25:20 | lqdev[m] | except, this time it destroys the whole compilation |
15:25:37 | lqdev[m] | s/compilation/`nim check` run/ |
15:26:40 | disruptek | Araq: yikes. |
15:27:19 | lqdev[m] | https://nimterop.github.io/nimterop/types.html#wchar_t oh. |
15:27:19 | lqdev[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:05 | lqdev[m] | because `<cwchar>` is a C++ STL header |
15:28:47 | lqdev[m] | where can I get a wchar_t in C? |
15:30:02 | lqdev[m] | or, in Nim? |
15:30:41 | disruptek | i have three of them i can send you for the right price. |
15:31:22 | lqdev[m] | lol |
15:31:23 | leorize | lqdev[m]: import from wchar.h |
15:31:23 | disruptek | see /usr/include/wchar.h |
15:32:02 | leorize | for every c<something>, there's a <something>.h :P |
15:32:13 | disruptek | yer blowin' my mind right now. |
15:32:25 | lqdev[m] | oh wait, nimterop/types only defines wchar_t if Nim is older than 0.19.9, wtf |
15:32:42 | leorize | but Nim has widestr so there has to be one somewhere already |
15:33:46 | shashlick | hey just catching up |
15:34:10 | lqdev[m] | I'm still wondering why is cImport so slow with nim check |
15:34:24 | shashlick | are you disabling caching? |
15:34:29 | lqdev[m] | it's perfectly fine when running `nim c` |
15:34:37 | lqdev[m] | no |
15:35:34 | * | tklohna_ quit (Ping timeout: 265 seconds) |
15:36:25 | lqdev[m] | leorize: widestrs doesn't have wchar_t, it defines its own wchar type which is Linux-incompatible afaict |
15:36:52 | shashlick | wchar_t is defined for > 0.19.9 also in the else |
15:37:15 | shashlick | https://github.com/nimterop/nimterop/blob/master/nimterop/types.nim#L20 |
15:37:24 | lqdev[m] | oh, I see |
15:37:47 | lqdev[m] | it's not present in `nim check` for some reason |
15:38:02 | FromGitter | <awr1> hello |
15:38:06 | lqdev[m] | well I just define it myself |
15:38:34 | shashlick | so i need an else? |
15:38:45 | * | Trustable joined #nim |
15:39:00 | shashlick | try adding an else on line 35 |
15:39:14 | lqdev[m] | shashlick: likely |
15:39:18 | disruptek | i don't use `nim check` since it's not always the same as a proper compile. bummer, that. |
15:39:21 | lqdev[m] | hello, @awr1 |
15:40:06 | lqdev[m] | disruptek: tell that to the VS Code plugin's author |
15:40:17 | lqdev[m] | I don't use it too, the VS Code plugin uses it for error highlighting |
15:41:46 | lqdev[m] | I wonder how good the Sublime Text 3 plugin is |
15:41:50 | shashlick | okay let's fix it then |
15:41:57 | shashlick | what's your latest wrapper look like |
15:42:56 | lqdev[m] | shashlick: https://github.com/liquid600pgm/rapid/tree/sdl2/src/rapid/lib/sdl |
15:44:06 | shashlick | which file should I test |
15:44:37 | lqdev[m] | sdl_base.nim |
15:45:46 | shashlick | how come git clone doesn't get the sdl directory |
15:45:49 | FromGitter | <awr1> i used vs code for a week and then went back to emacs |
15:46:09 | FromGitter | <awr1> also i think you have to clone the whole repo |
15:46:34 | krux02 | awr1: I used vs code for a day, saw that it doesn't have proper keyboard support, and went back to emacs. |
15:46:43 | FromGitter | <awr1> @shashlick https://stackoverflow.com/a/600189 |
15:47:10 | FromGitter | <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:10 | lqdev[m] | shashlick: it's a branch |
15:48:16 | krux02 | I really like to rant about web technology. |
15:49:03 | FromGitter | <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:05 | shashlick | okay missed that |
15:49:24 | shashlick | @awr1 which OS |
15:49:37 | FromGitter | <awr1> i use linux and windows |
15:50:09 | shashlick | okay then check out feud on windows |
15:50:17 | FromGitter | <awr1> i have been meaning to |
15:50:25 | krux02 | I 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:02 | krux02 | temporary contest should be popup |
15:51:18 | krux02 | not change the state of my editor. I really really hate that in emacs. |
15:51:19 | disruptek | pfft you have org mode and a proper lisp; your complaints are meaningless here. 😝 |
15:51:27 | krux02 | Apart from that I really like a lot in that editor. |
15:52:15 | krux02 | I am not really a fan of modal editing. |
15:52:18 | shashlick | how do you check if we are in `nim check` mode |
15:52:26 | shashlick | when defined(check) isn't working |
15:52:48 | krux02 | The leader key in the vim world is fine, but modal editing isn't really worth it in my opinion. |
15:53:01 | disruptek | next time i have some code that passes check but not compile, we'll turn it into a boolean test for ya. |
15:53:20 | krux02 | I 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:52 | shashlick | without scientific testing, every statement is an subjective |
15:54:42 | disruptek | it's hacktober, someone write me a password generator that takes keyboard heatmap into account. |
15:54:54 | disruptek | please and thank you. |
15:55:05 | lqdev[m] | any ideas on why NimLime doesn't check any errors? |
15:55:47 | disruptek | it's a shame you cannot use vim; leorize's plugin works quite well and it sees a lot of active support. |
15:57:15 | lqdev[m] | disruptek: I just don't get vim. it's weird to use |
15:57:40 | disruptek | honestly, i would find a way to use emacs. |
15:57:53 | disruptek | i really think it affords the most dividends long-term. |
15:58:04 | disruptek | i think i may just be too old to switch, or i'd be there. |
15:58:32 | shashlick | @lqdev - oky fixed the wchar_t issue |
15:58:36 | shashlick | nim check is also very fast |
15:58:43 | shashlick | what all should i try |
15:59:06 | disruptek | lmdb |
15:59:34 | * | Hideki_ quit (Remote host closed the connection) |
16:00:09 | lqdev[m] | shashlick: try compiling src/rapid/gfx/window/window_lowlevel |
16:00:18 | lqdev[m] | or, running nim check on it |
16:00:23 | * | Hideki joined #nim |
16:00:23 | * | nsf quit (Quit: WeeChat 2.6) |
16:01:14 | shashlick | nim c = 6 seconds |
16:01:23 | shashlick | nim chec = 1.5 seconds |
16:01:42 | disruptek | wrong answers are always faster to arrive. |
16:01:42 | jken | disruptek, turns out I was wrong yesterday about the naming of my cimgui.so being the issue. |
16:01:50 | jken | nim only checks /usr/lib64 |
16:01:56 | jken | and skips ldconfig entirely |
16:02:07 | disruptek | wow, but it checks two names? |
16:02:45 | jken | I said to dynload libcmgui.so |
16:02:50 | jken | and these are all the open calls in a strace looking for it: https://paste.debian.net/1108046/ |
16:03:17 | jken | Ignores /usr/lib entirely |
16:03:24 | jken | which I guess is sane on a 64 bit system? |
16:03:47 | jken | but not using ldconfig is definitely confusing |
16:03:47 | disruptek | it's not even looking for .so |
16:04:20 | * | NimBot joined #nim |
16:04:37 | * | Hideki quit (Ping timeout: 240 seconds) |
16:04:41 | jken | disruptek, sorry that is my bad, I left .so off of the string in the code |
16:04:59 | disruptek | that makes more sense. 😁 |
16:05:26 | jken | but it also does not check the current path either |
16:05:28 | disruptek | i'm not sure how sane that is. |
16:05:49 | jken | so even shipping a .so alongside my binary won't work out of the box |
16:06:02 | jken | there might be way to tell nim where to look that I don't know about? |
16:06:03 | disruptek | maybe you'd need to compile differently to enable 32-bit loads? |
16:06:25 | disruptek | is your project oss? |
16:06:33 | lqdev[m] | shashlick: it looks like toast takes a long time (approx. 0.2s) to start |
16:06:46 | lqdev[m] | that's what slows compilation down |
16:06:50 | jken | disruptek, no but I could give you access, its nothing secret |
16:07:10 | disruptek | i'm just curious and i'd like to build it on my machine. |
16:07:23 | disruptek | but i know you're made some tweaks to get as far as you have. |
16:07:33 | shashlick | @lqdev - can you check if it is compiled with -d:danger |
16:07:36 | disruptek | i've been interested in imgui, i just haven't used it myself. |
16:07:50 | jken | Just use the git version of imgui, not the one you get from nimble, |
16:07:51 | lqdev[m] | shashlick: how can I check that? |
16:08:02 | shashlick | was it nimble install'd? |
16:08:06 | disruptek | just clone nimgl? |
16:08:06 | jken | this one: https://github.com/nimgl/imgui |
16:08:18 | jken | disruptek, its seperate from nimgl, as I don't use nimgl in my project |
16:08:25 | disruptek | alrighty. |
16:08:40 | shashlick | @lqdev - also, toast shouldn't run unless the headers are changed |
16:08:48 | shashlick | it should load from cache |
16:09:14 | disruptek | and i run the test with -d:something? |
16:09:16 | jken | disruptek, whats your github username? |
16:09:27 | disruptek | get yourself a pen and paper; it's complicated. |
16:09:34 | jken | disruptek, if you mean the lmgui test, just make sure you use the c backend |
16:09:37 | disruptek | `disruptek` |
16:09:40 | jken | lol |
16:09:57 | disruptek | yeah, i'm from the states. |
16:10:01 | jken | I did search for that before asking, must have typoed |
16:10:13 | jken | invited you to my repo |
16:10:34 | disruptek | you don't need nimgl but you do need nimgl/opengl? |
16:10:54 | jken | Their test uses nimgl.. |
16:10:59 | jken | my repo does not, I use the raw opengl package |
16:11:08 | disruptek | ah, okie. |
16:11:24 | disruptek | now i'm seeing errors like you saw yesterday. should go faster from here. 😁 |
16:11:34 | jken | You'll probably want to clone and nimble develop the nimgl repo for their test |
16:14:16 | jken | oh, and to get cimgui.so, clone https://github.com/cimgui/cimgui and make |
16:14:51 | disruptek | and there's some kinda git submodule thing? |
16:15:08 | disruptek | is that just the cimgui stuff? |
16:15:34 | disruptek | i was never actually privy to what you did to fix that. |
16:15:54 | jken | git submodule update --recursive --remote --init . |
16:16:42 | jken | the 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:50 | disruptek | thanks, that worked. |
16:16:52 | jken | nimgl uses submodules for their stuff too |
16:16:53 | jken | np |
16:17:58 | disruptek | i thought the vulcan.c missing was due to -d:imguiDll needing defined? |
16:19:36 | jken | I don't recall specifically. |
16:20:01 | jken | Are you getting that when building the imgui tests/test.nim? |
16:20:07 | disruptek | yeah. |
16:20:26 | disruptek | maybe i need to do this gen thing first. |
16:20:51 | jken | builds for me without -d:imguiDll |
16:22:05 | disruptek | do you have src/private/glfw? |
16:22:16 | jken | yes, it came in as a submodule |
16:22:37 | shashlick | @lqdev - pushed a wchar_t fix to head |
16:22:38 | disruptek | odd, not for me. |
16:22:46 | jken | its a submodule of nimgl, not imgui |
16:22:51 | disruptek | ah |
16:23:02 | jken | kind of confusing |
16:23:05 | disruptek | bingo. 😀 |
16:23:58 | disruptek | okay, now i'm at that "can't find it" point. |
16:24:10 | jken | welcome :) |
16:24:16 | disruptek | 😁 |
16:24:38 | disruptek | i have like 30 libs linked into this thing, maybe more. |
16:24:57 | disruptek | 34 |
16:25:09 | jken | ldd ./test |wc -l |
16:25:09 | jken | 20 |
16:25:15 | jken | 20 for me |
16:25:16 | lmariscal | jken 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:26 | jken | lmariscal, turns out that was a red hearing |
16:25:42 | jken | and its more about where nim looks for libs then about their names |
16:26:12 | disruptek | i set my LD_LIBRARY_PATH and it worked. |
16:26:17 | lmariscal | oh, so how did you fixed it in you end? |
16:26:40 | jken | lmariscal, I think i got a false positive by importing imgui but not actually calling my ig methods.. |
16:26:49 | lqdev[m] | shashlick: yeah, I just ran `nimble install nimterop@#head` |
16:27:21 | disruptek | lmariscal: how do we get our binaries to find the library? you don't have a linux box, right? |
16:27:22 | jken | disruptek, oh really? Did you set it to the pwd? |
16:27:26 | shashlick | I'm not sure if nimble uses danger by default or release |
16:27:30 | lmariscal | hmm, so the issue still occures but it seems like disruptek has it working? |
16:27:45 | disruptek | when you set it, did you export your LD_LIBRARY_PATH? are you using bash? |
16:27:50 | lqdev[m] | hm, now it's faster |
16:27:50 | jken | We are in the midst of figuring that out :P |
16:28:02 | lqdev[m] | 1.013 sec total |
16:28:02 | lmariscal | disruptek sorry a little lost here, what do you mean by getting the binaries? |
16:28:11 | jken | I set it in the same line as my invocation of the binary. trying again |
16:28:24 | disruptek | oh, that should work, too, in bash. |
16:28:37 | disruptek | lmariscal: i mean, we're building programs that cannot find the library. |
16:28:42 | * | Hideki joined #nim |
16:28:51 | jken | oh wtf, |
16:28:54 | disruptek | we need a way to set the search path for the dl. |
16:28:57 | jken | LD_LIBRARY_PATH=$(pwd) ./test |
16:29:00 | jken | that works for me ^ |
16:29:06 | jken | with cimgui.so in the same dir as my binary |
16:29:31 | * | Hideki quit (Remote host closed the connection) |
16:29:37 | disruptek | yeah, but we want a way to encode that into the binary. |
16:30:40 | lmariscal | I could pass the L flag at compile time to locate the library location |
16:30:47 | shashlick | Then compile the binary with full path to the so |
16:30:49 | jken | yeah, I won't be in control of how my binary is invoked |
16:30:50 | disruptek | --rpath seems to be the only one. |
16:31:10 | * | filcuc quit (Ping timeout: 252 seconds) |
16:31:25 | * | Hideki joined #nim |
16:32:28 | lqdev[m] | shashlick: you're saying toast is ran again if the processed header is changed? |
16:32:39 | lqdev[m] | well it seems like it runs whenever any of my Nim source files are changed |
16:32:48 | lmariscal | do you think that the dl name should be libcimgui.so or cimgui.so? |
16:33:12 | jken | If I clone cimgui and `make`, it produces cimgui.so |
16:33:36 | jken | but ldconfig uses the lib prefix for libs in /usr/lib |
16:33:38 | lqdev[m] | lmariscal: according to unix conventions, the format is lib$1.so |
16:33:45 | disruptek | this. |
16:35:32 | lmariscal | I will open an issue later in cimgui to discuss a change in the name |
16:35:40 | shashlick | @lqdev - if the nim file being compiled has changed, it will rerun toast |
16:36:19 | shashlick | sorry no, if the h file being cImported has changed, it will rerun toast |
16:36:20 | * | Hideki quit (Ping timeout: 268 seconds) |
16:36:49 | shashlick | https://github.com/nimterop/nimterop/blob/master/nimterop/cimport.nim#L169 |
16:36:53 | shashlick | uses gorgeEx caching |
16:37:07 | shashlick | or if the command line changes somehow |
16:37:22 | shashlick | unless you use -f which will force rerun |
16:38:31 | lqdev[m] | shashlick: right, but the slowdown occurs whenever I modify my Nim source code |
16:38:56 | lqdev[m] | and it seems to get stuck for a brief amount of time on each `# Importing …` message |
16:39:11 | lqdev[m] | which suggests that it re-runs toast |
16:39:41 | shashlick | how can i recreate what you are seeing |
16:39:58 | jken | disruptek, so how does rpath work? |
16:40:10 | disruptek | it doesn't. |
16:40:28 | jken | oh. :P |
16:40:39 | disruptek | LD_RUN_PATH doesn't seem to work, either. |
16:40:44 | lmariscal | but I will look into passing into the compiler the `L` flag |
16:40:51 | disruptek | that didn't work, either. |
16:41:04 | disruptek | i don't think i'm using rpath right. |
16:42:50 | lmariscal | the L flag didnt work? |
16:42:57 | disruptek | no. |
16:43:02 | disruptek | shashlick knows how to do this. |
16:43:05 | disruptek | dude. |
16:43:22 | disruptek | how 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:02 | disruptek | lemme see see the linker command he uses. |
16:45:43 | FromGitter | <awr1> @jken did you use passL |
16:45:46 | FromGitter | <awr1> and not passC |
16:46:18 | FromGitter | <awr1> i think i brought this up yesterday, had to look back at some old code i had which did something similar |
16:46:48 | disruptek | why can't i make rpath work? |
16:46:48 | lqdev[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:17 | lqdev[m] | it doesn't even have to be window_lowlevel.nim, it can be any of the sdl_*.nim files |
16:48:07 | disruptek | the word `path` does not appear on the linker options page for gcc. |
16:48:23 | jken | awr1, imgui uses {.push dynlib: imgui_dll, cdecl, discardable.} |
16:48:33 | jken | where imgui_dll is "cimgui.so" |
16:49:28 | disruptek | i fixed it! |
16:49:47 | disruptek | "--passL:-Xlinker -rpath $THE_DIR" |
16:49:48 | shashlick | @lqdev - with -f, it takes 1.8 seconds, without -f it takes 1.4 seconds |
16:50:36 | shashlick | probably what's going on is that gorgeEx caching doesn't do anything in check mode |
16:51:38 | lqdev[m] | that's likely |
16:52:40 | shashlick | if nim check doesn't create a folder in ~/.cache/nim then there is nothing cached |
16:52:59 | jken | disruptek, are you passing that to nim c? |
16:53:08 | disruptek | yeah |
16:53:25 | shashlick | yep, there's no sdl_ directory created for nim check |
16:53:36 | disruptek | haven't figured out how to make it search the cwd though. |
16:54:01 | disruptek | oh, maybe i have and i'm just dumb. |
16:54:21 | jken | I just get command line(1, 2) Error: argument for command line option expected: '-p' |
16:54:27 | disruptek | yep, it works. |
16:54:46 | disruptek | nim c "--passL:-Xlinker -rpath ." test/test.nim |
16:54:56 | jken | ah, quotes. |
16:55:06 | disruptek | yes, whatfer space reasons. |
16:55:18 | lqdev[m] | shashlick: anything I can do about it, or is it a Nim issue? |
16:55:31 | shashlick | probably just how nim check works |
16:55:39 | shashlick | it is only checking so really nothing to save |
16:55:49 | shashlick | i am using gorgeEx for caching |
16:55:52 | disruptek | this is a workaround, though; i feel like there should be an in-nim way to add a searchpath. |
16:58:07 | lqdev[m] | for me, nim c and nim check both finish at about 1s |
16:59:32 | jken | disruptek, 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:00 | disruptek | https://github.com/nim-lang/Nim/issues/2408 |
17:01:05 | jken | eek, |
17:01:26 | disruptek | yeah, this attitude bothers me. |
17:03:14 | jken | well, that issue is tagged hacktoberfest |
17:03:15 | disruptek | https://github.com/nim-lang/RFCs/issues/58 |
17:06:28 | jken | so sounds like dynlibOverride is our best bet until something changes in nim? |
17:07:00 | disruptek | well, i'm not keen on specifying 35 libraries in a command-line option. |
17:07:24 | jken | ah right, you solution is best then. |
17:07:45 | jken | Is there a mechanism to add compiler flags to nimble build? |
17:07:57 | jken | Or do I need to stop using nimble to build my stuff. |
17:08:18 | jken | (not overly important just curious) |
17:08:18 | disruptek | i'm sure there is, or you can just put it in your code. passL is a pragma. |
17:08:25 | jken | ah. awesome. |
17:09:11 | disruptek | i wish this was just a little bit better. |
17:09:32 | disruptek | just give us a way to search the location of our executable. |
17:10:28 | jken | {.passL: "-Xlinker -rpath .".} in my code works |
17:10:59 | disruptek | yes, as long as your run your binaries from wherever they live on your filesystem. 🙄 |
17:11:06 | jken | oh.. right. |
17:11:28 | jken | I hadn't considered that |
17:13:55 | disruptek | well, we can still use LD_LIBRARY_PATH, so i guess it's not totally nuts. |
17:14:46 | jken | I am still way ahead of where I was yesteday, so its a win |
17:14:48 | jken | Thank you for your help |
17:14:52 | disruptek | nice to have this working, i will have to play with imgui. thanks for getting me setup. 😀 |
17:15:01 | disruptek | happy to help. |
17:15:23 | jken | Moving on to getting imgui working with sdl2, looks like lmariscal only added a glfw renderer |
17:20:16 | lmariscal | yeah sorry about that, it is still in the todo list |
17:20:31 | lmariscal | jken but you can create the renderer from https://github.com/ocornut/imgui/blob/master/examples/imgui_impl_sdl.cpp |
17:20:42 | jken | no worries, wasn't calling you out, if I get it working ill send a P |
17:20:44 | jken | PR* |
17:21:14 | lmariscal | thanks! I would really appreciate it |
17:21:45 | disruptek | thanks for your work on this stuff, lmariscal; it's pretty awesome. 👍 |
17:22:29 | lmariscal | thank you for using it, the project still has room to grow so let me know anything that could improve |
17:23:01 | jken | honestly not sure why I am hacking together opengl + sdl2 + imgui when you've put so much work into nimgl |
17:23:25 | jken | started off as a project so I could just learn opengl |
17:24:08 | disruptek | i just realized the test window magically appears as a modal in my compositor. weird. |
17:25:00 | disruptek | i guess 'cause it's not resizeable, maybe. anyway, full fun ahead! |
17:30:46 | disruptek | i guess i'm also not getting framerate. |
17:32:54 | disruptek | i 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:40 | jken | lmariscal, is imgui/impl_opengl intended to require nimgl? |
18:06:50 | * | nsf joined #nim |
18:13:40 | * | NimBot joined #nim |
18:46:07 | lqdev[m] | wow, `nim check` is actually faster after switching to SDL |
18:46:11 | lqdev[m] | it was painfully slow previously |
18:51:17 | lqdev[m] | nvm I take that back |
18:51:32 | lqdev[m] | I just had my imports broken |
18:53:32 | disruptek | did you catch the bastard's license plate numble? |
18:53:38 | disruptek | number, either? |
18:54:17 | disruptek | it's hacktober, someone make us a rainbow-colored debug macro to spite zevv. |
18:54:20 | disruptek | please and thank you. |
19:16:52 | * | clyybber joined #nim |
19:35:52 | Zevv | eh I do colors right |
19:50:21 | disruptek | oh, it's just code that has to be monochromatic? |
20:06:51 | Zevv | as 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:17 | lmariscal | jken, 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:41 | lqdev[m] | I just realized that splitting the SDL wrapper into multiple cImports was probably a very bad idea |
20:46:28 | disruptek | i 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:48 | Zevv | aand thats 0.20, so next should really be 1.0 then I guess. because traditions matter |
21:01:40 | disruptek | eh? |
21:02:18 | * | alexander92 quit (Ping timeout: 265 seconds) |
21:14:18 | Zevv | I jst tagged v0.20 of my stuff. Given Nims history 1.0 is due next |
21:14:42 | disruptek | i think you need 0.20.99 first. |
21:14:52 | disruptek | only 99 more bugfixes to go. |
21:15:12 | Zevv | oh right. first Ill have to make 99 bugs then |
21:17:22 | disruptek | i have one for you if you want. |
21:17:43 | shashlick | @lqdev what's the issue |
21:18:21 | Zevv | disruptek: give it to my, I can always act as if I didnt hear you |
21:18:27 | lqdev[m] | shashlick: `nim check` times |
21:18:33 | disruptek | https://github.com/disruptek/openapi/blob/master/src/openapi/paths.nim#L51 |
21:18:33 | lqdev[m] | it slows me down a lot |
21:18:59 | disruptek | it yields `Error: cannot evaluate at compile time: segments` under js. |
21:19:29 | disruptek | actually, under c too. |
21:19:38 | disruptek | hmm. |
21:21:08 | Zevv | cloned, how do I run? |
21:21:15 | Zevv | so i get your problem |
21:21:56 | disruptek | holdon, this is new to me. |
21:25:43 | disruptek | might be a nim regression. |
21:27:05 | Zevv | last time I got that, it was |
21:27:34 | disruptek | man, i really need to finish golden. |
21:27:39 | disruptek | this is ridonkulous. |
21:32:25 | Zevv | have you tryed turning it off and on again? |
21:32:42 | disruptek | i just realized that i was still attempting to js stuff. |
21:32:49 | disruptek | so, rolling up to head to try in c. |
21:32:59 | disruptek | okay, head works. |
21:33:11 | * | FromGitter quit (Remote host closed the connection) |
21:33:16 | disruptek | so i need to make you a test. |
21:33:30 | * | FromGitter joined #nim |
21:33:44 | Zevv | nim 1 or nim devel? |
21:34:02 | Zevv | oh I can reproduce already |
21:34:04 | disruptek | devel; prior versions don't have the support for ct js |
21:34:24 | disruptek | that newGrammar error you used to get... |
21:34:44 | Zevv | its probably a regression - I get it in my own code now, which I believe worked before on js. investigating |
21:35:08 | disruptek | well, lemme try a later npeg first, i guess. |
21:35:43 | disruptek | i was used 0.14 or something. |
21:36:19 | Zevv | don't think that matters, but please do |
21:36:28 | disruptek | yeah, doesn't work in .20 |
21:36:40 | shashlick | @lqdev even separate? |
21:36:45 | Zevv | this "cannot evaluate at compile time" is a pretty common complaint on #nim |
21:37:01 | disruptek | okay, now 0.20 breaks in c. lemme try 0.18; i think that works fine. |
21:37:24 | disruptek | i 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:34 | Zevv | that's something different |
21:37:41 | Zevv | what does your typical input string look like? |
21:37:53 | disruptek | ahh, my tests don't work in 0.20. |
21:38:00 | disruptek | so, that helps. openapi/tests/tests.nim |
21:38:21 | disruptek | i thought it was silly to write those. jokes on me! |
21:38:28 | Zevv | ha! |
21:38:28 | disruptek | joke's, too. |
21:39:15 | Zevv | so those broke from 0.18 to 0.19, interesting |
21:39:26 | disruptek | yeah. |
21:39:45 | disruptek | it's probably me. |
21:40:26 | Zevv | there 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:00 | disruptek | i have some kinda special ability to uncover shit like this. |
21:42:26 | disruptek | lmdb is broken for me, but _only_ in -d:danger, and only when setting the numble of db readers. |
21:42:29 | disruptek | go figure. |
21:42:31 | Zevv | ha |
21:42:38 | disruptek | damn numbles. |
21:42:42 | disruptek | get me every time. |
21:42:46 | Zevv | yeah, well, you check length of capture[] |
21:42:49 | Zevv | no one ever does that :) |
21:43:06 | Zevv | that changed |
21:43:16 | disruptek | why do i do that? |
21:43:19 | Zevv | capture[0] and $0 now always exist, those are the total capture that is passed to the code block |
21:43:33 | Zevv | capture[1] and $1 and higher are the explicit string captures *inside* that match |
21:43:46 | Zevv | so you do that to check if something is captured at all - makes sense |
21:43:50 | disruptek | how can i see if $1'll make sense? |
21:44:10 | disruptek | it's 'cause it might be a variable, i guess. |
21:44:15 | Zevv | capture[].len > 1 |
21:44:20 | Zevv | instead of 0 |
21:44:33 | Zevv | because there is always the total capture in capture[0] aka $0 |
21:44:45 | disruptek | i gotcha. |
21:44:51 | Zevv | This is part of my last-thing-I-must-fix-but-need-help |
21:44:56 | disruptek | that works great. |
21:45:05 | Zevv | this code running inside parsers needs a proper API to interact with the parser itself |
21:45:08 | Zevv | it is too ad-hoc now |
21:45:14 | disruptek | right. |
21:45:15 | Zevv | some vars, some procs, some peeking into internal state |
21:45:44 | * | Vladar quit (Quit: Leaving) |
21:45:46 | disruptek | who is a heavy use of npeg? |
21:45:50 | disruptek | user, too |
21:45:53 | Zevv | noone :) |
21:46:20 | Zevv | I think there's a handful of snippets floating around of people using it |
21:46:25 | disruptek | then i guess i'd leave it alone until an obvious criticism informs a decision. |
21:46:41 | Zevv | that was my current solution, yes |
21:47:12 | Zevv | I guess its pretty usable. It parses Rod now, and only 3 times slower then the native parser |
21:47:20 | disruptek | well, for starters, this suggests you might want a way to get the existence or number of actual captures. |
21:47:29 | disruptek | since that value is now overloaded. |
21:47:34 | Zevv | which is capture[].len, but that sucks to type |
21:47:54 | disruptek | i couldn't deref it, btw. |
21:48:07 | Zevv | otoh, your captures come in `capture[]`, so using it's .len does make sense |
21:48:44 | disruptek | i didn't ask for 0 and i don't want it! |
21:49:01 | Zevv | I know. But having $1 being capture[0] was evil |
21:49:04 | disruptek | oh, 0 is like the regexp match without ()? |
21:49:11 | Zevv | yes |
21:49:15 | disruptek | i see. |
21:49:27 | disruptek | i guess that's useful an might even be easier to explain. |
21:49:31 | Zevv | which often makes sense - i found my self regularly make a capture-inside-a-capture |
21:49:36 | disruptek | assuming people understand regexp. |
21:50:01 | disruptek | honestly, having it be more explicit is probably best. |
21:50:26 | disruptek | you could make {0}, {1} do something, too, if you want operators. |
21:50:46 | Zevv | how is that better then $0, $1? |
21:50:53 | * | Hideki joined #nim |
21:51:12 | disruptek | capture.group{Everything} could work as well as capture.group{1, 2, 3} |
21:51:21 | disruptek | just overload `{}` |
21:51:27 | Zevv | oh right, sure |
21:52:17 | Zevv | it'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:48 | disruptek | oh, i'm fine with the shorter vars, i mean more to solve the .len problem. |
21:53:12 | Zevv | oh, but then I don't understand you yet |
21:53:33 | disruptek | i think since 0 is always there, you may as well have len ignore it and only count "group" captures. |
21:53:57 | disruptek | no one said the $ stuff had to be indices. |
21:54:04 | disruptek | some regexp libs start at 1. |
21:54:12 | Zevv | no, but this 1-off also stinks |
21:54:14 | disruptek | iirc python does, actually, right? |
21:54:29 | Zevv | could be, I don't know |
21:54:32 | * | solitudesf quit (Ping timeout: 268 seconds) |
21:54:55 | Zevv | that's your fix anyway :) http://ix.io/1Z88 |
21:54:58 | disruptek | the index only matters if you're going to try to index it. |
21:55:16 | disruptek | thanks; i'll commit this and i guess bump the req to npeg 0.20 |
21:55:41 | Zevv | there 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:50 | Zevv | so I guess it makes sense to handle that |
21:56:02 | * | Hideki quit (Ping timeout: 276 seconds) |
21:56:14 | disruptek | i dunno, maybe there's a better way to write my pattern. |
21:56:15 | Zevv | I 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:24 | Zevv | but still, cool to see you using it! |
21:59:00 | disruptek | now i'm back to segments not being evaluat-able in js backend. |
21:59:07 | Zevv | right |
21:59:23 | disruptek | i like forcing people to install and update npeg. |
21:59:34 | disruptek | we'll get this library to replace pegs in nim. 😁 |
21:59:51 | Zevv | pleease don't. Then I have to sit on my hands before I type all of the time :) |
22:00:05 | disruptek | lol |
22:00:08 | Zevv | hm your testcases run fine in js |
22:00:11 | disruptek | i never let that hold me back. |
22:00:43 | disruptek | hmm, so maybe it's my impl. |
22:01:26 | disruptek | the 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:45 | Zevv | what change would that be |
22:02:01 | disruptek | those tests don't run at compile-time, though. |
22:02:12 | Zevv | no I figured |
22:02:15 | disruptek | the vm needs more iterations in order to build those larger apis. |
22:03:20 | Zevv | oh right I ran into that a few times |
22:03:41 | disruptek | i think the default is like 2MM and i'm running, idk, 10MM or something. |
22:04:11 | Zevv | dude |
22:04:47 | disruptek | what can i say? |
22:04:52 | disruptek | i'm hung like a horse. |
22:05:13 | disruptek | i mean, i literally own bigdickdigital.com. need i say more? |
22:05:25 | disruptek | rollin' 10MM deep. |
22:06:09 | Zevv | just confirmed that parseTemplate runs just fine @ compiletime |
22:07:45 | Zevv | if I was bored I'd now register bigdickanalogue or something like that |
22:08:17 | disruptek | i registered that one in 1981. |
22:08:22 | Zevv | ha |
22:08:44 | Zevv | No match for "BIGDICKANALOGUE.COM". |
22:09:01 | disruptek | it's ANALOG is US parlance. |
22:09:09 | disruptek | s/is/in/ |
22:09:20 | Zevv | oh well :) |
22:09:32 | Zevv | proc foo(): bool = echo parseTemplate("/foo") |
22:09:33 | Zevv | const a = foo() |
22:09:34 | Zevv | that runs |
22:09:42 | disruptek | so changing the name doesn't help, neither does init'ing the seq. |
22:10:43 | Zevv | make your templates consts |
22:10:57 | Zevv | they don't exist otherwise @ ct |
22:11:03 | Zevv | unless you mark them {.compileTime.} |
22:11:20 | disruptek | the templates are loaded from json. |
22:11:42 | Zevv | oh right |
22:12:40 | Zevv | how do I reproduce again? |
22:13:28 | disruptek | i guess follow the example on the main page? |
22:13:40 | Zevv | pfff that's just silly |
22:13:42 | disruptek | how is it that the tests work? |
22:13:55 | disruptek | i mean, how did you run them at compile-time? |
22:14:20 | Zevv | no I did proc foo(): bool = echo parseTemplate("/foo") at compiletime |
22:14:33 | Zevv | just to make sure it was not the parser breaking |
22:14:34 | disruptek | try that with "{name}" |
22:14:53 | disruptek | you did that in `nim js` backend? |
22:15:10 | Zevv | let me retest |
22:15:15 | disruptek | because now i'm thinking maybe it's using a cstring or something crazy. |
22:15:52 | Zevv | ok, {foo} breaks it |
22:15:53 | disruptek | just 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:53 | Zevv | met me see |
22:16:04 | disruptek | fix to nim, i mean. |
22:16:33 | disruptek | yes, because only {foo} would pass the isTemplate predicate. |
22:17:06 | Zevv | yeah |
22:17:30 | disruptek | it does seem to be something in npeg, because it crashes in match. |
22:17:53 | disruptek | so the peg macro works, at least. |
22:18:22 | Zevv | yeah, 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:16 | disruptek | some kinda closure issue. |
22:21:00 | * | al_ joined #nim |
22:21:22 | Zevv | let 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:33 | disruptek | you evil man. |
22:21:41 | Zevv | hm no that was different |
22:21:48 | Zevv | "Error: request to generate code for .compileTime proc" |
22:22:51 | * | alexander92 joined #nim |
22:25:07 | Zevv | got it |
22:25:13 | Zevv | mark your proc .compileTime. |
22:25:21 | Zevv | proc parseTemplate*(path: string): TemplateParse {.compileTime.} = |
22:25:25 | disruptek | sweet. |
22:26:31 | Zevv | sounds like a bug |
22:27:09 | lqdev[m] | shashlick: separate what? |
22:27:17 | Zevv | iirc .compileTime.s only function is to *not* generate run time code for a proc |
22:28:06 | disruptek | i can't make the tests work now. |
22:28:18 | Zevv | change them to compile time too |
22:28:34 | disruptek | i'm trying, captain! |
22:28:44 | Zevv | :) |
22:28:50 | Zevv | we should file this anyway |
22:29:08 | Zevv | but its not a nice minimal snippet if we rely on npeg showing the bug |
22:29:46 | disruptek | i'll see if i can shrink it once i patch this. |
22:31:12 | Zevv | yeah I found one of those dark cornercases yesterday too. Something with 'when' blocks messing up when used in a .computedGoto. while loop |
22:31:20 | Zevv | who makes that up |
22:32:09 | disruptek | a fuzzer. |
22:32:14 | disruptek | that's all npeg is. |
22:32:19 | Zevv | ha :) |
22:38:50 | Zevv | anyway, I'm off for my nap |
22:38:58 | disruptek | enjoy; thanks, zevv. |
22:39:09 | Zevv | tomorrow's a new day. good luck! |
22:42:23 | disruptek | oh, 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:03 | disruptek | oh, i guess that's a compile-time only "feature" of both backends. |
22:46:15 | * | Hideki joined #nim |
22:49:24 | disruptek | https://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:27 | disruptek | krab4t 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) |