01:07:36 | * | krux02 quit (Remote host closed the connection) |
01:22:00 | * | lucasta_ joined #nim |
03:14:16 | FromDiscord | <that_dude.> Juggling generics, inheritance and distinct types is kinda hard |
03:17:16 | FromDiscord | <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:29 | FromDiscord | <that_dude.> This code won't compile because it can't find the right `add` proc |
03:21:42 | FromDiscord | <Elegantbeef> I mean using aliases like this is always going to be an issue |
03:21:58 | FromDiscord | <that_dude.> Sad |
03:22:08 | FromDiscord | <Elegantbeef> I mean they're not existential types |
03:22:11 | FromDiscord | <that_dude.> But the feel so "cleen" |
03:22:38 | FromDiscord | <that_dude.> Is it better to always wrap them in an object then? |
03:22:46 | FromDiscord | <Elegantbeef> Or a distinct |
03:22:59 | FromDiscord | <that_dude.> I am using distinct tho |
03:23:08 | FromDiscord | <Elegantbeef> Not for EventContainer |
03:23:41 | FromDiscord | <that_dude.> I'll mess with distincts all the way down for a set |
03:23:45 | FromDiscord | <that_dude.> sec |
03:27:54 | FromDiscord | <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:16 | FromDiscord | <Elegantbeef> `distinct seq[T]` |
03:28:24 | FromDiscord | <that_dude.> Fair enough |
03:28:25 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=4EJd |
03:28:59 | FromDiscord | <that_dude.> Ah thanks |
03:29:15 | FromDiscord | <that_dude.> I remember seeing type traits, but got scared away lol |
03:30:10 | FromDiscord | <Elegantbeef> It's not even needed you can just do `seq[T](c).add(v)` |
03:31:20 | FromDiscord | <Elegantbeef> This does sorta relate to the row polymorphism stuff i've been doing 😄 |
03:31:44 | FromDiscord | <Elegantbeef> Instead of using inheritance a `type MyName {.join: BaseEvent.} = object` |
03:32:12 | FromDiscord | <Elegantbeef> https://github.com/beef331/nimtrest/blob/master/rowed.nim#L91-L116 |
03:32:39 | FromDiscord | <Elegantbeef> Sadly though have not got a way to select the most precise row |
03:35:22 | FromDiscord | <that_dude.> So why does `seq[Move_state](c).add(v)` work but not `EventContainer[Move_state](c).add(v)`? |
03:36:14 | FromDiscord | <that_dude.> Or did I just not define the chain to `seq[T` well enough |
03:36:44 | FromDiscord | <Elegantbeef> Seems like a bug if it doesnt work |
03:41:31 | FromDiscord | <ravinder387> can pixie compile to javascript? |
03:42:49 | FromDiscord | <Elegantbeef> So the issue seems to be that it loses it's mutability on conversion |
03:42:50 | FromDiscord | <Elegantbeef> Which is not right |
03:43:44 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=4EJg hmm |
03:45:26 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=4EJj yea nested generic distincts seem to cause this |
03:46:17 | FromDiscord | <Elegantbeef> Actually seems it might be builtin types https://play.nim-lang.org/#ix=4EJi |
03:54:23 | FromDiscord | <that_dude.> Should I make a bug report? |
03:54:35 | FromDiscord | <Elegantbeef> Probably |
03:55:14 | FromDiscord | <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:54 | NimEventer | New thread by Zeldapedia: More info on NimMain procedure, see https://forum.nim-lang.org/t/10446 |
05:52:42 | * | kenran joined #nim |
05:54:04 | FromDiscord | <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:21 | FromDiscord | <arathanis> In reply to @odexine "i'm forgetting, what kind": LEX/YACC is pretty common |
06:02:26 | FromDiscord | <arathanis> i often just write bespoke parsers |
06:02:35 | FromDiscord | <amaank404> my vscode is broken |
06:02:40 | FromDiscord | <arathanis> though for ergonomics i love parser/combinators |
06:02:45 | FromDiscord | <arathanis> (edit) "parser/combinators" => "parser combinators" |
06:02:50 | FromDiscord | <arathanis> (edit) "though for ergonomics i love parser combinators ... " added "or combinatorial parsers" |
06:02:56 | FromDiscord | <amaank404> what extension am i supposed to use? |
06:03:17 | FromDiscord | <amaank404> this nim 2 has broken my vscode autocomplete |
06:03:18 | FromDiscord | <arathanis> In reply to @amaank404 "what extension am i": i use the one by nimsaem |
06:03:27 | FromDiscord | <amaank404> that aint working no more |
06:03:33 | FromDiscord | <arathanis> hasnt broken for me |
06:03:35 | FromDiscord | <amaank404> not properly at least |
06:03:41 | FromDiscord | <arathanis> you might have just run up against nimsuggest blowing you out |
06:03:44 | FromDiscord | <arathanis> its notorious for that |
06:03:52 | FromDiscord | <arathanis> try reloading your workspace and giving it some time |
06:04:00 | FromDiscord | <arathanis> it can memory leak like crazy |
06:04:03 | FromDiscord | <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:24 | FromDiscord | <arathanis> yeah nimsuggest just up and dies sometimes |
06:04:34 | FromDiscord | <amaank404> so what do you suggest? |
06:04:37 | FromDiscord | <amaank404> restart? |
06:04:38 | FromDiscord | <arathanis> if you search this channel for "nimsuggest" you can see it talked about like every week |
06:04:45 | FromDiscord | <arathanis> In reply to @amaank404 "restart?": pretty much. |
06:04:51 | FromDiscord | <arathanis> either reload vs code using the reload window function |
06:04:53 | FromDiscord | <arathanis> or restarts vs code |
06:05:09 | FromDiscord | <arathanis> or just give it some time, mine sometimes figures its shit out |
06:05:20 | FromDiscord | <arathanis> nimsuggest is a lobotomized compiler and it shows lol |
06:05:38 | FromDiscord | <arathanis> usually if its behaving really badly ill do reload window |
06:05:39 | FromDiscord | <amaank404> Why cant I have just object https://media.discordapp.net/attachments/371759389889003532/1145600062353850488/image.png |
06:05:48 | FromDiscord | <arathanis> then take a 5m break to let nimsuggest figure its shit out again |
06:05:54 | FromDiscord | <arathanis> it can take a while to reinitialize and behave |
06:06:02 | FromDiscord | <amaank404> ig |
06:06:24 | FromDiscord | <amaank404> I was porting my old neural networks project to nim 2 |
06:06:38 | FromDiscord | <amaank404> and this is pretty much slowwing me down |
06:07:21 | FromDiscord | <Elegantbeef> Hit escape and carry on |
06:07:22 | FromDiscord | <Elegantbeef> There is no error here |
06:07:34 | FromDiscord | <amaank404> how? |
06:07:42 | FromDiscord | <amaank404> cant it suggest me the keyword "object" |
06:08:14 | FromDiscord | <amaank404> everytime I press space right after it, it accepts the suggestion |
06:08:16 | FromDiscord | <Elegantbeef> It's suggesting types as you're in a type code |
06:08:41 | FromDiscord | <amaank404> In reply to @amaank404 "everytime I press space": what about this? |
06:08:55 | FromDiscord | <Elegantbeef> I think you can configure what button accepts suggestions |
06:09:34 | FromDiscord | <Elegantbeef> No clue, do not use vscode |
06:10:10 | FromDiscord | <amaank404> what do u use? |
06:10:16 | FromDiscord | <amaank404> i need to know |
06:10:25 | FromDiscord | <amaank404> what is the most optimal for nim |
06:10:29 | FromDiscord | <amaank404> in ur opinions |
06:12:50 | FromDiscord | <amaank404> lemme reframe it, what ide do you use? |
06:13:51 | FromDiscord | <Elegantbeef> I presently use nvim |
06:13:58 | FromDiscord | <arathanis> called it https://media.discordapp.net/attachments/371759389889003532/1145602149980590110/image.png |
06:14:21 | FromDiscord | <amaank404> so I am the only non chad here |
06:14:24 | FromDiscord | <Elegantbeef> I used kate for a while |
06:14:41 | FromDiscord | <odexine> i like the neovim plugin more than any of the other ones, it works most of the time |
06:14:56 | FromDiscord | <odexine> i moved to vscode because i kinda stopped like tui editing |
06:15:22 | FromDiscord | <amaank404> In reply to @Elegantbeef "I used kate for": are you a bot? I cant help but notice |
06:15:25 | FromDiscord | <arathanis> ive used both vim and vscode and i like both for different reasons |
06:15:36 | FromDiscord | <arathanis> In reply to @amaank404 "are you a bot?": they are on IRC using the bridge |
06:15:43 | FromDiscord | <Elegantbeef> Fuck IRC |
06:15:46 | FromDiscord | <Elegantbeef> I'm a matrix boy |
06:15:52 | FromDiscord | <amaank404> oh |
06:15:52 | FromDiscord | <arathanis> the bot is forwarding our messaging between the two platforms |
06:15:58 | FromDiscord | <arathanis> In reply to @Elegantbeef "I'm a matrix boy": ok sure, matrix |
06:16:26 | FromDiscord | <amaank404> I like centralization, change my mind |
06:16:51 | FromDiscord | <amaank404> I heard intelliJ has a good extension too |
06:17:00 | FromDiscord | <Elegantbeef> You own nothing, discord da poo poo |
06:17:14 | FromDiscord | <amaank404> do i need to own it? |
06:18:06 | FromDiscord | <Elegantbeef> Do you need to own your computer? |
06:18:41 | FromDiscord | <amaank404> I dont |
06:18:55 | FromDiscord | <Elegantbeef> Sure is nice though isnt it? |
06:19:02 | FromDiscord | <amaank404> ummm |
06:19:02 | FromDiscord | <odexine> but they said they dont |
06:19:07 | FromDiscord | <amaank404> managing a server is a hassle |
06:19:10 | FromDiscord | <odexine> no |
06:19:15 | FromDiscord | <odexine> thats not what beef meant lol |
06:19:21 | FromDiscord | <odexine> do you own your desktop/laptop |
06:19:34 | FromDiscord | <amaank404> yes ofc, but I dont need to own a matrix server for the sake of talking |
06:19:44 | FromDiscord | <amaank404> and managing servers is a hassle |
06:19:53 | FromDiscord | <Elegantbeef> They said they don't need to own it not "I don't own my pc" |
06:20:23 | FromDiscord | <amaank404> this debate is exceeding my level of comprehensibility |
06:20:28 | FromDiscord | <amaank404> I shall chicken out this very moment |
06:21:14 | FromDiscord | <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:21 | FromDiscord | <Elegantbeef> But yes this is a silly conversation |
06:21:32 | FromDiscord | <Elegantbeef> Having control over your own things is always good in my book |
06:22:16 | FromDiscord | <amaank404> yes, its great to own, but the maintainence part of owning, no i am happy with centralized services |
06:22:32 | FromDiscord | <Elegantbeef> So use a homeserver someone else hosts |
06:44:32 | * | PMunch joined #nim |
06:53:28 | FromDiscord | <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:53 | FromDiscord | <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:36 | FromDiscord | <amaank404> I surrender, I believe whatever you like, I love it |
06:55:42 | FromDiscord | <amaank404> (edit) "believe" => "believe:" |
06:55:47 | FromDiscord | <nnsee> what? |
06:56:11 | FromDiscord | <amaank404> I have given up the discussion, I have exhausted my mental capacity to talk anymore |
06:57:14 | FromDiscord | <nnsee> um sorry |
06:57:21 | FromDiscord | <nnsee> was just offering my experience |
06:57:50 | FromDiscord | <amaank404> nah bro, my bad |
07:15:29 | * | enthus1ast joined #nim |
08:41:06 | FromDiscord | <frobnicate> In reply to @amaank404 "lemme reframe it, what": None, just VSCode because I'm stupid |
09:01:42 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4EK4 |
09:04:16 | FromDiscord | <heysokam> if `results == 33`, and `uniques == 32`.... how is it possible that `results - uniques` returns 0? 🧩 |
09:05:06 | FromDiscord | <heysokam> Can `OrderedSet`s contain duplicates or something? 🤔 |
09:07:10 | PMunch | Wild guess is that your hash method for BinTarget is bad |
09:07:54 | PMunch | Or rather that it is different than the one for string |
09:08:00 | PMunch | Hard to tell though without any data |
09:08:43 | FromDiscord | <heysokam> In reply to @PMunch "Wild guess is that": i don't have one |
09:08:47 | FromDiscord | <frobnicate> You also don't need to do `ctargets.pairs` |
09:08:57 | PMunch | True, but that shouldn't do anything wrong |
09:09:04 | FromDiscord | <heysokam> In reply to @frobnicate "You also don't need": its debug code, that's leftovers |
09:09:06 | PMunch | You don't have any what? |
09:09:14 | FromDiscord | <heysokam> In reply to @PMunch "You don't have any": hash function |
09:09:18 | FromDiscord | <heysokam> how do you create one? |
09:09:34 | FromDiscord | <heysokam> or method, rather |
09:09:35 | PMunch | Just implement `proc hash(x: <your type>): Hash` |
09:09:49 | FromDiscord | <Elegantbeef> They're using the default hash and `==` proc |
09:09:50 | PMunch | Procedure, I don't think hash can be a method.. |
09:10:11 | PMunch | There's a default hash now? |
09:10:28 | FromDiscord | <heysokam> i havent' implemented one, so there must be |
09:10:41 | FromDiscord | <Elegantbeef> Always has been |
09:10:41 | FromDiscord | <Elegantbeef> Just look at results and uniques2 before the assertion |
09:10:41 | FromDiscord | <Elegantbeef> default hash just never worked for `ref T` |
09:10:53 | FromDiscord | <heysokam> I was surprised i could even use sets when i started, thought i needed something but they just worked |
09:11:17 | PMunch | Aah I see |
09:11:24 | FromDiscord | <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:42 | PMunch | How big are the things you put in there? |
09:12:03 | FromDiscord | <heysokam> In reply to @PMunch "How big are the": which things? |
09:12:13 | PMunch | BinTarget and string |
09:12:19 | PMunch | 33 items isn't that much.. |
09:12:36 | PMunch | Unless you're throwing massive strings in, then it would be a pain to verify manually |
09:13:28 | FromDiscord | <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:38 | FromDiscord | <heysokam> https://media.discordapp.net/attachments/371759389889003532/1145647617158688828/image.png |
09:15:10 | FromDiscord | <heysokam> my brain cannot process this many items and remember what I just read 2milliseconds ago |
09:15:40 | FromDiscord | <heysokam> plus that's just the output targets, each of those entries contains 10s of source files to build them |
09:16:21 | FromDiscord | <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:39 | FromDiscord | <frobnicate> @heysokam I can't replicate your bug so I think it's your types |
09:17:44 | PMunch | Ah.. You're on Linux |
09:17:47 | PMunch | Windows* |
09:18:16 | PMunch | I would've just piped that output through some command line stuff and gotten the unique entries.. |
09:18:24 | FromDiscord | <heysokam> In reply to @frobnicate "<@186489007247589376> I can't replicate": yeah must be the hash function like they mentioned |
09:18:44 | PMunch | Come 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:53 | NimEventer | New Nimble package! knot - tie compile-time values to types under names, see https://github.com/metagn/knot |
09:19:48 | FromDiscord | <frobnicate> Does the built-in hash function create a hash from the fields? |
09:20:12 | FromDiscord | <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:45 | FromDiscord | <Elegantbeef> Yes the hash proc hashes fields |
09:23:57 | FromDiscord | <heysokam> ? |
09:25:00 | FromDiscord | <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:52 | FromDiscord | <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:22 | FromDiscord | <heysokam> how can i make a simple `thing.trg (which is a string) -> get hash from it`? |
09:26:40 | FromDiscord | <heysokam> In reply to @Elegantbeef "If you follow the": well it is failing, so there is the reason |
09:26:46 | FromDiscord | <Elegantbeef> Make a hash function that hashes the trg field |
09:26:59 | FromDiscord | <Elegantbeef> You also need a `==` proc that only compares that field |
09:27:01 | FromDiscord | <heysokam> the key part of that sentence was the how lol |
09:27:09 | FromDiscord | <heysokam> i understand that much |
09:27:19 | PMunch | heysokam, as I said, the set module uses buckets, so even with colliding hashes you shouldn't get this behaviour |
09:27:23 | FromDiscord | <heysokam> but not the how, because that function is cryptic as hell to me |
09:27:26 | FromDiscord | <Elegantbeef> `proc hash(myObj: MyType): Hash = hash(myObj.trg)` |
09:27:43 | FromDiscord | <heysokam> In reply to @PMunch "<@186489007247589376>, as I said,": > shouldnt↵well, i am... so... |
09:27:54 | FromDiscord | <heysokam> In reply to @Elegantbeef "`proc hash(myObj: MyType): Hash": ty |
09:28:19 | FromDiscord | <Elegantbeef> Like I said you also need to define a `==` proc |
09:28:31 | PMunch | As you can see here collisions work fine: https://play.nim-lang.org/#ix=4EK8 |
09:28:52 | FromDiscord | <Elegantbeef> For Nim's stdlib hash objects to work the `==` and `hash` have to produce the same result |
09:30:26 | PMunch | But you can define `proc hash(x: BinTarget): Hash = hash(x.trg)` and `proc ==(x, y: BinTarget): bool = x.trg == y.trg` |
09:30:39 | PMunch | To see if you still get the same error |
09:33:02 | FromDiscord | <heysokam> im getting big spam of `true, false, true false` in cli after adding those two |
09:33:24 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4EKa |
09:34:08 | FromDiscord | <heysokam> oh... it was a later spot that was happening later, nvm |
09:34:25 | FromDiscord | <heysokam> so yeah, seems like it worked now, they are the same length so no assert is hit |
09:38:40 | FromDiscord | <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:40 | FromDiscord | <frobnicate> what |
09:58:57 | * | armin joined #nim |
10:01:25 | FromDiscord | <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:33 | FromDiscord | <frobnicate> Oh |
10:03:01 | armin | you have to frobnicate the foo! |
10:06:49 | FromDiscord | <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:33 | FromDiscord | <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:19 | FromDiscord | <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:01 | FromDiscord | <odexine> can you send a min repro? that's a vague description |
12:18:06 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4EKx |
12:19:00 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4EKy |
12:19:40 | FromDiscord | <heysokam> (edit) "https://play.nim-lang.org/#ix=4EKy" => "https://play.nim-lang.org/#ix=4EKz" |
12:19:40 | FromDiscord | <ieltan> sent a code paste, see https://play.nim-lang.org/#ix=4EKA |
12:20:18 | FromDiscord | <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:45 | FromDiscord | <ieltan> alright then, thanks ! |
12:23:22 | FromDiscord | <odexine> i cannot repro the bug @heysokam |
12:23:34 | FromDiscord | <heysokam> is there a limit on the size of strings in the VM? |
12:23:50 | FromDiscord | <heysokam> i believe im reading/writing statically 🤔 |
12:24:24 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4EKD |
12:24:29 | FromDiscord | <odexine> i do not get the problem in static: context either |
12:24:42 | FromDiscord | <odexine> that's not calling it static |
12:24:54 | FromDiscord | <odexine> that's just under a when condition |
12:25:29 | FromDiscord | <odexine> the 11k long line is not giving me a problem |
12:25:35 | FromDiscord | <heysokam> sometimes i dont get it either |
12:25:36 | FromDiscord | <enthus1ast> me neither |
12:27:08 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4EKF |
12:27:17 | FromDiscord | <heysokam> (edit) "https://play.nim-lang.org/#ix=4EKF" => "https://play.nim-lang.org/#ix=4EKG" |
12:27:35 | FromDiscord | <heysokam> this one broke at a different spot https://media.discordapp.net/attachments/371759389889003532/1145696174083416211/broken.sh |
12:28:08 | FromDiscord | <heysokam> basically its those two spots, and another one that is something like `t.o somefile.o somefile.o` |
12:28:28 | FromDiscord | <heysokam> but its super random, sometimes it just works normally |
12:28:44 | FromDiscord | <heysokam> (edit) "but its super random, sometimes it just works normally ... " added "and doesn't cut any lines" |
12:31:02 | FromDiscord | <enthus1ast> which nim version do you use? @heysokam |
12:31:29 | FromDiscord | <nafeesurrehman> 💚 |
12:34:14 | FromDiscord | <heysokam> In reply to @enthus1ast "which nim version do": `stable` |
12:40:38 | FromDiscord | <heysokam> @odexine @enthus1ast the line is cut at exactly `2499` characters. Feels like a very specific number |
12:40:56 | FromDiscord | <odexine> In reply to @heysokam "`stable`": version number please |
12:41:48 | FromDiscord | <heysokam> sent a long message, see http://ix.io/4EKL |
12:42:04 | FromDiscord | <heysokam> (edit) "long message," => "code paste," | "http://ix.io/4EKL" => "https://play.nim-lang.org/#ix=4EKM" |
12:42:32 | FromDiscord | <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:16 | FromDiscord | <heysokam> mine is not complaining, its just failing to do manage the lines |
12:44:00 | FromDiscord | <heysokam> maybe make is giving a bad output? |
12:45:58 | FromDiscord | <heysokam> yeah i think make is giving bad input |
12:46:27 | FromDiscord | <heysokam> great news ⚰️, more reasons to rely on it forsure 😦 |
12:47:03 | FromDiscord | <heysokam> (edit) "input" => "data" |
12:49:15 | * | Amun-Ra quit (Ping timeout: 245 seconds) |
12:49:58 | FromDiscord | <heysokam> `-j8` might be the cause of the randomness after all |
12:50:13 | FromDiscord | <enthus1ast> oh \:D |
12:51:12 | FromDiscord | <enthus1ast> yeah that's messing up the output |
12:52:15 | FromDiscord | <enthus1ast> my duckduckgofu\: --output-sync |
12:52:25 | FromDiscord | <enthus1ast> maybe this helps |
12:55:56 | FromDiscord | <heysokam> In reply to @enthus1ast "my duckduckgofu\: --output-sync": is that a make switch? 🤔 |
13:01:30 | * | Amun-Ra joined #nim |
13:03:52 | FromDiscord | <odexine> prolly |
13:04:34 | FromDiscord | <enthus1ast> yes https://www.gnu.org/software/make/manual/make.html#Parallel-Output |
13:08:09 | * | xet7_ joined #nim |
13:10:01 | FromDiscord | <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:46 | FromDiscord | <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:04 | FromDiscord | <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:58 | FromDiscord | <enthus1ast> nice! |
14:01:59 | * | PMunch quit (Quit: Leaving) |
15:09:19 | FromDiscord | <jaar23> sent a code paste, see https://play.nim-lang.org/#ix=4ELr |
15:11:01 | FromDiscord | <griffith1deadly> In reply to @jaar23 "what is the bestway": spawn waitFor client_conn() ? |
15:21:54 | FromDiscord | <enthus1ast> async thread ? |
15:23:03 | FromDiscord | <enthus1ast> @jaar23\: your code has several problems |
15:23:13 | FromDiscord | <enthus1ast> maybe you should look at the async docs again |
15:26:26 | FromDiscord | <enthus1ast> for example the asyncnet docs have a nice example of a tcp server\: https://nim-lang.org/docs/asyncnet.html |
15:54:10 | FromDiscord | <ieltan> lol |
15:55:05 | FromDiscord | <alehander92> nice cross-forum ping achievement 😄 |
15:55:15 | FromDiscord | <itr_> I'm surprised that hasn't happened before |
15:55:39 | FromDiscord | <Chronos [She/Her]> Lmao |
15:55:43 | FromDiscord | <Chronos [She/Her]> Same tbh |
15:55:45 | FromDiscord | <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:56 | FromDiscord | <micha_ohne_el> (edit) "user's)" => "users')" |
15:56:03 | FromDiscord | <Chronos [She/Her]> Users can't @ everyone |
15:56:15 | FromDiscord | <micha_ohne_el> you sure? |
15:56:16 | FromDiscord | <catnowblue> bro just pinged everyone from nim forum 💀 |
15:56:18 | FromDiscord | <micha_ohne_el> wanna try? :D |
15:56:22 | FromDiscord | <alehander92> i mean, it's genius |
15:56:22 | FromDiscord | <rainbowasteroids> webhook just did |
15:56:28 | FromDiscord | <Chronos [She/Her]> But I'm betting the permissions in the Information category are janked |
15:56:28 | FromDiscord | <vmcs> that's so funny lmao |
15:56:29 | FromDiscord | <dithpri> In reply to @alehander92 "i mean, it's genius": @everyone |
15:56:48 | FromDiscord | <dithpri> (edit) "@everyone" => "@everyone↵e: meant to reply to message above" |
15:56:51 | FromDiscord | <micha_ohne_el> well okay |
15:57:28 | FromDiscord | <pk.kyle> lol nice try |
15:57:32 | FromDiscord | <n00nehere> lmao |
15:57:48 | FromDiscord | <pk.kyle> can mods turn off ping in that channel? |
15:58:02 | FromDiscord | <pk.kyle> and maybe it's a good idea to switch to matrix lol |
15:58:18 | FromDiscord | <n00nehere> there already is a matrix channel |
15:58:31 | FromDiscord | <jaar23> In reply to @griffith1deadly "spawn waitFor client_conn() ?": Tried but not sure is that correct way |
15:58:33 | FromDiscord | <rainbowasteroids> yeah this chat has been bridged for years now |
15:58:40 | FromDiscord | <odexine> i believe it is because it is a webhook that it went through |
15:59:08 | FromDiscord | <griffith1deadly> In reply to @jaar23 "Tried but not sure": async thread literally not good way bro |
16:00:21 | FromDiscord | <phytolizer> This channel is on irc and matrix, it's all synced |
16:00:32 | FromDiscord | <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:48 | FromDiscord | <jaar23> In reply to @griffith1deadly "async thread literally not": Mind sharing why? |
16:00:52 | FromDiscord | <griffith1deadly> In reply to @jaar23 "I managed to make": async always onethreaded |
16:01:04 | FromDiscord | <griffith1deadly> because has thread local event loop |
16:02:03 | FromDiscord | <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:35 | FromDiscord | <Chronos [She/Her]> Since they don't share schedulers (the thing that handles what piece of async code runs at what time) |
16:02:44 | FromDiscord | <Chronos [She/Her]> As far as I understand at least |
16:02:58 | FromDiscord | <Chronos [She/Her]> Generally you should stick to one or the other really |
16:03:01 | FromDiscord | <jaar23> In reply to @griffith1deadly "because has thread local": Thread local meaning it would required to constantly poll by main thread? |
16:03:52 | FromDiscord | <griffith1deadly> In reply to @jaar23 "Thread local meaning it": no. each thread has its own async event loop |
16:04:57 | FromDiscord | <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:13 | FromDiscord | <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:24 | FromDiscord | <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:29 | FromDiscord | <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:48 | FromDiscord | <jaar23> In reply to @griffith1deadly "for this i think": This sounds feasible but also technically hard. |
16:12:29 | FromDiscord | <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:06 | FromDiscord | <Chronos [She/Her]> Fair enough |
16:13:31 | FromDiscord | <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:52 | FromDiscord | <xtrayambak> How did nobody notice the bug or sanitize the input in the bridge lol |
16:16:18 | FromDiscord | <xtrayambak> Why can the webhook ping everyone in the first place, isn't there a setting to disable that? xD |
16:17:02 | FromDiscord | <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:18 | FromDiscord | <xtrayambak> aaah, that makes sense |
16:17:35 | FromDiscord | <xtrayambak> better push a fix before random people with silly intentions start spamming everyone in the forums |
16:18:38 | FromDiscord | <slymilano> Ayo what's with the global ping |
16:18:45 | FromDiscord | <slymilano> 😂 |
16:21:40 | * | krux02 joined #nim |
16:26:20 | FromDiscord | <xtrayambak> Yeaah, nobody thought of that edge case |
16:34:04 | FromDiscord | <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:54 | FromDiscord | <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:28 | FromDiscord | <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:18 | FromDiscord | <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:36 | FromDiscord | <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:57 | FromDiscord | <Phil> It's simply an overlap between that being used in the forum to target everyone and here |
16:47:47 | FromDiscord | <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:07 | FromDiscord | <wick3dr0se> (edit) "your everyone" => "everyones" |
16:48:46 | FromDiscord | <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:05 | FromDiscord | <Phil> As for the everyone feature, 🤷 , I'd need to dig into the source code to see what that actually does |
16:49:25 | FromDiscord | <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:45 | FromDiscord | <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:42 | FromDiscord | <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:00 | FromDiscord | <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:16 | FromDiscord | <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:32 | FromDiscord | <entikan> let's go back to irc! |
17:47:39 | * | azimut quit (Ping timeout: 246 seconds) |
17:52:01 | FromDiscord | <weathercold> I call it @everyone injection |
17:53:30 | advesperacit | Is there a convenient function for checking that a string is only alphabet characters? |
17:54:11 | advesperacit | oh, there it is.. nvm |
18:10:28 | FromDiscord | <xfcisco> can good nim code ever be faster than C ? |
18:11:08 | FromDiscord | <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:18 | FromDiscord | <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:40 | FromDiscord | <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:36 | FromDiscord | <that_dude.> Logic wise they will likely be the same. Implementation time is faster for Nim though |
18:17:45 | FromDiscord | <that_dude.> (edit) "Implementation" => "General implementation" |
18:18:46 | * | ced2 quit (Ping timeout: 245 seconds) |
18:19:03 | FromDiscord | <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:11 | FromDiscord | <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:12 | FromDiscord | <System64 ~ Flandre Scarlet> Does Nim even have tradeoffs? |
18:42:12 | FromDiscord | <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:46 | termer | Asking 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:08 | FromDiscord | <enthus1ast> i think the more important question is\: how easy it is to get things right. |
18:48:29 | FromDiscord | <enthus1ast> i think, its easier in nim to get things right than in c |
18:48:43 | FromDiscord | <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:12 | FromDiscord | <enthus1ast> in c you can, quite quickly shoot yourself in the foot |
18:51:01 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @jviega "Again, it all depends": Yeah, C programmers tends to pass by pointer for quite nothing |
18:51:23 | FromDiscord | <System64 ~ Flandre Scarlet> Do not pass by pointer for small structs bruh |
18:51:34 | FromDiscord | <System64 ~ Flandre Scarlet> UNLESS you want to change the content of it |
18:52:26 | FromDiscord | <jviega> Well to be fair, C's entire ecosystem has always dissuaded passing by value for more than a pointer-sized item. |
18:53:00 | FromDiscord | <jviega> Limited stack space used to be a bigger issue |
18:53:20 | termer | isn't windows' stack 2mb |
18:53:30 | termer | Linux's stack is 8mb by default if I remember correctly |
18:54:58 | FromDiscord | <jviega> Per thread yes |
18:56:20 | FromDiscord | <jviega> Stack size can be increased easily to very large values and the only downside is taking longer to detect recursion problems |
18:57:09 | FromDiscord | <jviega> In a 64 bit address space, with virtual memory, the max size is generally not very relevent |
18:57:09 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @termer "isn't windows' stack 2mb": Quite huge |
18:58:09 | termer | yeah, you'll be fine generally |
19:06:15 | FromDiscord | <djazz> In reply to @enthus1ast "in c you can,": in c++ you can quite quickly shoot your entire leg off xD |
19:09:11 | FromDiscord | <enthus1ast> but in c++ you have refs and such, so you can be much safer than in c |
19:13:26 | FromDiscord | <djazz> its a common joke haha i had to |
19:15:30 | armin | so 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:56 | FromDiscord | <enthus1ast> i write on matrix but it seems the discord bot bridges to irc |
19:18:12 | FromDiscord | <enthus1ast> (actually no idea how stuff is plugged together to be honest) |
19:19:04 | FromDiscord | <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:50 | FromDiscord | <Phil> I will be honest, I entirely do not get that sentence from armin |
19:40:13 | FromDiscord | <Phil> What does discord have to do with the channel through which you communicate. |
19:44:43 | FromDiscord | <0ffh> sent a code paste, see https://play.nim-lang.org/#ix=4EMu |
19:46:27 | FromDiscord | <0ffh> Here's a bit of context |
19:46:38 | FromDiscord | <0ffh> sent a code paste, see https://play.nim-lang.org/#ix=4EMv |
19:46:45 | FromDiscord | <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:04 | FromDiscord | <jviega> I'm not sure if that's better than the crashes I got in the rc's |
19:56:25 | FromDiscord | <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:20 | FromDiscord | <Phil> In reply to @0ffh "Thanks anyways. I just": And so the grip that devel has on devs continues |
20:09:01 | FromDiscord | <addiv> might be a problem with the cache? |
20:09:07 | FromDiscord | <addiv> try deleting home/user/.cache/nim/mil_r |
20:11:30 | FromDiscord | <0ffh> In reply to @addiv "might be a problem": Good idea, but I tried that. |
20:21:04 | FromDiscord | <.e.l.i> Is there a scraping lib for Nim? |
20:22:24 | FromDiscord | <jviega> What do you mean?? |
20:23:31 | FromDiscord | <srmordred> In reply to @.e.l.i "Is there a scraping": maybe this?↵https://github.com/GULPF/nimquery |
20:23:57 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4EMD |
20:23:59 | FromDiscord | <jviega> Oh, I thought he said "scripting" I need to learn to read |
20:24:12 | FromDiscord | <.e.l.i> I mainly write in Go, but nim has piqued my interest. So, something like Colly or Rod |
20:24:27 | FromDiscord | <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:59 | FromDiscord | <jviega> What'd you say? Let me turn up my hearing aid |
20:25:28 | FromDiscord | <Phil> "Back in my day!.... |
20:25:30 | FromDiscord | <Phil> (edit) "day!...." => "day!...."" |
20:26:02 | FromDiscord | <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:11 | FromDiscord | <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:28 | FromDiscord | <Phil> (edit) "webdriver" => "the nim-webdriver package" |
20:28:06 | FromDiscord | <.e.l.i> I see. Also, which gc is nim running now? Last I looked at nim was around 1.2 |
20:28:32 | FromDiscord | <0ffh> I think ORC is standard. |
20:28:35 | FromDiscord | <Phil> In 2.0? The default is ORC |
20:29:01 | * | rockcavera joined #nim |
20:29:10 | FromDiscord | <Phil> But "generally available and viable" are refc, ARC, ORC (which is ARC + a small cycle collector) and no gc at all. |
20:29:33 | FromDiscord | <Phil> (edit) "ARC," => "ARC and" | "collector) and" => "collector).↵And" | "gc" => "GC" | "all." => "all if you can live without any lib basically." |
20:30:15 | FromDiscord | <.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:55 | FromDiscord | <Phil> I think that includes the std/lib, but you'd need to ask somebody that actually tried to know for certain. |
20:31:13 | FromDiscord | <Phil> I generally use ORC or refc which both work fine for me on webdev. |
20:31:33 | FromDiscord | <0ffh> You might find someone over at #embedded |
20:34:00 | FromDiscord | <jviega> No, when you compile your code, it recompiles what it needs out of the std library |
20:34:09 | FromDiscord | <jviega> So it will use whatever gc your app uses |
20:34:32 | FromDiscord | <enthus1ast> @heysokam\: if strformat reached its Limits i tend to use nimja |
20:34:50 | FromDiscord | <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:22 | FromDiscord | <Phil> Aye, not like refc suddenly got shot in the leg or sth, it works perfectly fine |
20:38:47 | FromDiscord | <.e.l.i> Right, to install, I assume you just add the bin to PATH and run finish.exe? |
20:43:18 | FromDiscord | <.e.l.i> Oops, forgot to restart. |
20:50:10 | * | Guest82 joined #nim |
20:52:05 | * | advesperacit quit () |
20:54:16 | FromDiscord | <Phil> I mean, generally I just use choosenim |
20:54:22 | FromDiscord | <Phil> Works well enough for me on arch |
20:54:37 | * | Guest82 quit (Client Quit) |
21:04:26 | FromDiscord | <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:32 | FromDiscord | <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:31 | FromDiscord | <Elegantbeef> Right, no gc is pretty silly |
21:26:51 | FromDiscord | <acornes> sent a code paste, see https://play.nim-lang.org/#ix=4EMU |
21:27:16 | FromDiscord | <acornes> (edit) "https://play.nim-lang.org/#ix=4EMU" => "https://play.nim-lang.org/#ix=4EMV" |
21:27:29 | FromDiscord | <Elegantbeef> If only you explained what "this" was |
21:28:15 | FromDiscord | <acornes> well i want the proc to be able to send a different sequence of keys depending on the ChatType thats chosen |
21:28:33 | FromDiscord | <acornes> using the send() proc |
21:28:55 | FromDiscord | <acornes> but since it isnt a string or a float it wouldn't work in a case |
21:31:40 | FromDiscord | <Elegantbeef> Seems like you'd send enter, then send your string raw, then send enter |
21:35:13 | * | nils` joined #nim |
21:36:58 | FromDiscord | <acornes> oh i meant how to implement case to use the proc |
21:37:18 | FromDiscord | <acornes> or an alternative |
21:37:18 | FromDiscord | <Elegantbeef> What? |
21:37:25 | FromDiscord | <xfcisco> In reply to @acornes "oh i meant how": ehhh you're doing `case` on the type itself |
21:37:49 | FromDiscord | <xfcisco> sent a code paste, see https://play.nim-lang.org/#ix=4EMX |
21:37:50 | FromDiscord | <xfcisco> or maybe It's just a typo |
21:38:35 | FromDiscord | <acornes> well i just get this error: selector must be of an ordinal type, float or string |
21:39:06 | FromDiscord | <Elegantbeef> Right you're using the type not the value |
21:39:16 | FromDiscord | <Elegantbeef> You do not run a case on a type, you run a case on a value |
21:39:28 | FromDiscord | <acornes> oooh |
21:39:56 | FromDiscord | <xfcisco> lol |
21:40:07 | FromDiscord | <acornes> but is there a way to replicate the syntax of a case for a type? |
21:40:24 | FromDiscord | <Elegantbeef> With a macro, but you do not want a case for the type |
21:40:26 | FromDiscord | <xfcisco> like switching on a generic type like T ? |
21:40:52 | FromDiscord | <acornes> In reply to @Elegantbeef "With a macro, but": then how would i do it? |
21:42:19 | FromDiscord | <Elegantbeef> Like xfcisco showed |
21:42:45 | FromDiscord | <Elegantbeef> Change that `ChatType` to `chatType` |
21:44:11 | FromDiscord | <xfcisco> nah she wants to switch on a type argument |
21:44:34 | FromDiscord | <Elegantbeef> `when X is y` |
21:44:42 | FromDiscord | <Elegantbeef> That proc isnt a generic though |
21:45:25 | FromDiscord | <xfcisco> found this online |
21:45:41 | FromDiscord | <xfcisco> sent a code paste, see https://play.nim-lang.org/#ix=4EMY |
21:46:29 | FromDiscord | <acornes> sent a code paste, see https://play.nim-lang.org/#ix=4EMZ |
21:46:31 | FromDiscord | <acornes> like this? |
21:46:57 | FromDiscord | <Elegantbeef> Why are you asking me, I'm not a Nim compiler |
21:46:59 | FromDiscord | <acornes> let me test it hold on |
22:03:06 | FromDiscord | <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:29 | FromDiscord | <Elegantbeef> It's a biochemical limitation |
22:21:31 | FromDiscord | <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:42 | FromDiscord | <xfcisco> In reply to @0ffh "I find your lack": same. |
22:30:52 | FromDiscord | <xfcisco> In reply to @Elegantbeef "It's a biochemical limitation": skill issue tbh |
22:31:16 | termer | discord twitter speak |
22:41:56 | FromDiscord | <System64 ~ Flandre Scarlet> Btw, is it possible to add Rich Presence to a program with Nim? |
22:44:24 | FromDiscord | <xfcisco> In reply to @sys64 "Btw, is it possible": It's all just communicating with web apis right |
22:44:36 | FromDiscord | <xfcisco> discord bots, rich presence, etc.. |
22:44:45 | FromDiscord | <xfcisco> the libraries are just wrappers |
22:44:50 | FromDiscord | <xfcisco> try making your own library |
22:44:57 | FromDiscord | <xfcisco> or just wrapper in general |
22:47:08 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @xfcisco "the libraries are just": I guess I can futhark the wrapper? |
22:49:39 | FromDiscord | <System64 ~ Flandre Scarlet> Yeah there is an H file |
22:55:15 | FromDiscord | <xfcisco> no clue what you're talking about but sounds cool lol |
23:00:21 | termer | You can do it |
23:00:26 | termer | I think they have a C++ lib for it |
23:43:50 | * | ced2 is now known as cedb |