<< 16-03-2020 >>

00:09:29*krux02_ joined #nim
00:09:59*Hideki_ joined #nim
00:11:45*krux02 quit (Ping timeout: 240 seconds)
00:14:48*Hideki_ quit (Ping timeout: 256 seconds)
00:21:14*Trustable quit (Remote host closed the connection)
00:28:02*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
00:31:25*Hideki_ joined #nim
00:42:40*disrupteq joined #nim
00:45:25FromDiscord<Simula> is there a way to define a symbol from a nimble file? I want a task that defines debug
00:45:26*abm quit (Quit: Leaving)
00:45:50FromDiscord<Simula> wait i'm dumb
00:46:46FromDiscord<Varriount> Hm, anyone know if Rust has runtime interfaces like Go, or anything equivalent?
00:48:06*dwdv quit (Ping timeout: 265 seconds)
00:54:56leorizewrong channel :P
00:58:22*smitop joined #nim
01:03:16*sekao joined #nim
01:19:48*Hideki_ quit (Remote host closed the connection)
01:20:02*Hideki_ joined #nim
01:21:56*Hideki_ quit (Remote host closed the connection)
01:27:00*letto quit (Quit: Konversation terminated!)
01:28:56*letto joined #nim
01:29:43*krux02_ quit (Remote host closed the connection)
01:46:39FromDiscord<slymilano> There's still a bug where I have to pass threads:on to the compiler, but running through nimble doesn't pass in the options properly
01:47:12leorizeuse a project.nim.cfg to do that
01:47:39FromDiscord<slymilano> do you have an example?
01:49:52FromGitter<awr1> https://github.com/nim-lang/Nim/issues/2457
01:49:53disbotIterate items in reversed order
01:50:01FromGitter<awr1> kinda wish a reverse iterator was in the stdlib, but w/e
02:04:15FromGitter<awr1> is there something in strutils for like... a getting from the beginning of a string to a certain substring (and excluding it?)
02:04:40FromGitter<awr1> like a `"foobarbaz".upTo("bar") == "foo"`
02:05:56FromDiscord<flywind> you can use `parseUntil` in parseutils
02:06:39FromGitter<awr1> thanks
02:08:18sekaoi'm trying to get a "view" into a seq that doesn't require any copying (like slices do). i think someone here said it was possible with iterators...is that right? i've never found an example that does this
02:09:29sekaoit would be ideal to just get a ref seq that pointed to a part of a seq
02:13:40disrupteqiterate over indices.
02:22:58*Tanger quit (Read error: Connection reset by peer)
02:24:18sekaoi think i can write the iterator but i am not sure how to "apply" that to my seq to produce the view into it
02:27:42disruptekthe same way you apply a single index to view a member of the seq...
02:30:44*thomasross quit (Read error: Connection reset by peer)
02:30:45*thomasross_ joined #nim
02:31:07*thomasross_ is now known as thomasross
02:33:29sekaoi would get a single index via `mySeq[0]`, so you mean pass the iterator where the 0 is?
02:41:11sealmovehttps://github.com/sealmove/testify is finished
02:45:48*chemist69 quit (Ping timeout: 256 seconds)
02:47:29*chemist69 joined #nim
02:49:32*sekao quit (Remote host closed the connection)
03:00:19*Irregulator quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
03:11:58*muffindrake quit (Ping timeout: 245 seconds)
03:14:23*muffindrake joined #nim
03:16:50*dadada quit (Ping timeout: 240 seconds)
03:18:05*dadada joined #nim
03:18:30*dadada is now known as Guest12859
03:19:20*smitop quit (Quit: Connection closed for inactivity)
03:50:17*ftsf quit (Quit: Leaving)
04:09:50*deepend_ is now known as deepend
04:09:56*nsf joined #nim
04:21:14*Irregulator joined #nim
04:54:48*sealmove quit (Quit: WeeChat 2.7.1)
05:19:30FromDiscord<slymilano> having issues using params in my db_sqlite query: https://pastebin.com/1tQvw7S6
05:20:52FromDiscord<slymilano> I'm having some issues using a simple LIKE param in my query. If I hardcode the value between the `%VALUE%` symbol it works fine. https://pastebin.com/wbGwQ3bJ
05:23:56leorizeah you can't really do it like that
05:25:29leorizesince the string will be properly quoted and escaped, it'd result in something like this: `'%'your string here'%'` which will expose your string as sql
05:25:33leorizefun times :)
05:26:26*NimBot joined #nim
05:26:55leorizeto do it correctly, simply do a concatenation
05:27:13leorizeI think for sqlite you do it like this: '%' || ? || '%'
05:27:59FromDiscord<slymilano> thank you, i'll do a string concat
05:29:52leorizehttps://play.nim-lang.org/#ix=2emW
05:31:31FromDiscord<slymilano> awesome thank you!
06:16:19Guest12859hi
06:16:25*Guest12859 is now known as dadada
06:16:39dadadaI've another testcase similar to the bug I recently found
06:16:44dadadahttps://play.nim-lang.org/#ix=2emZ
06:17:12dadadamratsim helped me to find a workaround, maybe there's one here too
06:17:58dadadait says 'teststring[0 .. 1]' cannot be assigned to , though it works with manually written code
06:18:38dadadabut when I macro writes the left part of the assignment op it doesn't work
06:22:48dadadait works when you change the slice to an intlit
06:31:50*muffindrake quit (Quit: muffindrake)
06:32:02*muffindrake joined #nim
06:35:58*narimiran joined #nim
06:41:14dadadas/I macro/a macro
06:46:15*dddddd quit (Ping timeout: 265 seconds)
06:51:15FromGitter<awr1> is genotrance in here?
06:55:29narimiran@awr1 he goes by the name shashlick when here
06:55:44FromGitter<awr1> ah i forgot
07:00:00*gmpreussner quit (Quit: kthxbye)
07:05:09*gmpreussner joined #nim
07:10:24*Irregulator quit (Read error: Connection reset by peer)
07:33:04*tdog joined #nim
07:46:32*PMunch joined #nim
07:48:13Araqdadada, you need to generate a call to '..', I think
07:48:54dadadaAraq: I'll try, did you see the other similar issue I raised here a day or so ago?
07:52:06PMunchSpeaking of bugs raised here a day ago. Should I report this Araq, or is it known? https://play.nim-lang.org/#ix=2enf
07:52:36dadadamratsim provided a workaround for it, but the issues are probably related
07:52:39Araqreport bug on github
07:52:55AraqI don't read everything on IRC anymore
07:53:15Araqwhen I'm around it's likely I've read it but I don't read the logs, no time
07:54:56Araqmratsim: the priorities are yours to set but remember that only 'showstopper' means "to be fixed for the upcoming release"
07:59:52dadadaAraq: I tried it with a call to .. and now I get 'teststring[`..`(0, 1)]' cannot be assigned to ... did you mean something else?
08:00:25Araqno, that's what I meant
08:00:33Araqso now you need to show me your macro I guess
08:01:19dadadawell, just as I'm clicking on the share button on playground, the thing crashed :-( I have to write it again
08:03:32dadada2nd writing of the macro done: https://play.nim-lang.org/#ix=2enh
08:08:05Araqwell
08:08:20Araqna[0..1] = "da" is really `[]=`
08:08:47Araqand not "assignment to []"
08:19:43dadadaAraq: ok, I'm probably really annoying you know, (knowing that you are the guru of nim), but in my understanding my macro t ignores the argument na (which I just put there for making the macro work), and everything (meaning: t na) gets expanded to teststring[`..`(0,1)] which is confirmed by the compilers "'teststring[`..`(0, 1)]' cannot be assigned to" message, since it can only know that it can't be assigned
08:19:50dadadato, if it has first expanded to it
08:19:57dadadas/you know/you now ...
08:30:43dadadabtw. I meant guru as a compliment, hopefully it came across
08:32:08PMunchThe problem is that what you're doing is basically the second case here: https://play.nim-lang.org/#ix=2enq
08:32:29PMunchSo Nim will extract the substring first, then try to assign to that substring, which doesn't work
08:34:42dadadaah, so is there any way to get around this...?
08:36:37dadadathe macro does work when returning an index instead of a slice/substring
08:38:02*JustASlacker joined #nim
08:38:09JustASlackerso
08:38:13JustASlackerI have a strange problem
08:38:21JustASlackerError: cannot open 'strformat'
08:39:13PMunchdadada, hmm, not sure TBH
08:39:30PMunchJustASlacker, nim --version?
08:39:42JustASlackerNim Compiler Version 0.17.2 (2018-02-05) [Linux: amd64]
08:40:11narimiranJustASlacker: you're 4 versions behind
08:40:15JustASlackeroh noes
08:40:17dadadaJustASlacker: I'm curious, why would you use such an old version of nim?
08:40:36JustASlackerI did curl https://nim-lang.org/choosenim/init.sh -sSf | sh
08:40:57PMunch4 versions? He's 11 versions behind :P
08:41:33PMunchJustASlacker, when?
08:41:35JustASlackermhh
08:41:46PMunchWhat does `choosenim update stable` do?
08:41:54JustASlackerthere seems to be a conflict, the ouput of chooesenim is Switched to Nim 1.0.4
08:43:36AraqJustASlacker, please install Nim via the other documented means if choosenim causes trouble
08:44:13JustASlackerIt looks like /usr/bin/nim is old
08:44:29JustASlacker.nimble/bin/nim is recent
08:44:41dadadaJustASlacker: just rm -f /usr/bin/nim
08:45:00dadada/usr/bin is probably first in your PATH and when you call nim that takes priority
08:45:22JustASlackeryeah, did apt remove nim
08:45:32JustASlackernot sure when I installed that via apt ...
08:45:43JustASlackermust have been drunk or something
08:47:05JustASlackeranyway, thanks for the helps
08:47:30PMunchNo problem
08:47:34JustASlackerloving nim so far
08:47:40PMunchGreat :)
08:48:02JustASlackergotta get used to the fact I cant edit the compiled files, tho.
08:48:06JustASlackeryears of python ruined me
08:48:33PMunchWhat do you mean?
08:48:35JustASlackerhad a problem with a nim script but couldnt access source repository
08:48:46PMunchAh
08:48:46JustASlackerbecause I wasnt in the VPN
08:49:08JustASlackerthat was kinda awkward
08:49:17PMunchMaybe nimcr would help a bit
08:49:42PMunchI use it for Nim scripts that I have created for simple tasks on my linux machine, similar to what I would do in Python
08:49:49JustASlackeroh, funky
08:50:48JustASlackerthx, that looks good.
08:50:52JustASlackergonna try that
08:51:30PMunchFor simple scripts it's pretty neat
08:51:57dadadamaybe there could be a special wrapper that wraps a nimcompiler with the source files and the compiled binary into a special executable file, it could contain an image or archive of the sources that could be mounted to a directory with a fuse filesystem and be edited there as usual, then there could be a special command line argument for that wrapper/binary like --recompile that compiles from the edited
08:52:03dadadasources and changes the wrapped binary
08:53:14dadadanimcr is good!
08:53:54PMunchdadada, that sounds complicated..
08:55:03dadadaPMunch: it can be done with standard linux command line tools, I believe, the biggest downside would be the resulting file size
08:55:30JustASlackerprobably still less than go builds
08:57:49PMunchTo be fair though you could probably achieve world domination with standard linux command line tools, doesn't mean it's easy :P
08:58:22dadadaPMunch: not easy, but not that hard either, it's pretty amazing what you can do with some shell skills alone :P
08:58:42dadadait all depends on your knowledge
08:58:50PMunchOh trust me, I know
08:58:58PMunchSpend most of my day in a Linux shell :P
08:59:23dadadaso do I :-)
08:59:31*actuallybatman quit (Ping timeout: 255 seconds)
09:07:53*Vladar joined #nim
09:21:07*floppydh joined #nim
09:28:15*solitudesf- quit (Remote host closed the connection)
09:29:12*solitudesf joined #nim
09:37:24*dwdv joined #nim
09:45:19PMunchHmm, is there a way to make a code-block in docs use Nim syntax highlighting?
09:49:50Araq..code-block:: nim
09:53:46PMunchDoesn't work..
09:54:25Araqit works for me
09:54:28lqdev[m]wasn't it `.. code-block:: nim`?
09:54:36lqdev[m]like, with the space after `..`
09:54:39PMunchhttps://uploads.peterme.net/2020-03-16-105419_661x247_scrot.png
09:54:45lqdev[m]also Nim's RST parser supports markdown code blocks
09:54:54PMunchSame result..
09:55:47PMunchWowzer, wind is picking up here.. I can barely see the house across the street for all the snow
09:57:07PMunchhttps://uploads.peterme.net/2020-03-16-105650_829x208_scrot.png
09:57:10PMunchThat's the code
09:57:24PMunch(not sure why I screenshot that instead of pasting it..)
09:58:27PMunchWith markdown syntax it worked
09:59:07AraqPMunch, not enough indentation, you need at least 3 spaces after ::nim\n
09:59:16Araqit's an RST gotcha
09:59:28Araqno wonder markdown is winning :-)
09:59:47PMunchWhat, that is three spaces..
10:00:21Araqthen maybe 4, who knows
10:00:23lqdev[m]afaik, that's 2 spaces.
10:00:29PMunchTried up to 5..
10:00:34Araqand you also need a newline more
10:00:42Araq :: nim\n\n
10:00:53Araqand one to end the block
10:02:07PMunchIt needed one before the block..
10:02:19lqdev[m]damn
10:02:30lqdev[m]Araq: why is Nim using RST instead of Markdown?
10:02:35PMunchAnd a space after the ..
10:02:49lqdev[m]PMunch: told ya about the space
10:03:06PMunchhttp://ix.io/2enA/nim
10:03:08PMunchThis works
10:03:16PMunchYeah, but only that didn't work..
10:03:30PMunchI had already tried with a space before asking
10:10:39dadadadoes markdown support all features of rst?
10:13:21lqdev[m]no, it has a different syntax
10:13:34lqdev[m]but overall I don't think the feature set differs that much
10:15:11dom96This is IMO one great example why markdown is superior
10:16:09PMunchLinks are the big one for me
10:17:28PMunch[this](peterme.net) is so much better than `this<peterme.net>`_ (and yes I had to google how to do that in RST, I always do..)
10:17:51dom96you also need a space before the < in rst IIRC
10:18:06PMunchDamn it! I was wondering about that :P
10:18:25PMunchThe docs I found had a line-break there because of page-reflow..
10:19:12Araqanyhow we DO SUPPORT RST
10:19:15Araqout of the box
10:19:20Araqer
10:19:25Araqanyhow we DO SUPPORT markdown!
10:19:41Araqso use it and stop complaining
10:19:55PMunchOh yeah, I'm not complaining about Nim. I'm just complaining about RST :P
10:20:18dadadado you support one of the markdown flavors? or just the original markdown?
10:20:40dom96do we support markdown in the docs?
10:22:53PMunchSome markdown works
10:24:52axionCan the sequtils procedures be used on arrays too or just sequences? I'm looking for a way to efficiently map over the elements of an array var and modifying the values in-place
10:25:55lqdev[m]some of them can be
10:26:06lqdev[m]check ones that accept `openArray` as arguments
10:26:39lqdev[m]most of them can
10:27:43axionCool, thanks.
10:28:29*krux02 joined #nim
10:29:03Araqdom96, yeah we do
10:29:17dom96nice
10:30:01PMunchNot sure if it's documented anywhere though..
10:40:25axionis there anything built in that will replace the contents of an array starting at some index, with the contents of another small array?
10:42:04dadadaaxion: something like this https://play.nim-lang.org/#ix=2enM
10:42:05dadada?
10:44:06axionAH I didn't realize you could use slices like that. Thanks again
10:44:30dadadaas long as you don't use a macro to create the slice, then it fails :-) as I recently found out
10:44:47PMunchWell you can use it to create the slice
10:45:16dadadaPMunch: I think I tried that and it failed, but let me try again
10:46:42axioni suppose there isn't anything like available for sparse writing, like a[1,4-6,9] = [1,2,3,4,5] ?
10:47:17PMunchdadada, I mean this works: https://play.nim-lang.org/#ix=2enP
10:47:30dadadaPMunch: yeah, you're right I also tried that now, and it does work
10:48:01PMunchaxion, no for that you would need some kind of macro
10:48:06PMunchTo split it up into pieces
10:49:06FromGitter<alehander92> its possible in theory
10:49:07dadadaso let me correct my statement into: as long as you don't use a macro to create the code that tries to access a slice of an identifier by a macro, it works
10:52:59dadadas/of an identifier/of an array
10:54:44Araqslices have nothing to do with it really, it's simply []= vs []
10:55:10*lritter joined #nim
10:55:52dadadathen why does quote do: array[0] work while quote do: array[0..2] does not?
10:58:21Araqbecause a[0] uses the builtin [] which returns a 'var T'
10:58:34Araqand a[0..2] uses a custom []= instead
10:58:50Araqwell
10:59:05Araqa[0..2] = value uses the custom []=
10:59:12Araqand a[0..2] uses a custom []
11:02:02dadadawell, hopefully support for what I need can be added to the custom []
11:07:00*smitop joined #nim
11:09:00PMunchWell there is no string slice type that [] could return
11:09:22Araqsure it could return var openArray[char]
11:09:29PMunchWait, could it?
11:09:47Araqand it probably should but we're waiting for the RFC dealing with better checking for openarrays
11:09:51PMunchI didn't think openArray could be returned
11:10:03AraqNim evolves :P
11:10:26Araqbut yeah, currently you can't unless you're in system.nim iirc
11:10:41*abm joined #nim
11:12:37PMunchAh..
11:12:42PMunchYeah because this doesn't work: https://play.nim-lang.org/#ix=2enU
11:13:17PMunchWait.. That proc was never called..
11:17:33dadadawell, then I'm putting my programs into system.nim , great that there's finally a workaround :-)
11:18:32FromGitter<alehander92> what happened with custom system.nim btw
11:18:39FromGitter<alehander92> a bit offtopic :P
11:18:57PMunchdadada, include system.nim :P
11:23:33dadadaPMunch: if only it was this easy
11:23:56*federico3 left #nim ("http://quassel-irc.org - Chat comfortably. Anywhere.")
11:23:59*federico3 joined #nim
11:24:12PMunchWhat are you trying to do anyways?
11:26:22dadadait's a secret project right now, I can't tell you much besides, that I'll probably release it as FOSS when done :D
11:26:52FromGitter<alehander92> oh no that's the new bio manhatan project right
11:26:54dadadaseriously though I'm developing a bunch of convenience tools for nim
11:27:47dadadaand as you know I'm a noob here, so I'm only making slow but steady progress in this
11:28:39dadadalet's just say that I want nim to be even easier to use than it already is
11:29:28FromGitter<alehander92> but then we need to add features
11:29:30FromGitter<alehander92> to make it hard again
11:29:53FromGitter<alehander92> :) no, seriously sounds good, ok
11:30:24dadadaalehander92: more features doesn't equal being harder to use, it depends, but I know what you mean, actually I'm also adding features :D
11:33:14dadadaI've one subproject of this project, that is really promising, but needs a lot of thought to get it right, it will do no good to write the code in a few days, it's really a specification that I'm writing currently
11:35:28*okcc joined #nim
11:37:24dadadadoes disruptek stream today?
11:40:59*couven92 joined #nim
11:43:02FromGitter<alehander92> yeah, it depends how well they interact
11:43:03FromGitter<alehander92> i guess
11:43:13FromGitter<alehander92> disruptek is in the usa, it should be still early
11:49:05Araqnarimiran, my fix works and the tests remain green, can you believe it?
11:51:48*couven92 quit (Ping timeout: 256 seconds)
11:57:27axionCan someone help me with type parameters? I've been trying for days to understand them, and I'm not sure what I'm doing wrong.
11:59:08dadadaI'll try, do you have a testcase?
11:59:12axionIn this code, I would like to learn how to constrain the types for the `z` and `w` procs, such that line 32 is a static error rather than a runtime error. https://play.nim-lang.org/#ix=2eoa
12:01:27*kungtotte quit (Read error: Connection reset by peer)
12:02:16*kungtotte joined #nim
12:03:00dadadasry, I feel someone else will have to help you, and they wilL!
12:03:09PMunchHmm, I have some annoying bug with converters
12:03:43PMunchIt tries to apply a `converter toNimNode(x: NimNode): NimNode`, why would that ever happen?
12:03:56*Vladar quit (Quit: Leaving)
12:04:00axiondadada: Thanks anyway.
12:04:09FromGitter<dawkot> axion: https://play.nim-lang.org/#ix=2eoa
12:04:19FromGitter<dawkot> whoops
12:04:50FromGitter<dawkot> https://play.nim-lang.org/#ix=2eob
12:06:14axionAh so you';re unioning a type class right in the parameter section. Interesting. Is there any other way to do this apart from defining all combinations as separate types? This is a contrived example, and I actually have many types, but each function takes a specific configuration.
12:06:36FromGitter<dawkot> Also it was never a runtime error
12:07:07axionWell nim check didn't catch it. Only when I executed it did it give me an OOB error
12:08:06PMunchCan also be done like this if you want to check for any Vec[I]: https://play.nim-lang.org/#ix=2eoe
12:08:15PMunchNot only those you have defined aliases for
12:08:58PMunchMight be a prettier way to do that though..
12:10:00axionI see
12:10:56PMunchYou can at least put it in a template: https://play.nim-lang.org/#ix=2eog
12:12:10dadadathose are nice examples of Nim code IMO
12:12:35PMunchAnd you don't have to specify the static[int] part as that is defined for the type: https://play.nim-lang.org/#ix=2eoh
12:13:57*nsf quit (Quit: WeeChat 2.7)
12:15:52PMunchAnd you can throw in a touch of error checking: https://play.nim-lang.org/#ix=2eoi
12:17:44axionThe only thing I don't like is it produces a stack trace from the template, rather than the echo line. I would rather than line stand out in the stack rather than implementation details
12:25:04PMunchWell it starts on the echo line..
12:25:17PMunchThe shows the call to z, then the call to minimalCardinality
12:26:15axionIs there even a way to make this be caught with nim check? let x = [1,2,3]; echo x[42] ? I get no warnings or errors until I actually run the binary
12:26:39PMunchRun the binary?
12:26:45PMunchYou should get an error when you compile it
12:27:03axioncompilation produces no warnings/errors. running the resulting binary is when the error occurs
12:27:41axionoh hmm, maybe my setup is messed up
12:27:58PMunchNot the code that I shared.. That stops during compilation
12:28:32PMunchVim with nimlsp even highlights that there is an error on the echo line
12:29:23*Lord_Nightmare quit (Quit: ZNC - http://znc.in)
12:29:37axionah i'm using nim.nvim and i guess it only shows warnings/errors from `nim check`.
12:29:44axionand nim check doesn't catch this error
12:30:20PMunchIt does when I run it..
12:30:39PMunchhttp://ix.io/2eol
12:30:52axionas mentioned, just the 2 lines above
12:31:20PMunchOooh, sorry
12:32:17PMunchYeah that stops on compilation for me, but nim check doesn't detect it
12:32:38axionIs there any way to get nim check to be more aggressive for cases like this?
12:33:21FromGitter<alehander92> axion yeah i think i've wondered about this case
12:33:59FromGitter<alehander92> not sure, it can't be that complicated to catch cases for [index=> const]
12:34:47*Lord_Nightmare joined #nim
12:36:01*Hideki_ joined #nim
12:39:08lqdev[m]axion: the problem with nim check is that it doesn't generate any code, only checks it semantically. because of that, many checks are simply not made
12:40:33*Kaivo joined #nim
12:43:40okcci think i'm quitting
12:43:45axionAh ok makes sense
12:44:34dadadaokcc: quitting what?
12:48:49okcci have stuck in that for a couple of days, i'm being killing, T_T ..
12:49:26okcchttps://paste.ofcode.org/mEjtLxLFXJKt5zymnuJ9Kb
12:50:05FromDiscord<Recruit_main70007> whats the issue?
12:52:36PMunchWhat is it supposed to do?
12:53:13okcci can get it work (sniffing on xevents), but it'll stuck at "cleanupAndQuit" proc, and i found it's actually blocking at line 20 -> XCloseDisplay(display), that's ridiculous, https://tronche.com/gui/x/xlib/display/XCloseDisplay.html
12:53:36PMunchWhy are you trying to catch a SIGTERM?
12:53:44PMunchand a SIGINT for that matter
12:54:38okccfor cleaning up x related things, which is suggest in their official docs
12:55:51okccthere's a mistake in comment at line 49, it's not in a thread now
12:56:31lqdev[m]I suggest that you use signal trapping mechanisms such as `sigwait`, they're much better than signal callbacks. mainly because you don't need to resort to global state
12:57:21lqdev[m]example: https://github.com/liquid600pgm/pomod/blob/master/src/pomod.nim#L197
12:57:56okcclqdev: okay, truely grateful for your advises, but that's not the thing that drives me crazy
12:58:02lqdev[m]idk if there's a `sigpoll`, `man sigpoll` doesn't exist :(
12:58:48PMunchokcc, by the way this won't work with "nim c -r" proxyexe gets the signal and does weird things
12:59:45lqdev[m]PMunch: that's why you have to use `sighold` to prevent it from catching the signal
12:59:53lqdev[m]works with SIGUSR1 and SIGUSR2
13:00:11okcci can just manually call XCloseDisplay(display) before quit, but it'll blocking forever so that the process cannot quit, meanwhile it starts eating a single core of my cpu
13:00:52okccguys i'm appreciate for all of your comments, but the true problem is the XCloseDisplay T_T
13:00:54lqdev[m]I can't see anything about XCloseDisplay being able to block in the X11 docs
13:01:03lqdev[m]so this is weird
13:01:07okccyes, it's abnormal
13:01:12PMunchI'm seeing the same issue okcc
13:01:42okccit'll have no problem in pure C code i guess
13:02:12FromGitter<alehander92> you should look at the resulting C code from nim imho
13:02:30FromGitter<alehander92> it's probably not that different from the equivalent pure invocation of the function
13:03:02okccthat's a way to debug this code, thanks, alehander92
13:03:18PMunchHmm, maybe it throws a SIGINT and it goes into a loop?
13:04:19PMunchNope, that wasn't it..
13:04:46PMunchTried to change it to onSignal SIGUSR2 and sent that to the process. It started the close but it never completed..
13:04:49Araqokcc: use --stackTrace:off
13:05:13Araqand also -d:noSignalHandler
13:07:19PMunchxlib is always such a joy..
13:08:05okccokay, thanks you all and Araq, i'll try and give the results back here, and our nim community it so enthusiastic, i cannot keep myself of not being a part of it
13:08:39PMunchWhat is it that you're trying to do with this by the way?
13:08:57okccit's all about goldendict and emacs
13:08:58PMunchI've been playing around with xlib quite a bit myself as I'm making my own WM
13:09:17okccawesome, it' cool
13:09:33okcclet me tell you the story
13:10:10dadadaPMunch: what WM? is the project still active? Nim?
13:13:14okcci like the ctrl+c following ctrl+c global hotkey in goldendict for translating the word currently in clipboard, however, it's conflict with emacs (EX: in nim-mode, ctrl+c -- ctrl+c will compile and run cuurent nim file), so i decide to sniff the xevents for capturingthe hotkey and do the right thing according to the current focus window, so i can use emacs shortcut freely
13:13:17dadadadisruptek comments on comments, and some nice words about Araq https://www.twitch.tv/disruptek/clip/MushyCourageousMomTakeNRG?filter=clips&range=all&sort=timehttps://www.twitch.tv/disruptek/clip/MushyCourageousMomTakeNRG?filter=clips&range=all&sort=time
13:13:51*silvernode joined #nim
13:15:51*smitop quit (Quit: Connection closed for inactivity)
13:16:15Araqyeah I heard it. it's a valid point of view but in the end the problem is that comments are ignored by the compiler so you can never be sure it's up to date
13:17:07dadada"nice words about Araq" , I think I need to clarify that I was joking there, I don't endorse his words, but I know he was also joking
13:17:37Araqsure, no worries, I know disruptek, we're friends
13:18:14PMunchdadada, it's called PiMo, but it isn't done yet so the source is closed for now. It's still active in the sense that I still tinker with it from time to time and have ideas I want to implement. And yes, it's all written in Nim :)
13:18:48dadadaPMunch: what else is special about this WM?
13:19:47FromGitter<alehander92> yes, i still think a reasonable amount of comments is good to have into more mature codebases
13:20:05FromGitter<alehander92> especially inline comments are kinda obvious to change or not when one changes the code around them
13:20:19*silvernode quit (Ping timeout: 260 seconds)
13:21:17FromGitter<alehander92> and its not hard to imagine tooling for it, e.g. commit hook which asks you "are those comments related to those changed in diff lines still valid"
13:21:36FromGitter<alehander92> if they're not touched or something
13:23:13dadadaa favor more comments ... they should be put next to the code they conern and be updated when the code is updated ...
13:23:18dadadaconcern
13:25:23PMunchHmm, dadada, mind if we take this in #nim-offtopic? I started typing things out and it became pretty long :P
13:25:35PMunchOr a PM for that matter
13:25:42PMunchBut just in case anyone else wa wondering
13:25:55dadadaI never mind a PM
13:26:40*silvernode joined #nim
13:31:26disruptekif the comments are out of date, update the comments.
13:31:43disruptekthat's almost verbatim from my, uh, comments.
13:32:02disruptekso you maintain two pieces of "code."
13:35:04disruptekbig deal. only one set of code can have bugs. the other set serves to provide a bug-free statement of intent.
13:35:41*silvernode quit (Ping timeout: 246 seconds)
13:36:05disruptekotherwise, when you detect a bug with your eyes, you have to decrypt intent by grasping the entire surface.
13:37:01disruptekwe already know that bugs exist and more are made with every commit.
13:37:11Araqhey...
13:37:21disruptekso comments are a cheap reusable contribution against bugs.
13:37:39disruptekwrite once, read many.
13:38:09*shadowbane quit (Quit: Konversation terminated!)
13:39:50disruptekso i hit 50 followers and i cannot find a single thing in the twitch ui that has changed.
13:40:13*nsf joined #nim
13:40:23disruptekthe latency mode is still set to "low latency".
13:40:36FromGitter<alehander92> disruptek remember me when you become president
13:40:56disruptekpass.
13:41:18FromGitter<alehander92> maybe for the better with the size of this army
13:43:30disruptekthis was a pointless goal. 😠
13:44:08disrupteki'm not giving twitch money and no one else should, either.
13:44:32disruptekbuy emotes? give me a break.
13:45:38*shadowbane joined #nim
13:49:16disrupteklol you "buy" emotes and then for every $0.02 you waste, twitch takes >$0.01. what the hell are we doing here, people?
13:50:17disruptekwhy would anyone want to provide charity when a for-profit company owned by amazon will take >50% in "administrative costs"?
13:50:29disruptekthe world has gone mad.
13:50:47disruptekplease don't be stupid.
13:52:41FromDiscord<Kiloneie> That is dumb.
13:53:24FromDiscord<Kiloneie> Anyone got a clue on what happened on friday ? I swear the graph had more than 0 there.
13:53:24FromDiscord<Kiloneie> https://cdn.discordapp.com/attachments/371759389889003532/689109060045373479/anomaly.PNG
13:53:45disruptekchannel points could be interesting, though. it rewards investment and doesn't cost anyone anything.
13:54:17disruptekwhat does that mean?
13:55:02FromDiscord<Kiloneie> If you mean me and my graph, it says 0 views on my channel on friday 13th, last friday...
13:55:23FromDiscord<Kiloneie> Did something happen ? It's weird...
13:56:22disrupteki have streamed for 135hrs and have 35k mins watched.
13:56:32AraqCorona happened
13:56:52FromDiscord<Kiloneie> xD okay
13:57:58FromDiscord<Kiloneie> My last 2 videos have finally climbed my chart. Im still here D:...
13:58:43disruptekmaybe i should go back to focusing on simpler content. i feel like people that join the channel do so to ask about my wallpaper and not nim.
13:59:27FromDiscord<Kiloneie> If anyone got any ideas how to make a patreon page good, do @ me please :). It's as basic as it can be right now.
13:59:50*silvernode joined #nim
13:59:56disrupteki dunno what that means.
14:03:08FromGitter<alehander92> disruptek i thought you just stream about life, coding and random stuff
14:03:15FromGitter<alehander92> i didnt know there is a goal, man
14:06:54Araqdisruptek for president is the goal, what else
14:07:32dadadahate that you can't remove the top bar in vscode, generally I like this IDE
14:08:51Zevvdadada: http://zevv.nl/div/tape.jpg
14:09:37lqdev[m]dadada: which top bar?
14:09:54dadadaZevv: heh
14:10:15dadadalqdev[m]: the one with the filename in it and the x button on the upper right
14:11:27narimirandadada: fullscreen mode?
14:11:31narimiranzen mode?
14:11:59dadadanarimiran: I'm in fullscreen mode, and I also tried zen mode, the top bar doesn't go away, I want the whole window to be used by the editor
14:12:06dadadawhole screen
14:14:43lqdev[m]huh, I don't have the titlebar o.O
14:14:49lqdev[m]ah right, I disabled them in i3
14:15:12lqdev[m]dadada: check the "Title Bar Style" setting
14:15:38lqdev[m]you can save at least a few pixels by setting it to `custom`
14:17:23dadadatried it, looks almost identical, maybe my eyes aren't tuned for seeing minor pixel changes
14:17:32dadadathanks for the hint though
14:18:11silvernodetime to work on space_nim again
14:18:23*Hideki_ quit (Remote host closed the connection)
14:18:24silvernodeI don't have to go to work this time. I have all day to work on it
14:19:08*Hideki_ joined #nim
14:20:10*Hideki_ quit (Remote host closed the connection)
14:20:22*Hideki_ joined #nim
14:20:39*dddddd joined #nim
14:23:48JustASlackerhttps://www.mobygames.com/game/space-nim
14:26:01axionWhat is wrong here? https://play.nim-lang.org/#ix=2eoS
14:26:06disrupteki stream wallpaper.
14:26:21*Zectbumo joined #nim
14:26:47*JustASlacker quit (Quit: Leaving)
14:26:53narimiranaxion: do `o: var (Vec[N] or Mat[N])`
14:27:20narimiranbtw, why does everybody roll their own matrices and vectors? :)
14:27:44*nullwarp_ is now known as nullwarp
14:27:46PMunchThat's what the cool kids do nowadays I guess
14:27:47axionecause the existing ones are either mathematically incorrect in subtle ways, or inefficient for my use case
14:27:56narimiranaxion: which ones are those?
14:28:23narimiranand what is incorrect with them? their authors should be notified, IMO!
14:28:38axionvmath, linalg, and a few others i've looked at. i work for a game studio and it took us 10 years to write one in another language suitable for us, so i'm porting it :)
14:28:41dadadaagree with narimiran here
14:28:51narimiranaxion: try `neo` or `arraymancer`
14:29:18narimiran`neo` was great for my usecase
14:29:22disruptekmitems
14:30:06dadadadisruptek: I crave your music, please stream :-)
14:30:25disrupteki stream music.
14:31:34axionplus, i really need DQ support in a non-consing fashion, and it ties in heavily our existing V4 and Q codes
14:32:10disruptekmmm Dairy Queen.
14:33:50axionI'm not sure why indie game developers neglect dual quaternions so much. They are incredibly useful for more than just IK/skinning, since they take half the storage and cheaper to compute transformations than a matrix, whenever you don't need non-uniform scale
14:34:01*Serenitor joined #nim
14:35:11*Serenitor quit (Client Quit)
14:35:31*Serenitor joined #nim
14:38:07disruptek!last leorize
14:38:08disbotleorize left 12#disruptek 40 hours ago and last spoke 740 hours ago
14:39:15disruptekback to streaming wallpaper and tunes.
14:39:19disruptek~stream
14:39:19disbotstream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek
14:40:27PMunchDocumentation for my macroutils module done, now just to write some tests
14:40:43dadadaPMunch: what's that module doing`
14:40:44dadada?
14:40:56PMunchMagic
14:41:18dadadaI was expecting that
14:41:26PMunchhttps://uploads.peterme.net/macroutils.html
14:42:51dadadaPMunch: that's very useful, thanks
14:44:00PMunchI certainly hope it will be
14:45:08FromGitter<alehander92> i think the extract thing is most important
14:45:27FromGitter<alehander92> it really brings a missing piece in nim's macros iirc
14:49:07dadadasameTree is a nice too
14:49:58FromGitter<alehander92> that's it, after the oil field norway now invests into macro infrastructure
14:53:28dadadaPMunch: why is the example for Building trees written with a proc and not a macro in the doc?
14:53:52dadadaor is that an error in the doc?
14:54:10PMunchBecause I don goofed
14:54:14PMunchYeah it's an error
14:54:16*jholland__ joined #nim
14:54:39PMunchThanks for spotting it
14:54:50PMunchThat snippet was ripped from a longer macro I used for testing
14:54:50dadadadude, you're doing great work, keep it going
14:54:51*Serenitor quit (Quit: Leaving)
14:55:16*filcuc joined #nim
14:56:45dadadaPMunch: it's fantastic, you're the hero of the day
14:57:02PMunchHaha, don't over hype it now :P
14:57:16dadadaseriously it's wickedly good
14:59:53dadadashould be standard part of Nim, and superQuote maybe should simply be the new quote
15:02:12dadadait can't be overhyped, because it's sick
15:09:26*Vladar joined #nim
15:13:01*Mortir joined #nim
15:18:20*Hideki_ quit (Remote host closed the connection)
15:19:20MortirHey
15:19:21*Hideki_ joined #nim
15:19:49MortirAre there any plans on allowing tabs?
15:19:53Yardanicono
15:20:18PMunchYou can use tabs with a source filter
15:20:21PMunchBut please don't
15:20:23Yardanicowell yeah, but pls don't :P
15:20:50PMunchCouldn't be arsed to write all that many tests atm, and I'm heading out now so here you go! https://github.com/PMunch/macroutils
15:21:22PMunchHere is my test file if you want to see more about how to use it: http://ix.io/2epg
15:21:29PMunchPRs welcome
15:21:43MortirOk.
15:22:10dadadaMortir: you can set your editor to write spaces when you hit tab
15:23:40axionWhy is `if` --> `iff` typo'd in the manual and stdlib about 1,000 times? :)
15:23:45Yardanicoit's not a typo
15:23:47*Hideki_ quit (Ping timeout: 250 seconds)
15:23:53Yardanicohttps://en.wikipedia.org/wiki/If_and_only_if
15:24:03Yardanicoit's been discussed in at least 2-3 PRs to nim stdlib
15:24:45axionI would strognly suggest a terminology legend in the manual since this is not so well known, and often computing terms are so overloaded anyway
15:25:02Yardanicohttps://github.com/nim-lang/Nim/pull/10935 https://github.com/nim-lang/Nim/pull/5732 https://github.com/nim-lang/Nim/pull/1482
15:25:03disbotTypo fix in strutils.
15:26:09*okcc quit (Quit: Leaving)
15:29:22*Mortir left #nim (#nim)
15:37:31narimirandidn't we already "fix" those, just to prevent future questions?
15:38:12FromGitter<alehander92> axion its a math term
15:38:29FromGitter<alehander92> but otherwise i agree with legend and i dont agree with 'fix"
15:38:31FromGitter<alehander92> iff != if
15:38:31*Trustable joined #nim
15:38:45FromGitter<alehander92> and people ask about it anyway, so it's all good
15:39:38axionYeah, even mathematical texts and papers you have to carefully read the terminology legend, since especially in math, operators and terms are overloaded like crazy
15:40:05FromGitter<alehander92> yeah, but `iff` isn't really overloaded imho, it's basically `<=>`
15:40:57FromGitter<alehander92> but a legend is useful for many terms: compilation(not transpilation), side effects, and all kinds of others terms with
15:41:05FromGitter<alehander92> different interpretations
15:41:07axionWho am I to know it is what you say and not a typo without formal documentation?
15:41:25disruptekyou are a programmer, that's who.
15:41:36FromGitter<alehander92> what is "formal documentation"
15:41:45axionA programmer would question everything, because other programmers wrote it :)
15:41:49narimiran@alehander92 so why is IFF necessary in the docs?
15:42:06narimirancan you show me one example when IFF is correct and IF is incorrect?
15:42:08FromGitter<alehander92> well it gives you additional information
15:42:24narimiranno it does not
15:42:33narimiranin theory it does, in practice no
15:42:37narimiranwe're not robots
15:42:52FromGitter<alehander92> a >= b if a > b is true ⏎ a >= b iff a > b is false
15:43:10narimiranexample from our docs, please
15:43:25FromGitter<alehander92> well, they mean different things man
15:43:37narimiranyeah, i know the difference
15:43:46FromGitter<alehander92> a happens if b and ⏎ a happens if b and only then
15:43:52PMunchHmm, ..code-blocks apparently doesn't work on GitHub..
15:43:55FromGitter<alehander92> it seems obvious to me the second one is more useful
15:44:03FromGitter<alehander92> in both theory and practical sense
15:44:05narimirani'm telling you that all instances i've found in the docs were the "wrong usages" of IFF
15:44:28FromGitter<alehander92> well incorrect usages have to be fixed
15:44:33Araqenough people do not understand 'iff' so we shouldn't fight it and replace it by 'if'
15:44:41FromGitter<alehander92> but that's like saying why use `>` if we have `>=`
15:44:44FromGitter<alehander92> imho
15:45:18PMunchI just used iff in the documentation I wrote for macroutils..
15:45:20FromGitter<alehander92> but you maintain the docs, so you guys know better, just wanted to point out that a bit of pedancy is nothing strange for a docs full with very precise type/effect signatures
15:45:57axionI think there's quite a difference between a symbol that cannot be disambiguated with natural language typographical errors, and a string of text that can.
15:46:07axionWithout a legend of course
15:46:10PMunchBut oh my, when I was writing my beginners guide to programming in Nim (don't think I actually ever released that) I had to work so hard not to call anything but vars for variables.
15:46:22PMunchJust speaking of overloaded terms
15:46:57FromGitter<alehander92> axion well yeah, a legend is ok
15:47:24FromGitter<alehander92> and again, not only for that: most docs assume their particular definitions of many terms/names
15:48:29narimiranhttps://nim-lang.github.io/Nim/os.html#cmpPaths%2Cstring%2Cstring what does a regular nim user lose if we replace this IFF with IF?
15:48:46narimirandoes they suddenly don't understand how 'cmp' works and what it does?
15:49:35narimiran"oh, it returns 0 for same, negative for smaller, positive for larger. but, what if somebody is hiding from me?"
15:50:05Araqnarimiran, agreed and now let's move on, we have plenty of things to do
15:50:23FromGitter<alehander92> but if you look at the line in isolation, each line brings more meaning
15:50:37FromGitter<alehander92> `0 iff pathA == pathB` : i dont even need to look at the others, thats the only case it returns 0
15:51:33narimiranyeah, i can be as pedantic as the next guy (and i sometimes/often am, to the joy of my girlfriend and others), but also there are times when you need to be pragmatic
15:51:47FromGitter<alehander92> but not in a language spec/manual
15:52:00*Hideki_ joined #nim
15:52:17FromGitter<alehander92> i mean let's have `proc existsDir(dir: string): bool {.gcsafe, extern: "nos$1", tags: [ReadDirEffect], ⏎ ⏎ ``` raises: [].}` and then wondef if `iff` is too much :D``` [https://gitter.im/nim-lang/Nim?at=5e6fa0b0ebf3c06f30525130]
15:52:58FromGitter<alehander92> of course, its not a big deal if you change it, i just dont think its a big deal to leave it as well
15:53:03narimiranhow about `iff x <= z or y <= z`? what if i stopped reading before `or`?
15:54:07FromGitter<alehander92> i agree, this argument wasnt great, but it's not really padentry too
15:54:12FromGitter<alehander92> which reminds me of a new RFC guys
15:54:18FromGitter<alehander92> `iff a > b:` in functions
15:54:34FromGitter<alehander92> which ensures that no other paths in the branch tree result in the same value
15:54:37FromGitter<alehander92> oh yeah
15:55:49*nsf quit (Quit: WeeChat 2.7)
15:56:02*Hideki_ quit (Ping timeout: 246 seconds)
15:56:08FromGitter<alehander92> must write donald knuth to collect my turing award
15:59:39Yardanicolol
16:00:31FromDiscord<treeform> Hey can you guys help me out with a simple macro? So I am in side a macro I want to see if the expression I have will compile with $(expression) has a string function, otherwise do my own thing. I tried it with `if compiles($(n[i])):` but that checks the $ of the node, how can I check if $ of what node is compiles.
16:01:01Araqeasiest way is to not check it inside your macro
16:01:08Yardanicowell the easiest would be probably parseStmt, but it's not really the clean one
16:01:15Araqbut make your macro emit the 'when compiles' check
16:01:18Yardanicoah, wait, im wrong
16:01:34FromDiscord<treeform> Araq, neat, ill try that.
16:03:12Araqhmm plus 1111 cases, that can't be good
16:09:19shashlick!last awr1
16:09:20disbotawr1 never seen.
16:13:30*sealmove joined #nim
16:22:30leorizedisruptek: am I summoned? :p
16:23:07disruptekcan't remember. sorry! 🤣
16:24:49disrupteki got a clash between an enum Injection and, probably another enum Injection defined elsewhere. the compiler reported it as `undefined`.
16:25:36*Hideki_ joined #nim
16:27:13shashlickdisruptek: last doesn't work on gitter users?
16:27:35disruptek!last alehander92
16:27:35disbotalehander92 spoke in 12#nim 31 minutes ago
16:27:57shashlick!last awr1
16:27:58disbotawr1 never seen.
16:28:08leorize!last treeform
16:28:08disbottreeform spoke in 12#nim 26 minutes ago
16:28:14FromDiscord<Recruit_main70007> can we use it from discord?
16:28:19leorizeit seems to work?
16:28:19disrupteksure.
16:28:27FromDiscord<Recruit_main70007> !last Albus70007
16:28:27shashlickhttps://irclogs.nim-lang.org/16-03-2020.html#06:55:44
16:28:28disbotAlbus70007 never seen.
16:29:00FromGitter<Albus70007> whats my name in gitter?
16:29:09FromDiscord<Recruit_main70007> hmmm
16:29:12leorize!last Albus70007
16:29:12disbotAlbus70007 spoke in 12#nim 11 seconds ago
16:29:43FromDiscord<Recruit_main70007> makes sense, last time i spoke in gitter was very long ago
16:31:07disruptek!last slymilano
16:31:07disbotslymilano never seen.
16:31:20disruptek!last Guest12859
16:31:21disbotGuest12859 never seen.
16:31:45disruptekit looks like maybe it crashed and lost a few minutes of data.
16:31:58disruptek!last sealmove
16:31:58disbotsealmove joined 12#nim 18 minutes ago and last spoke 72 days ago
16:32:30disrupteki don't bother to rewrite the data on every change, so...
16:32:49disruptek!last Simula
16:32:50disbotSimula never seen.
16:32:57disruptekstrange.
16:34:13*tane joined #nim
16:35:48disrupteki dunno what's going on.
16:39:07*nsf joined #nim
16:42:07*sagax quit (Ping timeout: 255 seconds)
16:44:33FromGitter<alehander92> in gitter we all see 7
16:44:42disruptekthat's a lucky number.
16:44:56FromGitter<alehander92> instead of color code i guess (i remember somebody else said that)
16:45:02FromDiscord<Recruit_main70007> not for nothing in my name
16:46:50*Hideki_ quit (Ping timeout: 240 seconds)
16:48:26leorizethe gitter bot can't deal with irc colors
16:48:31leorizesame as with NimBot
16:50:15axionHow do i type a parameter to be a slice of a specific ordinal type and have a default range value?
16:50:36leorizeHSlice[T]
16:50:50leorizeSlice[T] to be precise
16:52:43axionYeah I tried that, but even though my parameter is [T: float32] it requires the caller to specify the correct type suffix. Is there a way around that?
16:54:57leorizewhat's your function prototype?
16:55:18leorizeoh and Nim can't infer param that precise yet
16:55:45axionproc foo*[T: float32](o: var MArray, range: Slice[T]) =
16:55:53leorizeuse Slice[float32]
16:56:58axionWell that'd be the same thing, but I agree. I'd like to be able to call it as o.foo(1..5) and have it treat that as a float range if possible
16:58:25*Zectbumo quit (Remote host closed the connection)
17:00:44*floppydh quit (Quit: WeeChat 2.7.1)
17:11:38*Vladar quit (Ping timeout: 240 seconds)
17:12:03*Vladar joined #nim
17:26:25*actuallybatman joined #nim
17:44:35*a_b_m joined #nim
17:44:44*a_b_m quit (Client Quit)
17:47:20*abm quit (Ping timeout: 246 seconds)
17:58:02*narimiran quit (Ping timeout: 240 seconds)
18:04:31*narimiran joined #nim
18:05:13*NimBot joined #nim
18:07:43*shadowbane quit (Quit: Konversation terminated!)
18:08:34*shadowbane joined #nim
18:10:58*shadowbane quit (Client Quit)
18:12:24*shadowbane joined #nim
18:12:43shashlick@leorize - please comment on https://github.com/nimterop/nimterop/issues/99
18:12:46disbota better proposal for mapping C enums ; snippet at 12https://play.nim-lang.org/#ix=2eq4
18:13:26Araqdoes Nimble support --nimExe?
18:14:30*shadowbane quit (Client Quit)
18:15:13*shadowbane joined #nim
18:16:06leorizeshashlick: it'd not be too deterministic
18:16:30leorizefor example if you handle repeats by: const ResourceLimitWarning = ExceptionType.WarningException
18:16:47leorizethen when someone tries to $ResourceLimitWarning, they get "WarningException"
18:17:02leorizethat's not something anyone would expects
18:18:30shashlickAraq: nope, it just uses findExe("nim")
18:18:39leorizethen if you go all const for enums with duplicates, then $ResourceLimitWarning will print an int instead
18:18:47leorizewhile some other enum will print a string
18:19:26shashlickleorize: well, the current implementation is the latter, so going to the former is an improvement
18:19:29leorizeI'd say that C enums just don't fit Nim's model
18:20:18leorizeI'd prefer how enum are represented in nim with nimterop to be upfront
18:21:03leorizeeither you go: everything mapped to nim enum, or you go everything mapped to distinct cint
18:21:22leorizeyou can give people the option, though I'm not sure if that's the best
18:21:31shashlickhmm
18:21:48*Vladar quit (Quit: Leaving)
18:21:56shashlickI'm not sure if the current distinct int method is really so bad
18:22:07leorizeif you found duplicates in "mapped to nim enum" mode, just abort, using a const to walkaround is just confusing to people
18:22:54shashlickmapping to Nim enum mainly gives readability if an enum is printed
18:22:58shashlickwhat else does it buy us?
18:23:30leorizeuse as array index if enum don't have holes?
18:25:03leorizeit basically gives us nothing more
18:26:25shashlicki don't think it is too much work but it will require spawning another nim process to get this cleaned up
18:26:43shashlickplus the distraction from all the other things nimterop still needs to get done
18:27:08*so quit (*.net *.split)
18:27:15leorizeimo this doesn't worth the time
18:27:19*so joined #nim
18:27:31leorizemaybe you can outline how should it be implemented and just leave it there as PR welcome
18:27:39leorizeor just abandon the idea because it's kinda useless
18:28:42shashlickokay will link to this discussion
18:28:45shashlickthanks for your thoughts
18:30:12FromGitter<dumjyl> duplicate enum values in c are often used to make up for lack of `low` and `high` and map just fine to nim enums once those are stripped. llvm/clang for example.
18:30:51shashlickhow would an automated tool know which one(s) to strip
18:32:07FromGitter<awr1> hello
18:32:28shashlickhey @awr1, good timing
18:32:28leorizethen there are also people who use enums as a way to specify flags that should be or-ed toghether
18:34:13*Zectbumo joined #nim
18:34:15FromGitter<awr1> yeah it might be preferable to keep it as an option, to do the enum transformation
18:34:36shashlickwe also lose the formula but i don't think that's really a problem
18:34:45*Hideki_ joined #nim
18:35:44FromGitter<awr1> how do you think you might relay which values belong to which enums to the macro?
18:36:01FromGitter<awr1> attach pragmas to the consts?
18:36:13leorizethe consts have names
18:37:11shashlickmight have to collate all enum consts into blocks by enum and have multiple calls to the macro for each enum
18:37:30shashlickthe macro would have to print out the results in a way to be easily parsable by toast
18:38:01leorizeor, you can have a nim macro that generates all of this
18:38:14leorizelike cenum EnumName: <enum values>
18:38:22leorizethen call nim with --expandMacro:cenum
18:38:30shashlickbut toast is runtime
18:38:31leorizebam you got the file without depending on cenum :)
18:38:34FromGitter<awr1> i was thinking that you could peform the macro after `toast` is done
18:38:35shashlickwe still need to spawn nim
18:39:00shashlicktoast needs to be standalone as well, some users prefer that to the compile time API
18:39:08*Hideki_ quit (Ping timeout: 246 seconds)
18:39:14leorizethat's what --expandMacro is for
18:39:39leorizeyou use it and get the expanded stuff, then you can just remove the imports
18:40:42*leorize quit (Quit: WeeChat 2.7.1)
18:40:54shashlickexpandMacro gives you code that can be compiled into toast and run at runtime?
18:43:14FromGitter<awr1> in regard to using bitor'd C enums as sets: there is a weird idea i'm thinking of
18:44:28FromGitter<awr1> the enum types could be all a part of a certain typeclass, and then you could have a special func that gives you set-like syntax but returns a `cint` or w/e
18:44:41FromGitter<awr1> (this func would be constrained to that typeclass)
18:45:10leorize[m]shashlick: as long as you don't use gensym, then yes
18:45:34shashlickDo you have some example code?
18:52:38*Zectbumo quit (Remote host closed the connection)
18:53:10*Zectbumo joined #nim
18:53:30FromGitter<awr1> @shashlick something like this? https://play.nim-lang.org/#ix=2eqj
18:54:49FromGitter<awr1> (idk how you get procs to work with `{}` syntax, like how it's used for sets and `toTable`)
19:00:45shashlick@awr1: what is this to solve? https://github.com/nimterop/nimterop/issues/159?
19:00:48disbotEnums that refer to other enum values fail ; snippet at 12https://play.nim-lang.org/#ix=2eqn
19:00:58shashlick@leorize: do you have an example of using --expandMacro
19:05:23*opal quit (Ping timeout: 240 seconds)
19:09:11FromGitter<awr1> as a way to allow people to use bitor'd enums for libraries. i guess it doesn't have to be set syntax, and i suppose one can also just implement `or`, `and`, `xor` etc.
19:09:33FromDiscord<mratsim> I use a Flag
19:10:00shashlickwe could add it to https://github.com/nimterop/nimterop/blob/master/nimterop/types.nim#L29
19:10:16FromDiscord<mratsim> see: https://github.com/numforge/laser/blob/master/laser/photon_jit/photon_osalloc.nim#L52-L61
19:10:23shashlickbut will need to setup combos of every enum with every other enum, so makes no sense
19:10:25FromDiscord<mratsim> I'm pretty sure you already saw that code
19:10:43*opal joined #nim
19:11:02shashlick@mratsim: what's your opinion on https://github.com/nimterop/nimterop/issues/99
19:11:03disbota better proposal for mapping C enums ; snippet at 12https://play.nim-lang.org/#ix=2eq4
19:11:47FromGitter<awr1> well wouldn't that be a use for using the type class?
19:12:45FromDiscord<mratsim> I don't see how to automate the `or` enums so that they use a separate Flag type
19:23:16federico3https://github.com/cheatfate/asyncpg is this project dead?
19:24:42*Zectbumo quit (Remote host closed the connection)
19:26:52FromDiscord<Lantos> wow nimx is actually sick
19:27:06FromDiscord<Lantos> Just ran the hello world on ubuntu & android
19:28:24*silvernode_ joined #nim
19:32:05FromGitter<brentp> with jester, I want to match `/a/a/a/` , `/a/b/c/`, `/a/x/y/z/2`, etc. do I need a regexp for this?http://github.com/nim-lang/Nim/wiki/Tutorial:-Creating-a-(micro)-service-flask
19:33:09dom96try `get "/a/@path"`
19:33:19dom96might work, but also might not :)
19:33:37FromGitter<brentp> that doesn't work, unfortunately
19:33:48dom96then yes, you need a regex
19:33:52FromGitter<brentp> that only works for `/a/b/`
19:34:35*nsf quit (Quit: WeeChat 2.7)
19:37:15*silvernode_ quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
19:39:04FromGitter<brentp> regex works. thanks
19:40:10*silvernode_ joined #nim
19:41:00*tdog quit (Ping timeout: 256 seconds)
19:49:55disruptek!last narimiran
19:49:56disbotnarimiran joined 12#nim 105 minutes ago and last spoke 73 hours ago
19:50:05Yardanico!last yardanico
19:50:06disbotYardanico spoke in 12#nim-offtopic 2 hours ago
19:50:11Yardanicohuh
19:50:14disruptek...
19:53:17disruptek~stream
19:53:18disbotstream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek
20:03:13FromDiscord<Kenran> is twitch slow today? it isn't really loading anything for me right now
20:03:46*PMunch quit (Ping timeout: 246 seconds)
20:07:48*natrys joined #nim
20:15:02*filcuc quit (Quit: KVIrc 5.0.0 Aria http://www.kvirc.net/)
20:16:49*PMunch joined #nim
20:30:44*shadowbane quit (Remote host closed the connection)
20:40:13*sagax joined #nim
20:48:23*Hideki_ joined #nim
20:49:09axionHow do i get at one of the bounds of a slice?
20:51:19FromGitter<kaushalmodi> use the .high or .low
20:52:58*Hideki_ quit (Ping timeout: 256 seconds)
21:00:17FromGitter<alehander92> dont be a sad fella
21:01:35*narimiran quit (Ping timeout: 246 seconds)
21:06:31axionthere doesn't seem to be an generic for those on Slice
21:10:58axionMaybe I'm doing something wrong? I get this: https://gist.github.com/mfiano/f17eb5ee0bea4a0af1c53d1418eb2e9c
21:13:17solitudesfits a and b fields for slice bounds
21:14:03shashlickAraq: what proc in the compiler reduces an expression into a value for a const? https://github.com/nimterop/nimterop/issues/99#issuecomment-599687131
21:14:04disbota better proposal for mapping C enums ; snippet at 12https://play.nim-lang.org/#ix=2eq4
21:16:09Araqshashlick: semfold or vm.nim
21:16:51*ptdel joined #nim
21:17:02shashlicknifty - awesome having the full compiler available within toast
21:21:27*natrys quit (Quit: natrys)
21:25:29axionis there an idiom for iterating over the indices rather than elements of a container? I feel this can be written better if I knew the language well: for i in 0..obj.len-1: ...
21:26:25FromGitter<kaushalmodi> there are pair iterators available
21:27:10axionright, but that seemed wrong to me, since i only need the first part of the pair, and can't do just the first part, so i'd have an unused identifier
21:27:22axionmaybe that's more idiomatic even though it introduces an unused thing?
21:28:23FromGitter<kaushalmodi> axion: https://play.nim-lang.org/#ix=2er8
21:28:28FromGitter<kaushalmodi> use the _ for the unused
21:28:41axionah ok, thanks
21:29:10FromGitter<kaushalmodi> if you wish, you can wrap that in your custom iterator to that you don't need the `, _` piece
21:29:43Araqdunno, use for i in low(x)..high(x)
21:29:51axionYeah I probably will. Just trying to sketch out the user API first and learning bits of the language in the process (my first project here)
21:32:35axionI don't know if I ever thanked you Araq, but thank you for your incredible devotion to the project (and all the other contributors too). I've tried about 2 dozen languages over the years, and everything has brought me back to my 2 decades of Lisp, except this one is making me not want to go back :)
21:32:57FromGitter<kaushalmodi> axion: https://play.nim-lang.org/#ix=2era (indices iterator)
21:33:12FromGitter<kaushalmodi> > I don't know if I ever thanked you Araq, but thank you for your incredible devotion to the project ⏎ ⏎ +1!
21:41:12Araqah thanks :-)
21:44:34shashlickAraq: what should I set PSym to in proc getConstExpr(m: PSym, n: PNode; g: ModuleGraph): PNode
21:46:48shashlicki constructed a const ast and have a newModuleGraph but am wondering what the m: PSym should refer to
21:54:56*Zectbumo joined #nim
21:58:38FromGitter<awr1> ah so you're just going to leverage the compiler const folding mechanism directly
21:59:33*shadowbane joined #nim
22:00:00Araqshashlick: it's the module you're compiling
22:00:34*silvernode_ quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
22:02:04*Skaruts joined #nim
22:02:45Skarutsis there some way to turn an instance of an object to a unique string that can serve as an ID?
22:03:17*Trustable quit (Remote host closed the connection)
22:03:25FromGitter<awr1> @Skaruts like a hash?
22:03:31Araqyou can cast a ref object to an id via cast[int](myref)
22:03:33Skarutsyea, I guess
22:03:42Araqbut objects themselves have no identity
22:03:51Skarutsgonna try that
22:03:57Araqdo NOT use addr/unsafeAddr, it never works for that
22:04:46*filcuc joined #nim
22:05:19FromGitter<awr1> if you want to do a hash instead of a int'd ref, you will have to implement the hash proc https://nim-lang.org/docs/hashes.html
22:05:30SkarutsI stay away from pointers anyway :)
22:05:46Skarutsseems to work nicely
22:08:06shashlick@awr1: yep
22:09:12Skarutsis the result of casting the ref always gonna be unique though?
22:10:21PMunchHmm, should we add a toOption proc (or maybe even a converter?) from ptr/ref types to options? They can be cast as they are now as the underlying Option[ptr T] is just a nil check on the type. But it would be cool to formalise this.
22:11:07AraqSkaruts: no, the refs can be collected and re-used
22:12:41Skarutshmm... I guess that won't be a problem, but gonna keep it in mind
22:13:20*filcuc quit (Remote host closed the connection)
22:13:22FromGitter<dumjyl> https://nim-lang.org/docs/options.html#option%2CT already does that I think.
22:14:39*filcuc joined #nim
22:15:13PMunchOh cool
22:15:19PMunchNice
22:24:52*PMunch quit (Quit: leaving)
22:27:02*filcuc quit (Ping timeout: 256 seconds)
22:27:16*solitudesf quit (Ping timeout: 246 seconds)
22:29:11*tane quit (Quit: Leaving)
22:38:37*zahary joined #nim
22:50:15federico3why is monotime in a dedicated module and not in times?
22:53:29federico3how can I convert a varargs to a seq?
22:54:04krux02federico3, probably with toSeq
22:54:14krux02but it does copy all elements
22:55:06axionis there a reason clamp takes separate parameters for its bounds, unlike say rand which uses a slice?
22:55:27krux02axion: probably not a very good one.
22:56:08krux02maybe because it is a port of a `clamp` function from a different programming language that does not have slices.
22:56:31krux02I also don't have very good experience with slices on floating point numbers.
22:58:21axioni see. noticing some inconsistencies learning the stdlib and just curious
22:58:39krux02yea there are quite a few inconsistentcies in the stdlib.
22:58:43krux02sorry for that.
22:58:52krux02It just happens when a lot of people contribute.
22:59:59krux02for me personally I prefer to not work with slices, as my brain internal representation gets confused weather ``0..10`` is a type or a value.
23:00:31krux02but that is just me.
23:01:07krux02I don't really have a strong opinion here.
23:01:34*lritter quit (Ping timeout: 246 seconds)
23:02:35krux02axion: what is your use case for Nim? What made you learn about it?
23:03:44*disrupteq quit (Ping timeout: 246 seconds)
23:04:05krux02I am just curious why people are using Nim, and for what they are using it.
23:04:51axionOh, a ton of reasons. zacharycarter told me about it a couple years ago, and had my eye on it since, but only been using it for about a month now. I really value a language that is both expressive and concise, because at the end of the day, the only thing that matters, is getting ideas working quickly. with Nim, there isn't the 2-language problem in doing that.
23:09:42axionarguably, where i came from didn't have the problem either. However, I have a lot of bad to say about nearly 2 decades of using Common Lisp I'd rather not flood off-topic nonsense with :)
23:13:13axionAs for what I plan on using it for, well I'm mostly aa game developer, so we'll see after I finish porting my huge stack over :)
23:17:27axionThe one thing about Nim that I think is a little rough around the edges, is the tedium involved in writing what would be 30 seconds and 2 lines of a Lisp macro, turning into an hour and 100 lines of nodes to represent Nim's AST for the same concept. There isn't much to be done with that, since it isn't homiconic, but I do believe macro writing could be a lot less painful.
23:20:19shashlickDo you have examples
23:22:42axionNot off hand. Clyybber was helping me port a 3 line Lisp macro the other day and he came up with about 50 lines of a node tree that was still incomplete by the time we gave up. I haven't written many macros yet out of fear I'll get too dissuaded and stop using Nim in my early stages of learning :)
23:23:13FromDiscord<Rika> Macros become very large very quickly
23:23:45shashlickI'm pretty lazy and use quote and parseStmt
23:25:26rayman22201there have been some good helper libraries to help writing macros that have come about through the life of nim. Also tricks like shashlick mentioned :-)
23:26:27rayman22201Nim macros will never be as concise as lisp of course, but I agree, there is always room for improvement.
23:26:37axionIt might be worthwhile to aggregate that list of libraries and tricks online somewhere, because I really do think this is one area that needs to get a little more closer to the expressiveness of Lisp
23:26:42shashlicki prefer nim code looking like nim rather than some crazy data structure
23:26:44axionAny help would go a long way
23:27:13shashlickbut no doubt, it is working great to use the AST in nimterop since i'm doing an ast -> ast translation
23:27:30krux02axion, I agree macros could be improved in Nim. Still there is nothing like typed macros in other languages.
23:28:55axionYeah I like that a lot.
23:29:02rayman22201yeah, nothing comes close to Nim here
23:29:04krux02I can only compare Nim macros to emacs-lisp macros. Never used common lisp.
23:29:35krux02I think it is not too different though.
23:29:44shashlickfolks, would really appreciate some help with testing the new backend for nimterop - anyone interested please ping
23:30:21krux02axion: Btw I also use nim for game development
23:30:36krux02or better said, I used to, currently I am fixing bugs in Nim.
23:32:18krux02if you care about the two language problem, I fixed that for game development.
23:32:28krux02write your shaders in Nim
23:32:56krux02import nim modules and use it in a shader
23:33:56krux02and most importantly, access variables from the outer scope in a shader, as if the shader was a lambda expression with closure.
23:34:26krux02https://github.com/krux02/opengl-sandbox
23:36:20krux02I didn't update the project for quite some time now though.
23:37:16krux02It is still alive though, as I don't know anything better to quickly write small efficient custom renderers quickly in.
23:38:50federico3krux02: it does not seems so
23:41:28FromGitter<awr1> what are rust's macros even like? i looked their documentation in comparison and i don't quite get what is going on
23:41:40rayman22201Krux02, your work on fixing bugs in Nim is greatly appreciated btw <3
23:42:06FromGitter<awr1> nim's is actually pretty straightforward if you're familiar with the concept of an AST
23:45:20FromGitter<awr1> RE: shaders: what i have kinda sorta wanted to do for a while is create a compiler for a Nim DSL that produces SPIRV/DXIR
23:45:23FromGitter<awr1> but meh
23:50:31*disrupteq joined #nim
23:51:42*adnanyaqoobvirk joined #nim
23:54:52*silvernode_ joined #nim
23:55:00*silvernode_ quit (Client Quit)