<< 30-04-2021 >>

00:02:49FromDiscord<mattrb> Does it automatically go to the scope of the macro expansion if it’s not in the scope of the macro or something?
00:07:39leorizeif you specify the correct bind flag, yes
00:08:32leorizehttps://github.com/nim-lang/Nim/blob/devel/lib/core/macros.nim#L445 <-
00:09:26leorizeso brOpen should be what you're looking for
00:15:44FromDiscord<mattrb> I'm not actually looking for it to do that. It was causing some issues because it seemed to be doing that even though I wasn't passing any flags :p
00:18:54FromDiscord<mattrb> sent a long message, see https://paste.rs/IVj
00:19:26FromDiscord<mattrb> Using ident rather than bindSym fixed my problem in this case, but I'm still confused about the scoping that was going on there
00:35:11*Gustavo6046 quit (Quit: a)
00:39:48*Gustavo6046 joined #nim
00:45:55FromDiscord<ElegantBeef> Only 8/16 of the checks fail for my type inference, maybe i'm not suited for compiler work 😛
00:52:51*njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
00:53:09*njoseph joined #nim
01:13:21saemBeef it takes a while to get into it, you're making good progress on a tricky part.
01:15:34FromDiscord<ElegantBeef> Yea after it passed all the CI's, thought it was mostly PR ready, so moved it into a PR, and the additional CI failed, so still a ways to go
01:19:19FromDiscord<ElegantBeef> Saem did you get any ideas about how to go around shrinkables?
01:20:16FromDiscord<ElegantBeef> We can always pass data doing `r.run((a.gen, b.gen...))` or w/e the proper logic is
01:21:40saemHilariously I can't see the issue any more. 🤦‍♂️
01:22:08FromDiscord<ElegantBeef> it's the `initArbitrary` hinding the issue
01:22:12FromDiscord<ElegantBeef> (edit) "hinding" => "hiding"
01:23:10saemoh I see
01:23:29saemthe problem isn't the tuple, it's the tuple of shirnkables
01:24:56FromDiscord<ElegantBeef> Automating the passing of the data/generators is the part we have to figure out
01:25:04FromDiscord<ElegantBeef> We being mostly me 😛
01:28:44saemone thing that comes to mind is create a var per arbitrary?
01:28:55saembrb, gotta run an errand.
01:35:17*sixtyten joined #nim
01:54:22*wasted_youth2 quit (Quit: Leaving)
02:00:39*Tlanger is now known as unshaven_merlin
02:05:15*kayabaNerve joined #nim
02:06:40kayabaNerveI have a Nimble package working with 0.12.0 yet not 0.13.0. The downloaded folder isn't considered a git repository when I try to clone submodules. I would say that's one me, if not for it working for several previous versions (package hasn't been touched in >1 year IIRC).
02:07:26kayabaNerveI did see Nimble's git clone command updates submodules, yet it doesn't init them. There is a full clone option, which does grab submodules and would mean I don't have to init them myself via Nimscript, yet that only triggers with `nimble develop`; not `nimble install` nor any CLI flags.
02:12:37kayabaNervehttps://github.com/MerosCrypto/mc_minisketch/blob/master/mc_minisketch.nimble is the Nimscript in question. It's a git submodule init/update + building said submodule. I can work around it by directly shipping the library, yet rather not.
02:14:12kayabaNerveAlso, the IRC topic says the latest version is 1.4.2; bit out of date on that one :P
02:19:34FromDiscord<codic> sent a code paste, see https://play.nim-lang.org/#ix=3lmu
02:38:12*sixtyten quit (Quit: Leaving)
02:39:45*unshaven_merlin is now known as nohusuro
02:50:31*nohusuro is now known as ash_the_ghost
02:54:21FromDiscord<ElegantBeef> @codic what the `ev.xcreatewindow` in D?
02:54:25FromDiscord<ElegantBeef> (edit) "@codic what ... the" added "is"
02:55:03FromDiscord<codic> it's a direct port of this: https://tronche.com/gui/x/xlib/events/structures.html
02:55:13FromDiscord<codic> > ` XCreateWindowEvent xcreatewindow;`
02:56:40FromDiscord<codic> the cast is likely the wrong way but the property doesnt exist in the Nim x11 library, so I don't see another way to do it
02:56:40FromDiscord<ElegantBeef> So why dont you do `ev.createWindow`?
02:57:01FromDiscord<codic> oh
02:57:01FromDiscord<ElegantBeef> Let me look at my wm
02:57:15FromDiscord<codic> no that doesn't exist
02:57:25FromDiscord<ElegantBeef> Like i said
02:57:26FromDiscord<codic> sent a code paste, see https://paste.rs/wNc
02:57:27FromDiscord<ElegantBeef> Let me look 😛
02:58:10FromDiscord<ElegantBeef> Oh i dont manage notify
02:59:14FromDiscord<codic> oh alright
02:59:40FromDiscord<ElegantBeef> I'll get you a solution though 😄
02:59:45*ash_the_ghost is now known as nohusuro
02:59:58*nohusuro quit (Disconnected by services)
03:00:10FromDiscord<codic> thanks!
03:00:13FromDiscord<codic> is your wm nimdow?
03:00:20FromDiscord<ElegantBeef> Nah that's prestige
03:00:29*Tlangir joined #nim
03:00:30FromDiscord<ElegantBeef> Mine is goodwm which is a burning dumpster fire of half implemented
03:00:38FromDiscord<codic> lol
03:00:40FromDiscord<ElegantBeef> It did give prestige a fair bit of "working"
03:02:19FromDiscord<ElegantBeef> `XEvent` certainly does have a `xcreatewindow` field
03:02:39FromDiscord<codic> ok wow
03:02:39FromDiscord<ElegantBeef> Line 773 of `x11/xlib.nim`
03:02:39FromDiscord<codic> i'm dumb
03:02:42FromDiscord<codic> sorry
03:02:57FromDiscord<codic> I was trying dpy.xcreatewindow lol
03:03:09FromDiscord<ElegantBeef> It's fine, you had an issue and we resolved it
03:03:15FromDiscord<ElegantBeef> It'd be worse if i was at a loss aswell 😛
03:03:46FromDiscord<codic> well it works, nice
03:03:46FromDiscord<ElegantBeef> If you want another source wm you can also look at mine, though i never got to cleaning it
03:03:49FromDiscord<ElegantBeef> https://github.com/beef331/goodwm
03:04:07FromDiscord<ElegantBeef> So it's like a single file of pure unadulterated "learning X11"
03:04:28FromDiscord<codic> while I'm here, I keep seeing people using `or` where you would normally use `xor`, any reason why?
03:04:29FromDiscord<codic> nice
03:04:43FromDiscord<ElegantBeef> No clue
03:05:33FromDiscord<codic> oh like your goodwm does it too
03:05:35FromDiscord<codic> https://github.com/beef331/goodwm/blob/master/src/goodwm.nim#L65
03:05:46FromDiscord<ElegantBeef> Oh
03:05:51FromDiscord<codic> wouldnt you use a bitwise xor instead of a boolean or?
03:05:53FromDiscord<ElegantBeef> That's making flags
03:05:59FromDiscord<ElegantBeef> `or` is a bitwise or in this case
03:06:11FromDiscord<codic> ah so its like an op overload
03:06:14FromDiscord<ElegantBeef> No
03:06:15FromDiscord<codic> sent a code paste, see https://play.nim-lang.org/#ix=3lmG
03:06:22FromDiscord<ElegantBeef> In nim `or` is both boolean or and bitwise
03:06:31FromDiscord<codic> huh
03:06:46FromDiscord<ElegantBeef> so you can do `true or false` and `1 or 2`
03:07:13FromDiscord<codic> nothing wrong with using xor for clarity tho right?
03:07:21FromDiscord<ElegantBeef> If you prefer different operators you can `import std/bitops` and have `bitor`
03:07:24FromDiscord<ElegantBeef> Well yea `xor` isnt or
03:07:37FromDiscord<ElegantBeef> `xor` is exclusive which does different logic to or
03:08:04FromDiscord<ElegantBeef> It's the `~` operator in C i believe, though i dont recall
03:08:34FromDiscord<ElegantBeef> Ah sorry `^` is xor in C
03:08:45FromDiscord<codic> ah yes
03:09:02FromDiscord<codic> idk why I said xor, I'll just use normal or tbh
03:12:41FromDiscord<ElegantBeef> I should oneday go back and finish goodwm, but x11 is so annoying to work with 😄
03:13:45FromDiscord<ElegantBeef> I have no idea how prestige got so far without melting down and going on a rampage
03:14:45FromDiscord<Rika> He’s not you, for one
03:14:55FromDiscord<ElegantBeef> Make sense
03:18:49FromDiscord<codic> sent a code paste, see https://play.nim-lang.org/#ix=3lmJ
03:18:50FromDiscord<codic> well there's the bool but I have a converter for that
03:19:13FromDiscord<codic> sent a code paste, see https://play.nim-lang.org/#ix=3lmK
03:21:54FromDiscord<ElegantBeef> Well subwindow cannot be nil
03:22:16FromDiscord<ElegantBeef> subWindow = Window = culong
03:23:29FromDiscord<codic> yeah but I don't think that's the issue
03:23:37FromDiscord<ElegantBeef> I was going top to bottom
03:23:38FromDiscord<ElegantBeef> Sorry
03:23:40FromDiscord<codic> yeah, happens if i remove that check too
03:23:53FromDiscord<codic> dont be sorry for me writing bad code lol
03:25:23FromDiscord<ElegantBeef> I do recall i think XGrabPointer never played nice
03:25:33ForumUpdaterBotNew thread by Halloleo: In Nimpy how to call methods on Python objects? (Example sys.path.insert), see https://forum.nim-lang.org/t/7888
03:28:27FromDiscord<ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=3lmN
03:28:58FromDiscord<codic> lemme see
03:29:17*wasted_youth2 joined #nim
03:30:02FromDiscord<codic> hmmm doesnt change anything
03:30:22FromDiscord<codic> but thats a useful tip to avoid useless copies
03:31:54FromDiscord<ElegantBeef> It seems to be identical so i dont get why
03:33:03*kayabaNerve quit (Remote host closed the connection)
03:33:44*kayabaNerve joined #nim
03:34:05FromDiscord<codic> sent a code paste, see https://play.nim-lang.org/#ix=3lmR
03:34:13FromDiscord<codic> it may be the Nim bindings, I'll try manually binding that function later but I gtg
03:34:45*thomasross quit (Ping timeout: 268 seconds)
03:38:48FromDiscord<ElegantBeef> It's bindings look right, so following the suggestion of the first stackoverflow post i found maybe change that true to a false @codic 😄
03:39:31*wasted_youth2 quit (Ping timeout: 250 seconds)
03:40:02FromDiscord<codic> it still doesnt work very funny
03:40:29FromDiscord<codic> oh wait
03:40:35FromDiscord<codic> I think the issue is in another function that is related
03:42:52FromDiscord<codic> yeah that was it
03:43:03FromDiscord<codic> in another function, I used cast, instead of using the proper field like I did in D
03:43:10FromDiscord<codic> and that event got triggered with this one
03:43:12FromDiscord<codic> (edit) "one" => "cakk"
03:43:14FromDiscord<codic> (edit) "cakk" => "call"
03:43:20FromDiscord<ElegantBeef> ah
03:43:29FromDiscord<ElegantBeef> This is why cast is unsafe 😛
03:54:56*kayabaNerve quit (Remote host closed the connection)
04:07:54FromDiscord<creonico> Any useful small projects to learn nim?
04:08:57FromDiscord<ElegantBeef> Make parsers, make a website, make bindings for a language
04:09:09FromDiscord<ElegantBeef> Many things to do that you can learn from
04:12:42FromDiscord<ElegantBeef> I find the best way to learn most things is to do it the wrong way and let cunningham's law show you the right way 😛
04:13:15FromDiscord<creonico> but I am just starting out 🥺
04:13:25FromDiscord<creonico> any small ideas?
04:13:32FromDiscord<creonico> that are useful though
04:16:26FromDiscord<Rika> Any smaller than suggested is likely not going to be very useful unless you have anything specific you need
04:20:54*wasted_youth2 joined #nim
04:35:38FromDiscord<creonico> why is it recommended to not use unsigned integers like C?
04:39:17FromDiscord<ElegantBeef> Overflow
04:39:46FromDiscord<ElegantBeef> !eval echo 255u8 + 1u8, " ", 0u8 - 1u8
04:39:49NimBot0 255
04:42:46FromDiscord<ElegantBeef> The github wiki links to here https://critical.eschertech.com/2010/04/07/danger-unsigned-types-used-here/
04:42:49FromDiscord<demotomohiro> Overflow can happen in signed integer.
04:43:14FromDiscord<ElegantBeef> !eval echo 127i8 + 2i8
04:43:17NimBot/usercode/in.nim(1) in↵/playground/nim/lib/system/fatal.nim(49) sysFatal↵Error: unhandled exception: over- or underflow [OverflowDefect]
04:43:18*johnnynitwits1 joined #nim
04:44:49FromDiscord<ElegantBeef> The difference is one silently does it and the other throws a defect which tells you to check the range before adding to it
04:46:33*johnnynitwits quit (Ping timeout: 265 seconds)
05:04:24FromDiscord<Rika> Unless you’re compiling in danger of course
05:13:39*narimiran joined #nim
05:40:00FromDiscord<demotomohiro> Nim cannot over/underflow check to unsigned integers as some algorithms like LCG, SHA1, murmur hash, xoroshiro128+, etc use unsigned int addition or mutiplication to mix bits and overflow can happen anytime.↵↵So, if we have 2 kind of unsigned int types(one checks over/underflow, another one doesn't check), we can use unsigned int type safely?
05:57:26FromDiscord<ElegantBeef> Quite possibly
06:08:28FromDiscord<codic> How can I use references in a for loop (to avoid making local copies for each iteration)? Like in C++ `for (auto& x: v)`, in D `foreach (ref x; v)`, Rust `for x in &v`, so on↵↵Is there a language construct besides the for-loop with an index?
06:09:03FromDiscord<ElegantBeef> `for x in col.mitems`
06:12:20FromDiscord<Rika> That’s an abuse though
06:15:53FromDiscord<codic> col.mitems is an abuse, or using references in a for loop?
06:16:01FromDiscord<ElegantBeef> the mitems
06:16:13FromDiscord<ElegantBeef> it shouldnt duplicate reference types
06:16:16FromDiscord<ElegantBeef> Atleast it shouldnt
06:17:45FromDiscord<Rika> Yes it does use references but that’s not its purpose
06:25:59*NimBot joined #nim
06:26:07FromDiscord<codic> should I just use an index-based loop them
06:30:15FromDiscord<Rika> And a template perhaps
06:30:17FromDiscord<ElegantBeef> You can always make an iterator
06:34:01ForumUpdaterBotNew thread by Xioren: Would macros work to parse js and create equivalent nim code?, see https://forum.nim-lang.org/t/7889
06:35:16FromDiscord<codic> or similar
06:35:21FromDiscord<codic> sent a code paste, see https://paste.rs/XY1
06:38:01FromDiscord<Rika> You can look into inline iterators as well as beef said
06:38:34*hyiltiz quit (Ping timeout: 252 seconds)
06:55:17*hyiltiz joined #nim
06:55:18*hyiltiz quit (Changing host)
06:55:18*hyiltiz joined #nim
06:56:25*PMunch joined #nim
07:00:06*hyiltiz quit (Ping timeout: 268 seconds)
07:06:21*mahlon quit (Read error: Connection reset by peer)
07:07:09*mahlon joined #nim
07:18:02FromDiscord<hamidb80> hey
07:18:13PMunchHi
07:19:10FromDiscord<hamidb80> how can i execute system commads in nim? for e.g. in c++ we write `System("clear")` to clear console
07:19:39FromDiscord<ElegantBeef> `terminal.clearScreen` iirc
07:20:06PMunch`execCmd` I think is the closest to `System`, but as ElegantBeef points out there are better ways of clearing the terminal
07:21:24FromDiscord<ElegantBeef> Ah sorry it's `eraseScreen`
07:26:57FromDiscord<hamidb80> question:↵is it possible to compile a nim program that includes 2 libraries one of them is a wrapper for a `C` library and other one is a wrapper for `C++` library ?
07:27:12FromDiscord<ElegantBeef> If the C wrapper is compilable in C++ yes
07:27:29FromDiscord<ElegantBeef> Atleast it should be 😄
07:28:33*hyiltiz joined #nim
07:35:17*hyiltiz quit (Ping timeout: 246 seconds)
07:39:06*letto_ quit (Quit: Konversation terminated!)
07:39:47*letto joined #nim
08:05:27FromDiscord<hamidb80> i don't remember exaclty,↵how can i print a `nimNode` like real code?
08:05:39FromDiscord<hamidb80> i mean
08:06:05PMunchrepr
08:06:50*hyiltiz joined #nim
08:06:50*hyiltiz quit (Changing host)
08:06:50*hyiltiz joined #nim
08:13:26*hyiltiz quit (Ping timeout: 240 seconds)
08:16:25FromDiscord<hamidb80> sent a code paste, see https://play.nim-lang.org/#ix=3lnz
08:16:34FromDiscord<hamidb80> (edit) "https://play.nim-lang.org/#ix=3lnz" => "https://play.nim-lang.org/#ix=3lnA"
08:16:38FromDiscord<hamidb80> (edit) "https://play.nim-lang.org/#ix=3lnA" => "https://paste.rs/STW"
08:16:52FromDiscord<hamidb80> (edit) "https://play.nim-lang.org/#ix=3lnC" => "https://play.nim-lang.org/#ix=3lnB"
08:17:27FromDiscord<ElegantBeef> `ident"some_string"`
08:19:37*hyiltiz joined #nim
08:19:37*hyiltiz quit (Changing host)
08:19:37*hyiltiz joined #nim
08:23:53*hyiltiz quit (Ping timeout: 240 seconds)
08:28:40*hyiltiz joined #nim
08:28:40*hyiltiz quit (Changing host)
08:28:40*hyiltiz joined #nim
08:30:27FromDiscord<hamidb80> sent a code paste, see https://play.nim-lang.org/#ix=3lnE
08:30:51FromDiscord<hamidb80> (edit) "https://play.nim-lang.org/#ix=3lnE" => "https://play.nim-lang.org/#ix=3lnF"
08:31:00FromDiscord<hamidb80> isn't that strange?
08:32:52PMunchquote doesn't support indexing like that
08:32:58PMunchHave a look at superQuote from macroutils
08:33:12FromDiscord<hamidb80> ok, tnks
08:34:14PMunchhttps://play.nim-lang.org/#ix=3lnG
08:35:20FromDiscord<hamidb80> superQoute is a external library, how did you added it to nim playground?
08:36:00PMunchThe playground has a lot of different packages: https://github.com/PMunch/nim-playground/blob/master/docker/packages.nimble
08:37:26PMunchIt was originally based on the "important packages" list from the Nim repository, then people have PRed other packages to it (and I've thrown in a couple of my own)
08:38:08FromDiscord<hamidb80> intresting
08:45:52*clyybber joined #nim
09:36:15*sz0 quit (Quit: Connection closed for inactivity)
09:44:15FromDiscord<hamidb80> does anyone knows when should i use `static`? sometimes i get error
09:44:20FromDiscord<hamidb80> (edit) "knows" => "know"
09:44:36FromDiscord<hamidb80> (edit) "`static`?" => "`static` in argument ?"
09:44:42FromDiscord<hamidb80> (edit) "does anyone know when should i use `static` in argument ... ?" added "list"
09:45:58FromDiscord<hamidb80> and that error doesn't make any sense at all
09:48:08FromDiscord<hamidb80> sent a code paste, see https://play.nim-lang.org/#ix=3lo5
09:48:09FromDiscord<demotomohiro> When you want your proc only takes compile time value like const or literals
09:48:52FromDiscord<hamidb80> sent a code paste, see https://paste.rs/Q2u
09:49:16FromDiscord<Rika> i think its the wrong order
09:50:01FromDiscord<demotomohiro> varargs[static[string]] is right order?
09:50:30FromDiscord<hamidb80> same of `varargs[static[string]]`
09:50:31FromDiscord<Rika> intuitively to me
09:50:37FromDiscord<hamidb80> (edit) "of" => "for"
09:50:37FromDiscord<Rika> but its not working either
09:50:38FromDiscord<Rika> yeah
09:50:40FromDiscord<Rika> i just checked lol
09:51:08PMunchI don't think it's possible to have static varargs unfortunately. You'll need to use a macro
09:51:17PMunchWith varargs[untyped]
09:51:27PMunchAnd then unwrap that
09:51:38FromDiscord<hamidb80> oh
09:51:54FromDiscord<hamidb80> i love nim with all of it's imperfections
09:53:14PMunchI love Nim in spite of its imperfections..
09:53:14ForumUpdaterBotNew question by Florian Schrofner: How to store references to types in Nim?, see https://stackoverflow.com/questions/67331771/how-to-store-references-to-types-in-nim
09:58:59*vicfred quit (Quit: Leaving)
09:59:11FromDiscord<demotomohiro> sent a code paste, see https://paste.rs/hso
10:07:29*letto quit (Ping timeout: 265 seconds)
10:27:34FromDiscord<Clonkk> Nimsuggest made my pc freeze because it takes all of the CPU indefinitely : episode 37
10:27:49FromDiscord<hamidb80> In reply to @SneakyBaguette "Nimsuggest made my pc": : episode 37?
10:28:06FromDiscord<Recruit_main707> Happened 36 times before
10:28:09FromDiscord<Rika> lol
10:28:25FromDiscord<Clonkk> In reply to @Recruit_main707 "Happened 36 times before": Yup
10:28:38FromDiscord<Clonkk> And I only started counting in April
10:29:47FromDiscord<hamidb80> one time per day
10:29:48PMunchWhat're you doing to make it freeze all the time?
10:30:00PMunchNimLSP doesn't seem to freeze nearly as often
10:30:22FromDiscord<Clonkk> Editing file with neovim, literally no other app running
10:30:35FromDiscord<Clonkk> I don't think it's Nimlsp fault
10:30:49FromDiscord<hamidb80> is neovim single threaded ?
10:31:03FromDiscord<hamidb80> like vim
10:31:31FromDiscord<zetashift> In reply to @SneakyBaguette "Editing file with neovim,": Currently running neovim too, I never had a freeze. Is this on the flambeau codebase?
10:31:50FromDiscord<Clonkk> Yes
10:33:18FromDiscord<zetashift> any specific file or is it completely random?
10:33:55FromDiscord<Clonkk> Generally speaking, Tensors.nim and rawtensors.nim produce the issue
10:35:09FromDiscord<zetashift> well it didn't get to the point to completely freezing but that was really painful damn
10:35:30FromDiscord<Clonkk> Maybe open S'use doesn't handle high CPU usage well
10:35:41FromDiscord<zetashift> I opened tensors.nim and my PC was like "naaahhh"
10:36:07FromDiscord<zetashift> neovim CPU usage spiked too
10:36:17FromDiscord<Clonkk> Yes both process go high
10:36:39FromDiscord<Clonkk> Using vs code with saem extension is painful but doesn't freeze
10:37:24FromDiscord<hamidb80> In reply to @SneakyBaguette "Using vs code with": what do you mean by "painful" ?
10:37:57FromDiscord<Clonkk> High CPU usage, fans going full speed
10:38:38FromDiscord<zetashift> Yea just tried vscode, it's still painful
10:38:52FromDiscord<zetashift> might be best to disable nimsuggest for these files
10:40:24PMunchI wonder what makes nimsuggest do this..
10:44:16FromDiscord<no name fits> I've never had nimsuggest do this for me. How do you guys manage that?
10:46:53FromDiscord<zetashift> I've experienced nimsuggest crapping out with macro heavy code usually
10:47:03FromDiscord<zetashift> or any of mratsim's codebases
10:53:33PMunchYeah, it's mostly if you have something that taxes the VM heavily. So macros, concepts, or other compile-time stuff
10:54:52PMunchNimLSP will only run the check whenever you save the file, to avoid some issues with it. But sometimes you notice that it locks up for a while when you save
10:57:18*lritter joined #nim
10:58:52FromDiscord<no name fits> I rarely use macros so I guess that's why. I do use compile-time stuff but it's mostly just templates and constants
10:59:04FromDiscord<no name fits> Which seems to behave just fine
10:59:59FromDiscord<no name fits> And I have my files set to auto-save, and they never lock up. I don't know if that's because VSC runs nimsuggest as a background process
11:05:27FromDiscord<zetashift> In reply to @no name fits "I rarely use macros": Same but some libraries I use make heavy use of it
11:06:09FromDiscord<zetashift> I think some editors deal with nimsuggest more elegantly than others
11:12:16FromDiscord<no name fits> I see
11:15:15ForumUpdaterBotNew thread by B3liever: Can passing sink parameters be supported when spawning new threads?, see https://forum.nim-lang.org/t/7890
11:21:59FromDiscord<zetashift> Is `combparser` the best Nim parser combinator library?
11:22:45FromDiscord<zetashift> Actually seems to be the only one haha
11:23:42*kayabaNerve joined #nim
11:29:31PMunchIn that case it is probably the best, but it's not very good..
11:30:38PMunchI have a branch that works on "string slices" instead of strings. Which basically just means that it doesn't copy the underlying input for each parser. It's way faster, but it has some issue that I can't think of off the top of my head..
11:31:12PMunchI just remember I tried to use it for protobuf and it didn't work (it uses combparser for now..)
11:32:11FromDiscord<zetashift> well there is also this: https://xmonader.github.io/nimdays/day21_parsec.html 😛
11:58:16*oprypin quit (Remote host closed the connection)
11:59:54*natrys joined #nim
12:00:23*FromGitter quit (Remote host closed the connection)
12:00:43*oprypin joined #nim
12:00:44*FromGitter joined #nim
12:03:24ForumUpdaterBotNew thread by Shirleyquirk: What's the difference between type,typeof,typedesc?, see https://forum.nim-lang.org/t/7891
12:41:31*Amun_Ra quit (Quit: Gdyby mi się chciało tak jak mi się nie chce…)
12:42:02*Amun_Ra joined #nim
13:22:15*narimiran quit (Remote host closed the connection)
13:23:27*narimiran joined #nim
13:42:33*fredrikhr joined #nim
13:57:45ForumUpdaterBotNew thread by FabienPRI: Nim update & choosenim, see https://forum.nim-lang.org/t/7892
14:03:11*Vladar joined #nim
14:04:09reversem3Are the nim docs going to change from using procs to funcs now ?
14:04:45leorizewe are switching to funcs wherever possible
14:05:01leorizeit does more than just looking different in docs
14:06:26reversem3I realize that , didn't mean to offend was just curious
14:07:13FromDiscord<sagecore> Is there a way to create a zip file on Windows 64 that retains the timestamp of the original files? Using zippy dates all files 1980-00-00 and zip/zipfiles gets the date right on Linux/Mac but simply doesn't compile (zlib fail) on Windows 64.
14:07:37reversem3Is there documentation that shows what is going to change in the spec ?
14:08:34leorizereversem3: usually it's in the change log
14:08:59leorizewe are mass switching to funcs in preparation for strictFunc iirc
14:09:26PMunch@sagecore, what's the zlib fail? That's probably the easiest to fix..
14:13:12FromDiscord<sagecore> PMunch: mingw64 doesn't have zlib support. zippy is pure Nim, which is why it works.
14:13:24PMunchOh right..
14:13:42PMunchHmm, zippy seems to store the timestamp for tarballs, but not for zip files. Does normal zip files store timestamps?
14:14:14PMunchI think they are typically just set to whatever the time is when they are created
14:14:17FromDiscord<sagecore> Yes. For example zip/zipfiles does. But that's only on Mac and Linux.
14:15:03PMunchHmm, curious. I thought zip files didn't preserve timestamps..
14:15:03FromDiscord<sagecore> zippy sets them to 1980-00-00 00:00 and not when they are created.
14:18:46FromDiscord<haxscramper> https://wandbox.org/permlink/Q7ZIDj4rIs3l2YYB Is there a way to have `typed` object pragma? Judging from the error it tries to do something like `Derive(A = object ...)`, which does not work
14:19:19FromDiscord<haxscramper> I suppose it is not possible, but I would want to make absolutely sure, because this is very important for an API
14:19:58FromDiscord<haxscramper> Maybe some hack is possible where I have `untyped`, which expands to differently wrapped `typed`?
14:21:30FromDiscord<sagecore> sent a long message, see http://ix.io/3lp6
14:22:11*fredrikhr quit (Ping timeout: 240 seconds)
14:22:41*PMunch quit (Quit: leaving)
14:23:33leorizehaxscramper: looks like you can't do it for real
14:23:57leorizewhat are you trying to do? maybe I can help
14:27:46FromDiscord<haxscramper> I need to get symbol of the declared type. Right now I have to do `processType(TypeName)`, which is ugly
14:28:19FromDiscord<haxscramper> I want to do `TypeName {.Process.} = object` instead
14:28:57leorizedepends on what you do, getTypeInst can also get you the symbol
14:29:23FromDiscord<haxscramper> Yes, that what I do now
14:29:59FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3lpb
14:29:59FromDiscord<haxscramper> AFter all type definitions
14:30:33reversem3Do you still have to use the async pragma or can you use funcs with async now ? Actually you would still have to use procs right?
14:30:50FromDiscord<haxscramper> I don't want to wrap `type` section in another `untyped` macro that generates store calls everywhere
14:31:14leorizereversem3: you have to use procs
14:31:42leorizehaxscamper: so what does your macro do?
14:34:15FromDiscord<haxscramper> It takes an object symbols and converts it's definition in internal object IR that I use for codegen later. The converter macro is expensive, so I need to make sure that I process any given type only once - that's why I need to manually add this annotation right after type definition
14:35:13FromDiscord<haxscramper> And later all macros that have to generate code based on structure can accept typedesc, call getObjectImpl and get preprocessed IR
14:37:18leorizeyea this stuff is definitely not possible
14:37:37leorizeblame Araq for the way he designed type macros
14:38:09FromDiscord<haxscramper> Well, it is not the end of the world, but certainly very annoying
14:38:19FromDiscord<haxscramper> Copy-pasted boilerplate
14:39:23FromDiscord<haxscramper> Still better than manually unparsing typed object body though, so I won't complain
14:39:35leorize:P
14:40:27leorizeif type section macros worked on a nnkTypeSection there would be much more flexibility
14:40:40leorizethough that would break same-section forward decl
14:41:09leorizeso maybe it'd have to come after we got the no forward decl stuff sorted out
14:51:50FromDiscord<haxscramper> Allowing single object declaration as an expression would probably solve my use case, but I'm not sure how typesection-level pragma can be implemented API-wise
14:53:02leorizetimothee drafted out how that would work
14:54:44leorizethe pragma will rewrite a type section of `type A; B {.pragma.}; C; D` into `type A; pragma(type B); type C; D`
15:06:36*fredrikhr joined #nim
15:09:28*natrys quit (Quit: natrys)
15:26:15*fredrikhr quit (Quit: Client Disconnecting)
15:27:27*letto joined #nim
15:35:01*letto quit (Ping timeout: 268 seconds)
15:52:54FromDiscord<creonico> what is the `pure` pragma used for?
15:53:23*letto joined #nim
15:53:55FromDiscord<creonico> example, for structs in the win32 api
16:05:04*letto quit (Ping timeout: 252 seconds)
16:30:12giacois runtime code in module root scope executed according to the import order from main?
16:32:47FromGitter<bung87> is it right way to check user implement a method `when compiles(onOpenFile(wv,$path))`
16:33:51FromDiscord<haxscramper> In reply to @bung87 "is it right way": This checks for `proc`/`func`/`template` etc. implementation - not `method` specifically
16:34:15FromDiscord<haxscramper> You can try and use `procCall` to test for method
16:34:28FromDiscord<haxscramper> https://nim-lang.org/docs/system.html#procCall%2Cuntyped
16:38:44FromGitter<bung87> how procCall test ? it returns bool?
16:40:05FromGitter<bung87> seems compiles fit my need well
16:43:15FromGitter<bung87> better have a proc to check just proc signature, for now need pass args to check
16:50:40giacodocumentation doesn't say anything about execution order in module scope on imports: https://nim-lang.org/docs/manual.html#modules-import-statement
16:51:47leorize[m]giaco: it's undefined, but wouldn't surprise me if it's in import order
16:54:57giacois it possible to output import order without building a toy project with many mock modules that imports each other?
16:55:54giacoI think is in important topic when dealing with globals
16:59:40giacofor example, I've an appconfig.nim that loads user preferences from .ini file at startup. To deal with defaults and the possibility of missing ini file I've defined all options with default value in module scope of appconfig.ini, then still in same scope I try to parse the ini and change them. When appconfig.ini is imported I need both the variables and runtime code to be fully executed. Yeah I surely
16:59:42giacocan wrap the init code in a proc and run it as first thing from main, but I'd like to take advantage of nim here
17:13:34giacothe advantage is clear: https://rosettacode.org/wiki/Singleton#Nim
17:15:06giacoquestion does not arise when module has variables defined at compile time, but only when they are at runtime in module scope
17:26:49*letto joined #nim
17:51:25*tane joined #nim
18:04:28*mindhunter0x quit (*.net *.split)
18:04:28*Figworm quit (*.net *.split)
18:04:28*xace quit (*.net *.split)
18:04:28*sagax quit (*.net *.split)
18:04:28*Ekho quit (*.net *.split)
18:04:28*joast quit (*.net *.split)
18:07:04*mindhunter0x joined #nim
18:07:05*Figworm joined #nim
18:07:05*xace joined #nim
18:07:05*sagax joined #nim
18:07:05*joast joined #nim
18:07:37*sagax quit (Max SendQ exceeded)
18:08:17FromDiscord<exelotl> oh nice, I was gonna raise an issue about const tables not working in the JS backend... but it seems to be fixed in devel :D
18:11:55*vicfred joined #nim
18:15:56*Ekho joined #nim
18:24:44ForumUpdaterBotNew thread by Javi: Assertions in the documentation., see https://forum.nim-lang.org/t/7893
18:26:12*xet7 quit (Remote host closed the connection)
18:31:32FromDiscord<mlokis> the CacheTable from macrocache does not have a contains method. Is there any way to check whether something is in table except looping trough all keys?
18:36:56FromDiscord<mlokis> this rally pisses me off
18:38:46ForumUpdaterBotNew thread by Ward: Nim doc lists procs by random order?, see https://forum.nim-lang.org/t/7894
18:41:04*jess quit ()
19:06:24*natrys joined #nim
19:06:46*pauwel_kwak quit (Ping timeout: 240 seconds)
19:08:50*pauwel_kwak joined #nim
19:41:04*lritter quit (Ping timeout: 268 seconds)
19:55:01*xet7 joined #nim
19:59:26FromDiscord<madman> is there a cleaner way to handle the `{.compile.}` pragmas?↵ https://play.nim-lang.org/#ix=3lrc
20:00:29FromDiscord<madman> was wondering if theres a flag i can use in nimscript to give to the c compiler to compile the c sources
20:27:36reversem3damn nim-suggest is at 99.6 % CPU ?
20:32:59ForumUpdaterBotNew thread by M33: Interesting video about transpiling (Linux conf AU 2020), see https://forum.nim-lang.org/t/7895
20:39:17FromDiscord<exelotl> yeah, nimsuggest is frustrating, you likely have to kill it when that happens... I think improving it is on the roadmap for this year (after IC lands)
20:41:14reversem3Bummer doom-emacs was working so nice
20:42:31FromDiscord<zetashift> that's not a doom-emacs/editor thing. Since every editor relies on nimsuggest in some way every editor is gonna struggle. I've tried neovim, vscode/oni2 and doom emacs. and VSCode/oni2 handle nimsuggest the best from what I've seen
20:43:14FromDiscord<zetashift> But yeah editor tooling is a focus this year, which is great! But patience is required for now(or PR's), but from what I've seen debugging nimsuggest isn't easy
20:44:01*NimBot joined #nim
20:47:36reversem3I understand I was on a roll with coding lol
20:47:42reversem3oh well
20:48:04FromDiscord<zetashift> yea it sucks sometimes
20:48:38*ubq323 joined #nim
20:48:41*natrys quit (Ping timeout: 240 seconds)
20:48:53FromDiscord<dom96> will 2021 be the year of nimsuggest?
20:50:15ubq323hello. if i use withTimeout on a future, is there a way to get the thing that that future returned, instead of just the boolean contained in the future returned by withTimeout?
20:51:05FromDiscord<dom96> yes, just store the future in a variable
20:51:32FromDiscord<dom96> let fut = someAsyncProc(); withTimeout(fut, 1000); fut.read()
20:52:18reversem3Yes year of not crashing
20:52:40reversem3BSON looks really cool
20:54:04reversem3Language transpilation
21:01:40ForumUpdaterBotNew Nimble package! slugify - Convert strings to a slug. Can be used for URLs, file names, IDs etc., see https://github.com/lenniezelk/slugify
21:07:49*Gustavo6046 quit (Ping timeout: 276 seconds)
21:08:51*narimiran quit (Quit: leaving)
21:09:24ubq323ah thanks
21:12:04*Gustavo6046 joined #nim
21:32:53*thomasross joined #nim
21:37:07FromDiscord<Avatarfighter> Hey guys, I was wondering if anyone had an idea of how of how to go about cancelling futures with the current async system? I am under the understanding it’s not builtin but I was wondering if anyone had a workaround or a sort of solution addressing this?
21:37:49FromDiscord<dom96> The only way to do this right now is to close the fd that the IO operation is pending on
21:40:00FromDiscord<Avatarfighter> In reply to @dom96 "The only way to": If I cancel a future in this way, do I have to clean up anything else ?
21:41:07FromDiscord<ElegantBeef> Last calls for TMWN!
21:41:37FromDiscord<Avatarfighter> TMWN
21:41:38FromDiscord<Avatarfighter> ?
21:41:51FromDiscord<ElegantBeef> This month with nim
21:41:59FromDiscord<Avatarfighter> Ah
21:42:04FromDiscord<ElegantBeef> The monthly showcase/blog post of community projects and schtuff
21:45:11FromDiscord<dom96> In reply to @Avatarfighter "If I cancel a": Hard to say, if it's just a socket then no, but if you're using a library then it might not like you closing an fd from under it 🙂
21:45:51FromDiscord<Avatarfighter> In reply to @dom96 "Hard to say, if": I’m trying to cancel an asynchttpclient request if that helps with ideas 🥲
21:47:14FromDiscord<dom96> just do it and see what happens
21:48:51*tane quit (Quit: Leaving)
21:53:22FromDiscord<Avatarfighter> kk
21:53:58FromDiscord<shirleyquirk> any way to check if a symbol exists, from within a macro? i.e. i'm generating a type, but only if it doesn't already exist (else redefinition error)
21:54:22FromDiscord<shirleyquirk> i know `defined` but i can't figure out how to call it from inside the macro
21:54:31FromDiscord<ElegantBeef> `bindsym` might work
21:54:46FromDiscord<shirleyquirk> it crashes if the type doesn't exist
21:55:14FromDiscord<shirleyquirk> same with 'getTypexxx'
21:59:29FromDiscord<shirleyquirk> i guess i could gensym the types, but i was hoping to allow them to be copied around
21:59:30FromDiscord<ElegantBeef> Well you could put the emitted code in a block that checks if the symbol exists
21:59:36FromDiscord<shirleyquirk> ooh, go on
22:00:07FromDiscord<ElegantBeef> Trying to find the way to check if a symbol exists in a scope
22:00:33FromDiscord<shirleyquirk> oh you legend,↵when not defined(thingy):↵ type thingy
22:02:07FromDiscord<ElegantBeef> Lol
22:02:19FromDiscord<Avatarfighter> @dom96 btw how would one go about closing the fd ?
22:02:23FromDiscord<shirleyquirk> https://play.nim-lang.org/#ix=3lrB
22:02:27FromDiscord<shirleyquirk> still not quite there
22:02:28FromDiscord<ElegantBeef> You had the answer all along i just aimlessly remembered a feature
22:03:24FromDiscord<dom96> @Avatarfighter close the http client instance
22:03:47FromDiscord<Avatarfighter> ah
22:06:21FromDiscord<ElegantBeef> The issue shirley seems to be the code you're emitting
22:06:40FromDiscord<ElegantBeef> the whole pipe op + spaces
22:06:42leorize@ElegentBeef where do I sign up for TMWN?
22:07:09FromDiscord<ElegantBeef> https://github.com/beef331/website/issues
22:07:33*NimBot joined #nim
22:07:33FromDiscord<ElegantBeef> Make an issue using the template and it'll get added when i get around to it, proof reading and the life is included 😛
22:09:25FromDiscord<shirleyquirk> declared!
22:09:29FromDiscord<shirleyquirk> not defined!
22:10:13FromDiscord<shirleyquirk> i know the spaces are weird, but it works, somehow
22:10:41FromDiscord<shirleyquirk> and dont call me shirley😆
22:10:57FromDiscord<ElegantBeef> Ok vector
22:15:08FromDiscord<shirleyquirk> thank heavens now i can sleep
22:17:09FromDiscord<shirleyquirk> thanks again eb
22:27:34*Vladar quit (Quit: Leaving)
22:48:39*oprypin quit (Quit: Bye)
22:48:48*oprypin joined #nim
22:57:10*siinamon quit (Quit: Oops, I quit!)
22:57:26*siinamon joined #nim
22:59:31*siinamon quit (Client Quit)
22:59:46*siinamon joined #nim
23:02:03*siinamon quit (Client Quit)
23:02:16*siinamon joined #nim
23:18:33*NimBot joined #nim
23:46:09*ubq323 quit (Quit: WeeChat 2.3)