<< 14-10-2022 >>

00:05:59FromDiscord<Patitotective> warcrime, beef? https://media.discordapp.net/attachments/371759389889003532/1030270208025317436/unknown.png
00:12:17FromDiscord<Elegantbeef> Why wouldnt it be legal↵(@Bung)
00:22:59FromDiscord<Elegantbeef> No clue↵(@Patitotective)
00:23:46FromDiscord<Elegantbeef> What's that for?
00:29:34*derpydoo joined #nim
00:38:02FromDiscord<Patitotective> sent a long message, see http://ix.io/4d63
00:38:09FromDiscord<Patitotective> (edit) "http://ix.io/4d63" => "http://ix.io/4d64"
00:38:27FromDiscord<Elegantbeef> Did you consider `mixin decode`?
00:38:52FromDiscord<Elegantbeef> Like what are you trying to work around
00:38:53FromDiscord<Patitotective> i did not
00:39:22FromDiscord<Elegantbeef> Also you likely should change the ringabout example
00:40:05FromDiscord<Elegantbeef> They tried to remove identifiable information on github and you just added it back 😄
00:40:59FromDiscord<Patitotective> In reply to @Elegantbeef "Like what are you": work around myself↵i should better look for an already existing code that deserializes stuff
00:41:06FromDiscord<Patitotective> In reply to @Elegantbeef "They tried to remove": didnt know 🧠
00:41:23FromDiscord<Elegantbeef> Though there are other things that point to them
00:41:24FromDiscord<Elegantbeef> So who knows
00:42:32FromDiscord<Elegantbeef> When you're using generic procedures like this you'll generally want to do `mixin` decode so people can override their procedures↵(@Patitotective)
00:42:47FromDiscord<Elegantbeef> This is how Jsony, jsonutils, and other serialise libraries work
01:01:52FromDiscord<Patitotective> perhaps naming all the procedures `decode` doesnt help my brain to try to understand what it wrote
01:17:17FromDiscord<! Nilts> how would I turn `helloworld` to `[0x68,0x65,0x6C,0x6C,0x6F,0x77,0x6F,0x72,0x6C,0x64]` and back again in nim?
01:19:45FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=4d6e
01:21:07FromDiscord<! Nilts> Thanks! but is from valid?
01:21:24FromDiscord<Patitotective> no
01:21:26FromDiscord<Patitotective> use something else
01:21:45FromDiscord<! Nilts> ok
01:25:30FromDiscord<Elegantbeef> From string to openarray[byte] can be done with `toOpenArrayByte(s, 0, s.high)`
01:25:39FromDiscord<Patitotective> 🧠
01:25:49FromDiscord<! Nilts> sent a code paste, see https://play.nim-lang.org/#ix=4d6g
01:26:25FromDiscord<Patitotective> In reply to @not logged in "i get this: `@[72,": huh?
01:26:56FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4d6i
01:27:18FromDiscord<Elegantbeef> Those arent hex those are binary values
01:27:22FromDiscord<Elegantbeef> decimal values rather
01:27:25FromDiscord<Elegantbeef> I'll get it right eventually
01:28:23FromDiscord<! Nilts> In reply to @Elegantbeef "Those arent hex those": i want hex, also what imports do i need for your latest snippet
01:28:30*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
01:29:15FromDiscord<Elegantbeef> You want the hex representation of a string?
01:29:26FromDiscord<Elegantbeef> https://nim-lang.org/docs/strutils.html#toHex%2Cstring
01:29:40FromDiscord<Elegantbeef> https://nim-lang.org/docs/strutils.html#fromHex%2Cstring
01:29:45FromDiscord<Elegantbeef> With my code you dont need anything
01:30:04FromDiscord<Elegantbeef> Whoops there is no fromHex for strings 😄
01:30:39FromDiscord<Elegantbeef> `parseHexStr`
01:30:47FromDiscord<Patitotective> beef's high, he writes urls manually
01:31:04FromDiscord<Elegantbeef> I dont do drugs pat!
01:33:22*arkurious quit (Quit: Leaving)
01:35:03FromDiscord<! Nilts> In reply to @Elegantbeef "https://nim-lang.org/docs/strutils.html#toHex%2Cstr": what it gives it a string not a seq. is the split fun in nim just spilt?
01:35:12FromDiscord<Bung> In reply to @Elegantbeef "Why wouldnt it be": see there's test case ensure errorhttps://github.com/nim-lang/Nim/pull/20549
01:36:01FromDiscord<! Nilts> (edit) "fun" => "func"
01:37:23FromDiscord<Elegantbeef> Those are different though
01:37:48FromDiscord<Elegantbeef> `var iii = it` does nothing but instantiate the closure iterator
01:38:24FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4d6k
01:38:54FromDiscord<! Nilts> In reply to @not logged in "what it gives it": i need to turn 48656C6C6F20576F726C64 into a seq with every 2 chars.
01:40:26FromDiscord<huantian> what are you trying to do? maybe it would be better to just encode your strings as base64 instead of hex
01:40:47FromDiscord<ChocolettePalette> 48, 65, 6C... ?Just create an empty seq and populate it with those characters
01:41:11FromDiscord<Elegantbeef> The question in my world is why do you need to have the string representation of the binary data 😄
01:41:41FromDiscord<! Nilts> In reply to @huantian "what are you trying": i kind know how to use hex, i have no clue how to use b64 to mess with and edit bytes and bits.
01:41:43FromDiscord<Patitotective> In reply to @Elegantbeef "This is how Jsony,": whats this monster https://github.com/nim-lang/Nim/blob/version-1-6/lib/std/jsonutils.nim#L149
01:41:48FromDiscord<ChocolettePalette> To send it via json maybe to further receive it and encode to binary again
01:42:02FromDiscord<Bung> tests/closure/tinvalidclosure4.nim
01:42:15FromDiscord<Elegantbeef> base....6....
01:42:52FromDiscord<Elegantbeef> That is invalid though bung
01:43:00FromDiscord<Bung> so what's this problem, it works why illegal
01:43:05FromDiscord<Elegantbeef> `proc b {.nimcall.} = echo v` requires capturing `v`
01:44:18FromDiscord<Elegantbeef> What does this print with your changes
01:44:19FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4d6l
01:46:15FromDiscord<Bung> I must get out of my bed first
01:46:27FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4d6m
01:46:47FromDiscord<Patitotective> In reply to @Bung "I must get out": its almost bedtime, what are you saying
01:47:21FromDiscord<Elegantbeef> `a` being used inside the local proc causes the compiler to raise by copy the parameter into the closure's environment
01:52:51FromDiscord<Bung> In reply to @Patitotective "its almost bedtime, what": I sleep at about 6 am , now it's 10 am, I wake up
01:53:08FromDiscord<Elegantbeef> 4 hours of sleep and now you're looking at closures
01:53:17FromDiscord<Patitotective> In reply to @Elegantbeef "4 hours of sleep": lmao
01:53:21FromDiscord<Elegantbeef> I'm sorry for your loss
01:54:26FromDiscord<Patitotective> In reply to @Bung "I sleep at about": healthy
01:54:34FromDiscord<Bung> oh just tried the code
01:54:37FromDiscord<Bung> Hello300↵5
01:55:36FromDiscord<Elegantbeef> hmph not what i expected
01:56:00FromDiscord<Elegantbeef> I guess where `a` points to is valid in this case.... hmmm
01:57:13FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4d6y
01:57:14FromDiscord<Elegantbeef> Try that if you dont mind
01:57:20FromDiscord<Elegantbeef> If you do tell me to sod off
01:59:04FromDiscord<Bung> this is bad cgen
01:59:11FromDiscord<Elegantbeef> There you go
01:59:15FromDiscord<Bung> @mtinvalidclosure7.nim.c:188:18: error: incompatible types when assigning to type 'tyProcT4eqaYlFJYZUv9aG9b1TV0bQ' {aka 'void ()(void)'} from type 'tyProcHzVCwACFYM9cx9aV62PdjtuA' ↵ 188 | result = T2_;
01:59:35FromDiscord<Elegantbeef> The compiler is at odds of what is valid 😄
02:00:09FromDiscord<Elegantbeef> It's an illegal capture regardless nimcalls cannot have an environment, that code requires an environment to function outside of `outer`
02:00:30FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=4d6B
02:00:47FromDiscord<Bung> the old version nim only do s.typ.kind check in illegalCapture
02:00:49FromDiscord<Elegantbeef> If you remove `nimCall` it'll work with no issue
02:02:23FromDiscord<Elegantbeef> Well it also uses `illegalCapture`
02:02:24FromDiscord<Patitotective> (edit) "https://play.nim-lang.org/#ix=4d6B" => "https://play.nim-lang.org/#ix=4d6C"
02:02:45FromDiscord<Elegantbeef> The old code is right in this case
02:03:10FromDiscord<Elegantbeef> The bug is `owner.typ.callConv == ccNimCall and tfExplicitCallConv notin owner.typ.flags` should be `(owner.typ.callConv == ccNimCall and tfExplicitCallConv notin owner.typ.flags)` i thinks
02:03:29FromDiscord<Elegantbeef> Fuck
02:03:46FromDiscord<Elegantbeef> Anyway
02:04:41FromDiscord<Bung> I say very old version like s.typ.kind in {tyVar,....}
02:04:54FromDiscord<Elegantbeef> I might be wrong with that line
02:05:00FromDiscord<Elegantbeef> Need to look at the bug again
02:06:11FromDiscord<Elegantbeef> Yea relooking at it the bug isnt in this proc
02:06:24FromDiscord<Elegantbeef> the bug is that `markAsClosure` is getting called in a state that it shouldnt
02:08:40FromDiscord<Bung> now problem become from "which is invalid capture" to "which is valid markAsClosure "
02:08:54FromDiscord<Elegantbeef> Yes
02:10:12FromDiscord<Bung> current behavior is like when it access outer variable it call `markAsClosure `
02:10:48FromDiscord<Elegantbeef> I see that, there seems to be a case where it shouldnt be called but it is
02:15:55FromDiscord<Bung> I can make closure iterater pass markAsClosure , but not sure if it's right
02:17:27FromDiscord<Bung> if something illegalCapture in `it` should check on `it` its self
02:18:18FromDiscord<Elegantbeef> Does it error at 475 or 499?
02:21:06FromDiscord<Mr.Ender> sent a code paste, see https://play.nim-lang.org/#ix=4d6G
02:21:07FromDiscord<Bung> sent a code paste, see https://paste.rs/uPN
02:21:14FromDiscord<Mr.Ender> sorry for overposting
02:21:36FromDiscord<Mr.Ender> (edit) "sorry for overposting ... " added "my discord was scrolled up so I did not see these messages"
02:22:16FromDiscord<Bung> dont be
02:22:46FromDiscord<huantian> In reply to @Mr.Ender "Hello im trying to": you might have better luck using <https://github.com/jiro4989/setup-nim-action>
02:22:57FromDiscord<Mr.Ender> In reply to @huantian "you might have better": Ill have a look into it
02:23:07FromDiscord<huantian> I don't know what it uses to install nim, but it's always been the easiest way for me to install the latest version of nim on github actions
02:26:37FromDiscord<Mr.Ender> ok
02:29:19FromDiscord<Elegantbeef> Yea bung whatever wrong is subtly wrong and i'm not seeing it
02:32:37FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4d6J
02:33:04FromDiscord<Bung> In reply to @Elegantbeef "Yea bung whatever wrong": I just modify one line make all these test case pass
02:33:20FromDiscord<Elegantbeef> Yea but that one test shouldnt pass
02:34:06FromDiscord<Bung> which one?
02:34:18FromDiscord<Elegantbeef> The one you removed
02:35:08FromDiscord<Bung> it's s till illegal capture
02:35:23FromDiscord<Elegantbeef> So why did you remove it?
02:35:59FromDiscord<Bung> the modified I just made seconds ago make this result.
02:36:03FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/ORH
02:36:04FromDiscord<Elegantbeef> Ah
02:36:19FromDiscord<Bung> sent a code paste, see https://play.nim-lang.org/#ix=4d6K
02:36:30FromDiscord<Elegantbeef> Yea that seems to be right
02:37:07FromDiscord<Bung> yea, it will not mark it as closure
02:37:18FromDiscord<Bung> the issue one
02:37:31FromDiscord<Elegantbeef> I'm thinking semantically and yea i'm fairly certain that's 100% right 😄
02:38:03FromDiscord<Elegantbeef> The procedure is checked to see if it needs an environment
02:38:06FromDiscord<sOkam!> If so, I'm missing it
02:38:10FromDiscord<Bung> hmm, I'll just push it see what others see or maybe there are CI fails...
02:38:13FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4d6L
02:38:20FromDiscord<Bung> (edit) "see" => "say"
02:38:23FromDiscord<Elegantbeef> If you use streams properly yes↵(@sOkam!)
02:38:42FromDiscord<Elegantbeef> Streams are what you're likely doing but better
02:38:44FromDiscord<sOkam!> Is there a manual entry about them?
02:38:52FromDiscord<Elegantbeef> https://nim-lang.org/docs/streams.html
02:39:01FromDiscord<Elegantbeef> Every library has docs
02:39:14FromDiscord<Elegantbeef> every stdlib module has docs
02:39:29FromDiscord<sOkam!> Well, but some are just the prototype without any text
02:41:41FromDiscord<ChocolettePalette> This one has both text and examples doe
02:42:50FromDiscord<sOkam!> This is for a TGA implementation PR for pixie, btw↵Seems like treeform was using strings because they found them to be 10-50% faster than streams
02:43:20FromDiscord<Elegantbeef> Eh with 2.0 that's not likely the case
02:44:12FromDiscord<Elegantbeef> Anyway you can do the same with the string it's just silly
02:44:51FromDiscord<sOkam!> kk ty ✍️
02:45:29FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4d6M
02:46:01NimEventerNew thread by KerryC: Introducing PhylogeNi and BioSeq, see https://forum.nim-lang.org/t/9528
02:51:32FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=4d6O
02:53:32FromDiscord<Elegantbeef> Guess what i suggest isnt right
02:56:47FromDiscord<Bung> hmm. tests/closure/tmacrobust1512.nim fails.
02:57:27FromDiscord<Bung> it try get env param, however markAsClosure and addClosureParam are called same time.
03:08:51*derpydoo quit (Quit: derpydoo)
03:29:36FromDiscord<sOkam!> Is the LSP being dumb here, or am I the dumb one? https://media.discordapp.net/attachments/371759389889003532/1030321449174573147/unknown.png
03:30:11FromDiscord<Elegantbeef> Likely the former
03:31:29FromDiscord<sOkam!> actually the latter, its a let 🤦‍♂️
03:31:48*xet7 joined #nim
04:15:35FromDiscord<Prestige> Error message could've been more helpful eh
04:16:31FromDiscord<Elegantbeef> immutable mismatches are the most common that confuse people
04:18:36FromDiscord<Patitotective> wonder how the compiler sorts the mismatches, would be nice to have the ones that match signature but expect mutable arguments
04:18:46FromDiscord<Elegantbeef> PRs welcome
04:19:44FromDiscord<Elegantbeef> https://github.com/nim-lang/Nim/blob/devel/compiler/sigmatch.nim#L2219-L2281
04:41:03FromDiscord<Mr.Ender> sent a code paste, see https://play.nim-lang.org/#ix=4d7b
04:41:27FromDiscord<Elegantbeef> Given they're both constants the latter might be better
04:41:38FromDiscord<Elegantbeef> If they are not constants the former likely will be better
04:41:43FromDiscord<Mr.Ender> ok
05:05:05FromDiscord<sOkam!> Is there something that can iterate through the bytes of any type?↵Saying something like `for byte in someCustomTypedVar: #doThing`
05:17:18FromDiscord<Bung> how to solve nimscript error when run `koch temp` during `git bitsect` ,when back to v1.4 it will be error
05:46:16*kenran joined #nim
05:55:00*kenran quit (Remote host closed the connection)
06:16:28*kenran joined #nim
06:45:27FromDiscord<fbpyr> sent a code paste, see https://play.nim-lang.org/#ix=4d7z
06:46:47FromDiscord<Elegantbeef> https://github.com/juancarlospaco/psutil-nim/blob/master/src/psutil.nim#L277-L295
06:46:49FromDiscord<Elegantbeef> It's not exported
06:47:04FromDiscord<Elegantbeef> you can do `import psutil/psutil_inux`
06:47:10FromDiscord<Elegantbeef> God i hate that naming
06:49:57FromDiscord<fbpyr> oh I see. Elegantbeef thank you!
06:55:32*neceve quit (Quit: ZNC - https://znc.in)
06:58:29*neceve joined #nim
07:04:28*PMunch joined #nim
07:05:13*LuxuryMode quit (Quit: Connection closed for inactivity)
08:20:03*genpaku quit (Remote host closed the connection)
08:20:44*genpaku joined #nim
08:30:49FromDiscord<untoreh> is a case expr on a `static` wrapped type resolved at compile time?
08:31:22FromDiscord<untoreh> or more in general to other kind of expression to I guess
08:31:27*rockcavera quit (Remote host closed the connection)
09:14:48*sagax joined #nim
09:47:29NimEventerNew thread by tubbs: Access type from two different files, see https://forum.nim-lang.org/t/9529
10:13:22FromDiscord<Bung> In reply to @untoreh "or more in general": yeah as it's named as `static`
10:42:02*jmdaemon quit (Ping timeout: 268 seconds)
11:21:00*arkurious joined #nim
11:27:25*jjido joined #nim
11:54:18*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
12:08:50FromDiscord<AbdullahLn> ها
12:22:17FromDiscord<rdb> sent a code paste, see https://play.nim-lang.org/#ix=4d8O
12:22:48FromDiscord<jos> generally speaking, is using a c library directly in nim tolerable? or should you wrap it up
12:29:50PMunch@jos, well you need to do some kind of wrapping
12:30:01PMunchOr rather, you need to tell Nim how the C library works
12:30:23PMunchBut using a C-interface library in Nim isn't a problem, it's a bit clumsy at times, but works well enough
12:30:43PMunchTo automatically generate the wrapping you can have a look at Futhark
12:32:10FromDiscord<Phil> In reply to @rdb "So, when I do": They are implicitly assumed to be the same type unless you explicitly make them different
12:32:13PMunchI plan on writing an article on this hopefully in the near future, as there are some tricks to get a library fully integrated with async and garbage collection
12:33:20FromDiscord<rdb> In reply to @Isofruit "They are implicitly assumed": By "explicitly make them different" you mean by doing `proc myfunc[T0, T1, T2: float32 | float64](tup: tuple[x: T0, y: T1, z: T2]) = ...` ?↵That does seem to work, thank you, and good to know that the behaviour is intended.
12:33:25FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4d8P
12:34:15FromDiscord<rdb> Also, good to know about SomeFloat. 🙂
12:35:22FromDiscord<Phil> sent a long message, see http://ix.io/4d8Q
12:35:34FromDiscord<rdb> Thank you!
12:36:13FromDiscord<Phil> You can also very easily make them yourself via Type aliasing:↵`type A = float64 | float32 | float` etc., thouh you might already be aware of this
12:36:25FromDiscord<Phil> (edit) "thouh" => "though"
12:36:49FromDiscord<Bung> don't rely generic type constraints it's not fully complete
12:37:18FromDiscord<Phil> It hasn't screwed me over yet and I've used generics fairly in depths
12:38:16FromDiscord<Phil> Though mostly the type constraint that a type must be a subtype of model
12:38:19FromDiscord<Bung> the default match state is matched
12:38:59FromDiscord<Bung> so in some case that should not match but it takes as a generic without constraints
12:40:44*PMunch quit (Quit: Leaving)
12:42:21NimEventerNew thread by drkameleon: From too many copies to too few, see https://forum.nim-lang.org/t/9530
12:47:24FromDiscord<fbpyr> in regex ( https://github.com/nitely/nim-regex ) does anybody know if there is a way to retrieve the originating re string back from the `Regex` object?↵(for debugging purpose..)
12:50:48*PMunch joined #nim
12:56:13*jjido joined #nim
12:56:45*derpydoo joined #nim
14:06:32*PMunch quit (Quit: Leaving)
14:17:04*ox is now known as oz
14:22:04*kenran quit (Remote host closed the connection)
14:22:26*rockcavera joined #nim
14:22:26*rockcavera quit (Changing host)
14:22:26*rockcavera joined #nim
14:27:16*derpydoo quit (Quit: derpydoo)
14:33:27FromDiscord<auxym> I use regex a lot instead of the stdlib re, but no, I'm not aware of a way to do that. there's the groups proc that takes the string as a third arg.
14:33:53FromDiscord<auxym> You could make your own wrapper object/procs that wrap regex though, and store the string in that?
14:34:13FromDiscord<Rika> wasnt this asked a while back?
14:42:37FromDiscord<fbpyr> thank you @auxym 🙂↵indeed regex is nice, so I do not need handle an extra dll on win10..↵↵hah wrapping it - interesting idea, I will give it a try.
14:55:00FromDiscord<auxym> Yeah, I'd just create a wrapper around the https://nitely.github.io/nim-regex/regex/nfatype.html#RegexMatch that adds a field for the original string. Then create your own match/find proc that stores the string and returns your new wrapper type
15:10:33*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
15:31:30*derpydoo joined #nim
16:24:11*rez joined #nim
16:34:48FromDiscord<! Nilts> What kinds of errors can i raise?
16:36:22FromDiscord<Patitotective> In reply to @not logged in "What kinds of errors": any `object of Exception` https://nim-lang.org/docs/manual.html#exception-handling-raise-statement
17:38:12FromDiscord<Phil> Can I replace a symbol with the value of the symbol at compile-time?
17:40:00FromDiscord<Patitotective> sent a long message, see http://ix.io/4da2
17:41:49FromDiscord<Phil> SomeTable is your own creation?
17:42:25FromDiscord<Patitotective> `SomeTable[A, B] = (Table[A, B] or OrderedTable[A, B])`
17:45:05FromDiscord<Phil> Hmmm the type checking matches
17:46:49FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4da3
17:47:22FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4da3" => "https://play.nim-lang.org/#ix=4da4"
17:47:38FromDiscord<Patitotective> hmm
18:11:55FromDiscord<Patitotective> In reply to @Patitotective "This does not make": @ElegantBeef welp
18:29:07*kenran joined #nim
18:50:17FromDiscord<Patitotective> the problem seems to be that the body of the `proc decodeHook[T](a: var SomeTable[string, T], b: KdlNode)` proc is what makes `compiles(decodeHook(a, b))` fail
18:50:38FromDiscord<Patitotective> (edit) removed "proc"
18:50:56*kenran quit (Remote host closed the connection)
18:51:13FromDiscord<Patitotective> i think this will work better overloading procedures
18:51:23*kenran joined #nim
18:52:18FromDiscord<Patitotective> (edit) "procedures" => "procs instead of `when T is type`"
18:53:09*kenran quit (Remote host closed the connection)
18:55:13FromDiscord<Patitotective> or if there were a procedure that finds an overload that matches some signature `overloads(foo(args))`
18:59:01*wallabra_ joined #nim
19:01:11FromDiscord<Ekopalypse> sent a code paste, see https://play.nim-lang.org/#ix=4dam
19:01:15*wallabra quit (Ping timeout: 250 seconds)
19:01:15*wallabra_ is now known as wallabra
19:37:41FromDiscord<Horizon [She/Her]> In reply to @PMunch "I plan on writing": Oh neat
19:38:09*kenran joined #nim
19:38:14FromDiscord<Horizon [She/Her]> Tbh i need to poke around in Futhark to make it not export numbered identifiers for better autocompletion
19:45:59*kenran quit (Read error: Connection reset by peer)
20:16:49*ttkap joined #nim
20:22:50*wallabra quit (Remote host closed the connection)
20:23:05*wallabra joined #nim
20:30:55FromDiscord<michaelb.eth> making use of `setControlCHook`, is it possible to have the exit code be `0` instead of `130` when the user stops the process with ctrl-c?
20:31:53FromDiscord<michaelb.eth> if in another shell I do `kill -SIGINT [pid]` the proc I passed to `setControlCHook` runs and the exit code is `0`
20:32:09FromDiscord<michaelb.eth> but when pressing ctrl-c I get `130`
20:32:55FromDiscord<michaelb.eth> I guess there's nothing necessarily wrong with it, but quitting a program like e.g. `top` by pressing ctrl-c results in exit code `0`
20:33:29FromDiscord<michaelb.eth> iow, if ctrl-c is the normal/expected way to stop the program, seems like `0` would be more appropriate
20:36:15FromDiscord<enthus1ast> i wonder i you can call exit(0) in the handler
20:38:48*kenran joined #nim
20:39:45FromDiscord<michaelb.eth> actually nevermind, `quit(QuitSuccess)` is working as expected. It's because I'm invoking the built executable with `make run`, so it's `make` that's exiting with `130`
20:40:14FromDiscord<michaelb.eth> (edit) "expected." => "expected, i.e. resulting in exit code `0`."
20:45:00*derpydoo quit (Quit: derpydoo)
20:47:33*kenran quit (Remote host closed the connection)
21:10:46*jmdaemon joined #nim
21:13:25strogon14I just handle all signals, including SIGINT, with my own signal handlers: https://github.com/SpotlightKid/jacket/blob/master/examples/signal.nim
21:14:48strogon14use it with e.g.: setSignalProc(signalCb, SIGABRT, SIGHUP, SIGINT, SIGQUIT, SIGTERM)
21:26:23FromDiscord<michaelb.eth> nice
22:12:24*xet7 quit (Remote host closed the connection)
22:27:41FromDiscord<Elegantbeef> Do you have a more specific overload?↵(@Patitotective)
22:29:17FromDiscord<Patitotective> In reply to @Elegantbeef "Do you have a": :p i found the issue `compiles(decodeHook(a, b))` indend finds the correct overload but the body of the procedure had a compile error so it caused the `compiles` proc to return false
22:29:25FromDiscord<Patitotective> (edit) "issue `compiles(decodeHook(a," => "issue↵`compiles(decodeHook(a,"
22:29:31FromDiscord<Patitotective> (edit) "indend" => "indeed"
22:29:39FromDiscord<Patitotective> (edit) "return false" => "fail"
22:29:44FromDiscord<Patitotective> (edit) "fail" => "return false"
22:30:50FromDiscord<Elegantbeef> Yea quit using the compiles check
22:30:53FromDiscord<Elegantbeef> There is no reason to
22:31:01FromDiscord<Elegantbeef> just do `decode` and carry on
22:32:52FromDiscord<Patitotective> In reply to @Elegantbeef "just do `decode` and": buuuut custom hooks are named `decodeHook`↵should i also name them `decode`?
22:33:20FromDiscord<Elegantbeef> I dont see why you'd need `hook`
22:33:52FromDiscord<Patitotective> 🤷‍♂️ jsonutils does that
22:36:28FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=4db4
22:36:29FromDiscord<Elegantbeef> Dont use a `compiles` check for dispatching the generic interface, use overloading
22:38:08FromDiscord<Patitotective> In reply to @Elegantbeef "https://play.nim-lang.org/#ix=4db4": :]
22:38:34FromDiscord<Elegantbeef> Nim's dispatch chooses the most precise procedure for overloads, so you can without hassle get a nice API
22:45:07FromDiscord<Patitotective> In reply to @Elegantbeef "https://play.nim-lang.org/#ix=4db4": if `decode` is `save`, what would `encode` be? 🤔 `unsave` :p
22:45:18FromDiscord<Elegantbeef> Whatever you want
22:45:32FromDiscord<Elegantbeef> You can name it whatever
22:45:49FromDiscord<Patitotective> you know im really bad at naming things
22:46:02FromDiscord<Elegantbeef> You could use `kdlDecode` and `kdlDecodeHook` or whatever
22:46:08FromDiscord<Elegantbeef> Point was mostly you dont need a `when compiles`
23:07:46FromDiscord<Patitotective> this is a bit more what i want https://play.nim-lang.org/#ix=4db7
23:08:49FromDiscord<Elegantbeef> I dont get the point of `saveStr` and `saveString` but you do you
23:09:39FromDiscord<Patitotective> In reply to @Elegantbeef "I dont get the": huuuuuuuuuuuh? i may be blind but i dont see any `saveString`
23:09:50FromDiscord<Elegantbeef> sorry saveint
23:09:53FromDiscord<Elegantbeef> Brain fart
23:16:26FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=4db9
23:16:54FromDiscord<Patitotective> `proc decodeHook[T: array](a: KdlVal, v: var T)` works
23:24:12FromDiscord<Patitotective> is there a way to do `proc foo[T](...): T` instead of `proc foo[T](_: typedesc[T], ...): T`? https://play.nim-lang.org/#ix=4dbb
23:26:08FromDiscord<huantian> uh wdym
23:27:26FromDiscord<Patitotective> i want to be able to call `foo` like this `foo[int]()` instead of `foo(int)`
23:28:45FromDiscord<huantian> sent a code paste, see https://play.nim-lang.org/#ix=4dbc
23:31:40FromDiscord<Elegantbeef> Yea it does
23:31:40FromDiscord<Elegantbeef> Pat is... being pat
23:32:35FromDiscord<Patitotective> hMMmMMm
23:32:50FromDiscord<Patitotective> these bugs try to gaslight me