00:02:49 | FromDiscord | <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:39 | leorize | if you specify the correct bind flag, yes |
00:08:32 | leorize | https://github.com/nim-lang/Nim/blob/devel/lib/core/macros.nim#L445 <- |
00:09:26 | leorize | so brOpen should be what you're looking for |
00:15:44 | FromDiscord | <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:54 | FromDiscord | <mattrb> sent a long message, see https://paste.rs/IVj |
00:19:26 | FromDiscord | <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:55 | FromDiscord | <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:21 | saem | Beef it takes a while to get into it, you're making good progress on a tricky part. |
01:15:34 | FromDiscord | <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:19 | FromDiscord | <ElegantBeef> Saem did you get any ideas about how to go around shrinkables? |
01:20:16 | FromDiscord | <ElegantBeef> We can always pass data doing `r.run((a.gen, b.gen...))` or w/e the proper logic is |
01:21:40 | saem | Hilariously I can't see the issue any more. 🤦♂️ |
01:22:08 | FromDiscord | <ElegantBeef> it's the `initArbitrary` hinding the issue |
01:22:12 | FromDiscord | <ElegantBeef> (edit) "hinding" => "hiding" |
01:23:10 | saem | oh I see |
01:23:29 | saem | the problem isn't the tuple, it's the tuple of shirnkables |
01:24:56 | FromDiscord | <ElegantBeef> Automating the passing of the data/generators is the part we have to figure out |
01:25:04 | FromDiscord | <ElegantBeef> We being mostly me 😛 |
01:28:44 | saem | one thing that comes to mind is create a var per arbitrary? |
01:28:55 | saem | brb, 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:40 | kayabaNerve | I 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:26 | kayabaNerve | I 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:37 | kayabaNerve | https://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:12 | kayabaNerve | Also, the IRC topic says the latest version is 1.4.2; bit out of date on that one :P |
02:19:34 | FromDiscord | <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:21 | FromDiscord | <ElegantBeef> @codic what the `ev.xcreatewindow` in D? |
02:54:25 | FromDiscord | <ElegantBeef> (edit) "@codic what ... the" added "is" |
02:55:03 | FromDiscord | <codic> it's a direct port of this: https://tronche.com/gui/x/xlib/events/structures.html |
02:55:13 | FromDiscord | <codic> > ` XCreateWindowEvent xcreatewindow;` |
02:56:40 | FromDiscord | <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:40 | FromDiscord | <ElegantBeef> So why dont you do `ev.createWindow`? |
02:57:01 | FromDiscord | <codic> oh |
02:57:01 | FromDiscord | <ElegantBeef> Let me look at my wm |
02:57:15 | FromDiscord | <codic> no that doesn't exist |
02:57:25 | FromDiscord | <ElegantBeef> Like i said |
02:57:26 | FromDiscord | <codic> sent a code paste, see https://paste.rs/wNc |
02:57:27 | FromDiscord | <ElegantBeef> Let me look 😛 |
02:58:10 | FromDiscord | <ElegantBeef> Oh i dont manage notify |
02:59:14 | FromDiscord | <codic> oh alright |
02:59:40 | FromDiscord | <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:10 | FromDiscord | <codic> thanks! |
03:00:13 | FromDiscord | <codic> is your wm nimdow? |
03:00:20 | FromDiscord | <ElegantBeef> Nah that's prestige |
03:00:29 | * | Tlangir joined #nim |
03:00:30 | FromDiscord | <ElegantBeef> Mine is goodwm which is a burning dumpster fire of half implemented |
03:00:38 | FromDiscord | <codic> lol |
03:00:40 | FromDiscord | <ElegantBeef> It did give prestige a fair bit of "working" |
03:02:19 | FromDiscord | <ElegantBeef> `XEvent` certainly does have a `xcreatewindow` field |
03:02:39 | FromDiscord | <codic> ok wow |
03:02:39 | FromDiscord | <ElegantBeef> Line 773 of `x11/xlib.nim` |
03:02:39 | FromDiscord | <codic> i'm dumb |
03:02:42 | FromDiscord | <codic> sorry |
03:02:57 | FromDiscord | <codic> I was trying dpy.xcreatewindow lol |
03:03:09 | FromDiscord | <ElegantBeef> It's fine, you had an issue and we resolved it |
03:03:15 | FromDiscord | <ElegantBeef> It'd be worse if i was at a loss aswell 😛 |
03:03:46 | FromDiscord | <codic> well it works, nice |
03:03:46 | FromDiscord | <ElegantBeef> If you want another source wm you can also look at mine, though i never got to cleaning it |
03:03:49 | FromDiscord | <ElegantBeef> https://github.com/beef331/goodwm |
03:04:07 | FromDiscord | <ElegantBeef> So it's like a single file of pure unadulterated "learning X11" |
03:04:28 | FromDiscord | <codic> while I'm here, I keep seeing people using `or` where you would normally use `xor`, any reason why? |
03:04:29 | FromDiscord | <codic> nice |
03:04:43 | FromDiscord | <ElegantBeef> No clue |
03:05:33 | FromDiscord | <codic> oh like your goodwm does it too |
03:05:35 | FromDiscord | <codic> https://github.com/beef331/goodwm/blob/master/src/goodwm.nim#L65 |
03:05:46 | FromDiscord | <ElegantBeef> Oh |
03:05:51 | FromDiscord | <codic> wouldnt you use a bitwise xor instead of a boolean or? |
03:05:53 | FromDiscord | <ElegantBeef> That's making flags |
03:05:59 | FromDiscord | <ElegantBeef> `or` is a bitwise or in this case |
03:06:11 | FromDiscord | <codic> ah so its like an op overload |
03:06:14 | FromDiscord | <ElegantBeef> No |
03:06:15 | FromDiscord | <codic> sent a code paste, see https://play.nim-lang.org/#ix=3lmG |
03:06:22 | FromDiscord | <ElegantBeef> In nim `or` is both boolean or and bitwise |
03:06:31 | FromDiscord | <codic> huh |
03:06:46 | FromDiscord | <ElegantBeef> so you can do `true or false` and `1 or 2` |
03:07:13 | FromDiscord | <codic> nothing wrong with using xor for clarity tho right? |
03:07:21 | FromDiscord | <ElegantBeef> If you prefer different operators you can `import std/bitops` and have `bitor` |
03:07:24 | FromDiscord | <ElegantBeef> Well yea `xor` isnt or |
03:07:37 | FromDiscord | <ElegantBeef> `xor` is exclusive which does different logic to or |
03:08:04 | FromDiscord | <ElegantBeef> It's the `~` operator in C i believe, though i dont recall |
03:08:34 | FromDiscord | <ElegantBeef> Ah sorry `^` is xor in C |
03:08:45 | FromDiscord | <codic> ah yes |
03:09:02 | FromDiscord | <codic> idk why I said xor, I'll just use normal or tbh |
03:12:41 | FromDiscord | <ElegantBeef> I should oneday go back and finish goodwm, but x11 is so annoying to work with 😄 |
03:13:45 | FromDiscord | <ElegantBeef> I have no idea how prestige got so far without melting down and going on a rampage |
03:14:45 | FromDiscord | <Rika> He’s not you, for one |
03:14:55 | FromDiscord | <ElegantBeef> Make sense |
03:18:49 | FromDiscord | <codic> sent a code paste, see https://play.nim-lang.org/#ix=3lmJ |
03:18:50 | FromDiscord | <codic> well there's the bool but I have a converter for that |
03:19:13 | FromDiscord | <codic> sent a code paste, see https://play.nim-lang.org/#ix=3lmK |
03:21:54 | FromDiscord | <ElegantBeef> Well subwindow cannot be nil |
03:22:16 | FromDiscord | <ElegantBeef> subWindow = Window = culong |
03:23:29 | FromDiscord | <codic> yeah but I don't think that's the issue |
03:23:37 | FromDiscord | <ElegantBeef> I was going top to bottom |
03:23:38 | FromDiscord | <ElegantBeef> Sorry |
03:23:40 | FromDiscord | <codic> yeah, happens if i remove that check too |
03:23:53 | FromDiscord | <codic> dont be sorry for me writing bad code lol |
03:25:23 | FromDiscord | <ElegantBeef> I do recall i think XGrabPointer never played nice |
03:25:33 | ForumUpdaterBot | New 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:27 | FromDiscord | <ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=3lmN |
03:28:58 | FromDiscord | <codic> lemme see |
03:29:17 | * | wasted_youth2 joined #nim |
03:30:02 | FromDiscord | <codic> hmmm doesnt change anything |
03:30:22 | FromDiscord | <codic> but thats a useful tip to avoid useless copies |
03:31:54 | FromDiscord | <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:05 | FromDiscord | <codic> sent a code paste, see https://play.nim-lang.org/#ix=3lmR |
03:34:13 | FromDiscord | <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:48 | FromDiscord | <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:02 | FromDiscord | <codic> it still doesnt work very funny |
03:40:29 | FromDiscord | <codic> oh wait |
03:40:35 | FromDiscord | <codic> I think the issue is in another function that is related |
03:42:52 | FromDiscord | <codic> yeah that was it |
03:43:03 | FromDiscord | <codic> in another function, I used cast, instead of using the proper field like I did in D |
03:43:10 | FromDiscord | <codic> and that event got triggered with this one |
03:43:12 | FromDiscord | <codic> (edit) "one" => "cakk" |
03:43:14 | FromDiscord | <codic> (edit) "cakk" => "call" |
03:43:20 | FromDiscord | <ElegantBeef> ah |
03:43:29 | FromDiscord | <ElegantBeef> This is why cast is unsafe 😛 |
03:54:56 | * | kayabaNerve quit (Remote host closed the connection) |
04:07:54 | FromDiscord | <creonico> Any useful small projects to learn nim? |
04:08:57 | FromDiscord | <ElegantBeef> Make parsers, make a website, make bindings for a language |
04:09:09 | FromDiscord | <ElegantBeef> Many things to do that you can learn from |
04:12:42 | FromDiscord | <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:15 | FromDiscord | <creonico> but I am just starting out 🥺 |
04:13:25 | FromDiscord | <creonico> any small ideas? |
04:13:32 | FromDiscord | <creonico> that are useful though |
04:16:26 | FromDiscord | <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:38 | FromDiscord | <creonico> why is it recommended to not use unsigned integers like C? |
04:39:17 | FromDiscord | <ElegantBeef> Overflow |
04:39:46 | FromDiscord | <ElegantBeef> !eval echo 255u8 + 1u8, " ", 0u8 - 1u8 |
04:39:49 | NimBot | 0 255 |
04:42:46 | FromDiscord | <ElegantBeef> The github wiki links to here https://critical.eschertech.com/2010/04/07/danger-unsigned-types-used-here/ |
04:42:49 | FromDiscord | <demotomohiro> Overflow can happen in signed integer. |
04:43:14 | FromDiscord | <ElegantBeef> !eval echo 127i8 + 2i8 |
04:43:17 | NimBot | /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:49 | FromDiscord | <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:24 | FromDiscord | <Rika> Unless you’re compiling in danger of course |
05:13:39 | * | narimiran joined #nim |
05:40:00 | FromDiscord | <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:26 | FromDiscord | <ElegantBeef> Quite possibly |
06:08:28 | FromDiscord | <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:03 | FromDiscord | <ElegantBeef> `for x in col.mitems` |
06:12:20 | FromDiscord | <Rika> That’s an abuse though |
06:15:53 | FromDiscord | <codic> col.mitems is an abuse, or using references in a for loop? |
06:16:01 | FromDiscord | <ElegantBeef> the mitems |
06:16:13 | FromDiscord | <ElegantBeef> it shouldnt duplicate reference types |
06:16:16 | FromDiscord | <ElegantBeef> Atleast it shouldnt |
06:17:45 | FromDiscord | <Rika> Yes it does use references but that’s not its purpose |
06:25:59 | * | NimBot joined #nim |
06:26:07 | FromDiscord | <codic> should I just use an index-based loop them |
06:30:15 | FromDiscord | <Rika> And a template perhaps |
06:30:17 | FromDiscord | <ElegantBeef> You can always make an iterator |
06:34:01 | ForumUpdaterBot | New thread by Xioren: Would macros work to parse js and create equivalent nim code?, see https://forum.nim-lang.org/t/7889 |
06:35:16 | FromDiscord | <codic> or similar |
06:35:21 | FromDiscord | <codic> sent a code paste, see https://paste.rs/XY1 |
06:38:01 | FromDiscord | <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:02 | FromDiscord | <hamidb80> hey |
07:18:13 | PMunch | Hi |
07:19:10 | FromDiscord | <hamidb80> how can i execute system commads in nim? for e.g. in c++ we write `System("clear")` to clear console |
07:19:39 | FromDiscord | <ElegantBeef> `terminal.clearScreen` iirc |
07:20:06 | PMunch | `execCmd` I think is the closest to `System`, but as ElegantBeef points out there are better ways of clearing the terminal |
07:21:24 | FromDiscord | <ElegantBeef> Ah sorry it's `eraseScreen` |
07:26:57 | FromDiscord | <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:12 | FromDiscord | <ElegantBeef> If the C wrapper is compilable in C++ yes |
07:27:29 | FromDiscord | <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:27 | FromDiscord | <hamidb80> i don't remember exaclty,↵how can i print a `nimNode` like real code? |
08:05:39 | FromDiscord | <hamidb80> i mean |
08:06:05 | PMunch | repr |
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:25 | FromDiscord | <hamidb80> sent a code paste, see https://play.nim-lang.org/#ix=3lnz |
08:16:34 | FromDiscord | <hamidb80> (edit) "https://play.nim-lang.org/#ix=3lnz" => "https://play.nim-lang.org/#ix=3lnA" |
08:16:38 | FromDiscord | <hamidb80> (edit) "https://play.nim-lang.org/#ix=3lnA" => "https://paste.rs/STW" |
08:16:52 | FromDiscord | <hamidb80> (edit) "https://play.nim-lang.org/#ix=3lnC" => "https://play.nim-lang.org/#ix=3lnB" |
08:17:27 | FromDiscord | <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:27 | FromDiscord | <hamidb80> sent a code paste, see https://play.nim-lang.org/#ix=3lnE |
08:30:51 | FromDiscord | <hamidb80> (edit) "https://play.nim-lang.org/#ix=3lnE" => "https://play.nim-lang.org/#ix=3lnF" |
08:31:00 | FromDiscord | <hamidb80> isn't that strange? |
08:32:52 | PMunch | quote doesn't support indexing like that |
08:32:58 | PMunch | Have a look at superQuote from macroutils |
08:33:12 | FromDiscord | <hamidb80> ok, tnks |
08:34:14 | PMunch | https://play.nim-lang.org/#ix=3lnG |
08:35:20 | FromDiscord | <hamidb80> superQoute is a external library, how did you added it to nim playground? |
08:36:00 | PMunch | The playground has a lot of different packages: https://github.com/PMunch/nim-playground/blob/master/docker/packages.nimble |
08:37:26 | PMunch | It 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:08 | FromDiscord | <hamidb80> intresting |
08:45:52 | * | clyybber joined #nim |
09:36:15 | * | sz0 quit (Quit: Connection closed for inactivity) |
09:44:15 | FromDiscord | <hamidb80> does anyone knows when should i use `static`? sometimes i get error |
09:44:20 | FromDiscord | <hamidb80> (edit) "knows" => "know" |
09:44:36 | FromDiscord | <hamidb80> (edit) "`static`?" => "`static` in argument ?" |
09:44:42 | FromDiscord | <hamidb80> (edit) "does anyone know when should i use `static` in argument ... ?" added "list" |
09:45:58 | FromDiscord | <hamidb80> and that error doesn't make any sense at all |
09:48:08 | FromDiscord | <hamidb80> sent a code paste, see https://play.nim-lang.org/#ix=3lo5 |
09:48:09 | FromDiscord | <demotomohiro> When you want your proc only takes compile time value like const or literals |
09:48:52 | FromDiscord | <hamidb80> sent a code paste, see https://paste.rs/Q2u |
09:49:16 | FromDiscord | <Rika> i think its the wrong order |
09:50:01 | FromDiscord | <demotomohiro> varargs[static[string]] is right order? |
09:50:30 | FromDiscord | <hamidb80> same of `varargs[static[string]]` |
09:50:31 | FromDiscord | <Rika> intuitively to me |
09:50:37 | FromDiscord | <hamidb80> (edit) "of" => "for" |
09:50:37 | FromDiscord | <Rika> but its not working either |
09:50:38 | FromDiscord | <Rika> yeah |
09:50:40 | FromDiscord | <Rika> i just checked lol |
09:51:08 | PMunch | I don't think it's possible to have static varargs unfortunately. You'll need to use a macro |
09:51:17 | PMunch | With varargs[untyped] |
09:51:27 | PMunch | And then unwrap that |
09:51:38 | FromDiscord | <hamidb80> oh |
09:51:54 | FromDiscord | <hamidb80> i love nim with all of it's imperfections |
09:53:14 | PMunch | I love Nim in spite of its imperfections.. |
09:53:14 | ForumUpdaterBot | New 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:11 | FromDiscord | <demotomohiro> sent a code paste, see https://paste.rs/hso |
10:07:29 | * | letto quit (Ping timeout: 265 seconds) |
10:27:34 | FromDiscord | <Clonkk> Nimsuggest made my pc freeze because it takes all of the CPU indefinitely : episode 37 |
10:27:49 | FromDiscord | <hamidb80> In reply to @SneakyBaguette "Nimsuggest made my pc": : episode 37? |
10:28:06 | FromDiscord | <Recruit_main707> Happened 36 times before |
10:28:09 | FromDiscord | <Rika> lol |
10:28:25 | FromDiscord | <Clonkk> In reply to @Recruit_main707 "Happened 36 times before": Yup |
10:28:38 | FromDiscord | <Clonkk> And I only started counting in April |
10:29:47 | FromDiscord | <hamidb80> one time per day |
10:29:48 | PMunch | What're you doing to make it freeze all the time? |
10:30:00 | PMunch | NimLSP doesn't seem to freeze nearly as often |
10:30:22 | FromDiscord | <Clonkk> Editing file with neovim, literally no other app running |
10:30:35 | FromDiscord | <Clonkk> I don't think it's Nimlsp fault |
10:30:49 | FromDiscord | <hamidb80> is neovim single threaded ? |
10:31:03 | FromDiscord | <hamidb80> like vim |
10:31:31 | FromDiscord | <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:50 | FromDiscord | <Clonkk> Yes |
10:33:18 | FromDiscord | <zetashift> any specific file or is it completely random? |
10:33:55 | FromDiscord | <Clonkk> Generally speaking, Tensors.nim and rawtensors.nim produce the issue |
10:35:09 | FromDiscord | <zetashift> well it didn't get to the point to completely freezing but that was really painful damn |
10:35:30 | FromDiscord | <Clonkk> Maybe open S'use doesn't handle high CPU usage well |
10:35:41 | FromDiscord | <zetashift> I opened tensors.nim and my PC was like "naaahhh" |
10:36:07 | FromDiscord | <zetashift> neovim CPU usage spiked too |
10:36:17 | FromDiscord | <Clonkk> Yes both process go high |
10:36:39 | FromDiscord | <Clonkk> Using vs code with saem extension is painful but doesn't freeze |
10:37:24 | FromDiscord | <hamidb80> In reply to @SneakyBaguette "Using vs code with": what do you mean by "painful" ? |
10:37:57 | FromDiscord | <Clonkk> High CPU usage, fans going full speed |
10:38:38 | FromDiscord | <zetashift> Yea just tried vscode, it's still painful |
10:38:52 | FromDiscord | <zetashift> might be best to disable nimsuggest for these files |
10:40:24 | PMunch | I wonder what makes nimsuggest do this.. |
10:44:16 | FromDiscord | <no name fits> I've never had nimsuggest do this for me. How do you guys manage that? |
10:46:53 | FromDiscord | <zetashift> I've experienced nimsuggest crapping out with macro heavy code usually |
10:47:03 | FromDiscord | <zetashift> or any of mratsim's codebases |
10:53:33 | PMunch | Yeah, it's mostly if you have something that taxes the VM heavily. So macros, concepts, or other compile-time stuff |
10:54:52 | PMunch | NimLSP 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:52 | FromDiscord | <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:04 | FromDiscord | <no name fits> Which seems to behave just fine |
10:59:59 | FromDiscord | <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:27 | FromDiscord | <zetashift> In reply to @no name fits "I rarely use macros": Same but some libraries I use make heavy use of it |
11:06:09 | FromDiscord | <zetashift> I think some editors deal with nimsuggest more elegantly than others |
11:12:16 | FromDiscord | <no name fits> I see |
11:15:15 | ForumUpdaterBot | New thread by B3liever: Can passing sink parameters be supported when spawning new threads?, see https://forum.nim-lang.org/t/7890 |
11:21:59 | FromDiscord | <zetashift> Is `combparser` the best Nim parser combinator library? |
11:22:45 | FromDiscord | <zetashift> Actually seems to be the only one haha |
11:23:42 | * | kayabaNerve joined #nim |
11:29:31 | PMunch | In that case it is probably the best, but it's not very good.. |
11:30:38 | PMunch | I 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:12 | PMunch | I just remember I tried to use it for protobuf and it didn't work (it uses combparser for now..) |
11:32:11 | FromDiscord | <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:24 | ForumUpdaterBot | New 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:45 | ForumUpdaterBot | New thread by FabienPRI: Nim update & choosenim, see https://forum.nim-lang.org/t/7892 |
14:03:11 | * | Vladar joined #nim |
14:04:09 | reversem3 | Are the nim docs going to change from using procs to funcs now ? |
14:04:45 | leorize | we are switching to funcs wherever possible |
14:05:01 | leorize | it does more than just looking different in docs |
14:06:26 | reversem3 | I realize that , didn't mean to offend was just curious |
14:07:13 | FromDiscord | <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:37 | reversem3 | Is there documentation that shows what is going to change in the spec ? |
14:08:34 | leorize | reversem3: usually it's in the change log |
14:08:59 | leorize | we are mass switching to funcs in preparation for strictFunc iirc |
14:09:26 | PMunch | @sagecore, what's the zlib fail? That's probably the easiest to fix.. |
14:13:12 | FromDiscord | <sagecore> PMunch: mingw64 doesn't have zlib support. zippy is pure Nim, which is why it works. |
14:13:24 | PMunch | Oh right.. |
14:13:42 | PMunch | Hmm, zippy seems to store the timestamp for tarballs, but not for zip files. Does normal zip files store timestamps? |
14:14:14 | PMunch | I think they are typically just set to whatever the time is when they are created |
14:14:17 | FromDiscord | <sagecore> Yes. For example zip/zipfiles does. But that's only on Mac and Linux. |
14:15:03 | PMunch | Hmm, curious. I thought zip files didn't preserve timestamps.. |
14:15:03 | FromDiscord | <sagecore> zippy sets them to 1980-00-00 00:00 and not when they are created. |
14:18:46 | FromDiscord | <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:19 | FromDiscord | <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:58 | FromDiscord | <haxscramper> Maybe some hack is possible where I have `untyped`, which expands to differently wrapped `typed`? |
14:21:30 | FromDiscord | <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:33 | leorize | haxscramper: looks like you can't do it for real |
14:23:57 | leorize | what are you trying to do? maybe I can help |
14:27:46 | FromDiscord | <haxscramper> I need to get symbol of the declared type. Right now I have to do `processType(TypeName)`, which is ugly |
14:28:19 | FromDiscord | <haxscramper> I want to do `TypeName {.Process.} = object` instead |
14:28:57 | leorize | depends on what you do, getTypeInst can also get you the symbol |
14:29:23 | FromDiscord | <haxscramper> Yes, that what I do now |
14:29:59 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3lpb |
14:29:59 | FromDiscord | <haxscramper> AFter all type definitions |
14:30:33 | reversem3 | Do 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:50 | FromDiscord | <haxscramper> I don't want to wrap `type` section in another `untyped` macro that generates store calls everywhere |
14:31:14 | leorize | reversem3: you have to use procs |
14:31:42 | leorize | haxscamper: so what does your macro do? |
14:34:15 | FromDiscord | <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:13 | FromDiscord | <haxscramper> And later all macros that have to generate code based on structure can accept typedesc, call getObjectImpl and get preprocessed IR |
14:37:18 | leorize | yea this stuff is definitely not possible |
14:37:37 | leorize | blame Araq for the way he designed type macros |
14:38:09 | FromDiscord | <haxscramper> Well, it is not the end of the world, but certainly very annoying |
14:38:19 | FromDiscord | <haxscramper> Copy-pasted boilerplate |
14:39:23 | FromDiscord | <haxscramper> Still better than manually unparsing typed object body though, so I won't complain |
14:39:35 | leorize | :P |
14:40:27 | leorize | if type section macros worked on a nnkTypeSection there would be much more flexibility |
14:40:40 | leorize | though that would break same-section forward decl |
14:41:09 | leorize | so maybe it'd have to come after we got the no forward decl stuff sorted out |
14:51:50 | FromDiscord | <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:02 | leorize | timothee drafted out how that would work |
14:54:44 | leorize | the 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:54 | FromDiscord | <creonico> what is the `pure` pragma used for? |
15:53:23 | * | letto joined #nim |
15:53:55 | FromDiscord | <creonico> example, for structs in the win32 api |
16:05:04 | * | letto quit (Ping timeout: 252 seconds) |
16:30:12 | giaco | is runtime code in module root scope executed according to the import order from main? |
16:32:47 | FromGitter | <bung87> is it right way to check user implement a method `when compiles(onOpenFile(wv,$path))` |
16:33:51 | FromDiscord | <haxscramper> In reply to @bung87 "is it right way": This checks for `proc`/`func`/`template` etc. implementation - not `method` specifically |
16:34:15 | FromDiscord | <haxscramper> You can try and use `procCall` to test for method |
16:34:28 | FromDiscord | <haxscramper> https://nim-lang.org/docs/system.html#procCall%2Cuntyped |
16:38:44 | FromGitter | <bung87> how procCall test ? it returns bool? |
16:40:05 | FromGitter | <bung87> seems compiles fit my need well |
16:43:15 | FromGitter | <bung87> better have a proc to check just proc signature, for now need pass args to check |
16:50:40 | giaco | documentation doesn't say anything about execution order in module scope on imports: https://nim-lang.org/docs/manual.html#modules-import-statement |
16:51:47 | leorize[m] | giaco: it's undefined, but wouldn't surprise me if it's in import order |
16:54:57 | giaco | is it possible to output import order without building a toy project with many mock modules that imports each other? |
16:55:54 | giaco | I think is in important topic when dealing with globals |
16:59:40 | giaco | for 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:42 | giaco | can 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:34 | giaco | the advantage is clear: https://rosettacode.org/wiki/Singleton#Nim |
17:15:06 | giaco | question 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:17 | FromDiscord | <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:44 | ForumUpdaterBot | New 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:32 | FromDiscord | <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:56 | FromDiscord | <mlokis> this rally pisses me off |
18:38:46 | ForumUpdaterBot | New 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:26 | FromDiscord | <madman> is there a cleaner way to handle the `{.compile.}` pragmas?↵ https://play.nim-lang.org/#ix=3lrc |
20:00:29 | FromDiscord | <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:36 | reversem3 | damn nim-suggest is at 99.6 % CPU ? |
20:32:59 | ForumUpdaterBot | New thread by M33: Interesting video about transpiling (Linux conf AU 2020), see https://forum.nim-lang.org/t/7895 |
20:39:17 | FromDiscord | <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:14 | reversem3 | Bummer doom-emacs was working so nice |
20:42:31 | FromDiscord | <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:14 | FromDiscord | <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:36 | reversem3 | I understand I was on a roll with coding lol |
20:47:42 | reversem3 | oh well |
20:48:04 | FromDiscord | <zetashift> yea it sucks sometimes |
20:48:38 | * | ubq323 joined #nim |
20:48:41 | * | natrys quit (Ping timeout: 240 seconds) |
20:48:53 | FromDiscord | <dom96> will 2021 be the year of nimsuggest? |
20:50:15 | ubq323 | hello. 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:05 | FromDiscord | <dom96> yes, just store the future in a variable |
20:51:32 | FromDiscord | <dom96> let fut = someAsyncProc(); withTimeout(fut, 1000); fut.read() |
20:52:18 | reversem3 | Yes year of not crashing |
20:52:40 | reversem3 | BSON looks really cool |
20:54:04 | reversem3 | Language transpilation |
21:01:40 | ForumUpdaterBot | New 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:24 | ubq323 | ah thanks |
21:12:04 | * | Gustavo6046 joined #nim |
21:32:53 | * | thomasross joined #nim |
21:37:07 | FromDiscord | <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:49 | FromDiscord | <dom96> The only way to do this right now is to close the fd that the IO operation is pending on |
21:40:00 | FromDiscord | <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:07 | FromDiscord | <ElegantBeef> Last calls for TMWN! |
21:41:37 | FromDiscord | <Avatarfighter> TMWN |
21:41:38 | FromDiscord | <Avatarfighter> ? |
21:41:51 | FromDiscord | <ElegantBeef> This month with nim |
21:41:59 | FromDiscord | <Avatarfighter> Ah |
21:42:04 | FromDiscord | <ElegantBeef> The monthly showcase/blog post of community projects and schtuff |
21:45:11 | FromDiscord | <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:51 | FromDiscord | <Avatarfighter> In reply to @dom96 "Hard to say, if": I’m trying to cancel an asynchttpclient request if that helps with ideas 🥲 |
21:47:14 | FromDiscord | <dom96> just do it and see what happens |
21:48:51 | * | tane quit (Quit: Leaving) |
21:53:22 | FromDiscord | <Avatarfighter> kk |
21:53:58 | FromDiscord | <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:22 | FromDiscord | <shirleyquirk> i know `defined` but i can't figure out how to call it from inside the macro |
21:54:31 | FromDiscord | <ElegantBeef> `bindsym` might work |
21:54:46 | FromDiscord | <shirleyquirk> it crashes if the type doesn't exist |
21:55:14 | FromDiscord | <shirleyquirk> same with 'getTypexxx' |
21:59:29 | FromDiscord | <shirleyquirk> i guess i could gensym the types, but i was hoping to allow them to be copied around |
21:59:30 | FromDiscord | <ElegantBeef> Well you could put the emitted code in a block that checks if the symbol exists |
21:59:36 | FromDiscord | <shirleyquirk> ooh, go on |
22:00:07 | FromDiscord | <ElegantBeef> Trying to find the way to check if a symbol exists in a scope |
22:00:33 | FromDiscord | <shirleyquirk> oh you legend,↵when not defined(thingy):↵ type thingy |
22:02:07 | FromDiscord | <ElegantBeef> Lol |
22:02:19 | FromDiscord | <Avatarfighter> @dom96 btw how would one go about closing the fd ? |
22:02:23 | FromDiscord | <shirleyquirk> https://play.nim-lang.org/#ix=3lrB |
22:02:27 | FromDiscord | <shirleyquirk> still not quite there |
22:02:28 | FromDiscord | <ElegantBeef> You had the answer all along i just aimlessly remembered a feature |
22:03:24 | FromDiscord | <dom96> @Avatarfighter close the http client instance |
22:03:47 | FromDiscord | <Avatarfighter> ah |
22:06:21 | FromDiscord | <ElegantBeef> The issue shirley seems to be the code you're emitting |
22:06:40 | FromDiscord | <ElegantBeef> the whole pipe op + spaces |
22:06:42 | leorize | @ElegentBeef where do I sign up for TMWN? |
22:07:09 | FromDiscord | <ElegantBeef> https://github.com/beef331/website/issues |
22:07:33 | * | NimBot joined #nim |
22:07:33 | FromDiscord | <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:25 | FromDiscord | <shirleyquirk> declared! |
22:09:29 | FromDiscord | <shirleyquirk> not defined! |
22:10:13 | FromDiscord | <shirleyquirk> i know the spaces are weird, but it works, somehow |
22:10:41 | FromDiscord | <shirleyquirk> and dont call me shirley😆 |
22:10:57 | FromDiscord | <ElegantBeef> Ok vector |
22:15:08 | FromDiscord | <shirleyquirk> thank heavens now i can sleep |
22:17:09 | FromDiscord | <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) |