<< 14-08-2022 >>

00:01:51FromDiscord<Elegantbeef> Right now instead of saying "Hey X variable doesnt exist you wrote it here" it goes "Cannot find identifier X"
00:03:08FromDiscord<Elegantbeef> Since fmt takes a static string
00:05:01FromDiscord<flywind> In reply to @Isofruit "I wonder what Araq": Not only a new book though.
00:18:07FromDiscord<!Patitotective> In reply to @Elegantbeef "Right now instead of": isnt that the same? :p
00:54:03*wallabra_ joined #nim
00:56:23FromDiscord<Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=47wW
00:56:26*wallabra quit (Ping timeout: 255 seconds)
00:56:26*wallabra_ is now known as wallabra
00:56:27FromDiscord<Bubblie> is it possible, to add an if statement inside of this
00:56:35FromDiscord<Bubblie> because some of these args require a condition
00:56:40FromDiscord<!Patitotective> yes, use parenthesis
00:56:40FromDiscord<Bubblie> if not thats okay I can just reassign
00:56:44FromDiscord<huantian> In reply to @Patitotective "isnt that the same?": no
00:56:51FromDiscord<Bubblie> In reply to @Patitotective "yes, use parenthesis": 👀
00:56:59FromDiscord<Bubblie> where would I use the paranthesis?
00:57:13FromDiscord<!Patitotective> `a: (if something: otherThing else: otherElseThing)`
00:57:26FromDiscord<huantian> the main place you can see it is in an ide, where instead of squiggly lines under the actual code that's wrong, there's just nothing
00:57:54FromDiscord<!Patitotective> In reply to @huantian "the main place you": ooo i get it↵i dont use an ide :pppp
00:59:09FromDiscord<Bubblie> In reply to @Patitotective "`a: (if something: otherThing": awesome
00:59:10FromDiscord<Bubblie> thank you
01:04:53FromDiscord<Elegantbeef> Ideally the macro expands to a bunch of `when` checks that call a macro that reports the proper line
01:05:52FromDiscord<Bubblie> what would be the equivalent of .data() in nim
01:06:08FromDiscord<Elegantbeef> what is `.data` elsewhere?
01:06:41FromDiscord<Bubblie> Wait nvm!
01:06:42FromDiscord<Bubblie> got it
01:06:45FromDiscord<Bubblie> sorry 😭
01:08:05FromDiscord<Elegantbeef> `s[0].addr`?
01:09:28FromDiscord<Bubblie> yeah I think so
01:09:34FromDiscord<Bubblie> nvm that should be the case but
01:10:05FromDiscord<Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=
01:10:26FromDiscord<Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=47x3
01:10:32FromDiscord<Bubblie> and extensions is just a var that is assigned to this function
01:10:42FromDiscord<Bubblie> basically holding the returned variable
01:11:04FromDiscord<Bubblie> usually .data indicates the start of the array but in this case its asking for this?
01:11:06FromDiscord<Bubblie> whatever this means
01:11:57FromDiscord<Bubblie> should this not return a sequence?
01:12:05FromDiscord<Bubblie> it makes the most sense that it would...
01:12:21FromDiscord<Elegantbeef> Welcome to C confuckery
01:12:31FromDiscord<Bubblie> this is pain
01:12:52FromDiscord<Bubblie> any ideas?
01:14:18FromDiscord<Bubblie> should I cast or something
01:14:21FromDiscord<Elegantbeef> `cast[ptr UncheckedArray[cstring]](mySeq[0].addr)` might be it
01:14:27FromDiscord<Bubblie> okay!
01:14:29FromDiscord<Bubblie> let me try that
01:14:32FromDiscord<Elegantbeef> char\\ is a fucking tedious type
01:14:39FromDiscord<Bubblie> 😭 it is
01:14:42FromDiscord<Bubblie> C is such a mess jesus christ
01:19:05FromDiscord<morgan> so im thinking about doing usb communication (or bluetooth) between my computer and a mcu, anyone know of existing info for simulating a usb connection with debugging for it? i don't want to prototype on hardware until i have a protocol worked out
01:19:37FromDiscord<Bubblie> to get a length of a sequence its .len right
01:21:39FromDiscord<Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=47x4
01:21:52FromDiscord<Elegantbeef> yes↵(@Bubblie)
01:22:23FromDiscord<Elegantbeef> dont cast do `uint32`
01:22:52FromDiscord<Bubblie> ?
01:22:54FromDiscord<Bubblie> lik
01:22:55FromDiscord<Bubblie> like
01:23:00FromDiscord<Bubblie> uin32 extensions.len
01:23:04FromDiscord<Bubblie> (edit) "uin32" => "uint32"
01:23:05FromDiscord<Elegantbeef> yes
01:23:14FromDiscord<Bubblie> weirdly the same issue happens
01:23:21FromDiscord<Bubblie> its still illegal storage access
01:23:24FromDiscord<Bubblie> and im unsure as to why this is
01:23:58FromDiscord<Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=
01:24:02FromDiscord<Bubblie> is what pops up
01:24:13FromDiscord<Bubblie> changing this to nil makes it run but I kinda need to have these values in here 💀
01:24:33FromDiscord<Elegantbeef> your array isnt right then
01:26:06FromDiscord<Bubblie> ?
01:26:17FromDiscord<Bubblie> I could send my exact code if that would help
01:26:23FromDiscord<Bubblie> I used a sequence as the return type
01:26:28FromDiscord<Bubblie> Should I have used an array?
01:30:14FromDiscord<Elegantbeef> wait `seq[ptr cstring]` is wrong
01:30:15FromDiscord<Elegantbeef> Might be best to nim's alloccstringarray and dealloc
01:30:16FromDiscord<Elegantbeef> that's more like a `char`
01:30:42FromDiscord<Elegantbeef> you shouldnt use cstrings anywhere 😄
01:31:03FromDiscord<Elegantbeef> Joke aside
01:31:20FromDiscord<Elegantbeef> https://nim-lang.org/docs/system.html#allocCStringArray%2CopenArray%5Bstring%5D
01:31:32FromDiscord<Elegantbeef> https://nim-lang.org/docs/system.html#deallocCStringArray%2CcstringArray
01:32:43FromDiscord<Bubblie> LOL
01:32:46FromDiscord<Bubblie> Okay ill use that
01:33:26FromDiscord<Bubblie> Im getting close to that triangle
01:33:40FromDiscord<Bubblie> That 800 line triangle rendered in nim vulkan 💀
01:33:57FromDiscord<Bubblie> Well
01:34:00FromDiscord<Bubblie> Its more than that but
01:36:45FromDiscord<Elegantbeef> cstringarray is such a ugh implementation
01:36:52FromDiscord<Bubblie> Seems like it
01:37:23FromDiscord<Bubblie> I really want to add a vulkan backend to boxy
01:43:04FromDiscord<Bubblie> wait so beef should I have it return cstringarray and just use the alloc and dealloc
01:45:29FromDiscord<Elegantbeef> No clue i avoid using Cstringarrays anywhere but where required
01:46:11FromDiscord<Bubblie> pain
01:46:18FromDiscord<Bubblie> well time to figure this out
01:46:28FromDiscord<Elegantbeef> So i'd use the procedures i gave you then convert to Nim strings/seq if needed
01:46:37FromDiscord<Bubblie> alright :) thank you
02:10:48FromDiscord<Bubblie> how would I turn a seq into an openarray?
02:11:03FromDiscord<kentuckybtc> https://t.me/+sj30hB-ZyA03Nzg0I'll 20 people on how to earn $10,000 or more in just 3day's from the crypto market.but you will pay me 10% commission when you receive your profit. if interested send me a direct message, for more information... Contact via📩📩📩📩📩📩📩📩TELEGRAM💬@@FLORAGORDONhttps://t.me/+sj30hB-ZyA03Nzg0
02:11:21FromDiscord<Bubblie> <@&371760044473319454>
02:11:43FromDiscord<Elegantbeef> It already is one↵(@Bubblie)
02:11:47FromDiscord<Bubblie> oh
02:12:13FromDiscord<Elegantbeef> openarray[T] allows `seq[T]` or `array[any, T]`
02:13:26FromDiscord<ohiobtc> sent a long message, see http://ix.io/47xc
02:13:37FromDiscord<Bubblie> sigh
02:13:43FromDiscord<Bubblie> <@&371760044473319454> sorry for the other ping
02:16:38FromDiscord<Bubblie> so i made the procedure return a cstringArray but I have no idea how to get or use its length etc.
02:17:31FromDiscord<Bubblie> oh
02:17:32FromDiscord<Bubblie> right
02:17:37FromDiscord<Bubblie> you can turn it into a sequence
02:18:21FromDiscord<Bubblie> well at least now I got a new error
02:18:25FromDiscord<Bubblie> which is out of memory 💀
02:18:29FromDiscord<Bubblie> pretty sure im supposed to dealloc
02:18:57FromDiscord<Elegantbeef> you'd iterate until nil doing `result.add $myCsarr[i]`
02:24:31FromDiscord<Bubblie> would that solve the out of memory issue?
02:25:09FromDiscord<Elegantbeef> Perhaps, no clue how you're converting it
02:25:43FromDiscord<Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=
02:26:28FromDiscord<Elegantbeef> Sounds like your array is null terminated or you're accessing bad memory
02:26:38FromDiscord<Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=47xe
02:26:46FromDiscord<Elegantbeef> result = temp\` 😄
02:26:52FromDiscord<Bubblie> its called temp because I was experimenting before 💀
02:26:56FromDiscord<Bubblie> ill change the name
02:27:05FromDiscord<Elegantbeef> you mean you wont use temp 😛
02:27:08FromDiscord<Elegantbeef> Anyway yea that seems fine
02:27:30FromDiscord<Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=
02:27:31FromDiscord<Bubblie> I then do this
02:27:48FromDiscord<Bubblie> however, it crashes immediately due to it being out of memory so im assuming I have to dealloc the cstring somehow
02:27:52FromDiscord<Bubblie> to freeup the memory right
02:27:57FromDiscord<Elegantbeef> No
02:28:02FromDiscord<Elegantbeef> I mean you do have to dealloc it
02:28:09FromDiscord<Elegantbeef> but i think you're capturing strings unsafely
02:28:19FromDiscord<Bubblie> oh
02:28:34FromDiscord<Bubblie> oh wait maybe
02:28:40FromDiscord<Bubblie> glfwExtensions is a ptr cstring
02:29:13FromDiscord<Bubblie> is that maybe the issue?
02:29:35FromDiscord<Elegantbeef> Also i guess i was wrong `seq[cstring]` is equivlent to `char` aslong as you add a `nil` after
02:29:49FromDiscord<Elegantbeef> But yea if you're taking `string` you need to ensure they outlive the `cstring` usage
02:30:30FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=47xf
02:31:04FromDiscord<Bubblie> In reply to @Elegantbeef "Also i guess i": a nil after?
02:31:23FromDiscord<Elegantbeef> yes `@[a.cstring, b.cstring, c.cstring, nul]`
02:31:27FromDiscord<Elegantbeef> nil\
02:31:29FromDiscord<Bubblie> oh!
02:31:37FromDiscord<Elegantbeef> cstring array is a null terminated collection
02:31:47FromDiscord<Bubblie> maybe thats why it said attempt to read from nil previously
02:32:05FromDiscord<Bubblie> should I try using what I had before and then just making sure there is a nil?
02:32:16FromDiscord<Elegantbeef> sure
02:34:30FromDiscord<Bubblie> wait should it be ptr cstring or just seq[cstring]
02:35:33FromDiscord<Elegantbeef> `cstring` is a `char` equivlent
02:35:51FromDiscord<Elegantbeef> So if you ensure the last entry of the seq is nil you can do `seq[cstring]`
02:36:22FromDiscord<Bubblie> alright
02:36:38FromDiscord<Bubblie> glfwextensions is ptr cstring so how would I make sure its just cstring so I can add it to the sequence?
02:37:08FromDiscord<Elegantbeef> `addr mySeq[0]`
02:40:25FromDiscord<Elegantbeef> This is why i despise C's typesystem
02:40:33FromDiscord<Elegantbeef> So many details are lost
02:41:22FromDiscord<Bubblie> Alright
02:41:24FromDiscord<Bubblie> Thank you!
02:41:45FromDiscord<Bubblie> Wait
02:42:00FromDiscord<Bubblie> But glfwextensions isn’t a sequence its just a ptr cstring
02:42:10FromDiscord<Elegantbeef> That doesnt matter
02:42:22FromDiscord<Elegantbeef> ptr cstring is a ptr to the first element of the collection
02:42:48FromDiscord<Bubblie> Oh
02:44:11FromDiscord<Bubblie> so doing extensions.add(nil) didn't do much
02:44:27FromDiscord<Bubblie> unless I was supposed to add nil a different way?
02:44:30FromDiscord<Elegantbeef> I mean you still need to ensure your strings outlive your collectiion
02:44:59FromDiscord<Elegantbeef> if the last element of your seq is nil you're doing it right
02:45:06FromDiscord<Bubblie> Ah okay
02:49:58FromDiscord<Bubblie> so uh
02:50:00FromDiscord<Bubblie> it prints out
02:50:02FromDiscord<Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=
02:50:05FromDiscord<Bubblie> does not print out nil
02:50:16FromDiscord<Bubblie> so nil is still not in there
02:50:32NimEventerNew thread by Zekereth: Can't Get Length of Returned Table, see https://forum.nim-lang.org/t/9369
02:50:37FromDiscord<Elegantbeef> !eval echo cstring(nil)
02:50:40NimBotCompile failed: /usercode/in.nim(1, 6) Error: type mismatch: got <cstring>
02:51:47FromDiscord<Elegantbeef> !eval var a\: cstring; echo a
02:51:50NimBotCompile failed: /usercode/in.nim(1, 9) Error: ':' or '=' expected, but got 'cstring'
02:52:44FromDiscord<flywind> !eval echo cstring"" == nil
02:52:48NimBotfalse
02:53:18FromDiscord<Bubblie> ok so it does now have nil but same issue and im severely distressed with unsafety 😭
02:54:29FromDiscord<Bubblie> OH
02:54:31FromDiscord<Bubblie> YOOOOOOOO
02:54:33FromDiscord<Bubblie> WAIT A SECOND
02:54:34FromDiscord<Bubblie> oh nvm
02:54:43FromDiscord<Bubblie> suffering again
02:55:51FromDiscord<Bubblie> so atleast now running the function doesn't crash it, its literally only when I do uint32 extensions.len
02:58:04FromDiscord<Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=
03:03:31FromDiscord<Bubblie> Oh
03:03:32FromDiscord<Bubblie> okay
03:03:40FromDiscord<Bubblie> so changing it to a string to be more safe did something...
03:03:47FromDiscord<Bubblie> out of memory
03:03:50FromDiscord<Bubblie> instead of the nil error
03:03:54FromDiscord<Bubblie> so uh what the fuck
03:04:07FromDiscord<Elegantbeef> cstring sucks
03:04:09FromDiscord<Elegantbeef> 😄
03:04:46madpropsi was learning a bit of c++ ... apparently you can initialize with { } instead of = , weird
03:05:05madpropslike int number { 2 }
03:05:40madpropsit had some benefit though, like it enables some warnings
03:06:41FromDiscord<Elegantbeef> C++s intialisers are things of nightmares
03:06:56FromDiscord<Elegantbeef> `MyType a(10)` is valid code
03:08:02FromDiscord<Elegantbeef> In C++ `=` is really copy not assignment, so it's a wacky world
03:09:37FromDiscord<Elegantbeef> As such `MyType a = MyType(10);` is not equal to the above
03:11:39FromDiscord<Bubblie> Hmmmm I simply cannot figure out what could be wrong
03:12:05FromDiscord<Bubblie> so I have this now
03:12:06FromDiscord<Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=47xq
03:12:20FromDiscord<Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=
03:12:31FromDiscord<Bubblie> sigh
03:12:43FromDiscord<Elegantbeef> string is not equivlent to cstring
03:13:07FromDiscord<Bubblie> so I cant cast string to cstring
03:13:40FromDiscord<Elegantbeef> You really need to grasp low level ideas
03:13:44FromDiscord<Elegantbeef> Nim strings are pascal strings
03:13:54FromDiscord<Elegantbeef> Cstrings are null terminated
03:14:19FromDiscord<Bubblie> right 💀 I keep forgetting
03:14:25FromDiscord<Bubblie> so I cant do this that wouldn't work obviously
03:14:25*arkurious quit (Quit: Leaving)
03:17:25FromDiscord<Elegantbeef> What you had before was correctish
03:17:43FromDiscord<Bubblie> ah okay
03:17:54FromDiscord<Elegantbeef> you're doing `newSeq[cstring](glfwExtensionCount)`?
03:18:07FromDiscord<Bubblie> yes
03:18:08FromDiscord<Elegantbeef> That allocates and sets the length to count
03:18:14FromDiscord<Elegantbeef> You then `.add` after
03:18:20FromDiscord<Elegantbeef> Which adds more elemtns
03:18:35FromDiscord<Bubblie> ah wait so its a permanent length?
03:18:36FromDiscord<Bubblie> 0?
03:18:42FromDiscord<Elegantbeef> No
03:18:45FromDiscord<Bubblie> well 0 in this case with glfwExtensionCount
03:18:49FromDiscord<Bubblie> In reply to @Elegantbeef "No": ah okay
03:18:56FromDiscord<Elegantbeef> `newSeq[int](3)` == `@[0, 0, 0]`
03:19:31FromDiscord<Bubblie> huh
03:19:45FromDiscord<Bubblie> isn't that assigning all three elements of an array to that seq
03:20:05FromDiscord<Elegantbeef> you get `count` default elements then add more elements
03:20:20FromDiscord<Elegantbeef> You want `newSeqOfCap`
03:20:56FromDiscord<Bubblie> Ohhhh
03:23:15FromDiscord<Bubblie> so like this
03:23:18FromDiscord<Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=47xs
03:23:45FromDiscord<Elegantbeef> No
03:23:50FromDiscord<Elegantbeef> Jesus the hell are you doing
03:24:16FromDiscord<Bubblie> well you told me newSeqOfCap instead of newSeq right? Must have misinterpreted my bad
03:24:29FromDiscord<Elegantbeef> No that's right but what are you trying to do
03:24:40FromDiscord<Bubblie> oh like in general?
03:24:43FromDiscord<Elegantbeef> You're attempting to query extensions then add their names to a seq of strings
03:24:56FromDiscord<Forest> In reply to @Elegantbeef "Jesus the hell are": you sound like you're gonna rip your hair out lmao
03:25:02FromDiscord<Elegantbeef> I'm about to
03:25:26FromDiscord<Bubblie> In reply to @Elegantbeef "You're attempting to query": yes, you want the original C++ code?
03:25:31FromDiscord<Bubblie> might be easier to understand what im trying to do
03:25:33FromDiscord<Elegantbeef> No this is fine
03:25:36FromDiscord<Elegantbeef> I cannot read C++
03:25:40FromDiscord<Bubblie> oh
03:26:57FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=47xt
03:27:32FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=47xu
03:28:08FromDiscord<Elegantbeef> Probably need a `cast[ptr UncheckedArray[cstring]](glfwExtensions)`
03:28:20FromDiscord<Elegantbeef> and probably need a count \> 0 check
03:31:45FromDiscord<Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=
03:31:53FromDiscord<Elegantbeef> You can
03:33:42FromDiscord<Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=47xv
03:34:02FromDiscord<Elegantbeef> "It's not letting me" isnt an error message
03:34:16FromDiscord<Elegantbeef> And not dont send it here
03:34:19FromDiscord<Elegantbeef> Read it and solve it yourself
03:34:23FromDiscord<huantian> In reply to @Elegantbeef "I'm about to": Wait I though you were a bot how do you have hair
03:34:36FromDiscord<Elegantbeef> My programmers were dicks↵(@huantian)
03:35:14FromDiscord<Bubblie> oh wait
03:35:23FromDiscord<Bubblie> btw I meant to send the error message after but
03:35:24FromDiscord<Elegantbeef> Connectting dots with the error message
03:35:25FromDiscord<Bubblie> give me one sec
03:35:30FromDiscord<Bubblie> In reply to @Elegantbeef "Connectting dots with the": yes
03:35:30FromDiscord<Elegantbeef> "Oh shit it's supposed to be X"
03:35:48FromDiscord<Elegantbeef> The fix is really really simple if i'm right
03:36:04FromDiscord<Elegantbeef> type mismathc at position 3
03:36:10FromDiscord<Elegantbeef> got cuint but expected int
03:36:13FromDiscord<Bubblie> yes
03:36:28FromDiscord<Elegantbeef> Read the error messages please 😛
03:36:33FromDiscord<Bubblie> oh sure
03:37:15FromDiscord<Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=47xw
03:37:31FromDiscord<Bubblie> im going to get my glasses thats probably also why im unable to read shit at times
03:39:09FromDiscord<Forest> Isn't cuint deprecated?
03:40:30FromDiscord<Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=47xy
03:40:53FromDiscord<Bubblie> hold on
03:41:21FromDiscord<Bubblie> I made it print out the length and its three
03:41:30FromDiscord<Bubblie> making enabledExtensionCount: 0 literally makes it run smoothly
03:41:45FromDiscord<Bubblie> so the minute I put extensions.len with a uint32 it just
03:41:45FromDiscord<Bubblie> dies
03:43:11FromDiscord<Bubblie> is this a binding issue?
03:43:14FromDiscord<Bubblie> is it possible?
03:45:02FromDiscord<SaAnd> the type signature expects an int to be passed where you passed the glfwCount thing. Since the glfw thing is an cuint, it errors
03:45:10FromDiscord<Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=47xA
03:45:51FromDiscord<Bubblie> In reply to @SaAnd "the type signature expects": oh I didn't see this
03:45:53FromDiscord<Elegantbeef> you need to convert it to an int in \`toOpenArray
03:45:58FromDiscord<Elegantbeef> Jesus
03:46:22FromDiscord<Bubblie> oh that?
03:46:29FromDiscord<Bubblie> In reply to @Bubblie "well I fixed it": I already fixed this
03:46:56FromDiscord<Elegantbeef> Ok
03:49:06FromDiscord<Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=47xD
03:49:18FromDiscord<Bubblie> (edit) "https://play.nim-lang.org/#ix=47xD" => "https://play.nim-lang.org/#ix=47xE"
03:49:30FromDiscord<Bubblie> OH
03:49:34FromDiscord<Bubblie> OKAY WAIT A SECOND
03:49:44FromDiscord<Bubblie> when enabledLayerCount is ANYTHING above 0 it dies
03:49:48FromDiscord<Bubblie> WTF
03:50:32FromDiscord<Bubblie> so this completely works, its just this part of the object not taking any integer above 0 thats the issue
03:50:40FromDiscord<Bubblie> which is, what...
03:51:40FromDiscord<Bubblie> wait a second
04:10:50FromDiscord<SrMordred> Q: its safe to return a struct from a proc?
04:11:00FromDiscord<Elegantbeef> Yes
04:11:12FromDiscord<Elegantbeef> they objects in Nim
04:11:15FromDiscord<Elegantbeef> they're\
04:12:24FromDiscord<SrMordred> sent a code paste, see https://play.nim-lang.org/#ix=47xL
04:14:21FromDiscord<Elegantbeef> nim -v?
04:14:43FromDiscord<SrMordred> Nim Compiler Version 1.6.6 [Windows: amd64]↵Compiled at 2022-05-05
04:15:07FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=47xM
04:17:27FromDiscord<Funky Egg> how do i remove all dependencies of a package that im uninstalling
04:20:15FromDiscord<Elegantbeef> remove the requires from your nimble registry
04:22:18FromDiscord<Funky Egg> is that to me
04:22:28FromDiscord<Elegantbeef> Yes
04:22:45FromDiscord<Funky Egg> i accidently installed globally, im new to nim
04:22:59FromDiscord<Elegantbeef> Nim doesnt have a local package registry
04:23:03FromDiscord<Elegantbeef> You install packages globally
04:23:15FromDiscord<Funky Egg> ?
04:23:25FromDiscord<Funky Egg> where do i go to remove them
04:23:37FromDiscord<Elegantbeef> `nimble uninstall package`
04:24:35FromDiscord<Funky Egg> that doesnt uninstall all its dependencies
04:24:47FromDiscord<Funky Egg> all its dependencies are still there
04:24:50FromDiscord<Elegantbeef> Oh that's what you mean
04:24:59FromDiscord<Rika> I assume manually
04:24:59FromDiscord<Elegantbeef> Dont know if nimble supports that
04:25:18FromDiscord<Funky Egg> ah ok
04:26:07FromDiscord<Bubblie> so beef, for now im gonna leave it at 0 and then figure it out as I go, just wanted to thank you for your help
04:27:03FromDiscord<SaAnd> nimble uninstall -i package↵(@Funky Egg)
04:27:44FromDiscord<SaAnd> short for nimble uninstall --inclDeps package
04:27:49FromDiscord<Funky Egg> ty
04:28:05FromDiscord<SaAnd> wait it might be -i before uninstall
04:28:36FromDiscord<SaAnd> yeah i think it is
04:32:45FromDiscord<Elegantbeef> @SrMordred\: i did do a min repro and i couldnt reproduce it outside of using raylibnow
04:36:19FromDiscord<SrMordred> sent a code paste, see https://play.nim-lang.org/#ix=47xO
04:36:36FromDiscord<Elegantbeef> I think it might be a NVRO bug, might be wrong
04:36:41FromDiscord<Funky Egg> one last quick thing how do i import a specific version of a package in a .nimble file
04:37:01FromDiscord<Elegantbeef> `requires "package == semver"`
04:37:11FromDiscord<Elegantbeef> Or commit or whatever other versioning works
04:37:21FromDiscord<Funky Egg> tysm
04:39:38FromDiscord<Elegantbeef> It's a bug with refc it seems
04:39:48FromDiscord<Elegantbeef> with `--mm:orc` or `--mm:arc` it doesnt appear
04:39:54FromDiscord<Elegantbeef> Such an od behaviour
04:40:21FromDiscord<Rainbow Asteroids> time to be a cool guy and use `--gc:orc` ig
04:40:39FromDiscord<Elegantbeef> Well a compiler bug needs to be made but i cannot find how to minrepro it
04:40:44FromDiscord<Elegantbeef> Guess it's time to look at the C code 😄
04:41:18FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=47xP
04:45:31FromDiscord<SrMordred> lol, its NVRO but also c bind related somehow, since its a simple struct. ↵but hey --mm:orc solves it, so my project its saved xD
04:48:36FromDiscord<Elegantbeef> Still certainly needs an issue, but it's a very ugh... what bug 😄
04:51:45FromDiscord<SrMordred> i tried nim a lot a years ago. ↵i'm translating a half-baked rust project to nim to see how its goes, and in the first day i hit a compiler bug. ↵this kind of thing happens way too often with me xD
04:52:27FromDiscord<Elegantbeef> It seems to be a bug with nim's `genericAssign` for refc
04:53:09FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=47xR
04:54:38FromDiscord<Elegantbeef> It's a bit odd that raylib imports that struct anyway
04:54:51FromDiscord<Elegantbeef> Mark it by copy and C's structural typing handles it i thought
05:50:16*xcodz-dot joined #nim
05:50:47xcodz-dotI am using js backend for nim, could someone please tell me how to use cookies
05:51:02xcodz-dotI am really desperate now
05:53:08FromDiscord<Elegantbeef> You'd use them the same way you use them in JS, the code might not be wrapped though
05:53:23xcodz-dotThat
05:53:49xcodz-dotThat's the problem, I am unable to find any standard API for using cookies
05:54:06xcodz-dotno such thing as the word `cookie` in the js standard lib
05:54:31FromDiscord<Elegantbeef> Yea i dont know anything about webdev so hopefully someone that does speaks
05:54:40FromDiscord<huantian> https://developer.mozilla.org/en-US/docs/Web/API/Document/cookie well google gives me this
05:54:55xcodz-dotthanks, I have already been there.
05:55:12xcodz-dotno such API is exposed in js backend for whatever reason
05:55:34FromDiscord<huantian> I think you can importc `document` as a JsObject
05:55:36FromDiscord<Prestige> Is there no way to do css hover with Karax?
05:55:44FromDiscord<huantian> https://nim-lang.org/docs/jsffi.html
05:56:02xcodz-dotWill try that
05:56:03FromDiscord<huantian> I don’t know why Document isn’t wrapped anywhere in the std
05:56:14xcodz-dotoh, document is there under dom
05:56:18FromDiscord<Elegantbeef> Prestige you should be able to add any attribute
05:56:19xcodz-dotbut are cookies under document?
05:56:38FromDiscord<Prestige> In reply to @Elegantbeef "Prestige you should be": I'm not sure how, with karax
05:57:04xcodz-dotnoop, cookies aren't there
05:57:16xcodz-dotlooks like, I will have to write some emit pragmas
05:57:33FromDiscord<Prestige> sent a code paste, see https://play.nim-lang.org/#ix=47xX
05:57:39FromDiscord<PyryTheBurger> how do i overwrite an object constructor
05:57:45FromDiscord<Elegantbeef> You dont
05:58:21FromDiscord<Elegantbeef> I mean you dont need to do anything in the html for that afaik, you just do `a: "Hello"` or w/e
05:58:41FromDiscord<Prestige> What?
05:58:49FromDiscord<Prestige> How does that apply with `hover`
05:58:55FromDiscord<Elegantbeef> Are you trying to embed CSS into a Nim object?
05:59:07FromDiscord<Elegantbeef> Fuck i havent touched karax or webdev in forever i forget how any of it works
05:59:55FromDiscord<Elegantbeef> What are you trying to do?↵(@PyryTheBurger)
06:00:11FromDiscord<Prestige> I can do stuff like `let blueTextCSS = toCss("color: blue")` then `tdiv(style = blueTextCSS)`
06:00:15FromDiscord<huantian> It’s probably be better to use your own document declared with JsObject↵(<@709044657232936960_xcodz-dot=5b=49=52=43=5d>)
06:00:28FromDiscord<Prestige> I wish I could just use a css file with karax tbh
06:00:37xcodz-dotthx huantian
06:00:39FromDiscord<Elegantbeef> You cant use css with karax?
06:01:08FromDiscord<PyryTheBurger> sent a code paste, see https://play.nim-lang.org/#ix=47xZ
06:01:08FromDiscord<huantian> I’d give an example but I’m on mobile 😞
06:01:27FromDiscord<PyryTheBurger> and then i want to make a custom constructor that also puts the instance into an array
06:01:29FromDiscord<Prestige> In reply to @Elegantbeef "You cant use css": Not that I'm aware of (a standalone css file)
06:02:27FromDiscord<Elegantbeef> You can with `link(rel = "stylesheet", type = "text/css", href = "main.css")` methinks
06:02:49FromDiscord<Elegantbeef> I thought i used a stylesheet for my site
06:02:49FromDiscord<Prestige> Hm I'll try it
06:02:54FromDiscord<huantian> Maybe you should just use tailwind ex
06:03:00FromDiscord<huantian> \ez
06:04:02FromDiscord<Prestige> I'd still have to have karax use that css file
06:04:13FromDiscord<Elegantbeef> Is that an issue?
06:04:17FromDiscord<untoreh> sent a code paste, see https://play.nim-lang.org/#ix=47y0
06:04:42FromDiscord<Elegantbeef> so make a `proc init(_: typdesc[Lol], lol: string)` or something similar↵(@PyryTheBurger)
06:05:05FromDiscord<Elegantbeef> I dont know what the issue is with just having karax link your `.css` init it
06:05:09FromDiscord<Elegantbeef> in it\
06:05:18FromDiscord<Prestige> In reply to @Elegantbeef "I dont know what": Figuring out how to do that
06:05:26FromDiscord<Elegantbeef> What i gave you will do that
06:05:29FromDiscord<Elegantbeef> Put that in your header
06:05:31FromDiscord<Elegantbeef> Or w/e
06:05:36FromDiscord<Prestige> I'm trying it out
06:05:48FromDiscord<Elegantbeef> Ah ok i thought you tried it out and were complaining
06:05:49FromDiscord<Elegantbeef> My bad
06:06:08FromDiscord<untoreh> sent a code paste, see https://play.nim-lang.org/#ix=47y1
06:06:30FromDiscord<Prestige> Yay it worked
06:06:32FromDiscord<Prestige> thanks beef
06:06:36FromDiscord<Elegantbeef> Look at the `withLock` template in `locks`
06:06:38FromDiscord<Elegantbeef> No problem
06:07:18FromDiscord<untoreh> can withlock be used on func defs?
06:07:22FromDiscord<Elegantbeef> Your locked template isnt proper i think cause it doesnt lock in the proc
06:07:36FromDiscord<Elegantbeef> You'll need a macro for that i assume
06:08:21FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=47y2
06:08:39FromDiscord<untoreh> I see
06:11:42FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=47y3
06:12:41FromDiscord<Elegantbeef> Damn this is actually smart
06:13:40FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=47y5
06:14:19FromDiscord<Elegantbeef> Not that it's really much better than the pragma as a first line
06:14:59FromDiscord<huantian> Yeah you just lose the indent
06:15:39FromDiscord<Elegantbeef> Wonder if you can lock on parameters
06:16:23FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=47y6
06:16:42FromDiscord<Elegantbeef> Probably not but meh i closed the file
06:45:53FromDiscord<Bubblie> Im gonna have to write some C++ vulkan tommorow to see if this is a binding issue with nimious vulkan and then fix it
06:46:11FromDiscord<Bubblie> Cause if it doesn’t work on C++ either it means I clearly did something wrong and am missing something
06:50:14FromDiscord<Bubblie> I hate c++
06:50:16FromDiscord<Bubblie> 😭
06:52:01*deadmarshal joined #nim
06:55:08*kenran joined #nim
06:55:52*kenran quit (Client Quit)
06:56:37FromDiscord<victory> im sort of new to nim, what is `Option`?
06:56:55FromDiscord<victory> and if i was specifying a value for something of type `Option[bool]`, how would it look?
06:58:02FromDiscord<Elegantbeef> `some(true)`
06:58:09FromDiscord<Elegantbeef> Option adds n + 1 possible states to a type
06:59:09FromDiscord<4zv4l> I was wondering since Nim is really similar to C with the function declaration, is it ok to include a nim file that contains all the functions and struct declaration like a `.h` file for but Nim ?
07:04:49FromDiscord<untoreh> why do you copy the tree? In what places would edit the proc def in place be bad?
07:05:39FromDiscord<untoreh> (edit) "places" => "cases"
07:06:28FromDiscord<Elegantbeef> It's not bad to mutate it if it's untyped
07:06:29FromDiscord<Elegantbeef> It was typed in my previous version so it needed it↵(@untoreh)
07:07:20*krux02 joined #nim
07:08:53FromDiscord<Bung> anyone know how to undervolt cpu in c on windows, I bought new pc with small case and i7 12700f . xtu does not works.
07:10:51xcodz-dotI do not think that windows provides any API to do such kernal level critical tasks
07:11:09FromDiscord<Elegantbeef> Normally you do it through uefi no?
07:11:16xcodz-dottrue
07:11:25xcodz-dotbios or uefi, whatever you have
07:11:39FromDiscord<Bung> bios has no option to set
07:11:59FromDiscord<Elegantbeef> Overclock settings?
07:12:17xcodz-dotThen you are out of luck
07:12:48FromDiscord<Bung> my pc is hp brand, does not have much custom options
07:12:56xcodz-dotI also got a new laptop recently with shitty uefi that has locked even the settings to Virtualization Technologies. Can not even use the features advertised by Intel
07:13:24FromDiscord<Bung> but xtu old version does support for non-k suffix cpu
07:13:29FromDiscord<Elegantbeef> I love that modern CPUs are so inefficient that people undervolt them instead of the companies providing ample cooling
07:14:15xcodz-dotIt is probabbly bad decisions of adding tons of complex instructions into the ISA earlier by intel for marketing purposes.
07:14:21FromDiscord<Bung> yeah , when you enable Virtualization Technologies which wsl needed, xtu does not work
07:14:28FromDiscord<Phil> In reply to @Elegantbeef "Oh is it `{.gcsafe.}:`": I squint at this because I'm pretty sure I tried that before, but that memory is at least half a year old so I could be misremembering
07:14:52FromDiscord<Elegantbeef> With 300W+ cpu and CPUs we're finally actually needing 600w PSUs on low spec PCs 😄↵(<@709044657232936960_xcodz-dot=5b=49=52=43=5d>)
07:15:09FromDiscord<Elegantbeef> cpus and gpus\
07:15:17FromDiscord<Elegantbeef> Yea i dont know phil
07:15:17xcodz-dotWTF? 300W CPU !!???
07:16:14FromDiscord<Elegantbeef> The 12900k pulls 241 W ad max turbo
07:16:14FromDiscord<Elegantbeef> at max\
07:16:58xcodz-dotthat is worst than what I though. I beleived that a really heavy CPU couldnt take more than 50-60 W. But that is on a whole another level.
07:17:59xcodz-dotanyways, remember the question I asked about cookies? I implemented it using emit pragma and importing using importjs pragma.
07:18:08FromDiscord<Elegantbeef> Nice
07:18:35FromDiscord<Phil> In reply to @xcodz-dot "that is worst than": May I introduce you to the assumed new Nvidia 4000 series specs?
07:18:39FromDiscord<Phil> They will blow your mind
07:18:44FromDiscord<Phil> Literally, the fans will need to be insane
07:18:45FromDiscord<Elegantbeef> I mean those are gpus
07:18:53FromDiscord<Elegantbeef> Cpus were generally low wattage for a long time
07:19:05xcodz-dotOh no no no
07:20:58xcodz-dotWell, wanted to share this: https://xcodz-dot.github.io/ .Dont mind the content. Just look at the animations. All implemented in 99% pure nim. (1% of JS using emit pragma)
07:21:56FromDiscord<Elegantbeef> Why is it .exe,, i'm scared is it running wine in a window, help! 😛
07:22:35xcodz-dotlol, wanted that old DOS look to it. But really, I am young so idk about that Time. I am not even an adult rn.
07:26:53FromDiscord<victory> how could I get the latency of a shard on dimscord?
07:34:47*xcodz-dot quit (Quit: Leaving)
07:35:14FromDiscord<!&luke> Can I compile nimja at runtime instead of compile time?
07:35:30FromDiscord<!&luke> In reply to @victory "how could I get": s.latency I think
07:35:39FromDiscord<!&luke> S is the shard
07:35:42FromDiscord<victory> i figured it out
07:35:43FromDiscord<victory> thx tho!
07:35:44FromDiscord<!&luke> (edit) "S" => "s"
07:35:49FromDiscord<!&luke> In reply to @victory "thx tho!": Np
07:40:15FromDiscord<4zv4l> how can I quickly get the number of line in a file ?
07:40:46*krux02 quit (Remote host closed the connection)
07:41:25FromDiscord<Rika> Scan the whole file
07:41:36FromDiscord<4zv4l> so read line by line ?
07:41:42FromDiscord<Rika> Pretty much
07:41:48FromDiscord<4zv4l> doesn't sound super optimized
07:41:51FromDiscord<4zv4l> wc doesn't do like that
07:41:53FromDiscord<Rika> No other way
07:41:58FromDiscord<Rika> Does it now
07:42:08FromDiscord<Rika> I don’t recall another way to do it other than to read the whole file
07:42:29FromDiscord<Rika> Are you sure it’s not just scanning really quickly
07:42:44FromDiscord<4zv4l> well if it does that then that's really really quick
07:43:05FromDiscord<4zv4l> I had a 30gb file↵and I tried a c program that scan each newline to increment
07:43:20FromDiscord<4zv4l> it tooks like 15 seconds more than wc
07:43:26FromDiscord<4zv4l> but alright, I'll do that
07:43:28FromDiscord<newlibarian> what is the difference between let and var?
07:43:30FromDiscord<4zv4l> just doesn't sound super nice
07:43:35FromDiscord<newlibarian> when and if ?
07:43:37FromDiscord<4zv4l> In reply to @newlibarian "what is the difference": let are immutable
07:43:41FromDiscord<4zv4l> var are mutable
07:43:49FromDiscord<4zv4l> In reply to @newlibarian "when and if ?": swicth case/ if else
07:44:12FromDiscord<4zv4l> In reply to @4zv4l "swicth case/ if else": not the best explanation
07:44:43FromDiscord<newlibarian> difference between const and let?
07:44:49FromDiscord<Rika> When is compile time
07:44:51FromDiscord<Rika> If is run time
07:44:58FromDiscord<Rika> In reply to @newlibarian "difference between const and": Const is immutable compile time
07:45:03FromDiscord<Rika> Let is immutable run time
07:45:15FromDiscord<newlibarian> what's the difference between run time and compile time?
07:45:44FromDiscord<Rika> Compile time happens when you compile the program, before it runs
07:45:48FromDiscord<Rika> Run time is when it runs
07:45:59FromDiscord<newlibarian> but won't the binary be the same?
07:46:11FromDiscord<Rika> What do you mean?
07:46:26FromDiscord<newlibarian> they both compile to binary ?
07:46:51FromDiscord<Rika> With compile time code execution, you can calculate stuff before you create the binary, and put only the final result into the binary
07:47:05FromDiscord<Elegantbeef> `let` can rely on runtime values where as `const` cannot
07:47:17FromDiscord<Rika> In reply to @Elegantbeef "`let` can rely on": That’s what he’s asking
07:47:22FromDiscord<Rika> What does it mean to be compile time and run time
07:47:52FromDiscord<newlibarian> my favorite languages are c , pascal and python, this is new to me.
07:47:59FromDiscord<Elegantbeef> A compiled language like Nim runs over your code before it's executed to generate a binary, this includes type checking, macro evaluation, static block evaluation, and anything else that can be evaluated statically.
07:48:36FromDiscord<Elegantbeef> This enables catching errors earlier and also saving performance
07:48:49FromDiscord<Elegantbeef> const in nim is a lot like C's `#define`
07:49:04FromDiscord<Elegantbeef> It's a cached constant expression that has a symbol
07:49:18FromDiscord<newlibarian> pascal use const too. i know if it value doesn't change i use const to improve performance.
07:49:18FromDiscord<Elegantbeef> The difference is that the expression is cached once and repetitive usage does not cause it to revaluate
07:51:03FromDiscord<newlibarian> i'm using vscode for editor. what's the best editor for nim?
07:51:29FromDiscord<Rika> That works, yes
07:51:33FromDiscord<Elegantbeef> All tooling for nim but jetbrains' uses nimsuggest so it's all about equal
07:51:44FromDiscord<Elegantbeef> If you're using vscode ensure you're using saem's extension
07:54:11FromDiscord<newlibarian> i pretty much know how to use nim even though i just installed it.. i just need to get the terminology right.
07:54:43FromDiscord<Elegantbeef> Wellyea you know pascal and it's pretty much fancier pascal
07:55:32FromDiscord<newlibarian> nim is like my 3 favorite languages into one.
08:11:08FromDiscord<4zv4l> is there a way to get the return from split to multiple variables ?
08:11:22FromDiscord<4zv4l> like↵`name, age, adr = str.split(",")`
08:11:36FromDiscord<4zv4l> split the result array to multiple variable
08:12:02FromDiscord<Elegantbeef> Are you sure you dont want `let (success, name, age, adr) = str.scanTuple("$+,$i,$+")`?
08:12:35FromDiscord<4zv4l> looks a bit fancier but why not yeah
08:12:43FromDiscord<Elegantbeef> `import std/strscans`
08:13:37FromDiscord<4zv4l> do I need the success one ?
08:13:47FromDiscord<4zv4l> why it doesn't throw an error instead ?
08:13:53FromDiscord<Elegantbeef> You can make i `_` if you dont care that it succeeded
08:14:13FromDiscord<Elegantbeef> Cause success makes more sense than a exception here as scanf doesnt raise an exception either
08:14:28FromDiscord<Elegantbeef> scanf you're supposed to use `if line.scanf(..., a, b, c)`
08:15:29FromDiscord<Rika> I don’t know but it feels like people forget what “exception” means xd
08:15:30FromDiscord<!&luke> In reply to @ripluke "Can I compile nimja": Anyone know?
08:16:04FromDiscord<4zv4l> In reply to @Rika "I don’t know but": well you expect the scanTuple to get the arguments you ask for
08:16:18FromDiscord<4zv4l> if there isn't all the one you asked then handle with `except`
08:16:45FromDiscord<Elegantbeef> That's not exceptional
08:16:59FromDiscord<Elegantbeef> Exceptions should be used in exceptional cases
08:17:02FromDiscord<Elegantbeef> Atleast in my view
08:17:56FromDiscord<Elegantbeef> If your parse failed would it cause something exceptional inside the procedure you called
08:17:58FromDiscord<Elegantbeef> No
08:17:58FromDiscord<4zv4l> so for basic error why not making an enum {value, error} and check all the time if the error is nul or not ?
08:18:05FromDiscord<4zv4l> yes right
08:18:10FromDiscord<4zv4l> then it will raise
08:18:12FromDiscord<Elegantbeef> Cause optionals are better
08:18:29FromDiscord<Elegantbeef> Sentinels and Optionals are lovely
08:18:33FromDiscord<Elegantbeef> But not for errors
08:18:40FromDiscord<Elegantbeef> Exceptions are pristine for errors
08:19:09FromDiscord<Elegantbeef> These are my views atleast others disagree
08:19:28FromDiscord<4zv4l> so, instead of using try/except, what should I use ?
08:19:43FromDiscord<Elegantbeef> You should use try except in the case there are exceptions/errors
08:20:02FromDiscord<Elegantbeef> You should use better methods to indicate when a procedure may fail at doing a task
08:20:09FromDiscord<4zv4l> alright
08:20:11FromDiscord<Elegantbeef> Be it a sentinel value or an optional
08:20:17FromDiscord<Elegantbeef> `std/options` for the latter
08:20:31FromDiscord<Elegantbeef> for the former you can either use dumb C sentinels or a static typed one like https://github.com/beef331/nimtrest/blob/master/sentinels.nim
08:21:29FromDiscord<4zv4l> In reply to @Elegantbeef "Are you sure you": how do I get unsigned with that ? I don't find the letter for unsigned if there is any
08:21:51FromDiscord<Elegantbeef> Nim says default to signed integers
08:21:56FromDiscord<4zv4l> wait, why are you talking about sentinel ?
08:22:16FromDiscord<Elegantbeef> Cause you asked how does one propagate an error failed and there are 3 methods
08:22:23FromDiscord<Elegantbeef> A procedure failed\
08:23:11FromDiscord<Elegantbeef> There are exceptions which are for when you something exceptional, optionals, and sentinels
08:23:26FromDiscord<Elegantbeef> Sentinels are optionals but do not take any more memory
08:23:29FromDiscord<4zv4l> sentinel are for the end of string aren't they ?
08:23:33FromDiscord<Elegantbeef> No
08:23:44FromDiscord<Elegantbeef> Those are sentinel terminated C arrays
08:24:03FromDiscord<Elegantbeef> Sentinels values are designating a value meaningless
08:24:20FromDiscord<Elegantbeef> So if you have an API that returns -1 on failure that's a sentinel
08:24:39FromDiscord<4zv4l> alright
08:24:41FromDiscord<4zv4l> get it
08:29:28FromDiscord<newlibarian> {.global.} is this the only way to declare global variables?
08:29:40FromDiscord<Elegantbeef> Nim supports top level variables
08:29:49FromDiscord<newlibarian> what does that mean?
08:29:55FromDiscord<Elegantbeef> The global pragma is for declaring a variable inside a procedure globally
08:30:06FromDiscord<Elegantbeef> That's valid
08:30:08FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=47yn
08:30:53FromDiscord<newlibarian> how do you delcare global variables?
08:31:04FromDiscord<Elegantbeef> I just showed you
08:31:07FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=47yo
08:31:10FromDiscord<Elegantbeef> A global variable is a top level variable
08:31:29FromDiscord<Elegantbeef> The global pragma on a variable in a procedure makes it outlast it's stack frame
08:33:00FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=47yp
08:33:09FromDiscord<Phil> Wait, beef already wrote an example
08:33:14FromDiscord<Phil> I should focus on eating breakfast
08:33:54FromDiscord<Elegantbeef> Dont worry phil sometimes i dont think even the interested parties read my messages
08:34:25FromDiscord<Elegantbeef> I should start rendering my messages in wordart to keep the attention
08:34:32FromDiscord<Phil> My order of operation is what screwed me here:↵Read message, reply to it if desired, read next message, reply to it if desired
08:34:47FromDiscord<Phil> etc.
08:37:25FromDiscord<untoreh> sent a code paste, see https://play.nim-lang.org/#ix=47yr
08:37:38FromDiscord<untoreh> (edit) "https://play.nim-lang.org/#ix=47yr" => "https://play.nim-lang.org/#ix=47ys"
08:38:10FromDiscord<Elegantbeef> Lock doesnt work with indirection
08:38:20FromDiscord<untoreh> 😦
08:38:38FromDiscord<Elegantbeef> I mean think about it you'd have to walk down every procedure call and check if any was guarded
08:38:46FromDiscord<Elegantbeef> It's a mess to be fair
08:38:55FromDiscord<Elegantbeef> It'd be nice if it did work but it's understandable it doesnt imo
08:39:04FromDiscord<untoreh> like regex lookbehinds 😛
08:39:11FromDiscord<Elegantbeef> Not to mention generics, and other complex
08:39:18FromDiscord<Elegantbeef> complex statements
08:39:25FromDiscord<Elegantbeef> Regex is a mistake
08:39:29FromDiscord<Elegantbeef> So who cares if it works
08:40:48FromDiscord<Prestige> Will Nim 2.0 do away with needing forward declarations? 🤔
08:40:57FromDiscord<Elegantbeef> It's in the roadmap
08:41:01FromDiscord<Prestige> Sweet
08:41:11FromDiscord<Elegantbeef> might not be 2.0 but after it
08:41:19FromDiscord<Elegantbeef> 2.0 isnt really that fancy to be fair
08:41:22FromDiscord<Prestige> My gf keeps complaining about it, lol
08:41:30FromDiscord<Elegantbeef> Everyone is acting like it will make 90000 different things
08:41:34FromDiscord<Prestige> Yeah
08:42:54FromDiscord<Prestige> Gah I should make my own terminal
08:44:01madpropshow do you measure nim usage worldwide?
08:44:18FromDiscord<Elegantbeef> You put a cup in the lake and if you catch a fish nim is popular
08:44:43madpropsa cup in the c
08:45:40*kenran joined #nim
08:45:57*kenran quit (Client Quit)
08:46:20FromDiscord<Elegantbeef> Generally people look at github activity
08:46:51FromDiscord<Elegantbeef> But given this live chat it seems nim is losing more than it's gaining, so who knows
08:48:09FromDiscord<Prestige> Tbh it's hard to gain new people with poor editor support
08:49:47*dnh joined #nim
08:50:06FromDiscord<flywind> In reply to @Elegantbeef "2.0 isnt really that": Nim v2 is gonna to be conservative, but the next gen compiler is going to be fancy
08:50:19FromDiscord<Elegantbeef> Assuming it ever comes 😄
08:50:26FromDiscord<flywind> (edit) "gonna" => "going"
08:50:48FromDiscord<flywind> Probably the same time when v2 is released.
08:51:04FromDiscord<Elegantbeef> What is there a hidden rewrite of Nim going on somewhere
08:51:19FromDiscord<flywind> In reply to @Avahe "Will Nim 2.0 do": It is in the 2.x roadmap.
08:51:43FromDiscord<flywind> In reply to @Elegantbeef "What is there a": A secret, I don't know much.
08:52:50FromDiscord<Prestige> Weird, never heard about that
08:55:11FromDiscord<flywind> Otherwise how can the GitHub activity of the Nim repo is so inactive.
08:55:44FromDiscord<Elegantbeef> Oh nice fly i see you've got defaults in a PR
08:56:31FromDiscord<Elegantbeef> Does it work with `a = 100`?
08:56:45FromDiscord<flywind> Yeah, It is green before, after I merge the upstream changes, some nimsuggest tests are broken on Linux and Macos.
08:57:03FromDiscord<Elegantbeef> Also does it work distincts?
08:57:17FromDiscord<flywind> In reply to @Elegantbeef "Does it work with": Yes, it works for const values.
08:57:36FromDiscord<flywind> with/without type
08:57:38FromDiscord<Elegantbeef> Ah so it's literally my defaults without a macro 😄
08:57:59FromDiscord<flywind> In reply to @Elegantbeef "Also does it work": I haven't tested distincts.
08:58:29FromDiscord<flywind> In reply to @Elegantbeef "Ah so it's literally": Yeah
08:58:35FromDiscord<untoreh> are lock levels still a thing? since TLock was deprecated?
08:58:53FromDiscord<Elegantbeef> Lock are being deprecated
08:58:57FromDiscord<Elegantbeef> Lock levels rather
08:59:31FromDiscord<Elegantbeef> Completely removed as they're pretty much useless
08:59:33FromDiscord<flywind> Lock levels is scheduled to be removed on the roadmap. I had a PR for ut.
08:59:36FromDiscord<Elegantbeef> I still dont know what the hell they indicate
08:59:46FromDiscord<flywind> (edit) "ut." => "it."
09:00:09FromDiscord<Elegantbeef> It was an under documented bitch of a feature
09:06:14FromDiscord<enthus1ast> FROM linux it was no big issue, but FROM windows TO linux ....
09:08:08FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=47yB
09:08:10FromDiscord<Elegantbeef> Remember that `newX` is conventionally a heap allocation
09:29:17*dnh quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
09:36:09*dnh joined #nim
09:53:39*xet7 joined #nim
10:40:20FromDiscord<Prestige> I'm trying to do some stuff with karax - anyone know how to get the string value from an `input` after it's been changed?
10:40:46FromDiscord<Prestige> I've added an event `onInput` listener to it, but haven't been able to pull a string value from the `Event` object
10:47:57FromDiscord<Prestige> ah, it's `n.value` - guess the data isn't inside the event
11:05:34FromDiscord<hotdog> In reply to @Avahe "I'm trying to do": If you did want to pull it from the event it would be event.target.value
11:05:56FromDiscord<Prestige> I was getting a nil error when trying that
11:06:04FromDiscord<hotdog> Though you’d need to convert it to InputEvent
11:06:13FromDiscord<hotdog> Or ChangeEvent maybe
11:06:34FromDiscord<hotdog> https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event
11:06:55FromDiscord<hotdog> Either
11:07:12FromDiscord<hotdog> https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event
11:07:28FromDiscord<hotdog> In reply to @Avahe "I was getting a": What was nil? The target or the value?
11:07:57FromDiscord<Prestige> The value, was throwing some error about the string in js being null when it was being converted over or something, I don't remember exactly
11:08:19FromDiscord<Prestige> I'm very familiar with how the js side of things works, but it's been a pain figuring out what karax is doing, exactly
11:15:56*pro joined #nim
11:20:03FromDiscord<Ras> yet another dumb question: is there a good way to combine those last two for loops? https://media.discordapp.net/attachments/371759389889003532/1008334184135262279/unknown.png
11:20:17FromDiscord<Ras> `nodes` and `floating_nodes` are both the same type
11:20:18FromDiscord<hotdog> @Prestige this seems to work fine for me - http://ix.io/47z0
11:24:54FromDiscord<hotdog> In reply to @Ras "yet another dumb question:": `for node in parent.nodes & parent.floatingNodes` or make a template
11:25:24FromDiscord<Ras> In reply to @hotdog "`for node in parent.nodes": does that allocate a new sequence?
11:25:33FromDiscord<hotdog> In reply to @Ras "does that allocate a": Ye
11:25:38FromDiscord<Ras> alright
11:25:42FromDiscord<hotdog> I would do the latter and template it
11:25:47FromDiscord<Ras> alright, thanks
11:26:21FromDiscord<Prestige> Weird
11:33:15*xcodz-dot joined #nim
11:35:54xcodz-dotWhy doesn't this work and shows an error of string being unused. I am trying to port my python written compiler to nim. https://play.nim-lang.org/#ix=47z3
11:36:02*krux02 joined #nim
11:37:18FromDiscord<flywind> In reply to @xcodz-dot "Why doesn't this work": You need to specify the return of macros, it should be string.
11:37:27FromDiscord<flywind> (edit) "In reply to @xcodz-dot "Why doesn't this work": You need to specify the return ... of" added "type"
11:37:34FromDiscord<flywind> return type
11:38:07FromDiscord<flywind> `macro defIns(statement: static[string]): string`
11:38:35xcodz-dotThanks, I am dumb. Shouldn't nim compiler give out a better error message?
11:39:02pronim compiler let's say unique
11:39:17prois!
11:39:26xcodz-dothmm
11:43:47*krux02 quit (Remote host closed the connection)
11:44:31*krux02 joined #nim
11:54:55*krux02 quit (Remote host closed the connection)
11:55:24FromDiscord<tandy> based nim gf↵(@Prestige)
11:55:45*krux02 joined #nim
11:57:25*pro quit (Quit: pro)
12:00:51FromDiscord<haxscramper> In reply to @flywind "Nim v2 is going": Just "fancy" or are there some details about that?
12:01:46FromDiscord<haxscramper> In reply to @flywind "A secret, I don't": You've been told this is a secret or there is just no info available?
12:02:02FromDiscord<haxscramper> In reply to @flywind "Otherwise how can the": And you guessed based on the GH activity
12:06:06FromDiscord<Phil> In reply to @flywind "Yes, it works for": Wait, does that generate a `new(T)` constructor proc for me?
12:06:24FromDiscord<Phil> Just now scrolled down enough to see hax' messages, everybody wants flywind it seems
12:22:59FromDiscord<tandy> does anyone know why my jsony rename hooks dont work for incoming json?↵https://gitlab.com/tandy1000/listenbrainz-nim/-/blob/master/src/listenbrainz/utils/tools.nim#L59
12:24:41FromDiscord<Phil> Just so I can be sure of what I'm reading
12:24:50FromDiscord<Phil> Could you give me an example string of the json you're expecting?
12:26:54FromDiscord<Phil> Because from what I'm seeing you're expecting something like this:↵` {"https://musicbrainz.org/doc/jspf#playlist": "some value or another"}`
12:27:33FromDiscord<kentuckybtc> https://t.me/+sj30hB-ZyA03Nzg0I'll 20 people on how to earn $10,000 or more in just 3day's from the crypto market.but you will pay me 10% commission when you receive your profit. if interested send me a direct message, for more information... Contact via📩📩📩📩📩📩📩📩TELEGRAM💬@@FLORAGORDONhttps://t.me/+sj30hB-ZyA03Nzg0
12:27:42FromDiscord<Phil> <@&371760044473319454> We have scum in the chat
12:27:58FromDiscord<Phil> Unrelated to that guy, tandy you there?
12:28:07FromDiscord<tandy> nvm, it was working, just ref object comparison failing \:L↵(@Phil)
12:28:09FromDiscord<tandy> im a knob
12:28:26FromDiscord<Phil> It's fine, we all ar
12:28:31FromDiscord<Phil> (edit) "ar" => "are 😄"
12:29:08FromDiscord<tandy> why would one want to use ref objects over objects?
12:30:09FromDiscord<Phil> Easy, normal objects are sometimes really painful to properly parse when you have nested ones and you may have a hidden copy somewhere
12:31:18FromDiscord<Phil> For example, I recently ran into this where I wanted to parse the `Row` datatype (which is seq[string] basically) that databases give you into objects.↵I had the scenario where I could have nested objects. With value type objects that suddenly becomes a massive pain because in the naive approach somewhere you have the object getting copied and the copy you parse the data into is not the one your proc eventually returns etc. etc.
12:32:10FromDiscord<Phil> Further, a normal object copies way more data around than a ref-type does.↵If your object is large, copying that around a lot is expensive when you can just have a single object and instead of the entire object you just copy the pointer to it
12:32:51FromDiscord<tandy> ahh
12:33:30FromDiscord<tandy> but why doesnt the nim compiler automatically generate equality checks for ref objects?
12:33:59FromDiscord<Phil> Hm? What do you mean?
12:34:16FromDiscord<Phil> I need some context here
12:34:39FromDiscord<dom96> ugh, matrix is too annoying to moderate
12:35:36FromDiscord<Phil> quick question, what was the proc again that showed me the amount of memory an object takes up?
12:36:00FromDiscord<Phil> I know there was one but I can't remember the name of it for the life of me, I know Rika told it to me once
12:37:15FromDiscord<Phil> It's flipping `sizeof`
12:37:17FromDiscord<Phil> damn
12:37:34FromDiscord<Phil> Okay I'm writing myself an SO question for this when I can't even remember that
12:39:34*jmdaemon quit (Ping timeout: 244 seconds)
12:41:46FromDiscord<Phil> But do we have a proc that gives me the size of a ref object!
12:41:52FromDiscord<Phil> (edit) "object!" => "object?"
12:42:56FromDiscord<Phil> Because I can't properly get the size of a seq of ints.↵That'll just throw out the size of the pointers
12:42:56FromDiscord<dom96> `sizeof(refObj[])` maybe
12:43:40FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=47zh
12:44:00FromDiscord<Phil> That gives you a compile-error for seqs sadly
12:44:11FromDiscord<dom96> well for seq you'd need to get the size of the element the number of elements
12:45:13FromDiscord<Phil> Fair. It feels like that's fairly doable to do and just nobody did it yet to have sizeof(obj) that gives you the entire memory-space taken up
12:45:28FromDiscord<Phil> Though the big question becomes who even needs that info
12:47:36FromDiscord<flywind> In reply to @Isofruit "Wait, does that generate": yes
12:48:13FromDiscord<Phil> Hell yeah
12:48:19FromDiscord<flywind> new T will initialize the variable with the default value.
12:48:21FromDiscord<Phil> Literally one of the day 1 features I'd have loved for nim to have
12:48:38FromDiscord<Phil> Which is why I loved beef's constructor/defaults module so much
12:50:03FromDiscord<Phil> If I can get moigagoo to agree this could literally be the basis for a more convenient norm API where you don't have to pass an instance of an object, but just the type that you want.↵It's what I use internally for my own webapplication already and why I wrote a wrapper module around everything I do with norm so that I don't have to deal with object instantiation
13:00:58FromDiscord<dom96> In reply to @Isofruit "Fair. It feels like": `sizeof` is modeled after how it works in C
13:01:32FromDiscord<dom96> so if it returned a large value for a pointer that would confuse a lot of people
13:02:15FromDiscord<Rika> In reply to @tandy "but why doesnt the": Because whether the user wants pointer equality or field equality is ambiguous
13:02:40FromDiscord<Rika> Or did I miss something
13:02:41FromDiscord<flywind> In reply to @Isofruit "That gives you a": seq is a value type, not a ref type though.
13:02:44FromDiscord<Rika> I probably did
13:02:54FromDiscord<Phil> In reply to @flywind "seq is a value": squint I'm not convinced of that, one sec
13:03:57FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=47zn
13:03:59FromDiscord<flywind> !eval var x = @[1]; var y = x; x[0] = 777; echo y
13:04:03NimBot@[1]
13:04:57FromDiscord<Phil> So is a seq something with the copy behaviour of value types but allocated on the heap instead of the stack?
13:05:18FromDiscord<flywind> Yes
13:05:23*xcodz-dot quit (Ping timeout: 244 seconds)
13:05:42FromDiscord<flywind> Are you using ORC btw?
13:05:42FromDiscord<Phil> And i assume the same is true for strings?
13:06:10FromDiscord<flywind> True
13:06:17*xcodz-dot joined #nim
13:06:22FromDiscord<Phil> In my playground project where I'm compiling the lines above? Yeah, but not always↵In my webapplication? Yeah
13:06:55FromDiscord<flywind> They don't copy string literals in ARC/ORC It copies on write.
13:07:13FromDiscord<flywind> (edit) "ARC/ORC" => "ARC/ORC."
13:07:47FromDiscord<flywind> (edit) "They don't" => "Nim doesn't" | "copies" => "uses "copy" | "write." => "write" for string literals"
13:08:03FromDiscord<Phil> As someone who tends to not think about these kinds of things and only if it's really necessary, do people deeper into low level stuff actually keep that in their head everytime they read code?↵Or do they start contemplating this also only when necessary?
13:09:12FromDiscord<Phil> "These kinds of things" being "When does a copy happen" and "Who owns what memory"
13:09:20FromDiscord<leorize> pretty much, if you ever found a weird hotspot that said `prepareMutation`, that's the problem
13:09:41FromDiscord<leorize> "who owns that memory" is pretty important, though
13:10:46FromDiscord<Phil> In reply to @leorize "pretty much, if you": What is `prepareMutation` is that an internal nim proc of sorts?
13:11:15FromDiscord<leorize> it's the CoW part flywind mentioned
13:14:56FromDiscord<Rika> If you deal with this kind of shit a few tens of times you tend to remember how it works xddd
13:16:16FromDiscord<leorize> a nice thing is that it's not usually an issue when CoW is applied only to literals
13:18:47FromDiscord<leorize> back when I was using pascal a common complaint on the mailing list was that if you happen to have an array of string, you might end up with hidden overhead when you process that array in a hot loop due to hidden copies from CoW (Free Pascal strings are fully CoW, which means free slices, but edits incur copying if never done before)
13:39:22FromDiscord<dom96> In reply to @Isofruit "As someone who tends": mostly only if I know a piece of code will be in the hot path or I'm explicitly looking to optimise a piece of code
13:48:24*xet7 quit (Remote host closed the connection)
13:54:07FromDiscord<mratsim> In reply to @Isofruit "As someone who tends": It depends if:↵↵- potential bottleneck↵- multithreading is involved and so we need to understand ownership
13:54:32FromDiscord<mratsim> but usually it's only when you benchmark that it surfaces.
14:00:23xcodz-dotexit
14:00:38xcodz-dotlol, sorry, I meant `/exit` in IRC
14:00:43*xcodz-dot quit (Quit: Leaving)
14:16:40FromDiscord<Adamillo> I feel like there's a bug in Nim where it doesn't install properly when using a non ASCII local username
14:20:30FromDiscord<mratsim> In reply to @Adamillo "I feel like there's": How do you install it?
14:20:45FromDiscord<Adamillo> https://nim-lang.org/install_windows.html
14:20:58FromDiscord<Adamillo> By downloading the x64 binary from there and running finish.exe
14:22:12FromDiscord<dom96> what issues are you seeing?
14:25:37FromDiscord<Adamillo> For example this happens and when using y it doesn't do anything https://media.discordapp.net/attachments/371759389889003532/1008380879036502096/unknown.png
14:29:05FromDiscord<dom96> yeah, looks like a bug
14:29:11FromDiscord<dom96> report it on the Nim repo
14:29:18FromDiscord<dom96> you can add that dir to your PATH manually
14:33:33FromDiscord<aruZeta> Is there a way to know if a proc's paramater with a default value was specified, like in common lisp `(defun foo (&optional (bar 0 barp))` where barp is a bool, if false bar is not specified, else it was
14:33:53FromDiscord<aruZeta> (edit) "barp))`" => "barp)))`"
14:34:26*arkurious joined #nim
14:39:50FromDiscord<Adamillo> In reply to @dom96 "you can add that": How do I manually put it in path?
14:40:08FromDiscord<aruZeta> sent a code paste, see https://play.nim-lang.org/#ix=47zI
14:40:11FromDiscord<aruZeta> (edit)
14:40:40FromDiscord<dom96> In reply to @Adamillo "How do I manually": https://www.architectryan.com/2018/03/17/add-to-the-path-on-windows-10/
14:41:17FromDiscord<dom96> sent a code paste, see https://play.nim-lang.org/#ix=47zJ
14:41:35FromDiscord<aruZeta> Can't be helped then, thanks
14:41:49FromDiscord<aruZeta> That feature is something i rly like from lisp
14:43:07FromDiscord<dom96> What's your use case for it?
14:45:37FromDiscord<aruZeta> For example, you have a range type like `type FooRange = range[0..10]` which is used as a parameter of a proc. If the proc receives no value, you calculate it with some algorithm or whatever, else use what was provided
14:46:10FromDiscord<Rika> You can calculate values directly in the default value expression
14:46:14FromDiscord<Rika> It’s just a bit cursed
14:46:25FromDiscord<dom96> You can use Option[FooRange] for that
14:46:40FromDiscord<aruZeta> sent a code paste, see https://play.nim-lang.org/#ix=47zK
14:46:42FromDiscord<Rika> Options
14:46:46FromDiscord<Rika> As mentioned
14:46:50FromDiscord<aruZeta> In reply to @dom96 "You can use Option[FooRange]": never heard of it, sounds good
14:47:00FromDiscord<aruZeta> lemme check the docs
14:47:44FromDiscord<aruZeta> std/options, just what i needed, thanks
14:47:48FromDiscord<dom96> sent a code paste, see https://play.nim-lang.org/#ix=47zL
14:50:40*dnh quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
14:59:15FromDiscord<leorize> alternatively you can provide an empty overload
14:59:57FromDiscord<leorize> I'm not sure if it's even possible to pass an `Option[int]` as `Option[FooRange]`, though, so that might be a potential issue
15:06:29FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=47A7
15:07:21FromDiscord<Rika> You’ll have to emit the printf too
15:07:49FromDiscord<4zv4l> because I don't get why he did that https://media.discordapp.net/attachments/371759389889003532/1008391498552856666/unknown.png
15:07:49FromDiscord<Rika> Nim is not really aware of anything you do in emit, so you can’t call things you include in Nim
15:08:02FromDiscord<4zv4l> why he just put an include in the emit ?
15:08:03FromDiscord<Rika> He then importc's it right there
15:08:29FromDiscord<Rika> For the importc, though im not really sure why either
15:08:38FromDiscord<4zv4l> and so when you emit the lib, then you don't need to precise which file in importc ?
15:08:53FromDiscord<Rika> Pretty much I guess
15:11:33FromDiscord<4zv4l> https://media.discordapp.net/attachments/371759389889003532/1008392439729487882/unknown.png
15:11:45FromDiscord<4zv4l> I missed a type or something ?
15:13:15FromDiscord<Rika> Return type
15:13:35FromDiscord<4zv4l> I tried cint
15:13:39FromDiscord<4zv4l> didn't work
15:13:53FromDiscord<4zv4l> https://media.discordapp.net/attachments/371759389889003532/1008393028752375849/unknown.png
15:13:58FromDiscord<4zv4l> and it's from the manual
15:16:54FromDiscord<4zv4l> with `cint` is seems that the issue remaining is the cstring not being `const`
15:16:58FromDiscord<4zv4l> can I change that ?
15:19:12FromDiscord<4zv4l> alright
15:19:23FromDiscord<4zv4l> without the `emit` it works if I add the `header`
15:19:25FromDiscord<4zv4l> super weird
15:26:55FromDiscord<4zv4l> the chat is saying it too xD https://media.discordapp.net/attachments/371759389889003532/1008396309641842754/unknown.png
15:26:58FromDiscord<leorize> you need to add `{.noDecl.}` if you want to use the emit
15:27:12FromDiscord<4zv4l> emit is to directly put C code right ?
15:27:19FromDiscord<leorize> or the prototype will not match between Nim and C, which is always bad news
15:27:39FromDiscord<4zv4l> alright, thank you so much↵I understand better now
15:27:44FromDiscord<4zv4l> (edit) "alright, thank you so much↵I ... understand" added "better" | removed "better"
15:27:52FromDiscord<leorize> yea, `{.header.}` is preferred for including headers
15:28:15FromDiscord<4zv4l> can I insert the header in top of the file or I need to precise for each thing I import ?
15:28:59FromDiscord<leorize> it is preferred to put `{.header.}` on stuff you import
15:29:39FromDiscord<4zv4l> alright
15:29:42FromDiscord<4zv4l> thank you ^^
15:30:55FromDiscord<Rika> You’re strewmingc
15:31:00FromDiscord<Rika> (edit) "strewmingc" => "streaming?"
15:32:18FromDiscord<4zv4l> I am not, just looking at this video↵https://www.youtube.com/watch?v=XoOp3UfKXQY&t=2132s
15:32:27FromDiscord<4zv4l> writing a keyboard software in Nim
15:59:14*dnh joined #nim
16:13:36NimEventerNew post on r/nim by zxyzyxz: erg: A Python-compatible statically typed language, see https://reddit.com/r/nim/comments/woa144/erg_a_pythoncompatible_statically_typed_language/
16:20:53FromDiscord<Rika> this does not look like python
16:21:21*Guest56 joined #nim
16:21:28FromDiscord<Rika> oh so its not supposed to look like it
16:21:34FromDiscord<Rika> but its supposed to interop well with it
16:23:03FromDiscord<Phil> ... but we have nimpy
16:23:53FromDiscord<Rika> oh damn mf main committer left us for rust
16:24:47FromDiscord<Rika> also that icon.....
16:25:17Guest56a simple question: how do I get a reference to an existing sequence?
16:26:56FromDiscord<Rika> i believe you dont; you either make it a reference from the start or you go unsafe
16:28:07Guest56I see... thanks
16:31:32*vicecea quit (Remote host closed the connection)
16:32:01*vicecea joined #nim
16:48:39*Guest56 quit (Quit: Client closed)
16:48:48FromDiscord<huantian> Can’t you just take the addr of the sequence?
16:51:10FromDiscord<Phil> You can
16:51:50FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=47AG
16:54:02FromDiscord<Phil> Huh, fascinating, you can get the addr of a `const` , you can even try to manipulate it, that will compile, but it will give you also a segfault at runtime
16:57:15*xcodz-dot joined #nim
16:59:56FromDiscord<Rika> addr is unsafe 🙂
17:00:55FromDiscord<Rika> a few keywords to remember to know if smth is unsafe is `ptr addr cast`
17:01:01FromDiscord<Rika> thats maybe 60 or 80 %
17:01:25FromDiscord<Rika> oh, add `pointer` too of course
17:01:45FromDiscord<SaAnd> `asm`
17:02:22FromDiscord<Rika> that's a rare keyword anyway
17:02:32FromDiscord<SaAnd> yes
17:02:38FromDiscord<domosokrat> and `addr some_seq` is not a pointer to the first element
17:03:44FromDiscord<domosokrat> it's a pointer to base structure of a seq. So the `y[2]=5` is poking somewhere it shouldn't
17:04:25FromDiscord<Rika> no, that wouldnt work because `[]=(ptr seq, int)` doesnt exist i believe
17:04:31FromDiscord<Rika> it would need to be `y[][2] = 5`
17:04:42FromDiscord<Rika> and then i dont even know if that would work
17:13:55FromDiscord<Phil> I mean, the code above works both with and without de-referencing the pointer
17:14:52FromDiscord<Phil> So maybe somebody thought ahead or through some unintended magics this is possible
17:16:03FromDiscord<Rika> you addr a let?
17:17:44FromDiscord<Rika> idk, i'm unsure why indexing a ptr seq works, i dont remmeber any coinverters
17:17:48FromDiscord<Phil> I was just as surprised as you that this worked
17:18:46FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=47AP
17:18:55FromDiscord<Rika> `var x`
17:19:06FromDiscord<Rika> if that works as is then you're on devel perhaps
17:19:14FromDiscord<Phil> Oh, right, yeah might be
17:19:21FromDiscord<Phil> yeh 171
17:19:23FromDiscord<Phil> (edit) "171" => "1.71"
17:20:02FromDiscord<Phil> (edit) "1.71" => "1.7..1"
17:20:37FromDiscord<Phil> Yeh, gets blocked on 1.6.6, x must be a var or it'll stop you at compiletime
17:23:58FromDiscord<Rika> hm
17:23:59FromDiscord<Rika> i dont know
17:25:55*Amun-Ra quit (Quit: Gdyby mi się chciało tak jak mi się nie chce...)
17:26:44*Amun-Ra joined #nim
17:28:08FromDiscord<EyeCon> I'm on devel, how do I see which commit I have? `nim -v` doesn't seem to include the commit hash
17:38:38*derpydoo quit (Quit: derpydoo)
17:48:08FromDiscord<Phil> Tried to compile my project, immediately noticed why I'm on devel: ↵1.6.6 didn't allow for enum-values to be compile-time strings
17:49:01xcodz-dotHow am I supposed to convert a table generated by a macro at compile time to ast for injection in the output code?
17:52:41xcodz-dotIf I wasn't clear. I have a Table[string, int] object generated statically inside macro, And I want to return that table back via macro as a `let mytable*: Table[string, int] = # Generated compile time table content goes here`.
17:54:58xcodz-dotplease leave a answer here, I will be back by tomorrow and shall check the IRC logs. Thanks!
17:55:04*xcodz-dot quit (Quit: Leaving)
17:58:31FromDiscord<aruZeta> In reply to @leorize "I'm not sure if": that's right, I'm getting some errors with range types, but why is it like that?
18:01:43FromDiscord<aruZeta> no, that's not it, I need to pass the params using `some()`
18:02:13FromDiscord<aruZeta> (edit) "`some()`" => "`some()`, which is not very convenient"
18:04:34FromDiscord<domosokrat> How complex are the calculations for the case of a missing optional? Because you can set optional arguments based on other arguments. e.g. `proc f(a: seq[int]; b=a.len)`
18:05:41FromDiscord<aruZeta> it's not so much about complexity, but just wanted to know if there was an easy way to know if optional params were specified or not
18:06:36FromDiscord<aruZeta> (edit) "complexity," => "the calculations being complex,"
18:07:46FromDiscord<domosokrat> Ok. It was just that the use case 'calculate if not given' can be done with the default value declaration
18:08:34FromDiscord<Phil> What is a calculation of a missing optional?↵Is this about calculating whether an optional is none? Or using optionals `map` operation?
18:09:47FromDiscord<Phil> Or given the line "calculate if not given" is this about extracting a value out of an optional, but getting a different value should the first one not be present?
18:10:33FromDiscord<domosokrat> It's about optional function parameters. Not about the type Option[T].
18:10:35FromDiscord<aruZeta> I was asking if there was a way, like in LISP, to know if an optional param of a proc has been provided or not
18:11:16FromDiscord<Phil> OHHH that makes so much more sense. I was so confused
18:11:36FromDiscord<Phil> Particularly because leorize mentioned Optionals I was fully trying to parse that in that context
18:11:49FromDiscord<aruZeta> Thing is, to use Option[T] I need to pass the params using `some()`
18:12:01FromDiscord<Phil> Which is painful, aye
18:12:07FromDiscord<aruZeta> that's it
18:12:09FromDiscord<Phil> You can get around this with helper procs surrounding your original proc
18:12:27FromDiscord<Phil> One with the parameter, one without the parameter, both calling your proc with the optional, one with none, the other with some
18:12:49FromDiscord<aruZeta> too much helper procs lol
18:12:54FromDiscord<Phil> And then you keep the one with the optional parameter private
18:13:00FromDiscord<Phil> (edit) "optional" => "Option"
18:13:15FromDiscord<leorize> I wonder if you can get away with `t: T | void`
18:13:57FromDiscord<aruZeta> sent a code paste, see https://play.nim-lang.org/#ix=47CI
18:14:06FromDiscord<leorize> unless you really want caller to dynamically pass in a `None`, `Option[T]` is a pain to use
18:14:06FromDiscord<aruZeta> sent a code paste, see https://play.nim-lang.org/#ix=47CJ
18:14:12FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=47CK
18:14:15FromDiscord<aruZeta> oops
18:14:29FromDiscord<aruZeta> (edit) "oops ... " added "(wrong error code)"
18:14:30FromDiscord<aruZeta> (edit) "https://play.nim-lang.org/#ix=47CJ" => "https://play.nim-lang.org/#ix=47CL"
18:15:09FromDiscord<huantian> You probably should just use overloading
18:15:38FromDiscord<Phil> I use overloading a fair amount so that's also the route I'd go
18:15:52FromDiscord<aruZeta> ik, its just a pain tho
18:15:54FromDiscord<Phil> overloading + default parameters covered all my needs so far
18:16:24FromDiscord<aruZeta> the proc has, 1 parameter, 2 optional and 1 with default value
18:17:46FromDiscord<Phil> Without having seen any code my first thought would be that that's a hint to go for overloads and multiple procs rather than single procs that have "flag" values that change behaviour
18:18:25FromDiscord<aruZeta> yh, I will try some stuff and see how it goes
18:18:31FromDiscord<Phil> Check
18:20:32FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=47CN
18:20:38FromDiscord<aruZeta> sent a code paste, see https://play.nim-lang.org/#ix=47CO
18:20:50FromDiscord<aruZeta> just curiosity
18:21:39FromDiscord<Phil> You give the compiler a proc where you say "bar can be int or of type Nothing, but my output must be int"
18:21:57FromDiscord<aruZeta> yep
18:21:58FromDiscord<Phil> The compiler then sees that you have result = bar, which can be int OR NOTHING.↵And that's not allowed
18:22:31FromDiscord<aruZeta> i guessed that, but since i'm discarding it being Nothing with the if, i thought it might work
18:22:45FromDiscord<Phil> Your trail of thought works if you do this at compile time with when
18:22:52FromDiscord<aruZeta> yh
18:23:07FromDiscord<Phil> When will lead to that piece of code getting actually removed
18:23:38FromDiscord<huantian> sent a code paste, see https://play.nim-lang.org/#ix=47CP
18:23:43FromDiscord<huantian> Oh phil already said they
18:23:45FromDiscord<Phil> ~~Which may lead to you having completely invalid nonsense in a where clause and you'll never know unless some piece of code triggers that right when clause so that that code appears one time to get compiled
18:23:46FromDiscord<huantian> (edit) "they" => "that"
18:23:48FromDiscord<Phil> (edit) "compiled" => "compiled~~"
18:24:01FromDiscord<Phil> (edit) "where" => "when"
18:24:25FromDiscord<huantian> (edit) "https://play.nim-lang.org/#ix=47CP" => "https://play.nim-lang.org/#ix=47CQ"
18:27:16FromDiscord<aruZeta> welp, for the moment I will use the when
18:27:46FromDiscord<aruZeta> and when the code explodes or whatever I will think of another way lol
18:28:29FromDiscord<Phil> If your code explodes that's most likely not an issue with the when statement (as long as your check is with values you know at compile-time), and more likely that you have bogus code within a when statement and just never noticed because it never got compiled 😛
18:29:34FromDiscord<aruZeta> the code used in the when can be perfectly run at compiletime, so it should not be a problem
18:30:05FromDiscord<aruZeta> and the tests show all [OK] so, no problem
18:30:10FromDiscord<aruZeta> (edit) "[OK] so," => "[OK], so"
18:33:36*kenran joined #nim
19:25:45FromDiscord<fwsgonzo> Does anyone know the status of incremental builds in Nim?
19:26:04FromDiscord<fwsgonzo> (edit) "Does anyone know the status of incremental builds in Nim? ... " added "And what will it look like?"
19:27:12FromDiscord<huantian> I think it is currently broken 😛 iirc it was planned for 1.6 but I’m not sure if it’ll even be ready for 2.0↵But I haven’t been keeping up with it myself
19:27:44FromDiscord<fwsgonzo> Currently I'm having some issues with ninja-ifying Nim builds because the nimcache of each program is always just a tiny bit different between programs. So far I have managed to parallelize the call to Nim itself as well as the building of the C sources (obviously).
19:28:35FromDiscord<fwsgonzo> Honestly, the best change would be if several programs could share nimcache in a way where tiny changes are appended, combined with linker GC to remove unused functions
19:41:40FromDiscord<victory> whats a good mongo package for nim?
19:42:03FromDiscord<Phil> Can't say I've used one, have you looked in the nimble directory yet?
19:42:19FromDiscord<victory> i have but nimongo seems to be 2 yrs old
19:42:23FromDiscord<victory> (last update)
19:42:33FromDiscord<victory> ill check out another pkg i saw
20:09:44FromDiscord<haxscramper> burndown of the `.nim` files in the repository https://media.discordapp.net/attachments/371759389889003532/1008467483864342708/unknown.png
20:09:55FromDiscord<haxscramper> compiler
20:11:49FromDiscord<aruZeta> sent a code paste, see https://play.nim-lang.org/#ix=47Db
20:13:09FromDiscord<aruZeta> can easily be solved by adding a `result = low(SomeRangeType)`
20:13:19FromDiscord<aruZeta> (edit)
20:14:49FromDiscord<aruZeta> (edit) "tho it can easily be solved by adding a `result = low(SomeRangeType)` ... " added "before the raise"
20:15:51FromDiscord<Elegantbeef> What's the point of nothing here why isnt `proc foo(bar = 0): int` sufficient?↵(@aruZeta)
20:16:41FromDiscord<huantian> I’d assume they just used 0 in this example and have some runtime value instead of it there
20:17:01FromDiscord<aruZeta> In reply to @Elegantbeef "What's the point of": that was from when I was trying to have optional params and know if the user specified them or not
20:17:19FromDiscord<Elegantbeef> Ranges are 0 init'd so that warning is beneficial
20:17:33FromDiscord<Elegantbeef> !eval var a\: 1..1; echo a
20:17:35NimBotCompile failed: /usercode/in.nim(1, 9) Error: ':' or '=' expected, but got '1'
20:17:49FromDiscord<Elegantbeef> The hell
20:18:08FromDiscord<aruZeta> !eval var a = 1..1; echo a
20:18:10NimBot1 .. 1
20:18:11FromDiscord<huantian> It should be probable that the result default isn’t used
20:18:21FromDiscord<Elegantbeef> No `=` makes it a slice
20:19:06FromDiscord<Elegantbeef> !eval (var a\: 1..1; echo a)
20:19:08NimBotCompile failed: /usercode/in.nim(1, 10) Error: ':' or '=' expected, but got '1'
20:19:10FromDiscord<Elegantbeef> If that doesnt work i give up
20:19:12FromDiscord<aruZeta> !eval var a: range[1..1]; echo a
20:19:15NimBot0
20:19:19FromDiscord<aruZeta> that?
20:19:31FromDiscord<Elegantbeef> No what i had is right it's the bot being dumb
20:19:35FromDiscord<aruZeta> lol
20:19:48FromDiscord<Elegantbeef> But yes
20:19:55FromDiscord<Elegantbeef> That warning is to prevent that
20:19:56FromDiscord<aruZeta> seems to be the same tho
20:20:25FromDiscord<aruZeta> yh, what I meant is that I am raising an exception anyways, so no result will be passed from the proc
20:20:34FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=47Dd
20:21:08FromDiscord<aruZeta> (edit) "passed" => "returned"
20:21:30FromDiscord<fwsgonzo> Is the `attribute((retain))` available in Nim?
20:21:58FromDiscord<aruZeta> is that from python maybe?
20:22:36FromDiscord<fwsgonzo> it's fairly new in binutils 2.36 and later
20:22:49FromDiscord<fwsgonzo> https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html >> retain
20:23:10FromDiscord<aruZeta> ahh, my bad
20:23:27FromDiscord<aruZeta> (edit) "bad" => "bad, idk sry"
20:24:32FromDiscord<Elegantbeef> The reason the warning exists is purely to say "This range value may not be assigned which may result in a incorrect value
20:24:33FromDiscord<Elegantbeef> Atleast i think that's the reason
20:24:33FromDiscord<Elegantbeef> Anyway you can always make an issue if you think it is a bug
20:26:19FromDiscord<Elegantbeef> You can usue codegendecl to get any attribute applied
20:30:20FromDiscord<fwsgonzo> how can I add the `used` and `retain` attribute to Nim codebase?
20:30:30FromDiscord<fwsgonzo> (edit) "attribute" => "attributes" | "attributesto ... Nim" added "functions in the"
20:30:37FromDiscord<Elegantbeef> I told you how
20:30:42FromDiscord<Elegantbeef> You use `codegendecl`
20:31:04FromDiscord<Elegantbeef> https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-codegendecl-pragma
20:31:15FromDiscord<Elegantbeef> Make me do all your searching for you aswell
20:31:58FromDiscord<fwsgonzo> I'm looking to add these as function attributes in the Nim codebase
20:32:04NimEventerNew thread by Polarian: Nimble decentralisation?, see https://forum.nim-lang.org/t/9370
20:33:06FromDiscord<fwsgonzo> I see something called `procPragmas` in pragmas.nim
20:33:55FromDiscord<Elegantbeef> Ok so we're just going to ignore me
20:34:04NimEventerNew thread by Polarian: Alternative to gravatar for the forums?, see https://forum.nim-lang.org/t/9371
20:34:37*kenran quit (Quit: WeeChat info:version)
20:34:46FromDiscord<fwsgonzo> hardly, I just don't think it's as nice as having those in the language
20:34:52FromDiscord<Elegantbeef> What?
20:35:13FromDiscord<Elegantbeef> You can use a macro to annotate custom attributes using codegendecl
20:35:33FromDiscord<Elegantbeef> https://github.com/beef331/wasmedge_playground/blob/master/src/wasmedge/exporter.nim for instance
20:36:00FromDiscord<Elegantbeef> It adds `EMSCRIPTEN_KEEPALIVE` to procedures when you annotate them with `{.wasmExport.}`
20:36:19FromDiscord<fwsgonzo> ok, it is nice 🙂
20:36:56FromDiscord<Elegantbeef> You reasonable could make a macro which takes an array of strings to add attributes
20:47:43FromDiscord<Bubblie> hi beef! I think I got it working now!
20:47:46FromDiscord<Bubblie> Im not sure what I did but it works
20:48:53FromDiscord<Elegantbeef> Ok
20:48:53FromDiscord<Elegantbeef> Scary
20:50:33FromDiscord<Bubblie> cstring and cstringarrays are the absolute bane of my existence
20:50:40FromDiscord<Elegantbeef> Welcome to why C sucks
20:51:18FromDiscord<Bubblie> yes 😭
20:53:16FromDiscord<Bubblie> this isn't even the beginning, it gets way more unsafe from here
20:54:54FromDiscord<Elegantbeef> I know opengl uses cstring arrays but they're not nil terminated ones
20:55:01FromDiscord<Elegantbeef> So it's much much nicer to use
20:55:31FromDiscord<Elegantbeef> Only assholes use nil terminated arrays
20:57:08FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=47Di
20:58:29FromDiscord<mratsim> In reply to @Elegantbeef "It's literally the exact": I remember seeing the reason in a fun old stuff trivia about 16-bit machines
20:58:46FromDiscord<Elegantbeef> Yea it probably made sense in the past but not much to me now
20:58:58FromDiscord<mratsim> it was cheaper to check for the character than having the length take up a register or something
20:59:18FromDiscord<Elegantbeef> This isnt for null terminated strings though
20:59:35FromDiscord<Elegantbeef> This is null terminated arrays, where you have `ptr T` contiguously
20:59:41FromDiscord<Elegantbeef> Then the last element of it is a `nil`
21:00:27FromDiscord<Rainbow Asteroids> what if i have an array of bytes? then your len takes up four of my precious bytes. you're eating away my 16GB of ram!
21:00:34FromDiscord<Elegantbeef> sorry that should've been `T: ptr`
21:01:04FromDiscord<Elegantbeef> Yea rainbow except like i forgot to mention that's `T: ptr`
21:01:10FromDiscord<Elegantbeef> So it's identical memory consumption
21:01:17FromDiscord<Rainbow Asteroids> yeah i just realized that
21:01:21FromDiscord<Elegantbeef> Also you wouldnt use a nil terminated array for bytes unless you were a sadist
21:01:40FromDiscord<Elegantbeef> Maybe another sentinel value but `0` is relatively common
21:01:41FromDiscord<Rainbow Asteroids> two zeros = 1 zero. 1 zero = end
21:02:40FromDiscord<Elegantbeef> I'll just blame C for this existing and carry on
21:11:35*dnh quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
21:41:50FromDiscord<Bubblie> In reply to @Elegantbeef "So it's much much": vulkan is a pain in the ass to setup but once its setup its actually incredibly easy
21:42:13FromDiscord<Bubblie> its why I like it, its just a painful process to setup since vulkan is a such a lowlevel API and is more of a DIY rather than it already being done for you
21:42:14FromDiscord<Bubblie> like opengl
21:44:55FromDiscord<Tuatarian> how would I write a custom destructor for this proc?
21:45:05FromDiscord<Tuatarian> sent a code paste, see https://play.nim-lang.org/#ix=47Du
21:45:05FromDiscord<Bubblie> sent a code paste, see https://play.nim-lang.org/#ix=
21:46:31FromDiscord<Tuatarian> (edit) "proc?" => "type?"
21:56:16FromDiscord<Elegantbeef> `stderr.writeLine "validation layer: " & pcallbackData.pMessage`
21:56:26FromDiscord<exelotl> sent a code paste, see https://play.nim-lang.org/#ix=47Dx
21:56:46FromDiscord<Bubblie> In reply to @Elegantbeef "`stderr.writeLine "validation layer: "": Thanks!
21:56:52FromDiscord<Bubblie> I didnt know nim had stderr
21:56:53FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=47Dy
21:56:54FromDiscord<Bubblie> Thats cool
21:57:14FromDiscord<Elegantbeef> Probably want to follow with a flushfile
21:57:28FromDiscord<exelotl> In reply to @exelotl "<@284835054633353226> you'd have to": it's not clear to me why you'd want to though, unless there's something fancy in `Board` thar requires manual acknowledgement when the node is destroyed...
21:59:11FromDiscord<Tuatarian> sent a code paste, see https://play.nim-lang.org/#ix=47Dz
21:59:16FromDiscord<Elegantbeef> Where would it
21:59:26FromDiscord<Elegantbeef> types in nim are static
22:01:02FromDiscord<Elegantbeef> It'ssemantically identiical to exelotl's
22:01:17FromDiscord<Elegantbeef> The only difference is I didnt introduce a name for the ref internal type
22:06:19FromDiscord<exelotl> ref types are automatically deallocated when there are zero references to them
22:06:34FromDiscord<Elegantbeef> I misread dealloc for deref
22:07:06FromDiscord<Elegantbeef> You should call `=destroy` on all of the objects fields though
22:07:40FromDiscord<Tuatarian> what is `mcNode()[]` doing?
22:07:49FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=47DC
22:07:51FromDiscord<Elegantbeef> Getting the type of the internal object
22:08:00FromDiscord<Tuatarian> it wouldn't just be McNode?
22:08:00FromDiscord<Elegantbeef> `ref object` is syntax sugar for what exelotl posted
22:08:11FromDiscord<Elegantbeef> No cause we're instantiation a `McNode` then dereferencing it
22:08:22FromDiscord<Elegantbeef> The type of that is actualy data and not a reference
22:08:33FromDiscord<Elegantbeef> `McNode` is a reference so if you dereference it you get it's internal type, a struct
22:08:48FromDiscord<Tuatarian> oh I see
22:15:46FromDiscord<Elegantbeef> It'd be nice if that dereference wasn needed but alas
22:48:01*derpydoo joined #nim
22:55:56FromDiscord<Vivek> how would I do proc overloading in nim? I've been trying to make a `sigmoid` function that can take in either floats or seq[floats] to use in python and it only detects the function that uses seq[float]. For reference, I made two different sigmoid functions: one for floats and the other for seq[floats]
22:57:02FromDiscord<Vivek> I also tried doing something along the lines of `sigmoid[T: float | seq[float]](z: T) ...` to no avail
22:57:40FromDiscord<SaAnd> what was the error?
23:02:48FromDiscord<Rainbow Asteroids> why can't you use a varadic function?
23:43:57*jmdaemon joined #nim
23:58:39FromDiscord<victory> how can i check if something doesnt exist?
23:58:45FromDiscord<victory> like if a string is nil and not an actual string
23:58:50FromDiscord<victory> how can i check that in an `if` statement?
23:58:54FromDiscord<Elegantbeef> Strings are not nilable
23:59:02FromDiscord<Elegantbeef> `myStr.len == 0`
23:59:13FromDiscord<victory> so if its an Option[string] then
23:59:17FromDiscord<victory> and theres no value
23:59:19FromDiscord<victory> itll be length 0?
23:59:23FromDiscord<Elegantbeef> `str.isSome`
23:59:35FromDiscord<victory> thanks!