<< 28-08-2023 >>

01:07:36*krux02 quit (Remote host closed the connection)
01:22:00*lucasta_ joined #nim
03:14:16FromDiscord<that_dude.> Juggling generics, inheritance and distinct types is kinda hard
03:17:16FromDiscord<that_dude.> Elegantbeef I'm throwing a hail Mary your way before I give up trying to use what I have and just go inheritance the entire way just to avoid distincts n stuff https://play.nim-lang.org/#ix=4EJa
03:17:29FromDiscord<that_dude.> This code won't compile because it can't find the right `add` proc
03:21:42FromDiscord<Elegantbeef> I mean using aliases like this is always going to be an issue
03:21:58FromDiscord<that_dude.> Sad
03:22:08FromDiscord<Elegantbeef> I mean they're not existential types
03:22:11FromDiscord<that_dude.> But the feel so "cleen"
03:22:38FromDiscord<that_dude.> Is it better to always wrap them in an object then?
03:22:46FromDiscord<Elegantbeef> Or a distinct
03:22:59FromDiscord<that_dude.> I am using distinct tho
03:23:08FromDiscord<Elegantbeef> Not for EventContainer
03:23:41FromDiscord<that_dude.> I'll mess with distincts all the way down for a set
03:23:45FromDiscord<that_dude.> sec
03:27:54FromDiscord<that_dude.> Is there a way I can do something similar to `object of seq[T]`? I know it doesn't work because seq is considered a final type right now
03:28:16FromDiscord<Elegantbeef> `distinct seq[T]`
03:28:24FromDiscord<that_dude.> Fair enough
03:28:25FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=4EJd
03:28:59FromDiscord<that_dude.> Ah thanks
03:29:15FromDiscord<that_dude.> I remember seeing type traits, but got scared away lol
03:30:10FromDiscord<Elegantbeef> It's not even needed you can just do `seq[T](c).add(v)`
03:31:20FromDiscord<Elegantbeef> This does sorta relate to the row polymorphism stuff i've been doing 😄
03:31:44FromDiscord<Elegantbeef> Instead of using inheritance a `type MyName {.join: BaseEvent.} = object`
03:32:12FromDiscord<Elegantbeef> https://github.com/beef331/nimtrest/blob/master/rowed.nim#L91-L116
03:32:39FromDiscord<Elegantbeef> Sadly though have not got a way to select the most precise row
03:35:22FromDiscord<that_dude.> So why does `seq[Move_state](c).add(v)` work but not `EventContainer[Move_state](c).add(v)`?
03:36:14FromDiscord<that_dude.> Or did I just not define the chain to `seq[T` well enough
03:36:44FromDiscord<Elegantbeef> Seems like a bug if it doesnt work
03:41:31FromDiscord<ravinder387> can pixie compile to javascript?
03:42:49FromDiscord<Elegantbeef> So the issue seems to be that it loses it's mutability on conversion
03:42:50FromDiscord<Elegantbeef> Which is not right
03:43:44FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=4EJg hmm
03:45:26FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=4EJj yea nested generic distincts seem to cause this
03:46:17FromDiscord<Elegantbeef> Actually seems it might be builtin types https://play.nim-lang.org/#ix=4EJi
03:54:23FromDiscord<that_dude.> Should I make a bug report?
03:54:35FromDiscord<Elegantbeef> Probably
03:55:14FromDiscord<that_dude.> Sounds good to me
04:33:46*SebastianM joined #nim
04:51:33*lucasta_ quit (Quit: Quit)
05:09:00*advesperacit joined #nim
05:12:24*SebastianM quit (Quit: -a- IRC for Android 2.1.59)
05:40:54NimEventerNew thread by Zeldapedia: More info on NimMain procedure, see https://forum.nim-lang.org/t/10446
05:52:42*kenran joined #nim
05:54:04FromDiscord<odexine> i'm forgetting, what kind of libraries do most people use to create parsers/combinators nowadays? i'm still using npeg and was wondering about other solutions
06:02:21FromDiscord<arathanis> In reply to @odexine "i'm forgetting, what kind": LEX/YACC is pretty common
06:02:26FromDiscord<arathanis> i often just write bespoke parsers
06:02:35FromDiscord<amaank404> my vscode is broken
06:02:40FromDiscord<arathanis> though for ergonomics i love parser/combinators
06:02:45FromDiscord<arathanis> (edit) "parser/combinators" => "parser combinators"
06:02:50FromDiscord<arathanis> (edit) "though for ergonomics i love parser combinators ... " added "or combinatorial parsers"
06:02:56FromDiscord<amaank404> what extension am i supposed to use?
06:03:17FromDiscord<amaank404> this nim 2 has broken my vscode autocomplete
06:03:18FromDiscord<arathanis> In reply to @amaank404 "what extension am i": i use the one by nimsaem
06:03:27FromDiscord<amaank404> that aint working no more
06:03:33FromDiscord<arathanis> hasnt broken for me
06:03:35FromDiscord<amaank404> not properly at least
06:03:41FromDiscord<arathanis> you might have just run up against nimsuggest blowing you out
06:03:44FromDiscord<arathanis> its notorious for that
06:03:52FromDiscord<arathanis> try reloading your workspace and giving it some time
06:04:00FromDiscord<arathanis> it can memory leak like crazy
06:04:03FromDiscord<amaank404> In reply to @arathanis "you might have just": somwhat like that, I type: object and it turns it to something completely different
06:04:24FromDiscord<arathanis> yeah nimsuggest just up and dies sometimes
06:04:34FromDiscord<amaank404> so what do you suggest?
06:04:37FromDiscord<amaank404> restart?
06:04:38FromDiscord<arathanis> if you search this channel for "nimsuggest" you can see it talked about like every week
06:04:45FromDiscord<arathanis> In reply to @amaank404 "restart?": pretty much.
06:04:51FromDiscord<arathanis> either reload vs code using the reload window function
06:04:53FromDiscord<arathanis> or restarts vs code
06:05:09FromDiscord<arathanis> or just give it some time, mine sometimes figures its shit out
06:05:20FromDiscord<arathanis> nimsuggest is a lobotomized compiler and it shows lol
06:05:38FromDiscord<arathanis> usually if its behaving really badly ill do reload window
06:05:39FromDiscord<amaank404> Why cant I have just object https://media.discordapp.net/attachments/371759389889003532/1145600062353850488/image.png
06:05:48FromDiscord<arathanis> then take a 5m break to let nimsuggest figure its shit out again
06:05:54FromDiscord<arathanis> it can take a while to reinitialize and behave
06:06:02FromDiscord<amaank404> ig
06:06:24FromDiscord<amaank404> I was porting my old neural networks project to nim 2
06:06:38FromDiscord<amaank404> and this is pretty much slowwing me down
06:07:21FromDiscord<Elegantbeef> Hit escape and carry on
06:07:22FromDiscord<Elegantbeef> There is no error here
06:07:34FromDiscord<amaank404> how?
06:07:42FromDiscord<amaank404> cant it suggest me the keyword "object"
06:08:14FromDiscord<amaank404> everytime I press space right after it, it accepts the suggestion
06:08:16FromDiscord<Elegantbeef> It's suggesting types as you're in a type code
06:08:41FromDiscord<amaank404> In reply to @amaank404 "everytime I press space": what about this?
06:08:55FromDiscord<Elegantbeef> I think you can configure what button accepts suggestions
06:09:34FromDiscord<Elegantbeef> No clue, do not use vscode
06:10:10FromDiscord<amaank404> what do u use?
06:10:16FromDiscord<amaank404> i need to know
06:10:25FromDiscord<amaank404> what is the most optimal for nim
06:10:29FromDiscord<amaank404> in ur opinions
06:12:50FromDiscord<amaank404> lemme reframe it, what ide do you use?
06:13:51FromDiscord<Elegantbeef> I presently use nvim
06:13:58FromDiscord<arathanis> called it https://media.discordapp.net/attachments/371759389889003532/1145602149980590110/image.png
06:14:21FromDiscord<amaank404> so I am the only non chad here
06:14:24FromDiscord<Elegantbeef> I used kate for a while
06:14:41FromDiscord<odexine> i like the neovim plugin more than any of the other ones, it works most of the time
06:14:56FromDiscord<odexine> i moved to vscode because i kinda stopped like tui editing
06:15:22FromDiscord<amaank404> In reply to @Elegantbeef "I used kate for": are you a bot? I cant help but notice
06:15:25FromDiscord<arathanis> ive used both vim and vscode and i like both for different reasons
06:15:36FromDiscord<arathanis> In reply to @amaank404 "are you a bot?": they are on IRC using the bridge
06:15:43FromDiscord<Elegantbeef> Fuck IRC
06:15:46FromDiscord<Elegantbeef> I'm a matrix boy
06:15:52FromDiscord<amaank404> oh
06:15:52FromDiscord<arathanis> the bot is forwarding our messaging between the two platforms
06:15:58FromDiscord<arathanis> In reply to @Elegantbeef "I'm a matrix boy": ok sure, matrix
06:16:26FromDiscord<amaank404> I like centralization, change my mind
06:16:51FromDiscord<amaank404> I heard intelliJ has a good extension too
06:17:00FromDiscord<Elegantbeef> You own nothing, discord da poo poo
06:17:14FromDiscord<amaank404> do i need to own it?
06:18:06FromDiscord<Elegantbeef> Do you need to own your computer?
06:18:41FromDiscord<amaank404> I dont
06:18:55FromDiscord<Elegantbeef> Sure is nice though isnt it?
06:19:02FromDiscord<amaank404> ummm
06:19:02FromDiscord<odexine> but they said they dont
06:19:07FromDiscord<amaank404> managing a server is a hassle
06:19:10FromDiscord<odexine> no
06:19:15FromDiscord<odexine> thats not what beef meant lol
06:19:21FromDiscord<odexine> do you own your desktop/laptop
06:19:34FromDiscord<amaank404> yes ofc, but I dont need to own a matrix server for the sake of talking
06:19:44FromDiscord<amaank404> and managing servers is a hassle
06:19:53FromDiscord<Elegantbeef> They said they don't need to own it not "I don't own my pc"
06:20:23FromDiscord<amaank404> this debate is exceeding my level of comprehensibility
06:20:28FromDiscord<amaank404> I shall chicken out this very moment
06:21:14FromDiscord<Elegantbeef> Well you do not need to host your own server, you can of course use other's server. Just own less, you still have your control over your client.
06:21:21FromDiscord<Elegantbeef> But yes this is a silly conversation
06:21:32FromDiscord<Elegantbeef> Having control over your own things is always good in my book
06:22:16FromDiscord<amaank404> yes, its great to own, but the maintainence part of owning, no i am happy with centralized services
06:22:32FromDiscord<Elegantbeef> So use a homeserver someone else hosts
06:44:32*PMunch joined #nim
06:53:28FromDiscord<Phil> In reply to @amaank404 "I heard intelliJ has": its alright. Autocomplete is one heck of a lot faster than nimsuggest.↵I just can't get myself to stick with intellij
06:54:53FromDiscord<nnsee> In reply to @amaank404 "yes, its great to": most server distros make maintenance pretty painless via automation. I have around 10 server machines and I ssh into most of them less than once a year
06:55:36FromDiscord<amaank404> I surrender, I believe whatever you like, I love it
06:55:42FromDiscord<amaank404> (edit) "believe" => "believe:"
06:55:47FromDiscord<nnsee> what?
06:56:11FromDiscord<amaank404> I have given up the discussion, I have exhausted my mental capacity to talk anymore
06:57:14FromDiscord<nnsee> um sorry
06:57:21FromDiscord<nnsee> was just offering my experience
06:57:50FromDiscord<amaank404> nah bro, my bad
07:15:29*enthus1ast joined #nim
08:41:06FromDiscord<frobnicate> In reply to @amaank404 "lemme reframe it, what": None, just VSCode because I'm stupid
09:01:42FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4EK4
09:04:16FromDiscord<heysokam> if `results == 33`, and `uniques == 32`.... how is it possible that `results - uniques` returns 0? 🧩
09:05:06FromDiscord<heysokam> Can `OrderedSet`s contain duplicates or something? 🤔
09:07:10PMunchWild guess is that your hash method for BinTarget is bad
09:07:54PMunchOr rather that it is different than the one for string
09:08:00PMunchHard to tell though without any data
09:08:43FromDiscord<heysokam> In reply to @PMunch "Wild guess is that": i don't have one
09:08:47FromDiscord<frobnicate> You also don't need to do `ctargets.pairs`
09:08:57PMunchTrue, but that shouldn't do anything wrong
09:09:04FromDiscord<heysokam> In reply to @frobnicate "You also don't need": its debug code, that's leftovers
09:09:06PMunchYou don't have any what?
09:09:14FromDiscord<heysokam> In reply to @PMunch "You don't have any": hash function
09:09:18FromDiscord<heysokam> how do you create one?
09:09:34FromDiscord<heysokam> or method, rather
09:09:35PMunchJust implement `proc hash(x: <your type>): Hash`
09:09:49FromDiscord<Elegantbeef> They're using the default hash and `==` proc
09:09:50PMunchProcedure, I don't think hash can be a method..
09:10:11PMunchThere's a default hash now?
09:10:28FromDiscord<heysokam> i havent' implemented one, so there must be
09:10:41FromDiscord<Elegantbeef> Always has been
09:10:41FromDiscord<Elegantbeef> Just look at results and uniques2 before the assertion
09:10:41FromDiscord<Elegantbeef> default hash just never worked for `ref T`
09:10:53FromDiscord<heysokam> I was surprised i could even use sets when i started, thought i needed something but they just worked
09:11:17PMunchAah I see
09:11:24FromDiscord<heysokam> In reply to @Elegantbeef "Just look at results": they contain 33 and 32 items. i don't think I can comb manually to find differences
09:11:42PMunchHow big are the things you put in there?
09:12:03FromDiscord<heysokam> In reply to @PMunch "How big are the": which things?
09:12:13PMunchBinTarget and string
09:12:19PMunch33 items isn't that much..
09:12:36PMunchUnless you're throwing massive strings in, then it would be a pain to verify manually
09:13:28FromDiscord<heysokam> In reply to @PMunch "33 items isn't that": well be my guest https://media.discordapp.net/attachments/371759389889003532/1145647325486788668/image.png
09:14:38FromDiscord<heysokam> https://media.discordapp.net/attachments/371759389889003532/1145647617158688828/image.png
09:15:10FromDiscord<heysokam> my brain cannot process this many items and remember what I just read 2milliseconds ago
09:15:40FromDiscord<heysokam> plus that's just the output targets, each of those entries contains 10s of source files to build them
09:16:21FromDiscord<heysokam> in any case, is there any implementation of hash i can take inspiration from?↵don't know how to start writing one
09:17:39FromDiscord<frobnicate> @heysokam I can't replicate your bug so I think it's your types
09:17:44PMunchAh.. You're on Linux
09:17:47PMunchWindows*
09:18:16PMunchI would've just piped that output through some command line stuff and gotten the unique entries..
09:18:24FromDiscord<heysokam> In reply to @frobnicate "<@186489007247589376> I can't replicate": yeah must be the hash function like they mentioned
09:18:44PMunchCome to think of it I believe HashSet in Nim uses buckets, so hash collision shouldn't be a problem (other than for perf reasons)
09:18:53NimEventerNew Nimble package! knot - tie compile-time values to types under names, see https://github.com/metagn/knot
09:19:48FromDiscord<frobnicate> Does the built-in hash function create a hash from the fields?
09:20:12FromDiscord<heysokam> https://github.com/nim-lang/Nim/blob/ef63d47ecd10b4f1cd96da7a491a85fee6ab5965/lib/pure/collections/sets.nim#L862-L868↵How is this even working anyway?↵what is `!$` and `!&`?
09:21:45FromDiscord<Elegantbeef> Yes the hash proc hashes fields
09:23:57FromDiscord<heysokam> ?
09:25:00FromDiscord<Elegantbeef> The operators are defined inside the module `!` I guess is a "hash" prefix and the rest is the same so it's "hashify" and "hash concat" respectively
09:25:52FromDiscord<Elegantbeef> If you follow the example it'll work, but there is likely no reason to define your own hash for your type
09:26:22FromDiscord<heysokam> how can i make a simple `thing.trg (which is a string) -> get hash from it`?
09:26:40FromDiscord<heysokam> In reply to @Elegantbeef "If you follow the": well it is failing, so there is the reason
09:26:46FromDiscord<Elegantbeef> Make a hash function that hashes the trg field
09:26:59FromDiscord<Elegantbeef> You also need a `==` proc that only compares that field
09:27:01FromDiscord<heysokam> the key part of that sentence was the how lol
09:27:09FromDiscord<heysokam> i understand that much
09:27:19PMunchheysokam, as I said, the set module uses buckets, so even with colliding hashes you shouldn't get this behaviour
09:27:23FromDiscord<heysokam> but not the how, because that function is cryptic as hell to me
09:27:26FromDiscord<Elegantbeef> `proc hash(myObj: MyType): Hash = hash(myObj.trg)`
09:27:43FromDiscord<heysokam> In reply to @PMunch "<@186489007247589376>, as I said,": > shouldnt↵well, i am... so...
09:27:54FromDiscord<heysokam> In reply to @Elegantbeef "`proc hash(myObj: MyType): Hash": ty
09:28:19FromDiscord<Elegantbeef> Like I said you also need to define a `==` proc
09:28:31PMunchAs you can see here collisions work fine: https://play.nim-lang.org/#ix=4EK8
09:28:52FromDiscord<Elegantbeef> For Nim's stdlib hash objects to work the `==` and `hash` have to produce the same result
09:30:26PMunchBut you can define `proc hash(x: BinTarget): Hash = hash(x.trg)` and `proc ==(x, y: BinTarget): bool = x.trg == y.trg`
09:30:39PMunchTo see if you still get the same error
09:33:02FromDiscord<heysokam> im getting big spam of `true, false, true false` in cli after adding those two
09:33:24FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4EKa
09:34:08FromDiscord<heysokam> oh... it was a later spot that was happening later, nvm
09:34:25FromDiscord<heysokam> so yeah, seems like it worked now, they are the same length so no assert is hit
09:38:40FromDiscord<heysokam> my best guess of what is happening is that the same target binary name is built from different source files, so it collides by trg but not by files... so the hash turns out different 🤔
09:49:32*def- quit (Quit: -)
09:57:40FromDiscord<frobnicate> what
09:58:57*armin joined #nim
10:01:25FromDiscord<heysokam> In reply to @frobnicate "what": > build/file.so <- file1.c file2.c↵> build/file.so <- file1.c file2.c file3.c file4.c
10:01:33FromDiscord<frobnicate> Oh
10:03:01arminyou have to frobnicate the foo!
10:06:49FromDiscord<heysokam> sent a long message, see http://ix.io/4EKh
10:15:01*def- joined #nim
10:45:17*blop joined #nim
11:00:23*azimut quit (Remote host closed the connection)
11:00:56*azimut joined #nim
11:47:24*jmdaemon quit (Ping timeout: 248 seconds)
12:14:33FromDiscord<heysokam> I have a line that is `9114` characters long and is being split incorrectly at (seemingly) random places by `strutils.splitLines`↵Is this a limitation of splitLines, a bug, or something else im missing?
12:15:19FromDiscord<heysokam> (edit) "I have ... afile" added "some lines in" | "line" => "file" | "afilethat ... islong," added "are really long, one of them" | "long" => "long," | "is" => "they are"
12:16:01FromDiscord<odexine> can you send a min repro? that's a vague description
12:18:06FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4EKx
12:19:00FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4EKy
12:19:40FromDiscord<heysokam> (edit) "https://play.nim-lang.org/#ix=4EKy" => "https://play.nim-lang.org/#ix=4EKz"
12:19:40FromDiscord<ieltan> sent a code paste, see https://play.nim-lang.org/#ix=4EKA
12:20:18FromDiscord<heysokam> In reply to @ieltan "Is there a way": afaik you can write templates for use, or mark things with them, but not define behavior for pragmas in any way
12:20:45FromDiscord<ieltan> alright then, thanks !
12:23:22FromDiscord<odexine> i cannot repro the bug @heysokam
12:23:34FromDiscord<heysokam> is there a limit on the size of strings in the VM?
12:23:50FromDiscord<heysokam> i believe im reading/writing statically 🤔
12:24:24FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4EKD
12:24:29FromDiscord<odexine> i do not get the problem in static: context either
12:24:42FromDiscord<odexine> that's not calling it static
12:24:54FromDiscord<odexine> that's just under a when condition
12:25:29FromDiscord<odexine> the 11k long line is not giving me a problem
12:25:35FromDiscord<heysokam> sometimes i dont get it either
12:25:36FromDiscord<enthus1ast> me neither
12:27:08FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4EKF
12:27:17FromDiscord<heysokam> (edit) "https://play.nim-lang.org/#ix=4EKF" => "https://play.nim-lang.org/#ix=4EKG"
12:27:35FromDiscord<heysokam> this one broke at a different spot https://media.discordapp.net/attachments/371759389889003532/1145696174083416211/broken.sh
12:28:08FromDiscord<heysokam> basically its those two spots, and another one that is something like `t.o somefile.o somefile.o`
12:28:28FromDiscord<heysokam> but its super random, sometimes it just works normally
12:28:44FromDiscord<heysokam> (edit) "but its super random, sometimes it just works normally ... " added "and doesn't cut any lines"
12:31:02FromDiscord<enthus1ast> which nim version do you use? @heysokam
12:31:29FromDiscord<nafeesurrehman> 💚
12:34:14FromDiscord<heysokam> In reply to @enthus1ast "which nim version do": `stable`
12:40:38FromDiscord<heysokam> @odexine @enthus1ast the line is cut at exactly `2499` characters. Feels like a very specific number
12:40:56FromDiscord<odexine> In reply to @heysokam "`stable`": version number please
12:41:48FromDiscord<heysokam> sent a long message, see http://ix.io/4EKL
12:42:04FromDiscord<heysokam> (edit) "long message," => "code paste," | "http://ix.io/4EKL" => "https://play.nim-lang.org/#ix=4EKM"
12:42:32FromDiscord<enthus1ast> when i put the code in a static block the compiler complains about to many iterations, so i compile with\:↵↵nim c -f -r --maxLoopIterationsVM\:5000000000 thefile.nim
12:43:16FromDiscord<heysokam> mine is not complaining, its just failing to do manage the lines
12:44:00FromDiscord<heysokam> maybe make is giving a bad output?
12:45:58FromDiscord<heysokam> yeah i think make is giving bad input
12:46:27FromDiscord<heysokam> great news ⚰️, more reasons to rely on it forsure 😦
12:47:03FromDiscord<heysokam> (edit) "input" => "data"
12:49:15*Amun-Ra quit (Ping timeout: 245 seconds)
12:49:58FromDiscord<heysokam> `-j8` might be the cause of the randomness after all
12:50:13FromDiscord<enthus1ast> oh \:D
12:51:12FromDiscord<enthus1ast> yeah that's messing up the output
12:52:15FromDiscord<enthus1ast> my duckduckgofu\: --output-sync
12:52:25FromDiscord<enthus1ast> maybe this helps
12:55:56FromDiscord<heysokam> In reply to @enthus1ast "my duckduckgofu\: --output-sync": is that a make switch? 🤔
13:01:30*Amun-Ra joined #nim
13:03:52FromDiscord<odexine> prolly
13:04:34FromDiscord<enthus1ast> yes https://www.gnu.org/software/make/manual/make.html#Parallel-Output
13:08:09*xet7_ joined #nim
13:10:01FromDiscord<heysokam> In reply to @enthus1ast "yes https://www.gnu.org/software/make/manual/make.": i had no idea about this. it explains everything really↵i have been testing it with a loop that runs the process 20 times and it hasn't crashed a single time without the -j8 switch↵will try this option afther that is finished, feels like this is the heart of the probl, basically
13:11:10*xet7 quit (Ping timeout: 250 seconds)
13:18:46FromDiscord<heysokam> yeah i added the j8 back and it crashed like on the third iteration. while the other two options (--output-sync and no-j8) run perfect without crashing the whole way↵seems like it was make after all
13:19:04FromDiscord<heysokam> (edit) "yeah i added the j8 back and it crashed like on the third iteration. while the other two options (--output-sync and no-j8) run perfect ... without" added "for the 20 tests"
13:24:58FromDiscord<enthus1ast> nice!
14:01:59*PMunch quit (Quit: Leaving)
15:09:19FromDiscord<jaar23> sent a code paste, see https://play.nim-lang.org/#ix=4ELr
15:11:01FromDiscord<griffith1deadly> In reply to @jaar23 "what is the bestway": spawn waitFor client_conn() ?
15:21:54FromDiscord<enthus1ast> async thread ?
15:23:03FromDiscord<enthus1ast> @jaar23\: your code has several problems
15:23:13FromDiscord<enthus1ast> maybe you should look at the async docs again
15:26:26FromDiscord<enthus1ast> for example the asyncnet docs have a nice example of a tcp server\: https://nim-lang.org/docs/asyncnet.html
15:54:10FromDiscord<ieltan> lol
15:55:05FromDiscord<alehander92> nice cross-forum ping achievement 😄
15:55:15FromDiscord<itr_> I'm surprised that hasn't happened before
15:55:39FromDiscord<Chronos [She/Her]> Lmao
15:55:43FromDiscord<Chronos [She/Her]> Same tbh
15:55:45FromDiscord<micha_ohne_el> whoever's the admin here should probably take away that bot's (and generally all user's) @ everyone permissions :D
15:55:56FromDiscord<micha_ohne_el> (edit) "user's)" => "users')"
15:56:03FromDiscord<Chronos [She/Her]> Users can't @ everyone
15:56:15FromDiscord<micha_ohne_el> you sure?
15:56:16FromDiscord<catnowblue> bro just pinged everyone from nim forum 💀
15:56:18FromDiscord<micha_ohne_el> wanna try? :D
15:56:22FromDiscord<alehander92> i mean, it's genius
15:56:22FromDiscord<rainbowasteroids> webhook just did
15:56:28FromDiscord<Chronos [She/Her]> But I'm betting the permissions in the Information category are janked
15:56:28FromDiscord<vmcs> that's so funny lmao
15:56:29FromDiscord<dithpri> In reply to @alehander92 "i mean, it's genius": @everyone
15:56:48FromDiscord<dithpri> (edit) "@everyone" => "@everyone↵e: meant to reply to message above"
15:56:51FromDiscord<micha_ohne_el> well okay
15:57:28FromDiscord<pk.kyle> lol nice try
15:57:32FromDiscord<n00nehere> lmao
15:57:48FromDiscord<pk.kyle> can mods turn off ping in that channel?
15:58:02FromDiscord<pk.kyle> and maybe it's a good idea to switch to matrix lol
15:58:18FromDiscord<n00nehere> there already is a matrix channel
15:58:31FromDiscord<jaar23> In reply to @griffith1deadly "spawn waitFor client_conn() ?": Tried but not sure is that correct way
15:58:33FromDiscord<rainbowasteroids> yeah this chat has been bridged for years now
15:58:40FromDiscord<odexine> i believe it is because it is a webhook that it went through
15:59:08FromDiscord<griffith1deadly> In reply to @jaar23 "Tried but not sure": async thread literally not good way bro
16:00:21FromDiscord<phytolizer> This channel is on irc and matrix, it's all synced
16:00:32FromDiscord<jaar23> In reply to @griffith1deadly "async thread literally not": I managed to make it via net and spawn already, but trying up the game a bit to learn about async. So I picked aysncnet
16:00:48FromDiscord<jaar23> In reply to @griffith1deadly "async thread literally not": Mind sharing why?
16:00:52FromDiscord<griffith1deadly> In reply to @jaar23 "I managed to make": async always onethreaded
16:01:04FromDiscord<griffith1deadly> because has thread local event loop
16:02:03FromDiscord<Chronos [She/Her]> If you use asynchronous programming in another thread, you should expect for anything using a future from it to break
16:02:35FromDiscord<Chronos [She/Her]> Since they don't share schedulers (the thing that handles what piece of async code runs at what time)
16:02:44FromDiscord<Chronos [She/Her]> As far as I understand at least
16:02:58FromDiscord<Chronos [She/Her]> Generally you should stick to one or the other really
16:03:01FromDiscord<jaar23> In reply to @griffith1deadly "because has thread local": Thread local meaning it would required to constantly poll by main thread?
16:03:52FromDiscord<griffith1deadly> In reply to @jaar23 "Thread local meaning it": no. each thread has its own async event loop
16:04:57FromDiscord<jaar23> In reply to @griffith1deadly "no. each thread has": Yea, so each thread would have it's own event loop. But I'm trying to run multiple async thread like multiple event loop
16:06:13FromDiscord<griffith1deadly> for this i think you can make a shared table and a pool of threads handling events, but it's dangerous to synchronize futures
16:11:24FromDiscord<jaar23> In reply to @chronos.vitaqua "If you use asynchronous": Okay, right. This should be one of the idea why discard spawn function is bad idea.
16:11:29FromDiscord<Chronos [She/Her]> In reply to @jaar23 "Yea, so each thread": You'll likely run into many errors involving threading and async code together tbh
16:11:48FromDiscord<jaar23> In reply to @griffith1deadly "for this i think": This sounds feasible but also technically hard.
16:12:29FromDiscord<jaar23> In reply to @chronos.vitaqua "You'll likely run into": Haha, that's why I asking help here. I think is not good solution but I really want to try how to do that
16:13:06FromDiscord<Chronos [She/Her]> Fair enough
16:13:31FromDiscord<Chronos [She/Her]> I'm not the most knowledgeable about this myself, tbh, so hopefully someone who's done this before can help?
16:15:52FromDiscord<xtrayambak> How did nobody notice the bug or sanitize the input in the bridge lol
16:16:18FromDiscord<xtrayambak> Why can the webhook ping everyone in the first place, isn't there a setting to disable that? xD
16:17:02FromDiscord<cosmicstella> In reply to @xtrayambak "Why can the webhook": it should be sanitized, webhooks can ping everyone since they require special permissions to be created and used
16:17:18FromDiscord<xtrayambak> aaah, that makes sense
16:17:35FromDiscord<xtrayambak> better push a fix before random people with silly intentions start spamming everyone in the forums
16:18:38FromDiscord<slymilano> Ayo what's with the global ping
16:18:45FromDiscord<slymilano> 😂
16:21:40*krux02 joined #nim
16:26:20FromDiscord<xtrayambak> Yeaah, nobody thought of that edge case
16:34:04FromDiscord<jaar23> In reply to @chronos.vitaqua "I'm not the most": No problem, I try to feature it myself when I have more free time
16:39:54FromDiscord<wick3dr0se> In reply to @slymilano "Ayo what's with the": Yea fr.. Dude made some stupid ass post that I care not to read
16:42:28FromDiscord<wick3dr0se> I'm actually confused why dude says my bad to @ everyone but then proceeds to do it knowing it's an issue lmao
16:45:18FromDiscord<Phil> In reply to @wick3dr0se "Yea fr.. Dude made": Yo chill, that guy is not on the discord afaik so he's not aware of the bridge and how `@everyone` gets turned into a global ping
16:46:36FromDiscord<wick3dr0se> I'm not tripping, everyone automatically assumes anytime there is a cuss word involved that it's extreme anger lol. I just think it's a stupid ass post fr lol
16:46:57FromDiscord<Phil> It's simply an overlap between that being used in the forum to target everyone and here
16:47:47FromDiscord<wick3dr0se> He shouldnt even be able to tag everyone on the forum. That sounds like a useless feature because anyone on the thread should get notified anyway, unless they specifically turned off notifications. Then they don't want your everyone pings lol
16:48:07FromDiscord<wick3dr0se> (edit) "your everyone" => "everyones"
16:48:46FromDiscord<Phil> In reply to @wick3dr0se "I'm not tripping, everyone": Again, chill. He was simply doing a minor "Ah right, it was X not Y" correction.
16:49:05FromDiscord<Phil> As for the everyone feature, 🤷 , I'd need to dig into the source code to see what that actually does
16:49:25FromDiscord<wick3dr0se> I just think its a little crazy. I run a relatively small Discord server compared to this. When people accidently tag everyone, it leads to multiple people leaving usually
16:49:45FromDiscord<fae___> I thought it was kind of funny, made my morning
17:00:30*kenran quit (Quit: ERC 5.6-git (IRC client for GNU Emacs 30.0.50))
17:06:42FromDiscord<enthus1ast> not even noticed anything since not all discord rooms are bridged to matrix
17:22:26*cedb quit (Ping timeout: 244 seconds)
17:24:44*ced2 joined #nim
17:30:00*cm quit (Ping timeout: 246 seconds)
17:30:35*cm joined #nim
17:34:00FromDiscord<that_dude.> In reply to @isofruit "Again, chill. He was": I'm pretty sure all you have to do is uncheck a box in the discord permissions to not let it do global pings. That way the bot can still type it, it just won't ping anyone
17:36:16FromDiscord<entikan> fwiw, the at-everyone stuff is a discord problem, maybe instead of getting angry at people triggering it, get angry at disscord
17:36:32FromDiscord<entikan> let's go back to irc!
17:47:39*azimut quit (Ping timeout: 246 seconds)
17:52:01FromDiscord<weathercold> I call it @​everyone injection
17:53:30advesperacitIs there a convenient function for checking that a string is only alphabet characters?
17:54:11advesperacitoh, there it is.. nvm
18:10:28FromDiscord<xfcisco> can good nim code ever be faster than C ?
18:11:08FromDiscord<xfcisco> like if C pulls out It's big guns (inline assembly and no stdlib)↵and nim pulls out It's guns, which will end up being faster ?
18:16:18FromDiscord<jviega> Well, nim has access to all those "guns" so to speak. Generated nim tends to alloc less and stick more on the stack, so can be faster, but is usually about the same, plus or minus.
18:16:40FromDiscord<that_dude.> I mean both will be the same (maybe with a very minor advantage to C). Nim compiles to C first and then compliles like normal. If you really want to get pedantic, both Nim and C allow you to output assembly directly
18:16:48*xet7_ quit (Quit: Leaving)
18:17:11*xet7 joined #nim
18:17:36FromDiscord<that_dude.> Logic wise they will likely be the same. Implementation time is faster for Nim though
18:17:45FromDiscord<that_dude.> (edit) "Implementation" => "General implementation"
18:18:46*ced2 quit (Ping timeout: 245 seconds)
18:19:03FromDiscord<jviega> Really depends on coding style. If you do a lot of heap allocation and are pretty defensive on checks on bounds, etc, then Nim's probably going to tend to be a tiny bit faster. I've done some tests on small problems anyway, seems to indicate that the strong preference for stack makes a bit of difference.
18:19:11FromDiscord<that_dude.> Some of Nim's strengths lie with the fact that it's clean and efficient in converting intent to code and picks good defaults for you
18:21:05*ced2 joined #nim
18:23:14*xet7_ joined #nim
18:26:38*xet7 quit (Ping timeout: 246 seconds)
18:28:24*krux02 quit (Remote host closed the connection)
18:37:02*rockcavera joined #nim
18:38:12FromDiscord<System64 ~ Flandre Scarlet> Does Nim even have tradeoffs?
18:42:12FromDiscord<jviega> If you want to do more dynamic stuff sure, or if you want access to a rich set of well supported libraries for common functionality, or a big welcoming community.
18:47:46termerAsking about raw language speed isn't really helpful, but since Nim translates to C, it can't possibly be "faster" than C theoretically. That's the most conclusive and least helpful answer
18:48:08FromDiscord<enthus1ast> i think the more important question is\: how easy it is to get things right.
18:48:29FromDiscord<enthus1ast> i think, its easier in nim to get things right than in c
18:48:43FromDiscord<jviega> Again, it all depends on your style. Passing objects on the stack a lot isn't something C programmers tend to do, but definitely can save quite a bit in a lot of programs
18:49:12FromDiscord<enthus1ast> in c you can, quite quickly shoot yourself in the foot
18:51:01FromDiscord<System64 ~ Flandre Scarlet> In reply to @jviega "Again, it all depends": Yeah, C programmers tends to pass by pointer for quite nothing
18:51:23FromDiscord<System64 ~ Flandre Scarlet> Do not pass by pointer for small structs bruh
18:51:34FromDiscord<System64 ~ Flandre Scarlet> UNLESS you want to change the content of it
18:52:26FromDiscord<jviega> Well to be fair, C's entire ecosystem has always dissuaded passing by value for more than a pointer-sized item.
18:53:00FromDiscord<jviega> Limited stack space used to be a bigger issue
18:53:20termerisn't windows' stack 2mb
18:53:30termerLinux's stack is 8mb by default if I remember correctly
18:54:58FromDiscord<jviega> Per thread yes
18:56:20FromDiscord<jviega> Stack size can be increased easily to very large values and the only downside is taking longer to detect recursion problems
18:57:09FromDiscord<jviega> In a 64 bit address space, with virtual memory, the max size is generally not very relevent
18:57:09FromDiscord<System64 ~ Flandre Scarlet> In reply to @termer "isn't windows' stack 2mb": Quite huge
18:58:09termeryeah, you'll be fine generally
19:06:15FromDiscord<djazz> In reply to @enthus1ast "in c you can,": in c++ you can quite quickly shoot your entire leg off xD
19:09:11FromDiscord<enthus1ast> but in c++ you have refs and such, so you can be much safer than in c
19:13:26FromDiscord<djazz> its a common joke haha i had to
19:15:30arminso why the hell is most of this channel content on discord? i mean isn't nim a language that should encourage use of the command line in the first place?
19:17:56FromDiscord<enthus1ast> i write on matrix but it seems the discord bot bridges to irc
19:18:12FromDiscord<enthus1ast> (actually no idea how stuff is plugged together to be honest)
19:19:04FromDiscord<enthus1ast> > encourage use of the command line in the first place?↵> you can write nearly everything in nim
19:27:19*ced2 quit (Ping timeout: 255 seconds)
19:29:27*ced2 joined #nim
19:39:50FromDiscord<Phil> I will be honest, I entirely do not get that sentence from armin
19:40:13FromDiscord<Phil> What does discord have to do with the channel through which you communicate.
19:44:43FromDiscord<0ffh> sent a code paste, see https://play.nim-lang.org/#ix=4EMu
19:46:27FromDiscord<0ffh> Here's a bit of context
19:46:38FromDiscord<0ffh> sent a code paste, see https://play.nim-lang.org/#ix=4EMv
19:46:45FromDiscord<jviega> No clue. For me, on nim2, besides some stdlib bugs I can easily work around, I have to compile with refc or the compiler never seems to return (have left it for hours).
19:47:04FromDiscord<jviega> I'm not sure if that's better than the crashes I got in the rc's
19:56:25FromDiscord<0ffh> Thanks anyways.↵I just thought of testing it in devel, and there the problem's gone.↵I hope that's because someone already found it and it got fixed, and not just coincidentally. 😅
20:00:20FromDiscord<Phil> In reply to @0ffh "Thanks anyways. I just": And so the grip that devel has on devs continues
20:09:01FromDiscord<addiv> might be a problem with the cache?
20:09:07FromDiscord<addiv> try deleting home/user/.cache/nim/mil_r
20:11:30FromDiscord<0ffh> In reply to @addiv "might be a problem": Good idea, but I tried that.
20:21:04FromDiscord<.e.l.i> Is there a scraping lib for Nim?
20:22:24FromDiscord<jviega> What do you mean??
20:23:31FromDiscord<srmordred> In reply to @.e.l.i "Is there a scraping": maybe this?↵https://github.com/GULPF/nimquery
20:23:57FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4EMD
20:23:59FromDiscord<jviega> Oh, I thought he said "scripting" I need to learn to read
20:24:12FromDiscord<.e.l.i> I mainly write in Go, but nim has piqued my interest. So, something like Colly or Rod
20:24:27FromDiscord<Phil> In reply to @jviega "Oh, I thought he": IIRC can't you also play the old man card in those scenarios? I recall you also being a working adult 😛
20:24:59FromDiscord<jviega> What'd you say? Let me turn up my hearing aid
20:25:28FromDiscord<Phil> "Back in my day!....
20:25:30FromDiscord<Phil> (edit) "day!...." => "day!....""
20:26:02FromDiscord<0ffh> Please, I'm trying to take a nap over here!
20:26:26*enthus1ast quit (Ping timeout: 246 seconds)
20:27:11*rockcavera quit (Remote host closed the connection)
20:27:11FromDiscord<Phil> In reply to @.e.l.i "I mainly write in": Generally the std lib has tools for parsing and traversing HTML in the form of "XML-Nodes" (aka object variants), then there's nimquery to be able to basically use the `querySelector` proc and other than that you could also use webdriver or the like or use nimble search to look for keywords
20:27:28FromDiscord<Phil> (edit) "webdriver" => "the nim-webdriver package"
20:28:06FromDiscord<.e.l.i> I see. Also, which gc is nim running now? Last I looked at nim was around 1.2
20:28:32FromDiscord<0ffh> I think ORC is standard.
20:28:35FromDiscord<Phil> In 2.0? The default is ORC
20:29:01*rockcavera joined #nim
20:29:10FromDiscord<Phil> But "generally available and viable" are refc, ARC, ORC (which is ARC + a small cycle collector) and no gc at all.
20:29:33FromDiscord<Phil> (edit) "ARC," => "ARC and" | "collector) and" => "collector).↵And" | "gc" => "GC" | "all." => "all if you can live without any lib basically."
20:30:15FromDiscord<.e.l.i> In reply to @isofruit "But "generally available and": Does that include the std lib? Is it compatible with no gc?
20:30:55FromDiscord<Phil> I think that includes the std/lib, but you'd need to ask somebody that actually tried to know for certain.
20:31:13FromDiscord<Phil> I generally use ORC or refc which both work fine for me on webdev.
20:31:33FromDiscord<0ffh> You might find someone over at #embedded
20:34:00FromDiscord<jviega> No, when you compile your code, it recompiles what it needs out of the std library
20:34:09FromDiscord<jviega> So it will use whatever gc your app uses
20:34:32FromDiscord<enthus1ast> @heysokam\: if strformat reached its Limits i tend to use nimja
20:34:50FromDiscord<jviega> I have not yet had good luck w/ ORC or ARC. If you don't need the shared heap then I'd stick w/ refc for a while
20:35:22FromDiscord<Phil> Aye, not like refc suddenly got shot in the leg or sth, it works perfectly fine
20:38:47FromDiscord<.e.l.i> Right, to install, I assume you just add the bin to PATH and run finish.exe?
20:43:18FromDiscord<.e.l.i> Oops, forgot to restart.
20:50:10*Guest82 joined #nim
20:52:05*advesperacit quit ()
20:54:16FromDiscord<Phil> I mean, generally I just use choosenim
20:54:22FromDiscord<Phil> Works well enough for me on arch
20:54:37*Guest82 quit (Client Quit)
21:04:26FromDiscord<Chronos [She/Her]> Isn't it just a bit stupid to use no gc? Even if you're limited on memory, doesn't arc makes it a bad choice?
21:04:32FromDiscord<Chronos [She/Her]> (edit) "makes" => "make"
21:20:48*azimut joined #nim
21:22:58*nils` quit (Ping timeout: 255 seconds)
21:24:04*jmdaemon joined #nim
21:25:31FromDiscord<Elegantbeef> Right, no gc is pretty silly
21:26:51FromDiscord<acornes> sent a code paste, see https://play.nim-lang.org/#ix=4EMU
21:27:16FromDiscord<acornes> (edit) "https://play.nim-lang.org/#ix=4EMU" => "https://play.nim-lang.org/#ix=4EMV"
21:27:29FromDiscord<Elegantbeef> If only you explained what "this" was
21:28:15FromDiscord<acornes> well i want the proc to be able to send a different sequence of keys depending on the ChatType thats chosen
21:28:33FromDiscord<acornes> using the send() proc
21:28:55FromDiscord<acornes> but since it isnt a string or a float it wouldn't work in a case
21:31:40FromDiscord<Elegantbeef> Seems like you'd send enter, then send your string raw, then send enter
21:35:13*nils` joined #nim
21:36:58FromDiscord<acornes> oh i meant how to implement case to use the proc
21:37:18FromDiscord<acornes> or an alternative
21:37:18FromDiscord<Elegantbeef> What?
21:37:25FromDiscord<xfcisco> In reply to @acornes "oh i meant how": ehhh you're doing `case` on the type itself
21:37:49FromDiscord<xfcisco> sent a code paste, see https://play.nim-lang.org/#ix=4EMX
21:37:50FromDiscord<xfcisco> or maybe It's just a typo
21:38:35FromDiscord<acornes> well i just get this error: selector must be of an ordinal type, float or string
21:39:06FromDiscord<Elegantbeef> Right you're using the type not the value
21:39:16FromDiscord<Elegantbeef> You do not run a case on a type, you run a case on a value
21:39:28FromDiscord<acornes> oooh
21:39:56FromDiscord<xfcisco> lol
21:40:07FromDiscord<acornes> but is there a way to replicate the syntax of a case for a type?
21:40:24FromDiscord<Elegantbeef> With a macro, but you do not want a case for the type
21:40:26FromDiscord<xfcisco> like switching on a generic type like T ?
21:40:52FromDiscord<acornes> In reply to @Elegantbeef "With a macro, but": then how would i do it?
21:42:19FromDiscord<Elegantbeef> Like xfcisco showed
21:42:45FromDiscord<Elegantbeef> Change that `ChatType` to `chatType`
21:44:11FromDiscord<xfcisco> nah she wants to switch on a type argument
21:44:34FromDiscord<Elegantbeef> `when X is y`
21:44:42FromDiscord<Elegantbeef> That proc isnt a generic though
21:45:25FromDiscord<xfcisco> found this online
21:45:41FromDiscord<xfcisco> sent a code paste, see https://play.nim-lang.org/#ix=4EMY
21:46:29FromDiscord<acornes> sent a code paste, see https://play.nim-lang.org/#ix=4EMZ
21:46:31FromDiscord<acornes> like this?
21:46:57FromDiscord<Elegantbeef> Why are you asking me, I'm not a Nim compiler
21:46:59FromDiscord<acornes> let me test it hold on
22:03:06FromDiscord<0ffh> In reply to @Elegantbeef "Why are you asking": I find your lack of ambition disappointing.
22:08:23*lumo_e joined #nim
22:10:29FromDiscord<Elegantbeef> It's a biochemical limitation
22:21:31FromDiscord<Chronos [She/Her]> What are brains, if not biocomputers
22:22:37*rockcavera quit (Read error: Connection reset by peer)
22:23:22*rockcavera joined #nim
22:23:23*rockcavera quit (Changing host)
22:23:23*rockcavera joined #nim
22:29:23*xet7_ quit (Read error: Connection reset by peer)
22:30:42FromDiscord<xfcisco> In reply to @0ffh "I find your lack": same.
22:30:52FromDiscord<xfcisco> In reply to @Elegantbeef "It's a biochemical limitation": skill issue tbh
22:31:16termerdiscord twitter speak
22:41:56FromDiscord<System64 ~ Flandre Scarlet> Btw, is it possible to add Rich Presence to a program with Nim?
22:44:24FromDiscord<xfcisco> In reply to @sys64 "Btw, is it possible": It's all just communicating with web apis right
22:44:36FromDiscord<xfcisco> discord bots, rich presence, etc..
22:44:45FromDiscord<xfcisco> the libraries are just wrappers
22:44:50FromDiscord<xfcisco> try making your own library
22:44:57FromDiscord<xfcisco> or just wrapper in general
22:47:08FromDiscord<System64 ~ Flandre Scarlet> In reply to @xfcisco "the libraries are just": I guess I can futhark the wrapper?
22:49:39FromDiscord<System64 ~ Flandre Scarlet> Yeah there is an H file
22:55:15FromDiscord<xfcisco> no clue what you're talking about but sounds cool lol
23:00:21termerYou can do it
23:00:26termerI think they have a C++ lib for it
23:43:50*ced2 is now known as cedb