00:13:39 | ForumUpdaterBot | New thread by Alexeypetrushin: Get column names for `db_postgres`?, see https://forum.nim-lang.org/t/7954 |
00:14:28 | FromDiscord | <smallgram> sent a code paste, see https://play.nim-lang.org/#ix=3men |
00:14:40 | FromDiscord | <smallgram> (edit) "sent" => "Is it supposed to be possible to use `switch("define", "ssl")` to enable ssl compilation in" | "code paste, see https://paste.rs/Ef0" => "`config.nims` file? I can't get it to work..." |
00:17:24 | FromDiscord | <smallgram> Welp. Suddenly it's working--so nevermind. |
00:27:16 | FromDiscord | <brainproxy> Is there an easy way to raise a key press event?↵↵It doesn't matter which one, I'm just trying to have ncurse's `getch()` to read as a result of some code of mine "pressing a key" instead of waiting for the next physical key press. |
00:28:03 | FromDiscord | <ElegantBeef> @brainproxy what do you mean "raise a key press event" |
00:28:21 | FromDiscord | <brainproxy> have the nim code I'm raising press the letter "a" or whatever |
00:28:35 | FromDiscord | <brainproxy> (edit) "raising" => "writing" |
00:29:57 | FromDiscord | <brainproxy> sent a code paste, see https://play.nim-lang.org/#ix=3meq |
00:30:33 | FromDiscord | <brainproxy> (edit) "https://play.nim-lang.org/#ix=3meq" => "https://play.nim-lang.org/#ix=3mer" |
00:31:07 | FromDiscord | <ElegantBeef> i still dont quite follow, you want to exit the current branch if a condition is met and go to the next loop? |
00:31:19 | FromDiscord | <ElegantBeef> if you just want to go to the next iteration you can `continue` |
00:31:34 | FromDiscord | <brainproxy> nah, just that `getch()` returns and then it will go back to the top of the loop |
00:31:51 | FromDiscord | <brainproxy> which will then end because on the other thread the Atomic[bool] `running` has already been set to `false` |
00:32:00 | FromDiscord | <brainproxy> (edit) "other" => "main" |
00:33:36 | FromDiscord | <ElegantBeef> Ah rereading it seems you're attempting to prevent the blocking behaviour? |
00:33:57 | FromDiscord | <ElegantBeef> where `getCh()` blocks until it gets a key |
00:34:02 | FromDiscord | <brainproxy> yes |
00:34:17 | FromDiscord | <brainproxy> it's fine that it blocks, just want to unblock it by simulating a keypress |
00:34:22 | FromDiscord | <brainproxy> from the main thread |
00:34:59 | FromDiscord | <ElegantBeef> It probably reads from the `stdin` so you might be able to do just do `stdin.write('\0')` to get it to tick |
00:35:12 | FromDiscord | <brainproxy> I tried writing to stdin but no joy |
00:35:45 | FromDiscord | <ElegantBeef> Ah it uses what it refers to as a `stdscr` so it might have the file handle |
00:41:53 | * | njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
00:42:12 | * | njoseph joined #nim |
00:54:30 | * | johnnynitwits1 quit (Quit: Bridge terminating on SIGTERM) |
00:55:36 | * | johnnynitwits joined #nim |
00:59:59 | FromDiscord | <brainproxy> sent a code paste, see https://play.nim-lang.org/#ix=3mew |
01:14:18 | ForumUpdaterBot | New question by Alex Craft: How to check for unnamed tuple in Nim?, see https://stackoverflow.com/questions/67453497/how-to-check-for-unnamed-tuple-in-nim |
02:24:56 | * | kitech1- quit (Quit: ZNC 1.7.5 - https://znc.in) |
02:25:12 | * | kitech1 joined #nim |
02:32:33 | * | PMunch quit (Quit: leaving) |
02:49:44 | * | wasted_youth2 quit (Quit: Leaving) |
02:51:36 | * | Gustavo6046_ joined #nim |
02:51:56 | * | Gustavo6046 quit (Ping timeout: 260 seconds) |
02:54:09 | * | Gustavo6046_ is now known as Gustavo6046 |
03:15:46 | * | thomasross quit (Ping timeout: 240 seconds) |
03:45:33 | FromDiscord | <reilly> I can't make heads or tails of this error. https://hatebin.com/ylasqwqyhn Any ideas? |
03:45:57 | FromDiscord | <ElegantBeef> somewhere you're passing 13 in `0..6` |
03:46:18 | FromDiscord | <reilly> But the thing is, I'm not. |
03:46:39 | FromDiscord | <ElegantBeef> might be the library you're using or just an odd async bug |
03:47:30 | FromDiscord | <reilly> The bizarre thing is that I've made no significant changes between today and yesterday, yet it worked fine then. |
03:49:20 | FromDiscord | <reilly> Everything I'm doing happens in one file, and the only reference to that file in the error is just `waitFor bot.startSession()`, so it must be something outside of my direct control. |
03:55:12 | FromDiscord | <reilly> sent a code paste, see https://play.nim-lang.org/#ix=3mgf |
03:55:27 | FromDiscord | <ElegantBeef> Did you update dimscord today? |
03:55:44 | FromDiscord | <ElegantBeef> Did you change your nim version, did you change your monitor's brightness? 😛 |
03:56:07 | FromDiscord | <reilly> Nothing has changed. |
03:56:24 | FromDiscord | <reilly> It might be worth mentioning that it manages to get out the "Ready to rumble!" before kicking the bucket. |
03:57:00 | voltist | Woah I haven't been on IRC for a while |
03:57:08 | FromDiscord | <ElegantBeef> Woah it's a voltist |
03:57:11 | FromDiscord | <ElegantBeef> I remember them |
03:58:00 | voltist | What's new? |
03:58:40 | FromDiscord | <ElegantBeef> Wonder if there is any chance this is an issue with discord somehow reilly |
03:58:46 | FromDiscord | <ElegantBeef> If that braindead example fails |
03:59:07 | FromDiscord | <ElegantBeef> I'm going to give it a whirl what version are you on? |
03:59:23 | FromDiscord | <reilly> Nim 1.4.6, Dimscord v1.2.5 |
03:59:35 | FromDiscord | <reilly> I'm just glad it's not my Hypixel api that's the issue 😛 |
04:00:18 | * | motersen quit (Remote host closed the connection) |
04:00:33 | * | motersen joined #nim |
04:01:19 | FromDiscord | <ElegantBeef> Runs fine here |
04:01:27 | FromDiscord | <reilly> I was dreading that... |
04:01:42 | FromDiscord | <ElegantBeef> Nothing here voltist, you? |
04:02:08 | FromDiscord | <ElegantBeef> Change your nim version, maybe something got corrupted |
04:02:34 | FromDiscord | <reilly> Well I also tried running this on a raspberry pi and digitalocean droplet, both give the same problem |
04:02:40 | FromDiscord | <reilly> and both I freshly updated |
04:02:50 | FromDiscord | <ElegantBeef> Hmm |
04:02:52 | FromDiscord | <reilly> As in, I compiled Nim from source on my pi not even 30 minutes ago |
04:03:18 | FromDiscord | <ElegantBeef> All on the same network? |
04:03:34 | FromDiscord | <reilly> Not the droplet, that's off in some digitalocean datacenter somewhere |
04:03:57 | FromDiscord | <reilly> Although granted, I've only tried the braindead example on my machine |
04:04:06 | FromDiscord | <ElegantBeef> Winblows or linsux? |
04:04:36 | FromDiscord | <reilly> My machine is Windows, the droplet and pi are linux based |
04:04:39 | voltist | Eh not much |
04:05:40 | FromDiscord | <reilly> git push/pulled the braindead bot onto the droplet, exactly the same thing |
04:05:52 | FromDiscord | <reilly> I'm not superstitious, but I think I may be cursed. |
04:06:30 | FromDiscord | <reilly> were you using a cacert.pem? |
04:06:48 | FromDiscord | <ElegantBeef> Well i'm on linux so probably, i did just get that error with the windows build |
04:07:17 | FromDiscord | <ElegantBeef> the pem error not the range error |
04:08:33 | FromDiscord | <ElegantBeef> Yea no crash here in wine |
04:08:59 | FromDiscord | <reilly> Tried after deleting cacert.pem on my pi, no dice |
04:09:06 | FromDiscord | <reilly> I think I might actually be going a little bit crazy |
04:09:40 | FromDiscord | <reilly> If you're willing, the repo is knaque/gexp-spy |
04:09:59 | FromDiscord | <reilly> ah, no, you probably don't have a hypixel api key 🙃 |
04:10:42 | FromDiscord | <ElegantBeef> You were getting a range error in that dummy example aswell? |
04:11:39 | FromDiscord | <reilly> Yep |
04:11:46 | FromDiscord | <ElegantBeef> same 0..13? |
04:12:00 | FromDiscord | <reilly> Always `Exception message: value out of range: 13 notin 0 .. 6` |
04:12:12 | FromDiscord | <ElegantBeef> ah yea that's what i meant |
04:13:04 | FromDiscord | <reilly> https://media.discordapp.net/attachments/371759389889003532/840803529395798016/unknown.png |
04:13:47 | FromDiscord | <reilly> I just remembered that the number 13 is associated with bad luck in certain cultures, so that's ironic |
04:14:30 | FromDiscord | <ElegantBeef> those were all compiled on their hardware? |
04:14:35 | FromDiscord | <reilly> Yep |
04:14:37 | FromDiscord | <reilly> just `nimble run` |
04:15:00 | FromDiscord | <ElegantBeef> That's not the dummy though |
04:15:13 | FromDiscord | <reilly> the dummy I run with `nim c -f -r testbot.nim` |
04:15:41 | FromDiscord | <ElegantBeef> Well time to try just a normal async function to see if you get the same error |
04:18:14 | FromDiscord | <reilly> so it must be a dimscord thing |
04:18:15 | FromDiscord | <reilly> sent a code paste, see https://play.nim-lang.org/#ix=3mgm |
04:18:31 | FromDiscord | <reilly> but a dimscord thing that only seems to affect me 🙃 |
04:20:26 | * | mindhunt1r0x joined #nim |
04:20:48 | FromDiscord | <reilly> slightly more complicated test w/ hypixel api requests still works just fine |
04:22:11 | * | mindhunter0x quit (Ping timeout: 240 seconds) |
04:22:34 | FromDiscord | <reilly> Hey @krisppurg, you made the thing, any idea what's going on here? |
04:24:06 | FromDiscord | <reilly> tl;dr even a bot as simple as `on_ready: echo "Ready to rumble!"` crashes with this message: https://hatebin.com/ylasqwqyhn |
04:24:37 | FromDiscord | <reilly> crashes on my machine, crashes on my raspberry pi, crashes on a node in a datacenter, but doesn't crash for elegantbeef for some reason 🤔 |
04:24:49 | FromDiscord | <reilly> running nim 1.4.6 and dimscord 1.2.5 |
04:37:23 | FromDiscord | <Rika> Maybe discord just really doesn’t like you |
04:37:45 | FromDiscord | <ElegantBeef> Yea if it's the same token it could be related to something there not working properly |
04:40:14 | FromDiscord | <reilly> Huh, go figure, it's something to do with this particular bot. |
04:40:42 | FromDiscord | <Rika> lol probably a permission thing |
04:41:11 | FromDiscord | <reilly> If so, that's a very unhelpful crash. |
04:43:09 | FromDiscord | <reilly> Now I just have to wait for the person that actually owns the server to make sure it has the right permissions. Who knows how long that could take. |
04:44:06 | FromDiscord | <ElegantBeef> Well you can make your own bot to test and make a possible PR to dimscord to more reasonably handle the crash |
04:44:30 | FromDiscord | <reilly> Wait, it might not be a permissions thing, because compiling it with my debug flag (changes what channels it sends messages in and stuff), it still crashes |
04:44:41 | FromDiscord | <reilly> So it can't be that it doesn't have permission to send messages |
04:46:07 | FromDiscord | <Rika> There are a lot more permissions than just that though heh |
04:47:11 | FromDiscord | <reilly> When in debug mode, it should only operate in a server that I own, in which it definitely has permission to send messages. |
04:47:32 | FromDiscord | <reilly> It sends 3 messages on startup, then updates those messages every hour. |
04:48:34 | FromDiscord | <reilly> There should be no reason for it to crash - you can see for yourself, the repo is knaque/gexp-spy |
04:49:40 | FromDiscord | <reilly> So, it's definitely a problem isolated to this one particular bot... |
04:50:28 | FromDiscord | <reilly> The only real difference between this and my other main bot is that the second server it's in is actually fairly large (~3000) members |
04:51:01 | FromDiscord | <reilly> Both are also in my testing server, but for the second bot, the only other server its in only has 11 members |
04:51:03 | FromDiscord | <Rika> Does it not stack trace where it does? |
04:51:04 | FromDiscord | <Rika> Does |
04:51:07 | FromDiscord | <Rika> Dies |
04:52:50 | FromDiscord | <reilly> You can see for yourself (https://hatebin.com/ylasqwqyhn) but I don't see anything in there that makes sense in the context of `Exception message: value out of range: 13 notin 0 .. 6` |
04:53:02 | FromDiscord | <reilly> (edit) "`Exception message: value" => "'value" | "6`" => "6'" |
04:53:47 | FromDiscord | <reilly> There is some internal dimscord stuff going on in there, but again, the line it points to has nothing to do with that exact error |
04:54:26 | FromDiscord | <reilly> Since the async macro does some codegen, it could be that the line in the stack trace isn't actually right, but either way it's not very helpful |
04:58:19 | FromDiscord | <reilly> sent a code paste, see https://play.nim-lang.org/#ix=3mgp |
04:59:06 | FromDiscord | <Rika> Might be the API changed and the library isn’t updated to handle that properly |
04:59:33 | FromDiscord | <reilly> Did Discord update its api sometime between yesterday and now? |
04:59:47 | FromDiscord | <reilly> That's not sarcastic, I'm serious. |
05:00:30 | FromDiscord | <reilly> last update was April 28, 2021 according to https://discord.com/developers/docs/change-log |
05:00:37 | FromDiscord | <Rika> I don’t know, did the library get updated yesterday |
05:01:23 | FromDiscord | <reilly> The version of Dimscord I'm using (latest release) is from december 2020 |
05:01:37 | FromDiscord | <reilly> So it is old, but that doesn't change that it worked yesterday |
05:02:08 | FromDiscord | <reilly> should I try #head? I don't know if that's stable. |
05:02:37 | FromDiscord | <reilly> I guess worst it could do is crash.. |
05:03:52 | FromDiscord | <reilly> braindead bot now works fine |
05:03:57 | FromDiscord | <reilly> testing the big boy |
05:05:45 | FromDiscord | <reilly> So #head works, it's just bizarre that 1.2.5 worked yesterday and not now... |
05:25:16 | FromDiscord | <mlokis> sent a code paste, see https://play.nim-lang.org/#ix=3mgx |
05:50:27 | * | NimBot joined #nim |
05:55:44 | FromDiscord | <Rika> You aren’t awaiting the threads |
05:55:58 | FromDiscord | <Rika> So they aren’t given time to run |
05:56:22 | FromDiscord | <Rika> Remember that there is no actual parallelism here, it’s all concurrent |
05:56:47 | FromDiscord | <Rika> And it’s cooperative so you have to explicitly give time to the other threads to run |
05:58:05 | FromDiscord | <Rika> Calling a proc that returns a future means you’re scheduling that to be run, awaiting something means you’re giving the scheduler time to run everything else as well as waiting for whichever future you’re awaiting to complete |
05:58:32 | FromDiscord | <Rika> Someone correct me if I’m wrong but this is what I know |
06:06:05 | FromDiscord | <hamidb80> In reply to @Rika "Does": Does[1] = "dies" |
06:06:29 | FromDiscord | <Rika> can’t assign string to char |
06:07:29 | FromDiscord | <hamidb80> In reply to @Rika "can’t assign string to": `Does es`[1] = "dies" |
06:07:37 | FromDiscord | <hamidb80> (edit) "`Does es`[1]" => "`Doeses`[1]" |
06:07:44 | FromDiscord | <Rika> Hm? |
06:07:49 | FromDiscord | <Rika> I don’t get it anymore lol |
06:11:24 | FromDiscord | <ElegantBeef> Hmm pmunch i may have figured out a good talk subject "Benchmarking and profiling" |
06:50:04 | * | johnnynitwits quit (Quit: Bridge terminating on SIGTERM) |
06:51:13 | * | johnnynitwits joined #nim |
07:07:02 | * | Vladar joined #nim |
07:09:25 | ForumUpdaterBot | New post on r/nim by xneo7: r/Nim subreddit statistics, see https://reddit.com/r/nim/comments/n88uk3/rnim_subreddit_statistics/ |
07:27:20 | * | blueberrypie quit (Quit: leaving) |
07:29:33 | * | blueberrypie joined #nim |
07:53:21 | FromDiscord | <carpal> is there a way to cast (bit) an array of bytes to an int? `cast[int64]([0, 0, 0, 0, 0, 0, 0, 1])` |
07:53:54 | FromDiscord | <carpal> ah ok I just checked in the playground and it works |
07:54:18 | FromDiscord | <carpal> cast[int64]([0, 0, 0, 0, 0, 0, 0, 1]) |
07:54:26 | FromDiscord | <carpal> <https://play.nim-lang.org/#ix=3mgX> |
07:55:28 | FromDiscord | <carpal> <https://forum.nim-lang.org/t/2626> |
07:56:44 | FromDiscord | <Rika> !eval echo cast[int64]([0'u8, 0, 0, 0, 0, 0, 0, 1]) |
07:56:48 | NimBot | 72057594037927936 |
07:56:56 | FromDiscord | <Rika> is that right... |
07:57:10 | FromDiscord | <Rika> !eval echo cast[int64]([1u8, 0, 0, 0, 0, 0, 0, 0]) |
07:57:13 | NimBot | 1 |
07:57:22 | FromDiscord | <Rika> @carpal |
07:57:39 | FromDiscord | <ElegantBeef> Yea the issue is just not telling it you wanted the literals to be bytes |
07:57:41 | FromDiscord | <carpal> ah nothing, I just fixed looking at the forum |
07:57:46 | FromDiscord | <Rika> warranty not included |
07:57:48 | FromDiscord | <carpal> thanks anyway, it wasn't a byte array |
07:57:54 | FromDiscord | <carpal> it was a int32 array |
07:58:37 | FromDiscord | <Rika> !eval echo cast[int64]([1i32, 0]) |
07:58:40 | NimBot | 1 |
08:10:55 | * | wasted_youth2 joined #nim |
08:18:17 | FromDiscord | <Varriount> Hm, this article presents a few arguments that have made me rethink my arguments on various things.↵https://elronnd.net/writ/2021-02-13_att-asm.html |
08:19:30 | FromDiscord | <Varriount> Especially this:↵↵> This is a classic logical fallacy: it’s an appeal to authority. It doesn’t say why the syntax is better, just asserts that somebody else (C) thinks it’s better. A slight variant on the argument says that making mnemonic assembler syntax reminiscent of the syntax of higher-level languages will make the language easier to learn for people who already know higher-level languages. This may be somewhat true, but |
08:20:35 | * | letto quit (Ping timeout: 246 seconds) |
08:35:41 | FromDiscord | <ElegantBeef> Also damn you varriount, reading your comments on the streams made me realize "Fuck 1 exists and using 1 as a multiplier of growth rate doesnt work well" |
08:36:01 | FromDiscord | <ElegantBeef> `(len + 1) 1` just doesnt have any good exponential growth |
08:42:18 | FromDiscord | <Rika> i wonder why |
08:46:06 | FromDiscord | <ElegantBeef> Math is hard so i hope someone smarter than me can figure out why |
09:00:03 | * | antholop[m] quit (Quit: Idle for 30+ days) |
09:09:15 | * | motersen_ joined #nim |
09:09:26 | * | krux02 joined #nim |
09:10:21 | * | motersen quit (Ping timeout: 240 seconds) |
09:40:04 | * | letto joined #nim |
09:45:48 | * | beshr joined #nim |
10:12:58 | ForumUpdaterBot | New thread by TokenChingy: Sequences, Type Inference, and Inheritance... I am slightly lost., see https://forum.nim-lang.org/t/7955 |
10:16:27 | * | Vladar quit (Read error: Connection reset by peer) |
10:17:11 | * | vicfred quit (Quit: Leaving) |
10:27:36 | * | Vladar joined #nim |
10:32:46 | * | letto quit (Ping timeout: 240 seconds) |
12:05:22 | * | letto joined #nim |
12:46:26 | * | PMunch joined #nim |
12:49:20 | giaco | I am not into cryptocurrencies, but is it real that nim has just received some good bitcoins? I'm very happy about this |
13:10:43 | FromDiscord | <mischa_u> Yeah, looks like they received $100,000 worth of Bitcoin a few weeks ago |
13:11:03 | FromDiscord | <mischa_u> (which is now worth $125,000) |
13:11:11 | PMunch | Damn, nice |
13:11:24 | FromDiscord | <mischa_u> https://www.blockchain.com/btc/address/1BXfuKM2uvoD6mbx4g5xM3eQhLzkCK77tJ |
13:12:12 | FromDiscord | <mischa_u> (that is the address listed on <https://nim-lang.org/donate.html>) |
13:19:17 | FromDiscord | <dom96> wtf |
13:19:42 | FromDiscord | <dom96> Whoever sent that should have probably confirmed that that address still works |
13:21:24 | FromDiscord | <Rika> well thats your responsibility isnt it? |
13:21:25 | FromDiscord | <dom96> giaco: how did you hear about this transaction? |
13:21:35 | FromDiscord | <Rika> well not your but the team's |
13:23:33 | giaco | I was just reading nim subreddit, then copypasted wallet address into random blockchain tracker |
13:24:38 | FromDiscord | <dom96> I guess you saw it here: https://www.reddit.com/r/nim/comments/mytp3j/is_there_a_list_of_developers_working_in_nim_that/gx4tjjq/ |
13:26:24 | giaco | Yeah. Actually I was interested into donating, too |
13:31:22 | FromDiscord | <dom96> You guys know any websites that can analyse a BTC address to find info about it? |
13:36:36 | FromDiscord | <zidsal> if it's real can we get someone famous to host nimconf!? |
13:40:20 | FromDiscord | <mischa_u> Obama as keynote speaker |
13:41:35 | FromDiscord | <mischa_u> (edit) "speaker" => "speaker: "Everybody's Got to Learn How to Code [in Nim]"" |
13:42:41 | FromDiscord | <ArMour85> In reply to @mikeX "Obama as keynote speaker:": I validate this proposition |
13:43:34 | FromDiscord | <ArMour85> But Obama is maybe more expansive |
13:46:50 | FromDiscord | <mischa_u> Al Gore: "How I invented the Internet [and Nim]" |
13:46:56 | FromDiscord | <Rika> In reply to @dom96 "You guys know any": do you know who controls the address? |
13:47:04 | FromDiscord | <Rika> yardanico? araq? |
13:48:31 | FromDiscord | <dom96> I do know. But I think it's best I don't share it publicly 🙂 |
13:49:00 | FromDiscord | <Rika> oh okay why analyse the address if you already know then lmao |
13:49:16 | FromDiscord | <dom96> I want to analyse the address that sent it |
13:49:17 | FromDiscord | <Rika> you're not gonna easily trace where it came from |
13:50:03 | FromDiscord | <dom96> It seems most of the transcations into the wallet that sent it came from Binance |
13:50:12 | FromDiscord | <dom96> so yeah, not gonna find much more about it I guess |
13:50:19 | FromDiscord | <dom96> Unless I can send a warrant to Binance 😛 |
13:51:43 | FromDiscord | <mischa_u> Lol that sounds like a great way to alienate anyone who would ever want to donate to Nim |
13:53:49 | FromDiscord | <Rika> why do you want to know anyway |
13:54:18 | FromDiscord | <dom96> Curiosity, it is a lot of BTC. |
13:55:37 | FromDiscord | <Anuke> When trying to `spawn` a specific proc (<https://github.com/Anuken/fau/blob/master/tools/antialias.nim#L19>), I get the error `'spawn' takes a GC safe call expression`.↵How would I find out why this proc isn't GC-safe? The procedure itself does not access global variables directly, although referenced procedures might. |
13:56:35 | FromDiscord | <dom96> > although referenced procedures might. |
13:56:40 | FromDiscord | <dom96> There is your answer |
13:58:40 | FromDiscord | <dom96> we should seriously set up some alerts on this BTC address lol |
13:58:53 | FromDiscord | <ArMour85> In reply to @dom96 "Curiosity, it is a": Elon Musk maybe 😋 |
13:59:50 | FromDiscord | <Anuke> In reply to @dom96 "There is your answer": But how would I know which one it is? |
14:00:26 | FromDiscord | <Rika> i think adding a gcsafe pragma on the proc will tell why its not gcsafe |
14:01:26 | FromDiscord | <Anuke> Looks like `readImage` isn't GC-safe, thanks |
14:12:35 | FromDiscord | <hamidb80> how can i bechmark my nim code? |
14:13:07 | FromDiscord | <hamidb80> i think nimble has something for it |
14:13:23 | FromDiscord | <hamidb80> (edit) "it" => "benchmarking" |
14:14:48 | * | tane joined #nim |
14:20:12 | FromDiscord | <haxscramper> https://github.com/treeform/benchy for microbenchmarking |
14:23:30 | * | kenran joined #nim |
14:28:44 | FromGitter | <bung87> how to do like `except A,B as e` ? |
14:29:25 | FromDiscord | <haxscramper> I don't think it is possible if `A` and `B` are different types |
14:29:51 | FromDiscord | <haxscramper> If they share the same base type you can just use base itself |
14:31:29 | FromGitter | <bung87> hmm doesn't like python's |
14:36:06 | FromGitter | <bung87> oh, I can do `except A,B: getCurrentException()` |
14:39:26 | FromDiscord | <retkid> Can you compile nim yo java via C |
14:39:53 | FromDiscord | <Rika> nim to java? if you have a C->java then sure |
14:41:01 | FromDiscord | <retkid> (edit) "nim" => "to" |
14:41:12 | FromDiscord | <retkid> Nim really is magic |
14:42:08 | FromDiscord | <Rika> well it might not work if the C to java translator is bad so |
14:42:16 | FromDiscord | <Rika> but that's not nim's responsibility any more |
14:44:15 | FromDiscord | <retkid> Wonder if I could do Minecraft dev with Java bindings |
14:44:55 | FromGitter | <bung87> https://github.com/yglukhov/jnim have you checked ? |
14:45:58 | FromDiscord | <retkid> We’re a group of people determined to do what we want |
14:46:18 | * | aeverr_ is now known as aeverr |
14:46:23 | FromDiscord | <retkid> And nim is designed to fit anywhere |
14:46:23 | FromDiscord | <hamidb80> question |
14:46:27 | FromDiscord | <retkid> It’s a really cool ting |
14:46:37 | FromDiscord | <retkid> In reply to @hamidb80 "question": You teleported bread? |
14:46:52 | * | Vladar quit (Quit: Leaving) |
14:48:18 | FromDiscord | <hamidb80> what happens when i compile with `-d:release` that cause 6x speed? |
14:53:27 | FromDiscord | <hamidb80> i think it removes debug information |
14:53:53 | FromDiscord | <hamidb80> but what are those "debug information"? |
14:54:14 | FromDiscord | <hamidb80> i know it contains line number |
14:54:21 | FromDiscord | <hamidb80> (edit) "i know it contains line number ... " added "for eg" |
14:54:24 | FromDiscord | <hamidb80> (edit) "eg" => "e.g." |
14:54:32 | FromDiscord | <hamidb80> (edit) "number" => "numbers" |
14:55:11 | FromDiscord | <haxscramper> it also disables some runtime checks |
14:55:32 | FromDiscord | <haxscramper> with `-d:release` you can assign to `.kind` fields for example |
14:55:39 | FromDiscord | <haxscramper> some array bound checks |
14:55:58 | FromDiscord | <zidsal> I thought array bound checks needs the danger flag? |
14:56:06 | FromDiscord | <haxscramper> IIRC `assert` also behaves differently, though I don't remenber exact details |
15:11:21 | * | letto quit (Ping timeout: 252 seconds) |
15:13:15 | * | Gustavo6046 quit (Ping timeout: 260 seconds) |
16:20:34 | * | beshr quit (Remote host closed the connection) |
16:27:19 | * | Gustavo6046 joined #nim |
16:27:30 | * | letto joined #nim |
16:28:23 | * | beshr joined #nim |
16:33:16 | FromDiscord | <retkid> In reply to @bung87 "https://github.com/yglukhov/jnim have you checked": You think I could fashion a Minecraft plugin from this |
16:33:37 | FromDiscord | <retkid> It would be very h |
16:33:48 | FromDiscord | <retkid> (edit) "h" => "hackey" |
16:34:01 | FromDiscord | <retkid> But I think it’s possible |
16:34:09 | FromDiscord | <retkid> Idk if doing |
16:34:26 | FromDiscord | <retkid> (edit) "Idk if doing ... " added "a mod would be possible" |
16:40:04 | FromGitter | <bung87> @retkid Idk , I haven't tried it and playing Minecraft |
16:42:33 | FromGitter | <bung87> what does os sendfile really do ? I have problem sendfile over ssl |
16:43:18 | FromGitter | <bung87> I found openssl have SSL_sendfile |
16:47:13 | FromDiscord | <haxscramper> In reply to @retkid "You think I could": I think @Technisha was doing something related (minecraft/nim integration in some way) |
16:48:49 | FromDiscord | <retkid> https://media.discordapp.net/attachments/371759389889003532/840993722137051146/image0.png |
16:48:52 | FromDiscord | <Rika> yup |
16:49:08 | FromDiscord | <retkid> This is what the plugin code looks like |
16:51:47 | FromDiscord | <retkid> https://media.discordapp.net/attachments/371759389889003532/840994466928001044/image0.png |
16:51:58 | FromDiscord | <retkid> Java is a very ugly language |
16:52:10 | FromDiscord | <retkid> But yeah the java bridge should work for this |
16:53:01 | FromDiscord | <retkid> In reply to @haxscramper "I think <@!470131488856211476> was": Probably doing the windows version which has likeC support iirc |
17:10:06 | saem | Anyone got a link to nitty gritty explanation as to why first class iterators aren't sorted in the JS backend? |
17:42:11 | * | oculux quit (Ping timeout: 240 seconds) |
18:33:12 | * | lritter joined #nim |
18:38:58 | * | lritter quit (Quit: Leaving) |
18:46:59 | * | Gustavo6046 quit (Ping timeout: 260 seconds) |
18:47:40 | * | PMunch quit (Quit: leaving) |
18:54:12 | * | oddp joined #nim |
19:08:20 | FromDiscord | <carpal> https://media.discordapp.net/attachments/371759389889003532/841028830827249724/unknown.png |
19:08:24 | FromDiscord | <carpal> https://media.discordapp.net/attachments/371759389889003532/841028845318832138/unknown.png |
19:08:28 | FromDiscord | <carpal> are you removing nil? |
19:08:33 | FromDiscord | <carpal> nim version 1.4.2 |
19:08:41 | FromDiscord | <carpal> strings are by default ""? |
19:11:20 | FromDiscord | <IDF(ardek66)> aren't strings `""` by default for a while |
19:13:14 | * | Gustavo6046 joined #nim |
19:19:27 | * | cheer[m] joined #nim |
19:19:57 | Amun_Ra | yes |
19:22:34 | FromDiscord | <konsumlamm> since at least 1.0 |
19:23:14 | FromDiscord | <mlokis> is nim regex thread safe? |
19:48:19 | FromDiscord | <jtiai> sent a code paste, see https://play.nim-lang.org/#ix=3mkP |
19:57:27 | FromDiscord | <jtiai> So I could write in my code something like `cpu.LDrr("A", "B")` (or something like that) |
19:59:50 | ForumUpdaterBot | New thread by Bung: Sendfile over ssl, see https://forum.nim-lang.org/t/7956 |
20:02:55 | FromGitter | <bung87> @jtiai https://nim-lang.org/docs/manual.html#templates-identifier-construction does this fit your needs? |
20:04:17 | FromDiscord | <jtiai> That might do it. |
20:22:14 | ForumUpdaterBot | New post on r/nim by Pcarbonn: how to modify a package, see https://reddit.com/r/nim/comments/n8mmib/how_to_modify_a_package/ |
20:53:31 | FromDiscord | <ElegantBeef> @treeform dont know if you saw in the RFC, but with a bit of a modification to streams binny isnt as nearly fast by comparison https://media.discordapp.net/attachments/371759389889003532/841055301725585438/unknown.png |
20:54:15 | FromDiscord | <ElegantBeef> Still vastly slower in `--newRuntime` but that's an issue with the `of` operation, so with arc/orc it's like 4ms per tick |
20:54:53 | FromDiscord | <ElegantBeef> Yea new runtime not nearly as nice https://media.discordapp.net/attachments/371759389889003532/841055647164661770/unknown.png |
20:55:16 | FromDiscord | <treeform> I saw the RFC, i StringStream would still be slower. |
20:55:25 | FromDiscord | <treeform> But yeah that bench shows they are nearly identical. |
20:55:36 | FromDiscord | <treeform> (edit) "I saw the RFC, i ... StringStream" added "thought" |
20:55:55 | FromDiscord | <ElegantBeef> Yea, it was just spending a lot of time in the string growth, which is weird since your library does the same thing |
20:56:05 | FromDiscord | <treeform> well it was growing it not by 2 |
20:56:13 | FromDiscord | <treeform> which does not amortize as well. |
20:56:24 | FromDiscord | <ElegantBeef> Did your override the setlen? |
20:56:28 | FromDiscord | <treeform> no |
20:56:50 | FromDiscord | <ElegantBeef> So then i dont see the difference in both cases a `setLen(len + size(t))` was being done |
20:57:12 | FromDiscord | <treeform> what was the fix then? |
20:57:39 | FromDiscord | <ElegantBeef> I changed the growth rate, but i could've sworn i seen the same setlen call |
20:58:18 | FromDiscord | <treeform> I think setLen grows stuff by 2 |
20:58:35 | FromDiscord | <treeform> I do use nearly identical code: https://github.com/treeform/flatty/blob/master/src/flatty/binny.nim#L41 |
20:59:03 | FromDiscord | <ElegantBeef> Yea it's odd, but i'll take it as a win 😄 |
20:59:17 | FromDiscord | <treeform> what change did you make to StringStream? |
20:59:46 | FromDiscord | <ElegantBeef> I implemented a custom growth rate which lets you grow the string by a multiplier instead of whatever it was doing before |
21:00:08 | FromDiscord | <ElegantBeef> Here's the diff https://github.com/nim-lang/Nim/pull/17977/files |
21:00:44 | * | kenran quit (Remote host closed the connection) |
21:03:07 | FromDiscord | <ElegantBeef> It allocates roughly 30 thousand more characters with a growth rate of 2 |
21:03:24 | FromDiscord | <ElegantBeef> So yea not a memory efficient optimization, just odd |
21:04:41 | FromDiscord | <ElegantBeef> You might be able to use similar logic to make a fast binny serializer, but no clue |
21:09:11 | FromDiscord | <treeform> looks complex I would just 2 and not allow chaining that |
21:09:24 | FromDiscord | <treeform> but its great that this was discovered, thank you for making the changes |
21:10:41 | FromDiscord | <ElegantBeef> Lol i just seen planetis' comment about the stream implementation and had to dig in, kinda makes me want to make a nimconf talk about benchmarking, profiling and preconceived notions of code |
21:12:46 | FromDiscord | <ElegantBeef> As much as i like benchy, it does not tell you why it's slow just if it's slow, so using it as evidence as planetis did that streams implementation is slow was just the wrong conclusion, since in 3 seconds i seen the reason it was slow was not actually a limitation of the string implementation 😄 |
21:12:58 | FromDiscord | <ElegantBeef> (edit) "string" => "stream" |
21:13:25 | FromDiscord | <ElegantBeef> Plus there is the whole `lto` compilation which without just causes all external modules to look slow |
21:13:30 | FromDiscord | <treeform> Well I use vtune to look at streams |
21:13:38 | FromDiscord | <treeform> and it was saying the dynamic dispatch was slow |
21:13:47 | FromDiscord | <treeform> So I made the wrong conclusion too |
21:13:51 | FromDiscord | <treeform> but I did use more tools |
21:14:03 | FromDiscord | <ElegantBeef> Hmm |
21:15:40 | FromDiscord | <ElegantBeef> I mean if there was a cpu graph next to the claim i wouldnt have looked into it, so more just a case of the amount of evidence, seeing a post linking to a benchmark just made me ask too many questions 😛 |
21:18:02 | FromDiscord | <ElegantBeef> It's a bit odd that the cause changed, now i'm curious if there is a reason for that |
21:18:11 | FromDiscord | <ElegantBeef> Though if you tested on arc/orc that'd explain it |
21:18:54 | FromDiscord | <ElegantBeef> The `of` operation on `newRuntime` is apparently very very slow |
21:19:13 | * | tane quit (Quit: Leaving) |
21:27:10 | FromDiscord | <Nisha's alt> ~~How hard would it be to wrap Dimscord for use in Python?-~~ |
21:28:39 | FromDiscord | <treeform> In reply to @ElegantBeef "Though if you tested": I don't remember exactly how I tested, I don't have screenshots of it. |
21:29:14 | FromDiscord | <treeform> I am stuck on this perf puzzle a little bit, it appears using arrays in nim is slower then using objects. |
21:30:23 | FromDiscord | <treeform> If you want bench perf puzzles here is a big one: https://gist.github.com/treeform/326b96e48743424c1d5e4dcb17402715 |
21:31:13 | FromDiscord | <treeform> Why is `a[i] = v` slower then `a.arr[i] = v` ? |
21:31:33 | FromDiscord | <treeform> Why is `a[i] = v` slower then `cast[ptr float32](cast[uint64](a.addr) + i.uint64 sizeof(float32).uint64)[] = v` ? |
21:31:42 | FromDiscord | <treeform> Makes no sense! My hair is falling out. |
21:32:14 | * | vicfred joined #nim |
21:32:41 | FromDiscord | <treeform> Here is some research: ↵https://stackoverflow.com/questions/1022379/why-cant-i-copy-an-array-by-using↵https://stackoverflow.com/questions/12896727/why-we-can-directly-copy-pointers-but-we-can-not-directly-copy-arrays-in-c↵https://cboard.cprogramming.com/c-programming/110716-how-do-you-copy-one-array-c-another.html |
21:34:08 | * | azed joined #nim |
21:34:32 | FromDiscord | <ElegantBeef> I guess i can check it out to get my hair pulled out 😄 |
21:34:43 | FromDiscord | <treeform> Only if you want a deep rabbit hole |
21:52:10 | FromDiscord | <DumbMahreeo> In reply to @Rika "<@!282246039526834177> is something like": Yes, sorry for not replying, I've been quite bust |
21:52:22 | FromDiscord | <DumbMahreeo> (edit) "bust" => "busy lately" |
21:52:32 | FromDiscord | <DumbMahreeo> (edit) "In reply to @Rika "<@!282246039526834177> is something like": Yes, sorry for not replying, I've been quite busy lately ... " added "and didn't took time to check Discord" |
21:55:39 | FromDiscord | <reilly> sent a code paste, see https://play.nim-lang.org/#ix=3mlk |
21:56:08 | FromDiscord | <reilly> As in, throw a compile-time error if `let` or `const` is used instead. |
21:56:37 | FromDiscord | <reilly> (edit) "https://play.nim-lang.org/#ix=3mlk" => "https://play.nim-lang.org/#ix=3mll" |
22:05:34 | * | azed quit (Read error: Connection reset by peer) |
22:10:37 | * | azed joined #nim |
22:11:24 | * | arecaceae quit (Remote host closed the connection) |
22:11:43 | * | arecaceae joined #nim |
22:13:49 | * | blackpawn joined #nim |
22:40:08 | ForumUpdaterBot | New thread by Alexeypetrushin: The `db_postgres`, distinguish "" from NULL, see https://forum.nim-lang.org/t/7957 |
22:43:39 | * | Gustavo6046 quit (Ping timeout: 250 seconds) |
22:51:04 | * | Gustavo6046 joined #nim |
22:54:47 | * | azed quit (Quit: WeeChat 3.1) |
22:54:56 | * | thomasross joined #nim |
23:01:43 | FromDiscord | <exelotl> @reilly I can't think of a way, even with term-rewriting macros... |
23:02:32 | FromDiscord | <exelotl> (though it might be possible with those) |
23:03:32 | FromDiscord | <reilly> No sweat. I thought I remembered there being one, but I'm probably just imagining it. |
23:23:07 | FromDiscord | <ElegantBeef> @exelotl @reilly Nope you can use term rewriting macros, actually surprisingly simple https://play.nim-lang.org/#ix=3mlH |
23:24:24 | FromDiscord | <ElegantBeef> Probably want to do more introspection to see if it's actually calling `newObject` otherwise it's fine |
23:24:51 | * | johnnynitwits quit (Quit: Bridge terminating on SIGTERM) |
23:24:57 | FromDiscord | <exelotl> oh! I was missing the brackets |
23:25:31 | FromDiscord | <exelotl> had `template check{let a = b}` and it was complaining about unexpected let |
23:25:36 | * | johnnynitwits joined #nim |
23:26:00 | FromDiscord | <ElegantBeef> Yea i read the TRM docs like 5 times to reason that one out |
23:26:42 | FromDiscord | <ElegantBeef> And for instance you can add more introspection to allow aliasing just not construction https://play.nim-lang.org/#ix=3mlJ |
23:31:10 | FromDiscord | <ElegantBeef> Ok now to ram my head into the wall of treeforms problem |
23:44:05 | FromDiscord | <ElegantBeef> @treeform found a solution to your slow problem, do less maths 😛 |
23:44:17 | FromDiscord | <ElegantBeef> https://media.discordapp.net/attachments/371759389889003532/841098273112064031/unknown.png |
23:44:48 | FromDiscord | <ElegantBeef> Only actually need a single cast |
23:44:59 | FromDiscord | <treeform> Why is the vec3array slower? |
23:45:08 | FromDiscord | <ElegantBeef> It's all the same with`lto` |
23:45:26 | FromDiscord | <ElegantBeef> with the old runtime atleast |
23:46:38 | FromDiscord | <ElegantBeef> Benchmarking is hard so i can only say "i think" it's faster and not just completely removed |
23:47:24 | FromDiscord | <ElegantBeef> If you're using the assignment from other modules that's why |
23:48:06 | FromDiscord | <ElegantBeef> Atleast in my looking into it if you dont have lto and use code from other modules the code just isnt inlined or optimized outside the main module |
23:48:31 | FromDiscord | <ElegantBeef> So without `lto` you can write a faster iterator than the system provided ones |
23:54:27 | FromDiscord | <ElegantBeef> Atleast with lto and the changes i made it optimizes away the same as the `arr` implementation |
23:54:37 | FromDiscord | <ElegantBeef> So take that with a grain of salt 😄 |
23:57:56 | FromDiscord | <ElegantBeef> Yea it's very bad to say anything here due to this being the output now with the changes i made to `[]=` and `set` https://media.discordapp.net/attachments/371759389889003532/841101709299679252/unknown.png |
23:59:01 | FromDiscord | <ElegantBeef> I can say though that `cast[ptr UncheckedArray[float32](a.addr)[i + 1] = v` is just nicer than the other method 😄 |