<< 06-01-2022 >>

00:00:40FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3Laq
00:01:52FromDiscord<Patitotective> (edit) "https://play.nim-lang.org/#ix=3Laq" => "https://play.nim-lang.org/#ix=3Las"
00:02:04FromDiscord<Patitotective> (edit) "https://play.nim-lang.org/#ix=3Las" => "https://paste.rs/wE4"
00:06:09FromDiscord<Elegantbeef> The pointer is typeless
00:06:13FromDiscord<Elegantbeef> What type is it supposed to be
00:07:44NimEventerNew Nimble package! base45 - Base45 encoder and decoder, see https://git.sr.ht/~ehmry/base45
00:08:32FromDiscord<Elegantbeef> You should do `cast[ptr YourType](data)[]`
00:08:33FromDiscord<Patitotective> In reply to @Elegantbeef "What type is it": I'm passing to it an object
00:08:58FromDiscord<Patitotective> In reply to @Elegantbeef "You should do `cast[ptr": where
00:09:03FromDiscord<Elegantbeef> Then you need to cast it to a ptr of that object
00:09:33FromDiscord<Elegantbeef> when you go to use the data you were given
00:12:22FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3Lax
00:13:08FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3Lay
00:13:12FromDiscord<Patitotective> (edit) "https://play.nim-lang.org/#ix=3Lax" => "https://play.nim-lang.org/#ix=3Laz"
00:15:58FromDiscord<impbox [ftsf]> argh, i can never figure out how to generate a lookup table at compile time
00:16:30FromDiscord<impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=3LaA
00:17:18FromDiscord<Elegantbeef> const
00:18:15FromDiscord<impbox [ftsf]> doesn't const have to be initialised?
00:18:26FromDiscord<impbox [ftsf]> i can't fill in a const
00:22:03FromDiscord<Elegantbeef> I mean why does it matter
00:22:15FromDiscord<impbox [ftsf]> uh... i'm just trying to figure out how to do this
00:22:23FromDiscord<impbox [ftsf]> how would you do it with const?
00:23:27FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3LaB
00:23:30FromDiscord<impbox [ftsf]> "compileTime variables are available at runtime too. This simplifies certain idioms where variables are filled at compile-time (for example, lookup tables) but accessed at runtime" trying to figure out the simple idiom for filling a lookup table at compile time
00:24:47FromDiscord<impbox [ftsf]> thanks beef <3
00:25:06FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3LaC
00:25:19FromDiscord<Elegantbeef> But it's best just make the procedure like i did since there isnt any reason to annotate it a compiletime proc/variable imo
00:26:23FromDiscord<impbox [ftsf]> yeah makes sense, was just going by what the manual said with regards to filling in variables at compile time, which after your example seems like the manual is misleading
00:27:45FromDiscord<Elegantbeef> I think it's not misleading just doesnt work always
00:28:38FromDiscord<Elegantbeef> That works for instance
00:28:40FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3LaD
00:29:18FromDiscord<impbox [ftsf]> misleading in that, you shouldn't do this because that's not the simple idiomatic way
00:31:46NimEventerNew Nimble package! nimdenter - A tool for people who don't like Nim's indentation-based syntax, see https://github.com/xigoi/nimdenter
00:32:11FromDiscord<impbox [ftsf]> downloads another language?
00:32:33FromDiscord<Elegantbeef> No it's just commented out `{}`s
00:32:40FromDiscord<Elegantbeef> Uses them to reason indention
00:33:01FromDiscord<impbox [ftsf]> so i see...
00:37:18FromDiscord<congusbongus> looks like BCPL in a way
00:40:07FromDiscord<huantian> Can I run a bunch of async functions concurrently, with a max number running at once?↵I was thinking of trying to do it by chaining callbacks, but not sure if that's the proper way
00:40:49FromDiscord<Elegantbeef> I swear i heard this question before
00:41:06FromDiscord<huantian> I asked it somewhere in the past I think
00:41:23FromDiscord<Elegantbeef> I dont use async so can only nod
00:41:49FromDiscord<huantian> I'd assume async is the right thing to use for this and not threading too right
00:41:56FromDiscord<congusbongus> async is single-threaded isn't it? So it's not actually running at once
00:42:00FromDiscord<Elegantbeef> Depends on what you're limited by
00:42:07FromDiscord<Elegantbeef> If you're limited by IO then async is right
00:42:15FromDiscord<Elegantbeef> If you're limited by cpu then threading is right
00:42:26FromDiscord<huantian> ok that makes sense
00:43:10FromDiscord<congusbongus> Raymond Hettinger did a good talk on async vs threading vs multiprocessing
00:56:18FromDiscord<huantian> hm it seems as if httpclient is not having a good time with multiple downloadFiles at the same time
00:56:47FromDiscord<Elegantbeef> async or sync?
00:56:51FromDiscord<huantian> async
00:57:05FromDiscord<impbox [ftsf]> are you using a different client for each download?
00:57:08FromDiscord<Elegantbeef> Different clients?
00:57:14FromDiscord<huantian> should I be?
00:57:16FromDiscord<Elegantbeef> God dammit imp
00:57:25FromDiscord<huantian> sniped
00:57:28FromDiscord<Elegantbeef> Yes you should two concurrent connections waiting for data sounds horrid
00:57:54FromDiscord<Elegantbeef> Atleast i think you should
01:01:48NimEventerNew Nimble package! jalali_nim - Jalili <=> Gregorian date converter, originally a copy of http://jdf.scr.ir/, see https://github.com/hamidb80/jalili-nim
01:11:24NimEventerNew thread by Oyster: Real type of openArray?, see https://forum.nim-lang.org/t/8779
01:28:29*NimBot joined #nim
01:29:01*Guest6782 quit (Ping timeout: 240 seconds)
01:44:46*noeontheend joined #nim
02:32:23*neurocyte091 joined #nim
02:34:51*neurocyte09 quit (Ping timeout: 256 seconds)
02:34:52*neurocyte091 is now known as neurocyte09
02:41:16*arkurious quit (Quit: Leaving)
02:57:57*noeontheend quit (Ping timeout: 240 seconds)
04:10:08*noeontheend joined #nim
05:04:57*noeontheend quit (Ping timeout: 240 seconds)
05:09:56*yitr joined #nim
05:17:59*rockcavera quit (Remote host closed the connection)
05:26:28*mahlon_ is now known as mahlon
05:46:56*yitr quit (Quit: Client closed)
07:01:37*nac quit (Quit: The Lounge - https://thelounge.chat)
07:02:03*nac joined #nim
07:27:51*dithpri joined #nim
07:49:09*PMunch joined #nim
07:53:15*dithpri quit (Ping timeout: 276 seconds)
08:59:55*Gustavo6046 quit (Quit: Leaving)
09:51:38*pro joined #nim
09:51:41*pro left #nim (#nim)
09:52:26*pro joined #nim
10:48:08FromDiscord<SirOlaf> Varargs really are quite scuffed https://play.nim-lang.org/#ix=3Ld0
10:48:56FromDiscord<Elegantbeef> Eh that's kinda tobe expected
10:49:28FromDiscord<SirOlaf> Would be one confusing error to encounter
10:49:45FromDiscord<Elegantbeef> Sure but `varargs[typedesc]` is a nonsensical collection of ints
10:49:52FromDiscord<Elegantbeef> In this case
10:50:09FromDiscord<Elegantbeef> typedesc is a typeclass so it binds to the first one
10:50:35FromDiscord<SirOlaf> What does that mean?
10:50:55FromDiscord<Elegantbeef> `varargs[typedesc]` is just a stupid complicated version of `typedesc`
10:51:19FromDiscord<Elegantbeef> You cannot have a varargs of anything but the first typedesc passed
10:51:23FromDiscord<Elegantbeef> since it
10:51:33FromDiscord<Elegantbeef> it's a homogeneous collection\
10:51:45FromDiscord<SirOlaf> Huh, that's interesting
10:51:53FromDiscord<SirOlaf> Would have expected typedesc to be more concrete for some reason
10:53:07FromDiscord<SirOlaf> So why does it fail with a single int type passed?
10:53:13FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/NCe
10:53:31FromDiscord<Elegantbeef> It fails on Cgen afaict
10:54:47FromDiscord<Elegantbeef> The failure is probably just the type not being assigned but eitherway an error should be emitted for `varargs[typedesc]`
10:55:22FromDiscord<Elegantbeef> It's a pointless collection that can only ever be used at CT
10:56:13FromDiscord<SirOlaf> Doesn't typeof make it "usable" at runtime
10:59:11FromDiscord<Elegantbeef> No cause that's a compile time statement
10:59:17FromDiscord<Elegantbeef> It's a pointless construct
10:59:40FromDiscord<Elegantbeef> What's the benefit of `[int, int, int]` verses `static int`
10:59:53FromDiscord<Elegantbeef> If you want `varargs[typedesc]` just do `typedesc[tuple]`
11:00:50FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/oP4
11:01:07FromDiscord<Elegantbeef> `typeof` evaluates the expression and returns the type at compile time
11:01:57FromDiscord<SirOlaf> sent a code paste, see https://play.nim-lang.org/#ix=3Ld9
11:02:20FromDiscord<Elegantbeef> Come again?
11:02:29FromDiscord<SirOlaf> Using tuple does not compile for me
11:02:38FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3Ldb
11:02:40FromDiscord<Elegantbeef> Runs fine
11:02:47FromDiscord<SirOlaf> That's weird
11:03:24FromDiscord<SirOlaf> Oh, it's because I didn't have a trailing comma
11:03:34FromDiscord<Elegantbeef> Anyway i'm going to sleep, so this has been "4am rants with beef"
11:03:59FromDiscord<SirOlaf> gn. I'll keep having fun with weird features
11:36:38*jjido joined #nim
11:41:15*jjido quit (Client Quit)
11:53:07*fvs joined #nim
12:45:18FromDiscord<Smarc> https://github.com/Smarcy/connect_the_dotfiles/blob/master/src/connect_the_dotfiles.nim↵After adding and then removing a file, listing all saved files (reading StorageFile at the whole) does return nothing although there should be something there. I think I am missing some File-handling stuff I don't know about, could anyone give me a hint?
12:47:26*rockcavera joined #nim
12:47:27*rockcavera quit (Changing host)
12:47:27*rockcavera joined #nim
12:49:52*jjido joined #nim
12:58:58FromDiscord<Rika> what do you mean?
12:59:36FromDiscord<Rika> your code probably is wrong
13:00:19FromDiscord<Rika> im gonna check it again wait
13:02:44FromDiscord<Rika> https://github.com/Smarcy/connect_the_dotfiles/blob/master/src/connect_the_dotfiles.nim#L90 probably that you do not close this file before you move it
13:02:59FromDiscord<Rika> @Smarc
13:07:44FromDiscord<Smarc> Ah, because the `defer: f.close()` happens only after the proc?
13:10:55FromDiscord<Smarc> nevermind, i forgot `defer tmpF.close()` .. you were right, thank you!
13:17:28FromDiscord<SecureThisShit> sent a long message, see http://ix.io/3Lee
13:31:03FromDiscord<kaddkaka> In reply to @SecureThisShit "One question: I'm using": If you only have the address of the string and it contains sentinel values, you need to hace some other information on where the the string ends. for example a length?
13:32:01FromDiscord<Michal Maršálek> I'm want to create a template that would take a type and return a value of that type and I'm struggling a bit. Can someone help, please? https://play.nim-lang.org/#ix=3Lej
13:32:52*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
13:33:59FromDiscord<eyecon> What would it return when it would be called by, I dunno, a tuple?
13:34:08FromDiscord<eyecon> (edit) "by," => "with,"
13:34:12FromDiscord<Michal Maršálek> Basically something similar to static constants in OOP languages
13:34:38FromDiscord<Michal Maršálek> In reply to @eyecon "What would it return": I only want it for some types.
13:38:08FromDiscord<kaddkaka> I took a guess: https://play.nim-lang.org/#ix=3Lej
13:38:20FromDiscord<kaddkaka> `@[one(typeof S)]`
13:38:42FromDiscord<kaddkaka> Seems to work, I'm not sure if it's correct.
13:39:22FromDiscord<kaddkaka> @Michal Maršálek (Thats in response to your code)
13:39:54FromDiscord<kaddkaka> (edit) "https://play.nim-lang.org/#ix=3Lej" => "https://play.nim-lang.org/#ix=3Leo"
13:56:14FromDiscord<eyecon> Related question: Is there a way to get `int` from `seq[int]` in generics? I.e. to have a generic function of type S, which is a container of T, and return T?
13:59:23FromDiscord<eyecon> `proc contained_type[S: openarray](): typedesc = # to return the type of S's elements, e.g. int for seq[int]`
14:00:50*katsuragi joined #nim
14:00:55*katsuragi left #nim (WeeChat 2.9)
14:03:26FromDiscord<SecureThisShit> In reply to @kaddkaka "If you only have": I also have the length. I could do for example memory allocation and copyMem() but I think there should be a simpler solution or not?
14:10:29FromDiscord<Solitude> In reply to @eyecon "Related question: Is there": https://nim-lang.org/docs/typetraits.html#genericParams.t%2Ctypedesc
14:13:08*arkurious joined #nim
14:25:58*rockcavera quit (Remote host closed the connection)
14:27:01FromDiscord<Michal Maršálek> In reply to @kaddkaka "Seems to work, I'm": Seems to work, but feels like a workaround.... is there a way to fix the signature of that template so that `S:typedesc`?
14:29:53FromDiscord<Solitude> In reply to @Michal58 "I'm want to create": i think someone reported that issue...
14:30:21*pro quit (Quit: WeeChat 3.4)
14:30:34FromDiscord<Michal Maršálek> In reply to @Solitude "i think someone reported": what is the issue? I don't really understand what is happening there
14:31:21FromDiscord<Solitude> In reply to @Michal58 "what is the issue?": https://github.com/nim-lang/Nim/issues/13527
14:31:36FromDiscord<Solitude> generics parameters in templates get treated as values
14:32:26FromDiscord<Solitude> you can change definitions to proc and it works correctly
14:33:27FromDiscord<Solitude> In reply to @Michal58 "what is the issue?": oh, i reported it https://github.com/nim-lang/Nim/issues/17240
14:34:09FromDiscord<Michal Maršálek> hmm
14:38:06FromDiscord<Solitude> In reply to @Michal58 "hmm": you can also use typetraits module to operate directly on typedesc parameter instead of generic parameter https://play.nim-lang.org/#ix=3LeQ
14:38:57FromDiscord<Michal Maršálek> Thank you will look into that
14:39:13FromDiscord<Michal Maršálek> Is there a more canonical way to define these "static" constants?
14:41:03FromDiscord<Solitude> look aight to me. but you are stepping into a minefield combining templates and generics.
14:42:27FromDiscord<Michal Maršálek> I was using converters initially but they were executed where t was nonsensical so I abondonded them
14:43:41FromDiscord<Michal Maršálek> Also why debugging my macros, I noticed a minor bug in `toStrLit` output: https://play.nim-lang.org/#ix=3LeT
14:44:01FromDiscord<Michal Maršálek> the `` needs backticks around it
14:44:17FromDiscord<Michal Maršálek> but `toStrLit` doesn't produce them
14:51:16FromDiscord<eyecon> In reply to @Solitude "https://nim-lang.org/docs/typetraits.html#genericPa": Thanks!
14:56:56FromDiscord<exelotl> https://play.nim-lang.org/#ix=3Lf4 lol
14:57:08FromDiscord<exelotl> linked lists are buggy
14:57:20FromDiscord<Michal Maršálek> In reply to @Solitude "look aight to me.": Thanks
14:59:37FromDiscord<eyecon> In reply to @Solitude "https://nim-lang.org/docs/typetraits.html#genericPa": I got an internal error while testing this: https://play.nim-lang.org/#ix=t%20wr
15:00:01FromDiscord<Solitude> In reply to @eyecon "I got an internal": wrong link
15:00:09FromDiscord<eyecon> Sorry, wrong one
15:00:10FromDiscord<Solitude> you got played by playground
15:03:06FromDiscord<eyecon> I meant: https://play.nim-lang.org/#ix=3Lfl
15:06:22FromDiscord<Solitude> In reply to @eyecon "I meant: https://play.nim-lang.org/#ix=3Lfl": nim moment
15:06:31FromDiscord<Solitude> feel free to create the issue
15:11:07FromDiscord<Solitude> In reply to @eyecon "I meant: https://play.nim-lang.org/#ix=3Lfl": if you only need to extract generic parameter from sequences, you can use this https://play.nim-lang.org/#ix=3Lfu
15:12:51FromDiscord<Michal Maršálek> What does "Error: Invalid node kind nnkCall for macros.`$`" mean?
15:13:35FromDiscord<eyecon> In reply to @Solitude "feel free to create": https://github.com/nim-lang/Nim/issues/19334
15:13:55FromDiscord<Solitude> you cant $/echo NimNodes directly, you need repr/treeRerp them
15:13:56*dithpri joined #nim
15:14:03FromDiscord<Solitude> In reply to @Michal58 "What does "Error: Invalid": ^
15:14:08FromDiscord<kaddkaka> sent a code paste, see https://play.nim-lang.org/#ix=3Lfv
15:14:19FromDiscord<Michal Maršálek> I see
15:14:26FromDiscord<eyecon> In reply to @Solitude "if you only need": Interesting approach, thanks, but mine is still supposed to work, right?
15:14:27FromDiscord<Michal Maršálek> I need to use toStrLit or something
15:14:54FromDiscord<Solitude> In reply to @eyecon "Interesting approach, thanks, but": whatever you're doing compiler shouldn;t crash
15:15:31FromDiscord<kaddkaka> `Error: unhandled exception: index 127 not in 0 .. 6 [IndexDefect]` is related to my `characters` string only having indices `0..6`, but if I make that string long enough, everything outputs "correctly".
15:15:45FromDiscord<kaddkaka> @Solitude oh, is that a compiler crash
15:16:02FromDiscord<eyecon> In reply to @Solitude "whatever you're doing compiler": Yes, but more than not crashing, it should give the same output as a direct call, right? At least I don't see why not
15:16:29FromDiscord<Solitude> yas
15:17:01FromDiscord<kaddkaka> (sorry got confused)
15:19:11FromDiscord<kaddkaka> sent a code paste, see https://play.nim-lang.org/#ix=3Lfy
15:21:11FromDiscord<Solitude> you're trolling
15:21:12FromDiscord<Solitude> second
15:21:13FromDiscord<Solitude> sent a code paste, see https://play.nim-lang.org/#ix=3Lfz
15:21:14FromDiscord<Solitude> what the hell
15:22:14FromDiscord<kaddkaka> @Solitude I'm playing in the playground: https://play.nim-lang.org/#ix=3LfA
15:23:06FromDiscord<kaddkaka> The crash looks strange. I encountered it because I was stupid and created a function called `char`.
15:25:10FromDiscord<Michal Maršálek> In reply to @demotomohiro "It seems you cannot": Ha! Sometimes you can?!!: https://play.nim-lang.org/#ix=3LfB
15:25:42FromDiscord<Solitude> In reply to @kaddkaka "The crash looks strange.": its because function calls have high priority than type conversions i guess↵` if c <= 127.char:` this is the line in system that invokes your `char`
15:25:48FromDiscord<Solitude> (higher
15:29:43FromDiscord<kaddkaka> @Solitude In what file is that? I'm looking at `/home/david/.choosenim/toolchains/nim-1.6.0/lib/system.nim` right now
15:30:28FromDiscord<kaddkaka> found it line 2913, thanks
15:30:28FromDiscord<Solitude> right there, addQuoted
15:31:12FromDiscord<kaddkaka> sent a code paste, see https://play.nim-lang.org/#ix=3LfG
15:31:39FromDiscord<Solitude> because only strings in collections/objects need addQuoted
15:31:44FromDiscord<Solitude> and the second one is empty
15:34:59FromDiscord<kaddkaka> Right
15:38:47NimEventerNew Nimble package! xlsxio - This is a xlsxio wrapper done Nim in mind., see https://github.com/jiiihpeeh/xlsxio-nim
15:38:53FromDiscord<kaddkaka> sent a code paste, see https://play.nim-lang.org/#ix=3LfJ
15:39:04FromDiscord<Solitude> they dont need to be escaped?
15:39:10FromDiscord<Solitude> why would you want your string to be quoted
15:47:31FromDiscord<SirOlaf> In reply to @exelotl "linked lists are buggy": Someone forgot to fix the tail
15:49:57FromDiscord<Michal Maršálek> How can I define what happens on explicit type conversion like `MyType 1`? I can somewhat control that by defining a converter from `int` to `MyType`, however that leads to implicit conversions happening which I don't want. Is there a way to allow only explicit conversions?
15:55:34*jjido joined #nim
15:56:35FromDiscord<Rika> You can’t explicitly convert object types afaik
15:59:46FromDiscord<Michal Maršálek> I'm sad
16:00:19*jjido quit (Client Quit)
16:00:59FromDiscord<kaddkaka> In reply to @Solitude "its because function calls": Is it possible to explicit call the type conversion and not the function?
16:01:06FromDiscord<Rika> Use a procedure, toX or a to(your type, typedesc)
16:01:16FromDiscord<Rika> In reply to @kaddkaka "Is it possible to": Rename the function please
16:01:36FromDiscord<kaddkaka> i@Rika that's not what I'm asking, but ofc I will not have a function named lke that
16:01:43FromDiscord<Rika> No
16:01:51FromDiscord<Rika> There is no way from what I know
16:01:54FromDiscord<kaddkaka> ok
16:08:48FromDiscord<SirOlaf> sent a code paste, see https://play.nim-lang.org/#ix=3LfY
16:09:02FromDiscord<SirOlaf> The type itself gets allowed
16:10:26FromDiscord<Rika> Have you tried? what error?
16:10:45FromDiscord<Patitotective> sent a code paste, see https://paste.rs/WBC
16:10:53FromDiscord<Rika> .isNil
16:11:14FromDiscord<SirOlaf> https://play.nim-lang.org/#ix=3Lg2 "cannot create null element for: tyVoid"
16:11:15FromDiscord<Patitotective> Oh ok :upś
16:11:20FromDiscord<Patitotective> (edit) ":upś" => "🙃"
16:12:03FromDiscord<SirOlaf> In reply to @SirOlaf "https://play.nim-lang.org/#ix=3Lg2 "cannot create n": Casting 0 to the type works though
16:12:08FromDiscord<Rika> Huh
16:12:13FromDiscord<Rika> Funky
16:13:21FromDiscord<SirOlaf> Nice, I got the compiler to crash with it
16:13:38FromDiscord<SirOlaf> https://play.nim-lang.org/#ix=3Lg6
16:14:06FromDiscord<SirOlaf> So void should probably not be allowed in that context
16:15:38FromDiscord<eyecon> Two compiler crashes in a day, lucky us
16:15:56FromDiscord<SirOlaf> To be fair, I'm actively looking for issues
16:16:07FromDiscord<eyecon> Well, I'm not 😄
16:30:03FromDiscord<SirOlaf> Also found a weird varargs bug yesterday where the parameters share a memory location
16:45:29FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3Lgg
16:45:55FromDiscord<Solitude> what the hell is stopwatch
16:45:59FromDiscord<Solitude> does it have state field
16:46:01FromDiscord<Solitude> is it exported
16:46:11FromDiscord<Patitotective> sorry i forgot that part lol
16:46:14FromDiscord<Patitotective> one sec
16:46:40FromDiscord<Patitotective> (edit) "https://play.nim-lang.org/#ix=3Lgg" => "https://play.nim-lang.org/#ix=3Lgh"
16:46:44FromDiscord<Solitude> export the field
16:47:03FromDiscord<Patitotective> Do you mean ``?
16:47:06FromDiscord<Solitude> yes
16:47:16FromDiscord<Patitotective> Do I need to do that for all the fields?
16:47:31FromDiscord<Rika> All the fields you care about
16:47:32FromDiscord<Rika> Yes
16:47:48FromDiscord<Solitude> In reply to @Patitotective "Do I need to": https://nim-lang.org/docs/tut1.html#advanced-types-objects
16:48:55FromDiscord<Patitotective> Is there a way to export all fields?
16:50:39*dithpri left #nim ('); DROP TABLE Users;--)
16:51:01FromDiscord<Rika> Automatically no
16:51:02FromDiscord<Solitude> you could write a macro for that, otherwise no
16:51:15FromDiscord<Rika> Well yeah but that’s probably not what he wants…
16:51:44FromDiscord<Rika> Well if you want someone to do it for you wait for beef to wake up or something I don’t know
16:52:11FromDiscord<Solitude> or use an editor where placing bunch of stars isnt a problem
16:52:14FromDiscord<Patitotective> It's okay 🙃
16:53:26FromDiscord<Patitotective> Also Nim seems to be super awesome, oop and pointers specifically (im a python programmer)
16:56:58FromDiscord<Patitotective> btw is it possible to have an emtpy procedure? so if I call it it happens nothing?
16:56:59FromDiscord<Patitotective> (edit) "nothing?" => "nothing"
16:57:06*Figworm quit (Quit: Figworm)
16:57:50FromDiscord<Solitude> `discard`
17:00:51FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3Lgr
17:01:14FromDiscord<Patitotective> (edit) "https://play.nim-lang.org/#ix=3Lgr" => "https://play.nim-lang.org/#ix=3Lgs"
17:04:32FromDiscord<Patitotective> Or should I use m a c r o s ?
17:04:56FromDiscord<Solitude> you should, but what do you want this code to do?
17:05:50FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3Lgt
17:06:42FromDiscord<Solitude> why does it have to be `let myProc` instead of normal procedure definition?
17:07:16*rockcavera joined #nim
17:07:16*rockcavera quit (Changing host)
17:07:16*rockcavera joined #nim
17:07:16FromDiscord<Solitude> and yes, you can do that.
17:07:50FromDiscord<Patitotective> In reply to @Solitude "why does it have": cause `myProc` is really a field of an object
17:09:09FromDiscord<Patitotective> In reply to @Solitude "and yes, you can": I'm getting `Error: expression expected, but found 'keyword discard'`
17:09:41FromDiscord<Solitude> can you slap some parens around it?
17:10:37FromDiscord<Patitotective> In reply to @Solitude "can you slap some": huh? where?
17:10:43FromDiscord<Solitude> around proc definition
17:10:51*Figworm joined #nim
17:11:44FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3Lgx
17:13:11FromDiscord<Solitude> sent a code paste, see https://play.nim-lang.org/#ix=3Lgy
17:14:42*pro joined #nim
17:17:28FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3LgA
17:18:09*rockcavera quit (Ping timeout: 256 seconds)
17:18:26FromDiscord<Solitude> remove `: StopwatchProc`
17:20:06FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3LgD
17:20:25FromDiscord<Patitotective> (edit) "https://play.nim-lang.org/#ix=3LgD" => "https://play.nim-lang.org/#ix=3LgE"
17:22:13FromDiscord<eyecon> @Patitotective check this out too, maybe it works for you: https://github.com/mratsim/Synthesis
17:22:15FromDiscord<Solitude> you didnt change my snippet to fit your code...
17:22:35FromDiscord<Solitude> your procs should have the signature of StopwatchProc
17:24:16FromDiscord<Patitotective> sent a code paste, see https://paste.rs/sGp
17:24:38FromDiscord<Solitude> thats literally what i told you to do...
17:24:50FromDiscord<Patitotective> hmmmm lol
17:28:17FromDiscord<Rosen> bruh moment
17:45:51*rockcavera joined #nim
17:45:51*rockcavera quit (Changing host)
17:45:51*rockcavera joined #nim
17:48:37FromDiscord<SirOlaf> sent a code paste, see https://play.nim-lang.org/#ix=3LgO
17:49:29FromDiscord<Rosen> why would you like that
17:49:30FromDiscord<Rosen> that's awful
18:21:28*Gustavo6046 joined #nim
18:23:44*neurocyte09 quit (Read error: Connection reset by peer)
18:24:33*neurocyte091 joined #nim
18:41:58*krux02 joined #nim
19:12:05FromDiscord<Hamid_Bluri> sent a code paste, see https://play.nim-lang.org/#ix=3Lhg
19:12:43FromDiscord<enthus1ast> also with --gc\:arc ?
19:12:51FromDiscord<Hamid_Bluri> with every gc
19:13:37FromDiscord<Hamid_Bluri> i think i dont know something about GC
19:13:57FromDiscord<Hamid_Bluri> nim's GC actually
19:18:40FromDiscord<Solitude> seq doesnt release its capacity
19:19:55FromDiscord<Solitude> nvm
19:20:08FromDiscord<Hamid_Bluri> seq just stores `ref` of string
19:20:44FromDiscord<Solitude> nim doesnt release the memory allocated
19:20:48FromDiscord<Hamid_Bluri> http://zevv.nl/nim-memory/
19:20:55FromDiscord<Solitude> you have to use -d:useMalloc for that
19:22:05FromDiscord<Solitude> yep, releases fine with malloc
19:22:17FromDiscord<Hamid_Bluri> no difference
19:22:25FromDiscord<Solitude> useMalloc only works with arc/orc
19:22:36FromDiscord<Solitude> its expected behaviour
19:23:16FromDiscord<Hamid_Bluri> why's refc doesn't release allocated memory?
19:23:31FromDiscord<Hamid_Bluri> (edit) "why's" => "why"
19:23:32FromDiscord<Solitude> its not refc, its nims allocator
19:24:19FromDiscord<Solitude> it doesnt release memory back to os, so it can be reused faster, probably
19:24:45FromDiscord<Hamid_Bluri> thanks
19:25:02FromDiscord<Solitude> status have pr to nim that ports useMalloc to refc
19:34:22*jjido joined #nim
19:39:36*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
19:56:54FromDiscord<michaelb> when adding pragma/s to a proc is it possible to have some conditions, e.g. if there's variation re: the version of Nim?
19:57:31FromDiscord<michaelb> or is it a matter of using `when/else` in combination with push/pop above below the definition of the proc?
19:59:22FromDiscord<Solitude> In reply to @brainproxy "when adding pragma/s to": huh? maybe this can help https://nim-lang.org/docs/manual.html#userminusdefined-pragmas-pragma-pragma
20:00:17FromDiscord<michaelb> ah very nice, will try that
20:00:20FromDiscord<michaelb> thank you
20:01:19FromDiscord<enthus1ast> can i forward declare a proc in another file?
20:01:31FromDiscord<enthus1ast> like c in c headers?
20:03:18FromDiscord<Solitude> if you mean module, then no. why do you need that
20:03:43FromDiscord<enthus1ast> i have a recursive dependecy that i do not know to break up yet
20:03:51FromDiscord<enthus1ast> how to
20:04:04FromDiscord<Solitude> actually, there is a hack with using importc and exportc
20:04:18FromDiscord<Solitude> but its a hack and you should feel bad for using it
20:04:28FromDiscord<enthus1ast> ah before i go this route i will try to refactor
20:06:50FromDiscord<enthus1ast> ok i think i have a solution, i must strictly break up types and procs and put the types in their own module
20:09:02Zevvwhat's with nim releasing memory
20:11:40FromDiscord<michaelb> In reply to @enthus1ast "ok i think i": happens that way quite frequently
20:11:42FromDiscord<michaelb> ime
20:15:16*jjido joined #nim
20:16:09FromDiscord<Patitotective> Is it possible to create a _windows_ executable from linux?
20:16:28FromDiscord<Solitude> yes, install mingw
20:24:14prowhat you want is wine
20:24:56nrds<Prestige99> nah pro
20:25:06proyeah I missread nrds
20:25:49FromDiscord<Patitotective> In reply to @Solitude "yes, install mingw": what do i do now?
20:27:01FromDiscord<michaelb> sent a long message, see http://ix.io/3LhD
20:27:12FromDiscord<Sabena Sema> sigh working in C and Rust lately and wow, it drives home home much “thrust to weight” nim has
20:27:16FromDiscord<Solitude> In reply to @Patitotective "what do i do": compile with -d:mingw
20:27:39FromDiscord<Sabena Sema> you can also run msvc under wine
20:27:48FromDiscord<michaelb> (edit) "http://ix.io/3LhD" => "http://ix.io/3LhE"
20:28:20FromDiscord<Sabena Sema> theres a set of scripts to download and extract msvc and the sdks independent from the vs installer
20:28:51FromDiscord<Sabena Sema> this can be handy if you need to do SEH or c++ things
20:29:47FromDiscord<Sabena Sema> In reply to @brainproxy "if you have windows": msys2 is almost the same as cygwin tbh, they regularly take patches from eachother/sync their code
20:30:03FromDiscord<michaelb> it's really not
20:30:15FromDiscord<michaelb> or that's to say, it's missing a lot of the point of MSYS@
20:30:18FromDiscord<michaelb> (edit) "MSYS@" => "MSYS2"
20:30:31FromDiscord<Sabena Sema> it is, mingw-w64 is the “different” part
20:30:54FromDiscord<Patitotective> @Sabena Sema It seems a little bit complex, I will try what @Solitude said and if it doesn't work I know who to ask 😉
20:31:04FromDiscord<michaelb> do you understand the concept of MSYS2's environments? UCRT64 vs MINGW64 vs. CLANG32?
20:31:15FromDiscord<Sabena Sema> I think you can even install mingw-w64 and use it from cygwin
20:31:16FromDiscord<michaelb> what they bring to the table?
20:31:28FromDiscord<Sabena Sema> yeah, they are basically shell profiles
20:31:40FromDiscord<michaelb> with different /usr/lib
20:31:43FromDiscord<Sabena Sema> yes
20:32:02FromDiscord<Sabena Sema> also: use ucrt64 if at all possible
20:32:12FromDiscord<michaelb> anyway, point is you can generate standalone native exe
20:32:16FromDiscord<michaelb> I
20:32:20FromDiscord<Sabena Sema> the old msvcrt is bug ridden and basically unmaintained
20:32:28FromDiscord<Sabena Sema> yeah
20:32:31*stkrdknmibalz joined #nim
20:33:20FromDiscord<michaelb> I've had luck compiling on Win 10 + MSYS2 with `-static` and then copying the executable to a bare bones Windows 7 machine (nothing of msys2 or cygwin installed) and it worked fine
20:33:29FromDiscord<michaelb> context being Nim programming
20:33:39FromDiscord<Sabena Sema> static doesnt do the same thing on windows as linux
20:33:51FromDiscord<Sabena Sema> windows does not have “static executables”
20:34:06FromDiscord<Sabena Sema> it just modifies the linkers preference for static vs dynamic libs
20:34:21FromDiscord<Sabena Sema> for pe hosts
20:35:34FromDiscord<michaelb> fair enough, you're more knowledgeable than me in this area apparently; what I meant is that with help of `-static` passed to gcc in msys2 mingw64 environment on win 10, I was able to produce a program that I could copy to an old Win 7 box and it ran fine though that box didn't have anything ever installed having to do with msys2, cygwin, etc.
20:35:44FromDiscord<Sabena Sema> you shouldn’t use it on linux either tbh, it can opt you out of some security features, and you dont get the vdso
20:36:01FromDiscord<Sabena Sema> yeah
20:36:34FromDiscord<Sabena Sema> Thats possible with the ucrt as well if I’m not mistaken, there is a static version of the ucrt
20:36:44FromDiscord<michaelb> yes, I believe so
20:36:49FromDiscord<Sabena Sema> idk if `-static` alone picks it up
20:37:34FromDiscord<michaelb> ucrt is definitely preferable, and has proper support for utf-8
20:37:44FromDiscord<michaelb> msvcrt lacks that
20:39:54FromDiscord<Sabena Sema> tbh it should also be possible to link with msvcversion.dll to, in theory, but because that would mean you need to redistribute a nonfree file the mingw folks were never interested in supporting it, which is why the horrid and crufty msvcrt.dll was the default for so long
20:40:20FromDiscord<Sabena Sema> it also is non-broken under multithreading
20:40:23FromDiscord<Sabena Sema> and is faster
20:41:33FromDiscord<Sabena Sema> seriously msvcrt hasnt been updated except for extremely critical security issues since 1998
20:41:55FromDiscord<michaelb> win 98 ftw
21:15:32FromDiscord<Isofruit> sent a code paste, see https://play.nim-lang.org/#ix=3LhU
21:16:04FromDiscord<Isofruit> I know I can iterate over the fields using the `fieldPair`iterator, but that gives me the field name as a string and the fieldvalue as a... wait I can just call fieldvalue.type()
21:16:25FromDiscord<Isofruit> (edit) "I know I can iterate over the fields using the `fieldPair`iterator, but that gives me the field name as a string and the fieldvalue as a... wait I can just call fieldvalue.type() ... " added "and compare that with my type"
21:16:27FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3LhV
21:16:39FromDiscord<Isofruit> That looks a lot simpler than what I had in mind
21:17:05FromDiscord<Isofruit> fields is defined for types? When I skimmed over the page for it, I only glimpsed one for strings
21:17:24FromDiscord<Isofruit> Wait no , that was the pairs iterator
21:17:33FromDiscord<Isofruit> Fuck my brain today, curse this log4j hell
21:17:35FromDiscord<Elegantbeef> https://nim-lang.org/docs/iterators.html#fields.i%2CT
21:18:03FromDiscord<Isofruit> Thanks Beef!
21:18:33FromDiscord<SirOlaf> Hey Beef, what do you think of my newest creation? https://github.com/nim-lang/Nim/issues/19335
21:19:38FromDiscord<Elegantbeef> I mean not helpful compiler errors suck, but stuff like this is like "No stop it, dont hit yourself, oh no what will i do"
21:20:05FromDiscord<SirOlaf> Oh yeah, I agree, this is some very obscure stuff. But was funny to see what it did
21:20:26FromDiscord<Elegantbeef> I mean it's not exactly obscure as completely pointless 😀
21:20:43FromDiscord<SirOlaf> The pointless part is allowing void in type declarations
21:20:57FromDiscord<Elegantbeef> Exactly
21:21:25FromDiscord<Elegantbeef> My point is more "Ok so void is 'allowed', but if you use it you're a purposely writing code that will not work"
21:21:59FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3LhY
21:22:17FromDiscord<Solitude> In reply to @SirOlaf "The pointless part is": its not entirely pointless, it only breaks if void is only field
21:23:10FromDiscord<SirOlaf> No, void never works
21:23:12FromDiscord<Elegantbeef> Attempting to instantiate void is the issue
21:23:17FromDiscord<Solitude> sent a code paste, see https://play.nim-lang.org/#ix=3LhZ
21:23:25FromDiscord<SirOlaf> You cannot instantiate the void
21:23:31FromDiscord<Elegantbeef> I've used `distinct void` multiple times as a named flag
21:23:44FromDiscord<Elegantbeef> Void does work in typedefs
21:24:00*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
21:24:30FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Li0
21:24:34FromDiscord<Elegantbeef> Here's a valid use of void in a type def
21:24:46FromDiscord<Elegantbeef> We make a type that's usable as a flag to a parameter
21:25:06FromDiscord<Elegantbeef> You can also use void in a typeclass of course
21:25:19FromDiscord<Elegantbeef> Unless you meant object definitions
21:25:41FromDiscord<SirOlaf> When using void as a concrete type in a object definition it seems kinda pointless
21:25:50FromDiscord<Isofruit> Is there an iterator you can use directly on a type as opposed to an instance of a type?
21:25:51FromDiscord<Elegantbeef> It's 100% pointless
21:26:15FromDiscord<SirOlaf> Good, so I'm not just missing the intricacies of invalid types here
21:26:41FromDiscord<Elegantbeef> You just said typedef so i was pointing out there are valid usages
21:26:44FromDiscord<Elegantbeef> iso i dont think so
21:26:59FromDiscord<Elegantbeef> Why are you after that?
21:27:41FromDiscord<Solitude> `echo default (void,)` compiler really likes that
21:28:08FromDiscord<Isofruit> I'm just trying to see whether I can make the proc's signature look something like this:↵`a.getRelatedFieldName(B)` with a being an instance of A and B being the type B
21:28:18FromDiscord<SirOlaf> In reply to @Solitude "`echo default (void,)` compiler": Nice, another crash
21:28:42FromDiscord<Isofruit> Because that intuitively makes sense to me, as in, give me the field on B that is related to my instance of a
21:29:19FromDiscord<Isofruit> But I think I can still make that work by iterating over an empty instance, so just doing B() beforehand in the proc
21:29:29FromDiscord<Solitude> In reply to @Isofruit "Because that intuitively makes": you can do whatever you want
21:29:44FromDiscord<Solitude> just dont instantiate void
21:29:57FromDiscord<Isofruit> Too late, instructions unclear, deleted the internet
21:39:12*PMunch quit (Quit: leaving)
21:42:38FromDiscord<SirOlaf> Does typeRel seem right for this issue? https://github.com/nim-lang/Nim/issues/18845
21:42:44FromDiscord<SirOlaf> Wanna try fixing some of them instead of creating more
21:52:44*zgasma[m] joined #nim
21:54:04FromDiscord<Elegantbeef> It could be
21:54:10FromDiscord<Elegantbeef> My dud of a PR might help though doubtful
21:54:28FromDiscord<SirOlaf> I saw it, but was in a completely different area from what I think is the issue
21:55:05FromDiscord<Elegantbeef> From what i could tell the dispatch just doesnt know about non ref inheritance so `tyObject -> tyObject`
21:56:02FromDiscord<Elegantbeef> I could be wrong about the issue
21:56:21FromDiscord<SirOlaf> typeRel returns isSubtype for it I think
21:57:02FromDiscord<Elegantbeef> Well good luck
21:57:15FromDiscord<Elegantbeef> If you need any back and forth you know where to find me 🙂
21:57:35FromDiscord<SirOlaf> 👍
22:00:30FromDiscord<Elegantbeef> Ah correction skipping `tyObject` brings you to the `tyGenericInst` which is why my solution works
22:01:24FromDiscord<Elegantbeef> In any other object case it doesnt skip or gets nil, in inheritance it's an `object -> genericInst -> (params, inheriting type)`
22:02:33FromDiscord<SirOlaf> That does sound correct
22:04:38FromDiscord<SirOlaf> So that's kinda fixed if you just reopen your pr. Gonna look at a different issue
22:06:52FromDiscord<Elegantbeef> I do have my doubts on if that's the best solution though
22:08:59FromDiscord<Elegantbeef> If you want a fun issue look at generic distincts borrowing
22:09:08FromDiscord<Elegantbeef> I looked at it a while and could not reason a good method
22:09:48FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Lin
22:10:33FromDiscord<Elegantbeef> The issue here is that there first isnt a mechanism to know `MySeq[T]` is a generic distinct iirc, then also getting the symbol of the proc is complicated due to that
22:11:15FromDiscord<SirOlaf> That one does look pretty interesting
22:11:40FromDiscord<SirOlaf> Is it this one? https://github.com/nim-lang/Nim/issues/19097
22:11:51FromDiscord<Elegantbeef> Yeppers
22:14:22FromDiscord<Elegantbeef> Further comments https://forum.nim-lang.org/t/8568#55770
22:16:59FromDiscord<Elegantbeef> `./build_all.sh` on \nix
22:16:59FromDiscord<Elegantbeef> then you can do `./koch temp c ./someSourceFile.nim`
22:16:59FromDiscord<ynfle (ynfle)> How do I build koch to test my changes to nim locally?
22:17:01FromDiscord<ynfle (ynfle)> Where someSourceFile.nim is part of the standard lib?
22:17:01FromDiscord<ynfle (ynfle)> Thanks
22:17:02FromDiscord<Elegantbeef> I guess depends what you're testing
22:17:02FromDiscord<Elegantbeef> If you're testing the stdlib then yea, if you have a scenario you're testing then no
22:17:15FromDiscord<Elegantbeef> I generally fix semantic stuff so i have a file i just compile to see if anything changes
22:17:59FromDiscord<ynfle (ynfle)> I want to add to `json`
22:18:01FromDiscord<Elegantbeef> If you're just changing the stdlib, then you can just do `./koch test cat stdlib` iirc
22:18:13FromDiscord<ynfle (ynfle)> What's cat in this context?
22:18:44FromDiscord<Elegantbeef> It's short for category and is just to tell koch "i want to run all tests in X folder"
22:18:52FromDiscord<Elegantbeef> I dont recall/know if it's possible to run single tests
22:19:10FromDiscord<ynfle (ynfle)> Ok
22:23:09FromDiscord<SirOlaf> In reply to @Elegantbeef "The issue here is": Just seems like it's impossible to borrow generic functions in general
22:24:14FromDiscord<SirOlaf> (edit) "In reply to @Elegantbeef "The issue here is": Just seems like it's impossible to borrow generic functions ... in" added "to generic types"
22:26:04FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Liu
22:26:18FromDiscord<SirOlaf> That's because B is concrete
22:26:54FromDiscord<Elegantbeef> Then yes it's presently impossible for generic distincts to borrow operations
22:27:10FromDiscord<Elegantbeef> That's what that issue comes to
22:29:22FromDiscord<SirOlaf> sent a code paste, see https://play.nim-lang.org/#ix=3Liv
22:29:39FromDiscord<SirOlaf> Although I'm not sure if it should
22:30:07FromDiscord<SirOlaf> (edit) "https://play.nim-lang.org/#ix=3Liv" => "https://play.nim-lang.org/#ix=3Liw"
22:30:26FromDiscord<SirOlaf> (edit) "https://play.nim-lang.org/#ix=3Liw" => "https://play.nim-lang.org/#ix=3Lix"
22:32:23FromDiscord<Elegantbeef> It should
22:32:52FromDiscord<Elegantbeef> Adding type information does not change the base
22:38:17FromDiscord<SirOlaf> What does `$.T`mean
22:38:22FromDiscord<SirOlaf> (edit) "`$.T`mean" => "`$.T` mean"
22:38:46FromDiscord<SirOlaf> Is that just for internal substitution or something?
22:38:53FromDiscord<Elegantbeef> `$T`?
22:39:14FromDiscord<SirOlaf> Printed fn.typ in searchForBorrowProc which gave `proc (a: B[$.T]): string`
22:39:26FromDiscord<Elegantbeef> `$` is the stringification operator in Nim
22:39:39FromDiscord<SirOlaf> That I do know
22:39:48FromDiscord<Elegantbeef> Seems `$` is leaking into the generic parameter
22:40:08FromDiscord<SirOlaf> So no special meaning in this context?
22:40:25FromDiscord<Elegantbeef> Well `$.T` == `$(T)`
22:41:05FromDiscord<SirOlaf> sent a code paste, see https://paste.rs/HIH
22:41:33FromDiscord<Elegantbeef> You're welcome 😀
22:42:03FromDiscord<SirOlaf> Is this even an issue then
22:42:41FromDiscord<SirOlaf> Seems more like bad documentation at best
22:42:48FromDiscord<SirOlaf> (edit) "best" => "worst"
22:43:43FromDiscord<Elegantbeef> well we cannot do `$(b: B[int]): string {.borrow.}` `$(b: B[float]): string = "Hello"`
22:44:33FromDiscord<Elegantbeef> So i guess this is a possible non issue just needs a better error message to use a composite type class
22:45:06FromDiscord<SirOlaf> This works too though
22:45:06FromDiscord<Elegantbeef> Actually the two procs in the example are atrocious to write
22:45:08FromDiscord<SirOlaf> sent a code paste, see https://play.nim-lang.org/#ix=3LiA
22:45:57FromDiscord<SirOlaf> No wonder you didn't find a solution if it isn't broken in the first place
22:46:07FromDiscord<Elegantbeef> I mean look at the example code again
22:46:17FromDiscord<Elegantbeef> We have a generic distinct we want to borrow operation for
22:46:23FromDiscord<SirOlaf> Oh
22:46:33FromDiscord<SirOlaf> Yeah, that works too
22:47:14FromDiscord<Elegantbeef> How?
22:47:21FromDiscord<Elegantbeef> Or do we just do `auto` everywhere
22:47:25FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3LiC
22:48:04FromDiscord<SirOlaf> Don't know if I'm still misunderstanding https://play.nim-lang.org/#ix=3LiD
22:49:56FromDiscord<Elegantbeef> It doesnt work for uninstantiated generics
22:50:26FromDiscord<Elegantbeef> You might say "makes sense" but that means it requires manually making operations for any instantiated type
22:55:22FromDiscord<Elegantbeef> Basically from my recollection we need to know that `DefaultTable[A, B]` is a distinct, get the symbol add it to the generic proc, then not instantiate the body on the generic procs instantiation
22:55:35FromDiscord<Elegantbeef> The hard part was the knowing it was a distinct and getting the original symbol
22:57:48*pro quit (Quit: WeeChat 3.4)
22:57:49FromDiscord<SirOlaf> I see now
22:58:31FromDiscord<SirOlaf> Ah yes `proc [missing parameters](t: var DefaultTable, key: A, val: B): var B`
22:58:44FromDiscord<Elegantbeef> Lol
23:03:40FromDiscord<Elegantbeef> I think the issue was along the lines of "we now know this is a distinct, but `semOverloadedCall` get's a type instead of an instantiated type, so doesnt get the symbol"
23:05:39FromDiscord<SirOlaf> Seems correct, it can't resolve it
23:16:29FromDiscord<SirOlaf> It is tyGenericInvocation instead of tyDistinct
23:21:49FromDiscord<SirOlaf> Can you just call like newType on it
23:22:21FromDiscord<SirOlaf> Probably not, but there must be something to resolve generics, right?
23:23:32FromDiscord<Elegantbeef> My idea was going to be look up the procedure name check if the generic constrains match and all the types match, if so use that
23:23:36FromDiscord<Elegantbeef> But i couldnt reason that
23:24:33FromDiscord<SirOlaf> Feels like it would be easier to just fix the distinct check
23:27:25*yitr joined #nim
23:29:41FromDiscord<SirOlaf> May have a solution
23:37:42FromDiscord<SirOlaf> Yeah, so I do have a solution
23:37:49FromDiscord<SirOlaf> But it probably works only for this scenario
23:39:10FromDiscord<SirOlaf> The info about these generic types is buried a lot deeper than normal
23:40:40FromDiscord<SirOlaf> It also only seems to "fix" the first part of the issue
23:43:07*yitr quit (Quit: Client closed)
23:43:48FromDiscord<Elegantbeef> Yea you will have to not instantiated the proc body if the body is a symbol
23:43:55FromDiscord<Elegantbeef> So do you have it getting the proper sym?
23:44:29FromDiscord<SirOlaf> I have something, but not quite sure what exactly I have
23:45:09FromDiscord<SirOlaf> Can figure out if it's distinct for this specific case by going to t[0].lastSon (obviously check type and length before)
23:52:05*vicfred joined #nim
23:53:47FromDiscord<SirOlaf> sent a code paste, see https://play.nim-lang.org/#ix=3Lj2
23:54:30FromDiscord<Elegantbeef> Ah yes you're at the part i had issue now 😀
23:54:35FromDiscord<SirOlaf> Nice
23:54:45FromDiscord<SirOlaf> So what is the issue starting here?
23:54:48FromDiscord<Elegantbeef> SemOverloaded call is now attempting to call with the type
23:55:09FromDiscord<Elegantbeef> The uninstantiated generic does not allow you to get a resolved symbol
23:55:31FromDiscord<Elegantbeef> In this case was where my reasoning was to "check all symbols of name and find the one that matches" manually
23:55:57FromDiscord<Elegantbeef> Since this is a borrow of a generic we do not want to call, but we want to find a symbol of a specific kind
23:57:13FromDiscord<SirOlaf> Are you sure about that
23:57:15FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Lj4
23:57:19FromDiscord<Elegantbeef> I now wonder if that'd be the solution
23:57:35FromDiscord<Elegantbeef> to make the body be `(proc(args)) symName`
23:58:16FromDiscord<Elegantbeef> I dont know if you know how borrows work
23:58:41FromDiscord<SirOlaf> Not in detail
23:58:48FromDiscord<SirOlaf> Just going off of what I see
23:58:57FromDiscord<Elegantbeef> They do not copy code, what they do is store the symbol inside the proc body, and then on `transf` the turn into a call to the base proc, reducing binary size and reducing indirection
23:59:17FromDiscord<Elegantbeef> So any proc annotated with borrow does not exist past `transf` iirc