<< 09-05-2021 >>

00:13:39ForumUpdaterBotNew thread by Alexeypetrushin: Get column names for `db_postgres`?, see https://forum.nim-lang.org/t/7954
00:14:28FromDiscord<smallgram> sent a code paste, see https://play.nim-lang.org/#ix=3men
00:14:40FromDiscord<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:24FromDiscord<smallgram> Welp. Suddenly it's working--so nevermind.
00:27:16FromDiscord<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:03FromDiscord<ElegantBeef> @brainproxy what do you mean "raise a key press event"
00:28:21FromDiscord<brainproxy> have the nim code I'm raising press the letter "a" or whatever
00:28:35FromDiscord<brainproxy> (edit) "raising" => "writing"
00:29:57FromDiscord<brainproxy> sent a code paste, see https://play.nim-lang.org/#ix=3meq
00:30:33FromDiscord<brainproxy> (edit) "https://play.nim-lang.org/#ix=3meq" => "https://play.nim-lang.org/#ix=3mer"
00:31:07FromDiscord<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:19FromDiscord<ElegantBeef> if you just want to go to the next iteration you can `continue`
00:31:34FromDiscord<brainproxy> nah, just that `getch()` returns and then it will go back to the top of the loop
00:31:51FromDiscord<brainproxy> which will then end because on the other thread the Atomic[bool] `running` has already been set to `false`
00:32:00FromDiscord<brainproxy> (edit) "other" => "main"
00:33:36FromDiscord<ElegantBeef> Ah rereading it seems you're attempting to prevent the blocking behaviour?
00:33:57FromDiscord<ElegantBeef> where `getCh()` blocks until it gets a key
00:34:02FromDiscord<brainproxy> yes
00:34:17FromDiscord<brainproxy> it's fine that it blocks, just want to unblock it by simulating a keypress
00:34:22FromDiscord<brainproxy> from the main thread
00:34:59FromDiscord<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:12FromDiscord<brainproxy> I tried writing to stdin but no joy
00:35:45FromDiscord<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:59FromDiscord<brainproxy> sent a code paste, see https://play.nim-lang.org/#ix=3mew
01:14:18ForumUpdaterBotNew 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:33FromDiscord<reilly> I can't make heads or tails of this error. https://hatebin.com/ylasqwqyhn Any ideas?
03:45:57FromDiscord<ElegantBeef> somewhere you're passing 13 in `0..6`
03:46:18FromDiscord<reilly> But the thing is, I'm not.
03:46:39FromDiscord<ElegantBeef> might be the library you're using or just an odd async bug
03:47:30FromDiscord<reilly> The bizarre thing is that I've made no significant changes between today and yesterday, yet it worked fine then.
03:49:20FromDiscord<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:12FromDiscord<reilly> sent a code paste, see https://play.nim-lang.org/#ix=3mgf
03:55:27FromDiscord<ElegantBeef> Did you update dimscord today?
03:55:44FromDiscord<ElegantBeef> Did you change your nim version, did you change your monitor's brightness? 😛
03:56:07FromDiscord<reilly> Nothing has changed.
03:56:24FromDiscord<reilly> It might be worth mentioning that it manages to get out the "Ready to rumble!" before kicking the bucket.
03:57:00voltistWoah I haven't been on IRC for a while
03:57:08FromDiscord<ElegantBeef> Woah it's a voltist
03:57:11FromDiscord<ElegantBeef> I remember them
03:58:00voltistWhat's new?
03:58:40FromDiscord<ElegantBeef> Wonder if there is any chance this is an issue with discord somehow reilly
03:58:46FromDiscord<ElegantBeef> If that braindead example fails
03:59:07FromDiscord<ElegantBeef> I'm going to give it a whirl what version are you on?
03:59:23FromDiscord<reilly> Nim 1.4.6, Dimscord v1.2.5
03:59:35FromDiscord<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:19FromDiscord<ElegantBeef> Runs fine here
04:01:27FromDiscord<reilly> I was dreading that...
04:01:42FromDiscord<ElegantBeef> Nothing here voltist, you?
04:02:08FromDiscord<ElegantBeef> Change your nim version, maybe something got corrupted
04:02:34FromDiscord<reilly> Well I also tried running this on a raspberry pi and digitalocean droplet, both give the same problem
04:02:40FromDiscord<reilly> and both I freshly updated
04:02:50FromDiscord<ElegantBeef> Hmm
04:02:52FromDiscord<reilly> As in, I compiled Nim from source on my pi not even 30 minutes ago
04:03:18FromDiscord<ElegantBeef> All on the same network?
04:03:34FromDiscord<reilly> Not the droplet, that's off in some digitalocean datacenter somewhere
04:03:57FromDiscord<reilly> Although granted, I've only tried the braindead example on my machine
04:04:06FromDiscord<ElegantBeef> Winblows or linsux?
04:04:36FromDiscord<reilly> My machine is Windows, the droplet and pi are linux based
04:04:39voltistEh not much
04:05:40FromDiscord<reilly> git push/pulled the braindead bot onto the droplet, exactly the same thing
04:05:52FromDiscord<reilly> I'm not superstitious, but I think I may be cursed.
04:06:30FromDiscord<reilly> were you using a cacert.pem?
04:06:48FromDiscord<ElegantBeef> Well i'm on linux so probably, i did just get that error with the windows build
04:07:17FromDiscord<ElegantBeef> the pem error not the range error
04:08:33FromDiscord<ElegantBeef> Yea no crash here in wine
04:08:59FromDiscord<reilly> Tried after deleting cacert.pem on my pi, no dice
04:09:06FromDiscord<reilly> I think I might actually be going a little bit crazy
04:09:40FromDiscord<reilly> If you're willing, the repo is knaque/gexp-spy
04:09:59FromDiscord<reilly> ah, no, you probably don't have a hypixel api key 🙃
04:10:42FromDiscord<ElegantBeef> You were getting a range error in that dummy example aswell?
04:11:39FromDiscord<reilly> Yep
04:11:46FromDiscord<ElegantBeef> same 0..13?
04:12:00FromDiscord<reilly> Always `Exception message: value out of range: 13 notin 0 .. 6`
04:12:12FromDiscord<ElegantBeef> ah yea that's what i meant
04:13:04FromDiscord<reilly> https://media.discordapp.net/attachments/371759389889003532/840803529395798016/unknown.png
04:13:47FromDiscord<reilly> I just remembered that the number 13 is associated with bad luck in certain cultures, so that's ironic
04:14:30FromDiscord<ElegantBeef> those were all compiled on their hardware?
04:14:35FromDiscord<reilly> Yep
04:14:37FromDiscord<reilly> just `nimble run`
04:15:00FromDiscord<ElegantBeef> That's not the dummy though
04:15:13FromDiscord<reilly> the dummy I run with `nim c -f -r testbot.nim`
04:15:41FromDiscord<ElegantBeef> Well time to try just a normal async function to see if you get the same error
04:18:14FromDiscord<reilly> so it must be a dimscord thing
04:18:15FromDiscord<reilly> sent a code paste, see https://play.nim-lang.org/#ix=3mgm
04:18:31FromDiscord<reilly> but a dimscord thing that only seems to affect me 🙃
04:20:26*mindhunt1r0x joined #nim
04:20:48FromDiscord<reilly> slightly more complicated test w/ hypixel api requests still works just fine
04:22:11*mindhunter0x quit (Ping timeout: 240 seconds)
04:22:34FromDiscord<reilly> Hey @krisppurg, you made the thing, any idea what's going on here?
04:24:06FromDiscord<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:37FromDiscord<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:49FromDiscord<reilly> running nim 1.4.6 and dimscord 1.2.5
04:37:23FromDiscord<Rika> Maybe discord just really doesn’t like you
04:37:45FromDiscord<ElegantBeef> Yea if it's the same token it could be related to something there not working properly
04:40:14FromDiscord<reilly> Huh, go figure, it's something to do with this particular bot.
04:40:42FromDiscord<Rika> lol probably a permission thing
04:41:11FromDiscord<reilly> If so, that's a very unhelpful crash.
04:43:09FromDiscord<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:06FromDiscord<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:30FromDiscord<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:41FromDiscord<reilly> So it can't be that it doesn't have permission to send messages
04:46:07FromDiscord<Rika> There are a lot more permissions than just that though heh
04:47:11FromDiscord<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:32FromDiscord<reilly> It sends 3 messages on startup, then updates those messages every hour.
04:48:34FromDiscord<reilly> There should be no reason for it to crash - you can see for yourself, the repo is knaque/gexp-spy
04:49:40FromDiscord<reilly> So, it's definitely a problem isolated to this one particular bot...
04:50:28FromDiscord<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:01FromDiscord<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:03FromDiscord<Rika> Does it not stack trace where it does?
04:51:04FromDiscord<Rika> Does
04:51:07FromDiscord<Rika> Dies
04:52:50FromDiscord<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:02FromDiscord<reilly> (edit) "`Exception message: value" => "'value" | "6`" => "6'"
04:53:47FromDiscord<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:26FromDiscord<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:19FromDiscord<reilly> sent a code paste, see https://play.nim-lang.org/#ix=3mgp
04:59:06FromDiscord<Rika> Might be the API changed and the library isn’t updated to handle that properly
04:59:33FromDiscord<reilly> Did Discord update its api sometime between yesterday and now?
04:59:47FromDiscord<reilly> That's not sarcastic, I'm serious.
05:00:30FromDiscord<reilly> last update was April 28, 2021 according to https://discord.com/developers/docs/change-log
05:00:37FromDiscord<Rika> I don’t know, did the library get updated yesterday
05:01:23FromDiscord<reilly> The version of Dimscord I'm using (latest release) is from december 2020
05:01:37FromDiscord<reilly> So it is old, but that doesn't change that it worked yesterday
05:02:08FromDiscord<reilly> should I try #head? I don't know if that's stable.
05:02:37FromDiscord<reilly> I guess worst it could do is crash..
05:03:52FromDiscord<reilly> braindead bot now works fine
05:03:57FromDiscord<reilly> testing the big boy
05:05:45FromDiscord<reilly> So #head works, it's just bizarre that 1.2.5 worked yesterday and not now...
05:25:16FromDiscord<mlokis> sent a code paste, see https://play.nim-lang.org/#ix=3mgx
05:50:27*NimBot joined #nim
05:55:44FromDiscord<Rika> You aren’t awaiting the threads
05:55:58FromDiscord<Rika> So they aren’t given time to run
05:56:22FromDiscord<Rika> Remember that there is no actual parallelism here, it’s all concurrent
05:56:47FromDiscord<Rika> And it’s cooperative so you have to explicitly give time to the other threads to run
05:58:05FromDiscord<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:32FromDiscord<Rika> Someone correct me if I’m wrong but this is what I know
06:06:05FromDiscord<hamidb80> In reply to @Rika "Does": Does[1] = "dies"
06:06:29FromDiscord<Rika> can’t assign string to char
06:07:29FromDiscord<hamidb80> In reply to @Rika "can’t assign string to": `Does es`[1] = "dies"
06:07:37FromDiscord<hamidb80> (edit) "`Does es`[1]" => "`Doeses`[1]"
06:07:44FromDiscord<Rika> Hm?
06:07:49FromDiscord<Rika> I don’t get it anymore lol
06:11:24FromDiscord<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:25ForumUpdaterBotNew 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:21FromDiscord<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:54FromDiscord<carpal> ah ok I just checked in the playground and it works
07:54:18FromDiscord<carpal> cast[int64]([0, 0, 0, 0, 0, 0, 0, 1])
07:54:26FromDiscord<carpal> <https://play.nim-lang.org/#ix=3mgX>
07:55:28FromDiscord<carpal> <https://forum.nim-lang.org/t/2626>
07:56:44FromDiscord<Rika> !eval echo cast[int64]([0'u8, 0, 0, 0, 0, 0, 0, 1])
07:56:48NimBot72057594037927936
07:56:56FromDiscord<Rika> is that right...
07:57:10FromDiscord<Rika> !eval echo cast[int64]([1u8, 0, 0, 0, 0, 0, 0, 0])
07:57:13NimBot1
07:57:22FromDiscord<Rika> @carpal
07:57:39FromDiscord<ElegantBeef> Yea the issue is just not telling it you wanted the literals to be bytes
07:57:41FromDiscord<carpal> ah nothing, I just fixed looking at the forum
07:57:46FromDiscord<Rika> warranty not included
07:57:48FromDiscord<carpal> thanks anyway, it wasn't a byte array
07:57:54FromDiscord<carpal> it was a int32 array
07:58:37FromDiscord<Rika> !eval echo cast[int64]([1i32, 0])
07:58:40NimBot1
08:10:55*wasted_youth2 joined #nim
08:18:17FromDiscord<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:30FromDiscord<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:41FromDiscord<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:01FromDiscord<ElegantBeef> `(len + 1) 1` just doesnt have any good exponential growth
08:42:18FromDiscord<Rika> i wonder why
08:46:06FromDiscord<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:58ForumUpdaterBotNew 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:20giacoI am not into cryptocurrencies, but is it real that nim has just received some good bitcoins? I'm very happy about this
13:10:43FromDiscord<mischa_u> Yeah, looks like they received $100,000 worth of Bitcoin a few weeks ago
13:11:03FromDiscord<mischa_u> (which is now worth $125,000)
13:11:11PMunchDamn, nice
13:11:24FromDiscord<mischa_u> https://www.blockchain.com/btc/address/1BXfuKM2uvoD6mbx4g5xM3eQhLzkCK77tJ
13:12:12FromDiscord<mischa_u> (that is the address listed on <https://nim-lang.org/donate.html>)
13:19:17FromDiscord<dom96> wtf
13:19:42FromDiscord<dom96> Whoever sent that should have probably confirmed that that address still works
13:21:24FromDiscord<Rika> well thats your responsibility isnt it?
13:21:25FromDiscord<dom96> giaco: how did you hear about this transaction?
13:21:35FromDiscord<Rika> well not your but the team's
13:23:33giacoI was just reading nim subreddit, then copypasted wallet address into random blockchain tracker
13:24:38FromDiscord<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:24giacoYeah. Actually I was interested into donating, too
13:31:22FromDiscord<dom96> You guys know any websites that can analyse a BTC address to find info about it?
13:36:36FromDiscord<zidsal> if it's real can we get someone famous to host nimconf!?
13:40:20FromDiscord<mischa_u> Obama as keynote speaker
13:41:35FromDiscord<mischa_u> (edit) "speaker" => "speaker: "Everybody's Got to Learn How to Code [in Nim]""
13:42:41FromDiscord<ArMour85> In reply to @mikeX "Obama as keynote speaker:": I validate this proposition
13:43:34FromDiscord<ArMour85> But Obama is maybe more expansive
13:46:50FromDiscord<mischa_u> Al Gore: "How I invented the Internet [and Nim]"
13:46:56FromDiscord<Rika> In reply to @dom96 "You guys know any": do you know who controls the address?
13:47:04FromDiscord<Rika> yardanico? araq?
13:48:31FromDiscord<dom96> I do know. But I think it's best I don't share it publicly 🙂
13:49:00FromDiscord<Rika> oh okay why analyse the address if you already know then lmao
13:49:16FromDiscord<dom96> I want to analyse the address that sent it
13:49:17FromDiscord<Rika> you're not gonna easily trace where it came from
13:50:03FromDiscord<dom96> It seems most of the transcations into the wallet that sent it came from Binance
13:50:12FromDiscord<dom96> so yeah, not gonna find much more about it I guess
13:50:19FromDiscord<dom96> Unless I can send a warrant to Binance 😛
13:51:43FromDiscord<mischa_u> Lol that sounds like a great way to alienate anyone who would ever want to donate to Nim
13:53:49FromDiscord<Rika> why do you want to know anyway
13:54:18FromDiscord<dom96> Curiosity, it is a lot of BTC.
13:55:37FromDiscord<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:35FromDiscord<dom96> > although referenced procedures might.
13:56:40FromDiscord<dom96> There is your answer
13:58:40FromDiscord<dom96> we should seriously set up some alerts on this BTC address lol
13:58:53FromDiscord<ArMour85> In reply to @dom96 "Curiosity, it is a": Elon Musk maybe 😋
13:59:50FromDiscord<Anuke> In reply to @dom96 "There is your answer": But how would I know which one it is?
14:00:26FromDiscord<Rika> i think adding a gcsafe pragma on the proc will tell why its not gcsafe
14:01:26FromDiscord<Anuke> Looks like `readImage` isn't GC-safe, thanks
14:12:35FromDiscord<hamidb80> how can i bechmark my nim code?
14:13:07FromDiscord<hamidb80> i think nimble has something for it
14:13:23FromDiscord<hamidb80> (edit) "it" => "benchmarking"
14:14:48*tane joined #nim
14:20:12FromDiscord<haxscramper> https://github.com/treeform/benchy for microbenchmarking
14:23:30*kenran joined #nim
14:28:44FromGitter<bung87> how to do like `except A,B as e` ?
14:29:25FromDiscord<haxscramper> I don't think it is possible if `A` and `B` are different types
14:29:51FromDiscord<haxscramper> If they share the same base type you can just use base itself
14:31:29FromGitter<bung87> hmm doesn't like python's
14:36:06FromGitter<bung87> oh, I can do `except A,B: getCurrentException()`
14:39:26FromDiscord<retkid> Can you compile nim yo java via C
14:39:53FromDiscord<Rika> nim to java? if you have a C->java then sure
14:41:01FromDiscord<retkid> (edit) "nim" => "to"
14:41:12FromDiscord<retkid> Nim really is magic
14:42:08FromDiscord<Rika> well it might not work if the C to java translator is bad so
14:42:16FromDiscord<Rika> but that's not nim's responsibility any more
14:44:15FromDiscord<retkid> Wonder if I could do Minecraft dev with Java bindings
14:44:55FromGitter<bung87> https://github.com/yglukhov/jnim have you checked ?
14:45:58FromDiscord<retkid> We’re a group of people determined to do what we want
14:46:18*aeverr_ is now known as aeverr
14:46:23FromDiscord<retkid> And nim is designed to fit anywhere
14:46:23FromDiscord<hamidb80> question
14:46:27FromDiscord<retkid> It’s a really cool ting
14:46:37FromDiscord<retkid> In reply to @hamidb80 "question": You teleported bread?
14:46:52*Vladar quit (Quit: Leaving)
14:48:18FromDiscord<hamidb80> what happens when i compile with `-d:release` that cause 6x speed?
14:53:27FromDiscord<hamidb80> i think it removes debug information
14:53:53FromDiscord<hamidb80> but what are those "debug information"?
14:54:14FromDiscord<hamidb80> i know it contains line number
14:54:21FromDiscord<hamidb80> (edit) "i know it contains line number ... " added "for eg"
14:54:24FromDiscord<hamidb80> (edit) "eg" => "e.g."
14:54:32FromDiscord<hamidb80> (edit) "number" => "numbers"
14:55:11FromDiscord<haxscramper> it also disables some runtime checks
14:55:32FromDiscord<haxscramper> with `-d:release` you can assign to `.kind` fields for example
14:55:39FromDiscord<haxscramper> some array bound checks
14:55:58FromDiscord<zidsal> I thought array bound checks needs the danger flag?
14:56:06FromDiscord<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:16FromDiscord<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:37FromDiscord<retkid> It would be very h
16:33:48FromDiscord<retkid> (edit) "h" => "hackey"
16:34:01FromDiscord<retkid> But I think it’s possible
16:34:09FromDiscord<retkid> Idk if doing
16:34:26FromDiscord<retkid> (edit) "Idk if doing ... " added "a mod would be possible"
16:40:04FromGitter<bung87> @retkid Idk , I haven't tried it and playing Minecraft
16:42:33FromGitter<bung87> what does os sendfile really do ? I have problem sendfile over ssl
16:43:18FromGitter<bung87> I found openssl have SSL_sendfile
16:47:13FromDiscord<haxscramper> In reply to @retkid "You think I could": I think @Technisha was doing something related (minecraft/nim integration in some way)
16:48:49FromDiscord<retkid> https://media.discordapp.net/attachments/371759389889003532/840993722137051146/image0.png
16:48:52FromDiscord<Rika> yup
16:49:08FromDiscord<retkid> This is what the plugin code looks like
16:51:47FromDiscord<retkid> https://media.discordapp.net/attachments/371759389889003532/840994466928001044/image0.png
16:51:58FromDiscord<retkid> Java is a very ugly language
16:52:10FromDiscord<retkid> But yeah the java bridge should work for this
16:53:01FromDiscord<retkid> In reply to @haxscramper "I think <@!470131488856211476> was": Probably doing the windows version which has likeC support iirc
17:10:06saemAnyone 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:20FromDiscord<carpal> https://media.discordapp.net/attachments/371759389889003532/841028830827249724/unknown.png
19:08:24FromDiscord<carpal> https://media.discordapp.net/attachments/371759389889003532/841028845318832138/unknown.png
19:08:28FromDiscord<carpal> are you removing nil?
19:08:33FromDiscord<carpal> nim version 1.4.2
19:08:41FromDiscord<carpal> strings are by default ""?
19:11:20FromDiscord<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:57Amun_Rayes
19:22:34FromDiscord<konsumlamm> since at least 1.0
19:23:14FromDiscord<mlokis> is nim regex thread safe?
19:48:19FromDiscord<jtiai> sent a code paste, see https://play.nim-lang.org/#ix=3mkP
19:57:27FromDiscord<jtiai> So I could write in my code something like `cpu.LDrr("A", "B")` (or something like that)
19:59:50ForumUpdaterBotNew thread by Bung: Sendfile over ssl, see https://forum.nim-lang.org/t/7956
20:02:55FromGitter<bung87> @jtiai https://nim-lang.org/docs/manual.html#templates-identifier-construction does this fit your needs?
20:04:17FromDiscord<jtiai> That might do it.
20:22:14ForumUpdaterBotNew 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:31FromDiscord<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:15FromDiscord<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:53FromDiscord<ElegantBeef> Yea new runtime not nearly as nice https://media.discordapp.net/attachments/371759389889003532/841055647164661770/unknown.png
20:55:16FromDiscord<treeform> I saw the RFC, i StringStream would still be slower.
20:55:25FromDiscord<treeform> But yeah that bench shows they are nearly identical.
20:55:36FromDiscord<treeform> (edit) "I saw the RFC, i ... StringStream" added "thought"
20:55:55FromDiscord<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:05FromDiscord<treeform> well it was growing it not by 2
20:56:13FromDiscord<treeform> which does not amortize as well.
20:56:24FromDiscord<ElegantBeef> Did your override the setlen?
20:56:28FromDiscord<treeform> no
20:56:50FromDiscord<ElegantBeef> So then i dont see the difference in both cases a `setLen(len + size(t))` was being done
20:57:12FromDiscord<treeform> what was the fix then?
20:57:39FromDiscord<ElegantBeef> I changed the growth rate, but i could've sworn i seen the same setlen call
20:58:18FromDiscord<treeform> I think setLen grows stuff by 2
20:58:35FromDiscord<treeform> I do use nearly identical code: https://github.com/treeform/flatty/blob/master/src/flatty/binny.nim#L41
20:59:03FromDiscord<ElegantBeef> Yea it's odd, but i'll take it as a win 😄
20:59:17FromDiscord<treeform> what change did you make to StringStream?
20:59:46FromDiscord<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:08FromDiscord<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:07FromDiscord<ElegantBeef> It allocates roughly 30 thousand more characters with a growth rate of 2
21:03:24FromDiscord<ElegantBeef> So yea not a memory efficient optimization, just odd
21:04:41FromDiscord<ElegantBeef> You might be able to use similar logic to make a fast binny serializer, but no clue
21:09:11FromDiscord<treeform> looks complex I would just 2 and not allow chaining that
21:09:24FromDiscord<treeform> but its great that this was discovered, thank you for making the changes
21:10:41FromDiscord<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:46FromDiscord<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:58FromDiscord<ElegantBeef> (edit) "string" => "stream"
21:13:25FromDiscord<ElegantBeef> Plus there is the whole `lto` compilation which without just causes all external modules to look slow
21:13:30FromDiscord<treeform> Well I use vtune to look at streams
21:13:38FromDiscord<treeform> and it was saying the dynamic dispatch was slow
21:13:47FromDiscord<treeform> So I made the wrong conclusion too
21:13:51FromDiscord<treeform> but I did use more tools
21:14:03FromDiscord<ElegantBeef> Hmm
21:15:40FromDiscord<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:02FromDiscord<ElegantBeef> It's a bit odd that the cause changed, now i'm curious if there is a reason for that
21:18:11FromDiscord<ElegantBeef> Though if you tested on arc/orc that'd explain it
21:18:54FromDiscord<ElegantBeef> The `of` operation on `newRuntime` is apparently very very slow
21:19:13*tane quit (Quit: Leaving)
21:27:10FromDiscord<Nisha's alt> ~~How hard would it be to wrap Dimscord for use in Python?-~~
21:28:39FromDiscord<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:14FromDiscord<treeform> I am stuck on this perf puzzle a little bit, it appears using arrays in nim is slower then using objects.
21:30:23FromDiscord<treeform> If you want bench perf puzzles here is a big one: https://gist.github.com/treeform/326b96e48743424c1d5e4dcb17402715
21:31:13FromDiscord<treeform> Why is `a[i] = v` slower then `a.arr[i] = v` ?
21:31:33FromDiscord<treeform> Why is `a[i] = v` slower then `cast[ptr float32](cast[uint64](a.addr) + i.uint64 sizeof(float32).uint64)[] = v` ?
21:31:42FromDiscord<treeform> Makes no sense! My hair is falling out.
21:32:14*vicfred joined #nim
21:32:41FromDiscord<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:32FromDiscord<ElegantBeef> I guess i can check it out to get my hair pulled out 😄
21:34:43FromDiscord<treeform> Only if you want a deep rabbit hole
21:52:10FromDiscord<DumbMahreeo> In reply to @Rika "<@!282246039526834177> is something like": Yes, sorry for not replying, I've been quite bust
21:52:22FromDiscord<DumbMahreeo> (edit) "bust" => "busy lately"
21:52:32FromDiscord<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:39FromDiscord<reilly> sent a code paste, see https://play.nim-lang.org/#ix=3mlk
21:56:08FromDiscord<reilly> As in, throw a compile-time error if `let` or `const` is used instead.
21:56:37FromDiscord<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:08ForumUpdaterBotNew 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:43FromDiscord<exelotl> @reilly I can't think of a way, even with term-rewriting macros...
23:02:32FromDiscord<exelotl> (though it might be possible with those)
23:03:32FromDiscord<reilly> No sweat. I thought I remembered there being one, but I'm probably just imagining it.
23:23:07FromDiscord<ElegantBeef> @exelotl @reilly Nope you can use term rewriting macros, actually surprisingly simple https://play.nim-lang.org/#ix=3mlH
23:24:24FromDiscord<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:57FromDiscord<exelotl> oh! I was missing the brackets
23:25:31FromDiscord<exelotl> had `template check{let a = b}` and it was complaining about unexpected let
23:25:36*johnnynitwits joined #nim
23:26:00FromDiscord<ElegantBeef> Yea i read the TRM docs like 5 times to reason that one out
23:26:42FromDiscord<ElegantBeef> And for instance you can add more introspection to allow aliasing just not construction https://play.nim-lang.org/#ix=3mlJ
23:31:10FromDiscord<ElegantBeef> Ok now to ram my head into the wall of treeforms problem
23:44:05FromDiscord<ElegantBeef> @treeform found a solution to your slow problem, do less maths 😛
23:44:17FromDiscord<ElegantBeef> https://media.discordapp.net/attachments/371759389889003532/841098273112064031/unknown.png
23:44:48FromDiscord<ElegantBeef> Only actually need a single cast
23:44:59FromDiscord<treeform> Why is the vec3array slower?
23:45:08FromDiscord<ElegantBeef> It's all the same with`lto`
23:45:26FromDiscord<ElegantBeef> with the old runtime atleast
23:46:38FromDiscord<ElegantBeef> Benchmarking is hard so i can only say "i think" it's faster and not just completely removed
23:47:24FromDiscord<ElegantBeef> If you're using the assignment from other modules that's why
23:48:06FromDiscord<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:31FromDiscord<ElegantBeef> So without `lto` you can write a faster iterator than the system provided ones
23:54:27FromDiscord<ElegantBeef> Atleast with lto and the changes i made it optimizes away the same as the `arr` implementation
23:54:37FromDiscord<ElegantBeef> So take that with a grain of salt 😄
23:57:56FromDiscord<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:01FromDiscord<ElegantBeef> I can say though that `cast[ptr UncheckedArray[float32](a.addr)[i + 1] = v` is just nicer than the other method 😄