<< 01-10-2023 >>

00:06:11*antranigv quit (Quit: ZNC 1.8.2 - https://znc.in)
00:10:33*antranigv joined #nim
00:11:28*antranigv quit (Remote host closed the connection)
00:13:55*tiorock joined #nim
00:13:55*tiorock quit (Changing host)
00:13:55*tiorock joined #nim
00:13:55*rockcavera is now known as Guest9165
00:13:55*Guest9165 quit (Killed (calcium.libera.chat (Nickname regained by services)))
00:13:55*tiorock is now known as rockcavera
00:45:49FromDiscord<_gumbercules> wtf is Packwood
01:02:12FromDiscord<makoren> you could spell out any set of 3-4 letters and it would sound like a drug name
01:02:32FromDiscord<Elegantbeef> Nim, Zig, Odin, Rust, Go
01:02:33FromDiscord<Elegantbeef> It checks out
01:04:33FromDiscord<odexine> loooooooool
01:14:13FromDiscord<my.narco> how am i supposed to print out an object ref?
01:14:29FromDiscord<my.narco> https://media.discordapp.net/attachments/371759389889003532/1157847971644321812/image.png?ex=651a1974&is=6518c7f4&hm=1a88a3f18dee47038ce66199b005e3fa05c1bc9719e16018b63892818bede66b&
01:14:48FromDiscord<my.narco> heres the definition of NoliNode https://media.discordapp.net/attachments/371759389889003532/1157848048542695545/image.png?ex=651a1986&is=6518c806&hm=d40d25689e42bf4f53ab9f01434530898300ce349e378b466f8440058a6dc328&
01:16:17FromDiscord<_gumbercules> In reply to @my.narco "how am i supposed": `echo repr`
01:16:44FromDiscord<_gumbercules> or if you want to print out the value that is referenced
01:16:55FromDiscord<_gumbercules> `echo refObj[]`
01:17:26FromDiscord<_gumbercules> `[]` is Nim's derference operator similar to `ptr` in C/C++
01:17:39FromDiscord<Elegantbeef> You likely should define your own `$` operator
01:18:03FromDiscord<my.narco> In reply to @_gumbercules "`[]` is Nim's derference": thank you
01:18:04FromDiscord<Elegantbeef> or use treeform's print library
01:18:09FromDiscord<Elegantbeef> Since you have a possibly cyclical type you may want to handle that
01:18:34FromDiscord<_gumbercules> blow dat stack up
01:18:53FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4HRF
01:19:39FromDiscord<Elegantbeef> Though you still likely want to define your own `$` logic to pretty print it
01:19:42FromDiscord<_gumbercules> not that you couldn't write a non-recursive funciton to do it
01:39:34FromDiscord<my.narco> sent a code paste, see https://play.nim-lang.org/#ix=4HRK
01:42:40FromDiscord<Elegantbeef> What's wrong?
01:43:02FromDiscord<Elegantbeef> > while tokens[0].kind != NoliTokenType.Eof\:
01:43:10FromDiscord<Elegantbeef> you're not using the deque you're using the passed in
01:43:17FromDiscord<Elegantbeef> `parser.tokens[0]`
01:44:11FromDiscord<Elegantbeef> Replacing that will make it work fine as it will now not go into your errory proc
01:44:21FromDiscord<my.narco> its too late
01:44:28FromDiscord<my.narco> ugh
01:44:31FromDiscord<my.narco> os tired
01:44:31FromDiscord<Elegantbeef> It's never too late
01:44:31FromDiscord<my.narco> thank you
01:44:37FromDiscord<my.narco> In reply to @Elegantbeef "It's never too late": i meant the tim e:sob
01:44:41FromDiscord<Elegantbeef> I know
01:44:59FromDiscord<my.narco> im very tired my bd for asking stupid questions
01:45:22FromDiscord<Elegantbeef> Hey you got an answer and it was not hard work to find the issue 😛
01:45:25FromDiscord<my.narco> sent a code paste, see https://play.nim-lang.org/#ix=4HRL
01:45:31FromDiscord<my.narco> In reply to @Elegantbeef "Hey you got an": yeah thats right
01:49:21FromDiscord<Elegantbeef> Hows the Nim vs Odin experience so far? 😄
01:49:39FromDiscord<Elegantbeef> I didnt find it much different, minus not having to play compiler
01:50:32FromDiscord<my.narco> In reply to @Elegantbeef "Hows the Nim vs": its pretty good
01:50:35FromDiscord<my.narco> i like nim alot
01:50:40FromDiscord<my.narco> ive had way less issues with nim than odin
01:50:45FromDiscord<my.narco> it fits my programming style
01:51:18FromDiscord<Elegantbeef> Aside from Odin's `union`, I concur
01:51:57FromDiscord<makoren> what would you guys recommend first for learning nim? there are tons of options
01:52:11FromDiscord<makoren> last time i tried this i sorta ended up with half baked knowledge of the language
01:52:37FromDiscord<Elegantbeef> First class union types are pretty nice
01:53:21FromDiscord<odexine> In reply to @Elegantbeef "I didnt find it": What issues did Odin have?
01:54:31FromDiscord<ElegantBeouf> Bridge has gone and died
01:54:42FromDiscord<ElegantBeouf> Odin is purposely a simple low level language
01:55:30FromDiscord<ElegantBeouf> Which is fine if you're into that, but having to manually do things like `^MyType` to pass as reference is just ugh, the worst part is Odin has immutable parameters
01:56:26FromDiscord<ElegantBeouf> sent a code paste, see https://play.nim-lang.org/#ix=4HRO
01:56:33FromDiscord<ElegantBeouf> But you do not pass by reference...?
01:57:12FromDiscord<ElegantBeouf> It also doesnt even have destructor based management, which is annoying to me
01:57:49FromDiscord<Elegantbeef> Ping
01:58:40FromDiscord<ElegantBeouf> The worst part about `union` is that there is no way to convert to another union of a different type, but that is a subset or superset
01:58:59FromDiscord<ElegantBeouf> so `{u32, f32}` -> `{f32, u32}` requires a manually written proc
01:59:21FromDiscord<ElegantBeouf> But `{u32, f32}` -> `{u32, f32, i64}` does not
02:00:23FromDiscord<ElegantBeouf> To be clear I only wrote a basic sdl2 program using Odin, so perhaps more usage would make me appreciate the language 😄
02:08:34FromDiscord<ElegantBeouf> In reply to @makoren "what would you guys": There's also a lot to learn so I'd just refer to the Nim Programming Book and official tutorials whilst trying to make a simple project
02:35:43FromDiscord<leorize> is odin union not a set? how come ordering matters?↵(@ElegantBeouf)
02:36:07FromDiscord<Elegantbeef> Don't look at me it does 😄
02:36:14FromDiscord<Elegantbeef> It creates a tagged union and it only does the whole `copyMem` approach
02:36:59FromDiscord<Elegantbeef> It's only a valid conversion where `copyMem(a, b, sizeof(a))` works
02:37:18FromDiscord<leorize> so not as good as mine \:p
02:39:14FromDiscord<leorize> but i can see why
02:39:14FromDiscord<Elegantbeef> But even if order matters
02:39:15FromDiscord<Elegantbeef> you should be able to convert between `{u32, f32}` and `{f32, u32}`
02:39:16FromDiscord<leorize> making the ordering works reliably is just really hard
02:39:16FromDiscord<Elegantbeef> Not when you are the compiler 😛
02:39:42FromDiscord<leorize> well I went with besteffort for nim but they go with noeffort \:p
02:40:36FromDiscord<leorize> given how they are gamedev oriented I figured they're just allergic to branches
02:40:52FromDiscord<Elegantbeef> You can do it branchless with an array 😛
02:43:17FromDiscord<Elegantbeef> What happens if the user has an invalid tag
02:43:17FromDiscord<Elegantbeef> Means you need to have an error check on conversion
02:43:17FromDiscord<Elegantbeef> Somehow multiple return types did not suffice
02:47:58FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4HRV
02:49:02FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4HRW
02:55:45FromDiscord<leorize> maybe cast isn't errorable in odin?
02:56:06FromDiscord<leorize> do they have checked conversion?
02:57:30FromDiscord<Elegantbeef> I do not think they have an errorable cast presently, but they have that same paradigm for other types
02:58:52FromDiscord<Elegantbeef> But they do have errorable field access
02:59:27FromDiscord<Elegantbeef> Well it errors and is fatal iirc
03:30:28*rockcavera quit (Remote host closed the connection)
04:21:48NimEventerNew thread by amkrajewski: Customizable Nimble-badge with latest tag, see https://forum.nim-lang.org/t/10523
05:32:50*rez joined #nim
06:10:59*azimut quit (Ping timeout: 252 seconds)
06:19:37*LuxuryMode quit (Quit: Connection closed for inactivity)
06:34:32FromDiscord<nomad> how do you make embed fields in dimscord?
06:44:04FromDiscord<intellij_gamer> sent a code paste, see https://play.nim-lang.org/#ix=4HSx
06:46:58*rez quit (Quit: much snoozes...)
07:34:26*rez joined #nim
08:12:02*rez quit (Quit: much snoozes...)
08:25:40*junaid_ joined #nim
08:26:57*rez joined #nim
08:40:35*rez quit (Quit: much snoozes...)
08:47:53*rez joined #nim
08:54:07*rez quit (Quit: much snoozes...)
08:59:01FromDiscord<xtrayambak> This is really weird.
08:59:19FromDiscord<xtrayambak> Anything Nim library that uses SIMD fails to compile on my system.
08:59:24FromDiscord<xtrayambak> Yes, my system supports SIMD.
08:59:41FromDiscord<xtrayambak> This includes pixie and crunchy so far.
09:01:13FromDiscord<Elegantbeef> What compiler are you using?
09:01:32FromDiscord<xtrayambak> gcc
09:02:07FromDiscord<Elegantbeef> What's the compiler error?
09:02:16FromDiscord<xtrayambak> Wait, let me recompile and show the error.
09:05:06FromDiscord<xtrayambak> https://pastebin.com/8wWZ6MZ2
09:07:02FromDiscord<Elegantbeef> https://stackoverflow.com/a/44962907/15200657
09:07:32FromDiscord<Elegantbeef> Seems like an issue with their simd library not passing the right flags
09:10:27FromDiscord<xtrayambak> It seems `-mavx` is indeed passed, and I also added `-march=native` when I was trying to fix this earlier
09:13:40FromDiscord<System64 ~ Flandre Scarlet> https://github.com/nim-lang/Nim/pull/22777↵↵Wait, will it be official in the future ?
09:16:50FromDiscord<Elegantbeef> Will what be?
10:13:40*gooba_ quit (Ping timeout: 255 seconds)
10:23:26FromDiscord<Chronos [She/Her]> In reply to @sys64 "https://github.com/nim-lang/Nim/pull/22777 Wait, w": The IR? Yeah↵↵A WASM backend? No, but Araq said that it'd be easier for people to implement themselves
11:05:29*gooba joined #nim
11:26:05*Mister_Magister quit (Quit: bye)
11:30:55FromDiscord<xtrayambak> How can I trigger a garbage collection? Is there a function for it?
11:32:23FromDiscord<System64 ~ Flandre Scarlet> In reply to @chronos.vitaqua "The IR? Yeah ": Sounds interesting↵but when Nim will have an IR, will it be as easy as before to interop with C?
11:33:07FromDiscord<Chronos [She/Her]> In reply to @xtrayambak "How can I trigger": [`GC_fullCollect`](https://nim-lang.org/docs/system.html#GC_fullCollect) but you shouldn't ever need to call it yourself
11:33:26FromDiscord<ShalokShalom (ShalokShalom)> Every language already has some form of IR↵(@System64 ~ Flandre Scarlet)
11:33:32FromDiscord<Chronos [She/Her]> In reply to @sys64 "Sounds interesting but when": Yeah I'd imagine the priority is making sure C and C++ interop from before will work exactly the same
11:34:00FromDiscord<ShalokShalom (ShalokShalom)> And the benfit of Nim interacting with C mainly comes from compiling to it
11:34:00FromDiscord<Chronos [She/Her]> In reply to @ShalokShalom (ShalokShalom) "Every language already has": Yeah but Nim wants a simpler IR form that other backends can use to produce code rather than directly working on the AST
11:34:53FromDiscord<enthus1ast> @Chronos [She/Her]\: does it even do something with arc/orc?
11:35:10FromDiscord<enthus1ast> Not sure
11:35:26FromDiscord<ShalokShalom (ShalokShalom)> It should the existing issues first, before adding new features.↵(@Chronos [She/Her])
11:35:27FromDiscord<ShalokShalom (ShalokShalom)> But alas.
11:35:45FromDiscord<System64 ~ Flandre Scarlet> In reply to @ShalokShalom (ShalokShalom) "Every language already has": True↵Is assembly an IR?
11:36:15FromDiscord<System64 ~ Flandre Scarlet> In reply to @chronos.vitaqua "Yeah I'd imagine the": Nice, because this is one of the things that makes Nim shines
11:36:42FromDiscord<odexine> In reply to @sys64 "True Is assembly an": Technically? It’s a human readable representation of the byte code
11:37:27FromDiscord<System64 ~ Flandre Scarlet> Oh alright
11:38:12FromDiscord<Chronos [She/Her]> In reply to @enthus1ast "<@524288464422830095>\: does it even": With orc I'd imagine so, not with arc tho
11:38:24FromDiscord<enthus1ast> Intermediate representation↵↵An intermediate representation is the data structure or code used internally by a compiler or virtual machine to represent source code.
11:38:24FromDiscord<Chronos [She/Her]> Orc still has a gc for cyclic references
12:02:06*Mister_Magister joined #nim
12:15:00FromDiscord<yetiwizard> is there a shorter way to write this: `cast[ptr pointer](someProc.addr)`
12:15:55FromDiscord<odexine> ?? Youre casting to C equivalent void is that intentional
12:17:51FromDiscord<Chronos [She/Her]> Aren't procs already passed around as pointers too? So `cast[pointer](someProc)` should be enough? Or am I mistaken
12:23:34*Mister_Magister quit (Quit: bye)
12:24:23FromDiscord<yetiwizard> In reply to @odexine "?? Youre casting to": that is correct, I'm interfacing with a C function that requires void as a param
12:26:24FromDiscord<yetiwizard> In reply to @chronos.vitaqua "Aren't procs already passed": `cast[pointer](someProc)` gives me a type mismatch
12:26:29FromDiscord<odexine> Be careful with the calling convention of the proc
12:26:41FromDiscord<yetiwizard> I got it right, it's a thisCall
12:27:05FromDiscord<odexine> Anyway it looks like that’s the “shortest” you can write that code
12:27:26FromDiscord<odexine> In reply to @yetiwizard "`cast[pointer](someProc)` gives me a": Add an .addr at the end if you want an equivalent
12:28:38FromDiscord<yetiwizard> hmm but the ptr pointer is still needed or else I get a type mismatch
12:28:49FromDiscord<yetiwizard> but I guess this is as short as it gets
12:28:53FromDiscord<yetiwizard> thx
12:29:19FromDiscord<odexine> Yes, cast[pointer](someproc).addr should still give a ptr pointer
12:36:10FromDiscord<yetiwizard> sent a code paste, see https://play.nim-lang.org/#ix=4HTG
12:36:28FromDiscord<demotomohiro> In reply to @xtrayambak "How can I trigger": Heap memory is freed right after exiting from the scope last ref type variables is declared in.
12:39:14FromDiscord<xtrayambak> Ah, thanks
12:39:20FromDiscord<demotomohiro> If `someProc` is a name of non-closure procedure, it should be already pointer, isn't it?
12:41:02FromDiscord<yetiwizard> in my case it is `var someProc: proc(this: pointer, fileName: cstring): bool {.thisCall.}`
12:43:41FromDiscord<demotomohiro> So it is a procedual type variable, `addr(procName)` makes scense.
12:44:46*Mister_Magister joined #nim
12:49:52FromDiscord<odexine> they need a void pointer
12:50:04FromDiscord<odexine> rather, a void
13:08:00*junaid_ quit (Remote host closed the connection)
13:08:03FromDiscord<sOkam! 🫐> !eval "" in "abcde"
13:08:05NimBotCompile failed: /usercode/in.nim(1, 4) Error: type mismatch
13:08:17FromDiscord<sOkam! 🫐> (edit) "!eval ... """ added "echo"
13:08:31FromDiscord<sOkam! 🫐> (edit) removed "echo"
13:08:34FromDiscord<sOkam! 🫐> !eval echo "" in "abcde"
13:08:36NimBotCompile failed: /usercode/in.nim(1, 9) Error: type mismatch
13:15:28FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4HTX
13:22:38FromDiscord<odexine> the contains proc for two strings means "is B a substring of A"?
13:23:06FromDiscord<odexine> the empty string is a substring of all strings i believe
13:24:37FromDiscord<sOkam! 🫐> that is crazy confusing, it makes no logical sense to me
13:25:05FromDiscord<sOkam! 🫐> why would you consider an empty string to be a substring of all strings...
13:25:13FromDiscord<odexine> the empty set does not mean "nothing"
13:25:17FromDiscord<odexine> rather empty string
13:25:29FromDiscord<sOkam! 🫐> yeah but logically that's what it represents
13:25:42FromDiscord<starkiller1493> I'm having issue with ssl in smtp with Nim 2. It's erroring out with `SSL routines uninitialized ` even when compiled with -d:ssl
13:25:45FromDiscord<odexine> nuances, an empty string contains no characters but is not nothing
13:25:56FromDiscord<sOkam! 🫐> "empty" cannot be contained in "non-empty"... they are logical opposites
13:26:40FromDiscord<sOkam! 🫐> like... is this shrodingers strings, where they can be both empty and nonempty? that makes no sense
13:27:23FromDiscord<nnsee> sent a code paste, see https://paste.rs/INkqs
13:27:29FromDiscord<nnsee> an empty set is a subset of all sets
13:27:42FromDiscord<odexine> `"" in "abc"` asks "is the sequence of characters in B contained in A?"↵since there are no characters, there is nothing to ask, so it is vacuously true (i think is the terminology)
13:29:21FromDiscord<nnsee> just curious, what would you expect `"" in ""` to return?
13:30:06FromDiscord<sOkam! 🫐> In reply to @nnsee "just curious, what would": assertion error, or true. this is arguable for either case
13:30:22FromDiscord<sOkam! 🫐> but "" in "nonempty" makes no sense
13:30:36FromDiscord<nnsee> how does it not? it's basic set theory like i said
13:30:37FromDiscord<xtrayambak> In reply to @starkiller1493 "I'm having issue with": This happened to me when I gave it a bogus protocol scheme.
13:31:30FromDiscord<nnsee> In reply to @heysokam "assertion error, or true.": for it to return true, it would make sense that no matter how many letters you append to the checked string, `""` doesn't suddenly disappear from there
13:31:41FromDiscord<starkiller1493> In reply to @xtrayambak "This happened to me": i'm not doing anything special though
13:31:42FromDiscord<nnsee> and i definitely don't agree with it being an assertion error
13:32:13FromDiscord<sOkam! 🫐> In reply to @odexine "`"" in "abc"` asks": https://en.wikipedia.org/wiki/Vacuous_truth didn't know about this↵well this is really dangerous for my type of coding, that much I can say
13:32:29FromDiscord<sOkam! 🫐> because to my brain this should be false or error, not silently agree that its true and fail
13:32:57FromDiscord<sOkam! 🫐> (like it did now, and I had to hunt for a bug for who knows how long, only to find that "" in "something" == true 🧩)
13:34:24FromDiscord<nnsee> In reply to @heysokam "because to my brain": dunno, to me, it makes sense that there are an infinite number of `""` in every string
13:35:54FromDiscord<sOkam! 🫐> In reply to @nnsee "dunno, to me, it": "" is empty, how can empty be contained in non-empty...
13:36:23FromDiscord<odexine> how much empty space is in a balloon?
13:36:42FromDiscord<odexine> you can say "well there's air" but air is not tightly packed
13:36:45FromDiscord<sOkam! 🫐> probably none, because it has air
13:37:25FromDiscord<odexine> In reply to @odexine "you can say "well": and even then there is space between subatomic particles
13:37:35FromDiscord<sOkam! 🫐> In reply to @odexine "you can say "well": the difference here is that real life is infinite, while computers are finite
13:37:53FromDiscord<odexine> In reply to @heysokam "the difference here is": there is a finite amount of space in a balloon
13:37:57FromDiscord<nnsee> In reply to @heysokam """ is empty, how": it can be, and it is, between any two characters, an infinite amount of them
13:38:01FromDiscord<sOkam! 🫐> just like you cannot express an infinite amount of decimals for periodic numbers
13:38:08FromDiscord<sOkam! 🫐> you have to settle for something
13:38:22FromDiscord<sOkam! 🫐> In reply to @nnsee "it can be, and": except computers are finite
13:38:33FromDiscord<sOkam! 🫐> you cannot express the infinite in a finite system
13:39:01FromDiscord<odexine> In reply to @heysokam "except computers are finite": just because computers have a finite amount of memory doesnt mean it is unable to represent infinitely precise/infinitely repeating items
13:39:11FromDiscord<nnsee> In reply to @heysokam "you cannot express the": irrelevant, this is a logic issue
13:40:26FromDiscord<nnsee> sent a code paste, see https://play.nim-lang.org/#ix=4HU6
13:40:30FromDiscord<sOkam! 🫐> well i don't agree. just like i don't agree that 1/0 should be considered infinite (out of the two options that are possible)↵but we won't agree on this, nobody has agreed on this in history, so its pprobably a waste of our times to argue
13:41:02FromDiscord<nnsee> except literally everyone agrees that an empty set is a subset of all sets, which is what this logic stems from
13:42:02FromDiscord<odexine> it's almost kinda the same with "how many 0s can you contain in 1 (or 2 or 3 ...)"
13:42:29FromDiscord<odexine> aka `n = ?, n 0 = 1`
13:47:35FromDiscord<sOkam! 🫐> well then im the only one on earth to disagree with the set idea of empty being able to be contained in non-empty↵in either case it makes no sense to argue
13:47:53FromDiscord<sOkam! 🫐> to my brain thats false, and that's the problem
13:48:02FromDiscord<nnsee> sent a code paste, see https://paste.rs/tg8UH
13:48:50FromDiscord<bulan2> The word you are looking for to describe this true/false issue is called Amphiboly
13:49:06FromDiscord<sOkam! 🫐> all it matters is that i now have to preemptively write an extra assert line in every string comparison I write↵which basically affects nobody other than myself, so again... its wasted energy to argue
13:49:46FromDiscord<odexine> i dont know, what did you intend with writing that?
13:49:58FromDiscord<sOkam! 🫐> In reply to @bulan2 "The word you are": ty ✍️
13:50:01FromDiscord<nnsee> In reply to @heysokam "all it matters is": not arguing, just providing examples :p
13:50:14FromDiscord<sOkam! 🫐> In reply to @odexine "i dont know, what": wdym?
13:50:30FromDiscord<odexine> what was your intention when you wrote `if "" in "abc":`
13:51:11FromDiscord<sOkam! 🫐> `"" in "glfw"` or `"" in "vmath"` or `"" in "otherdependency"`... how can "nothing" be contained in "somedependency"
13:51:38FromDiscord<sOkam! 🫐> makes no sense, so i've been tracking a bug that was hidden in front of my face
13:52:06FromDiscord<xtrayambak> This seems to be a problem and a non-problem at the same time.
13:52:10FromDiscord<xtrayambak> It depends on whom you'll ask.
13:52:23FromDiscord<sOkam! 🫐> yeah i can see that much
13:52:29FromDiscord<my.narco> :oogbruh:
13:53:28FromDiscord<sOkam! 🫐> i guess i won't `std/strutils` from now on, and only import my own custom version with a check for that situation that basically just crashes or something, instead of silently agreeing an introducing a silent bug
13:53:33FromDiscord<xtrayambak> Perhaps there should be a `contains` proc which optionally has a `strict` bool argument
13:54:25FromDiscord<nnsee> In reply to @heysokam "`"" in "glfw"` or": i'm still not sure what you're doing?
13:54:30FromDiscord<nnsee> what are you expecting the first value to be
13:54:33FromDiscord<nnsee> if it weren't blank
13:55:52FromDiscord<sOkam! 🫐> In reply to @nnsee "i'm still not sure": its not the first that matters, its the second↵you could be checking `"glfw" in "github.com/someone/glfw"` and that should return true↵but `"" in "github.com/someone/glfw" == true` is just plain wrong
13:56:34FromDiscord<odexine> you can think of `B in A` as `someString1 & B & someString2 == A` where the somestrings can be anything
13:56:46FromDiscord<nnsee> In reply to @heysokam "its not the first": i mean that's just bad code
13:56:57FromDiscord<odexine> since `"" & A == A`, `"" in A` is always true
13:56:59FromDiscord<sOkam! 🫐> In reply to @nnsee "i mean that's just": how do you write that with good code?
13:57:02FromDiscord<nnsee> that would return a false true if my name had `glfw` in it for example
13:57:16FromDiscord<nnsee> split by `/`, check last component literally
13:57:30FromDiscord<sOkam! 🫐> In reply to @nnsee "split by `/`, check": that would still fail the exact same way
13:57:37FromDiscord<nnsee> how?
13:57:55FromDiscord<odexine> `==` does not have the same "bug" as you describe
13:58:01FromDiscord<odexine> `"" != A`
13:58:11FromDiscord<odexine> well, of course, if A isnt literally ""
13:58:12FromDiscord<sOkam! 🫐> because `"" in "glfw"` is true... no matter if you got it from `"some/repo/glfw"` or from just literally `"glfw"`
13:58:17FromDiscord<nnsee> i said literally
13:58:20FromDiscord<odexine> he said literally
13:58:21FromDiscord<odexine> yes
13:58:25FromDiscord<odexine> literally being using `==`
13:58:28FromDiscord<odexine> not contains
13:58:44FromDiscord<nnsee> `parts_of_url[^1] == "glfw"`
13:58:45FromDiscord<sOkam! 🫐> ah i see what you mean
13:58:53FromDiscord<nnsee> or whatever the nim syntax is haha
13:59:00FromDiscord<sOkam! 🫐> how do you handle `#head` or all of the nimble versions options?
13:59:01FromDiscord<nnsee> brain is in python mode right now
13:59:05*junaid_ joined #nim
13:59:08FromDiscord<odexine> In reply to @nnsee "or whatever the nim": reads correct
13:59:15FromDiscord<odexine> In reply to @heysokam "how do you handle": use a URL parser
13:59:28FromDiscord<nnsee> https://github.com/treeform/urlly/blob/master/src/urlly.nim
13:59:32FromDiscord<nnsee> had this open in another tab :p
14:00:32FromDiscord<sOkam! 🫐> definitely makes this specific code situation better, just not the underlying issue. but ty, will keep it around for the non-rushed implementation
14:01:19*junaid_ quit (Client Quit)
14:02:02*junaid_ joined #nim
14:02:51FromDiscord<nnsee> well ideally you should make it so the first value can't be blank anyways
14:10:09FromDiscord<sOkam! 🫐> that would make the rest of the code 10x more overengineered. the code should handle the empty case, not the other way around 🤷‍♂️
14:10:19FromDiscord<sOkam! 🫐> (edit) "that would make the rest of the code 10x more overengineered. the ... code" added "dependencies check"
14:10:29FromDiscord<sOkam! 🫐> (edit) "around" => "around, imo"
14:25:11FromDiscord<nnsee> i meant generally speaking
14:34:44FromDiscord<nnsee> i wonder if the maintainer of the nim docker image is here?
14:38:39*azimut joined #nim
14:39:27FromDiscord<nnsee> well they seem to be active on github at least, so i guess i'll just submit a PR
14:44:42FromDiscord<nnsee> oh, they are here, but haven't spoken in a while
14:58:57*SebastianM joined #nim
15:04:20*SebastianM quit (Remote host closed the connection)
15:11:42*xet7 quit (Remote host closed the connection)
15:13:23*junaid_ quit (Remote host closed the connection)
15:16:23*xet7 joined #nim
15:27:09FromDiscord<Phil> In reply to @nnsee "i wonder if the": I have some connection there, what up?
15:35:43*xet7 quit (Remote host closed the connection)
16:01:49*junaid_ joined #nim
16:07:59*brettgilio quit (Ping timeout: 245 seconds)
17:07:23FromDiscord<sOkam! 🫐> https://nim-lang.org/docs/nimc.html#compiler-usage-configuration-files↵Is there a way to skip `$projectDir/nim.cfg` but not `$project.nim.cfg`?
17:07:28FromDiscord<nnsee> In reply to @isofruit "I have some connection": was looking into the state of aarch64 builds, but it looks like the image builder needs a rewrite
17:07:42FromDiscord<nnsee> I'll work on it and submit a PR at one point
17:16:32FromDiscord<Phil> The entire part where it uses source code filters to generate docker files was never quite for me or rather I'm not soure I'm the greatest fan of SCF in the first place.↵I guess they're neat if you quickly need your own templating language for arbitrary thing X?↵Other than that I just don't find them insanely readable
17:21:14*xet7 joined #nim
17:22:33FromDiscord<odexine> In reply to @heysokam "https://nim-lang.org/docs/nimc.html#compiler-usage-": Why?
17:22:58FromDiscord<odexine> I don’t think it’s possible
17:31:50*krux02 joined #nim
17:42:12FromDiscord<bhunao> yo, anyone here has worked with audio files in nim? i kind wanna try to draw audio waves, i know how to draw but i don't know how to get started with audio stuff
17:48:20FromDiscord<darthvaderbn> How to fix repeating suggestions in vs code? (i tried disabling/enabling nim extension) https://media.discordapp.net/attachments/371759389889003532/1158098081947062402/image.png?ex=651b0263&is=6519b0e3&hm=ca0c8ee38817a31ae52c01528a501a984dee2807a24d2eac1f53a5ff602f0dc0&
17:48:59*rockcavera joined #nim
17:53:14FromDiscord<leorize> it's likely just multiple overloads
17:56:02FromDiscord<leorize> the extension probably doesn't support that so you might have to file a bug report
17:56:03FromDiscord<Phil> Wish I could force some macros to resolve before others =/
17:56:53FromDiscord<Phil> Or rather have it so that macro B only deals with the result of macro A and not the AST itself of macro A >_>
17:56:59FromDiscord<leorize> we call it a typed macro
17:57:07FromDiscord<leorize> which have it's own troubles
17:57:43FromDiscord<leorize> see cps for the amount of workarounds we apply to handle the typed AST
17:58:02FromDiscord<Phil> I'm currently just getting boned by owlkettle's DSL meaning I can't use macros within the gui section of it.↵Which is not that big of a deal right up until I want to iterate over a state at compiletime and generate expressions of `state.<FieldName>` in various places in the gui DSL section
17:58:13*rockcavera quit (Ping timeout: 255 seconds)
17:58:45FromDiscord<leorize> owlkettle would have to use a typed macro
17:58:52*junaid_ quit (Remote host closed the connection)
17:59:07FromDiscord<leorize> unfortunately there isn't much you can do with an untyped macro other than syntactic transformation
17:59:26FromDiscord<Phil> It does not and I'm not that deep in the lore that I can just say "I'll refactor this"
18:00:59*rockcavera joined #nim
18:01:36FromDiscord<leorize> the issue with untyped macro not being able to "resolve first" is basically because the AST is not considered "usable" until the untyped macro finishes
18:17:24*xet7 quit (Ping timeout: 240 seconds)
18:17:28*SebastianM joined #nim
18:30:24FromDiscord<demotomohiro> In reply to @bhunao "yo, anyone here has": How about to learn about .wav file format that store audio data in PCM format and write a loader.
18:30:42*xet7 joined #nim
18:35:38*xet7 quit (Ping timeout: 255 seconds)
18:40:59FromDiscord<Chronos [She/Her]> My code for getting what tile a user clicked on is... funky :p
18:45:32*SebastianM quit (Ping timeout: 248 seconds)
18:46:07FromDiscord<Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4HVC
18:48:23*xet7 joined #nim
18:50:05FromDiscord<Chronos [She/Her]> If anyone could help me figure this out, that'd be great aha
18:52:24FromDiscord<demotomohiro> Is your grid not uniform?↵Just `tileXID = floor(x / tileWidth)` doesnt work?
18:52:34FromDiscord<Chronos [She/Her]> Wdym by not uniform?
18:53:00FromDiscord<Chronos [She/Her]> It's all squares of the same size
18:53:27FromDiscord<demotomohiro> Uniform means each tile has same width and height.
18:57:20FromDiscord<demotomohiro> If 32 is tile width, `tile[0] = pos.x div 32` doesn't work?
18:59:23FromDiscord<Chronos [She/Her]> ...I'll try that rn actually
19:16:48FromDiscord<fabric.input_output> just wanted to say that my library is about finished and ready to be used↵https://github.com/fabriciopashaj/yarolin
19:17:39FromDiscord<bhunao> In reply to @demotomohiro "How about to learn": gonna search for that, thanks
19:20:27FromDiscord<Chronos [She/Her]> In reply to @demotomohiro "If 32 is tile": That works much better than how I was doing it, thanks :p
19:21:08FromDiscord<Chronos [She/Her]> But only issue I have is that the center 4 tiles seem to all be `0, 0` until I move another tile away in that direction
19:23:26FromDiscord<Chronos [She/Her]> It makes sense, but it's still annoying
19:25:26FromDiscord<Chronos [She/Her]> `(floor(pos.x / 32).int, floor(pos.y / 32).int)` this does the trick!
19:25:34FromDiscord<Chronos [She/Her]> Thanks for the help Demo!
19:26:21FromDiscord<Chronos [She/Her]> I now need to make a GUI with Raylib, fun 🥲
19:26:39FromDiscord<Chronos [She/Her]> I could probably use Pixie to render an SVG of a GUI tho.....
19:28:17FromDiscord<Chronos [She/Her]> Wonder if there's any point to layering Boxy on top of Raylib
19:28:23FromDiscord<Chronos [She/Her]> Probably not but hm...
19:35:01FromDiscord<Chronos [She/Her]> Anyone know if there's any implementation of/that builds upon a sequence to allow for negative indexes?
19:35:58FromDiscord<Chronos [She/Her]> Not talking about backward indexes btw
19:36:29FromDiscord<Chronos [She/Her]> Though ig having a seq with negative indexes complicates everything massively...
19:36:40FromDiscord<jviega> For arrays I believe you can do something along the lines of `array[int, -100 .. 100]`; think you'd have to overload the index operator for sequences
19:36:56FromDiscord<Elegantbeef> Swap the type for the range and you've got it 😛
19:37:04FromDiscord<Elegantbeef> Negative index on a normal seq makes very little sense
19:37:43FromDiscord<Chronos [She/Her]> In reply to @jviega "For arrays I believe": Hm... Fair, thanks jtv
19:37:52FromDiscord<Elegantbeef> Plus it's going to be very slow to do anything like `addFront`
19:38:41FromDiscord<Chronos [She/Her]> In reply to @Elegantbeef "Negative index on a": I'd want to use it for a 2D map to make it much nicer to edit stuff in general, but I'd probably be better off just moving everything in the sequence forward/down an index aha
19:39:08FromDiscord<Elegantbeef> Why do you have negative indicies in a 2D map?
19:39:27FromDiscord<Chronos [She/Her]> Or maybe just not allowing it in the first place, and forcing myself to pre-create the map with the correct size
19:39:36FromDiscord<Chronos [She/Her]> In reply to @Elegantbeef "Why do you have": Tile coordinates
19:39:56FromDiscord<Elegantbeef> That doesnt answer it
19:40:03FromDiscord<Elegantbeef> If you have a world the furthest you should be able to go is `0, 0`
19:40:19FromDiscord<Chronos [She/Her]> Fair enough
19:40:28FromDiscord<Chronos [She/Her]> Welp, time to implement GUIs and inventories
19:40:29FromDiscord<Elegantbeef> If you have a chunk system you do `x - chunkX, y - chunkY`
19:40:42FromDiscord<Chronos [She/Her]> I do not have a chunk system aha
19:41:11FromDiscord<Chronos [She/Her]> Maybe it'd make sense to do that though, to avoid loading maps all at once
19:41:33FromDiscord<Chronos [She/Her]> Big maps with a lot of tiles
19:41:59FromDiscord<Chronos [She/Her]> Tho realistically it shouldn't be an issue since the most memory limited device it'd run on would be a phone
19:43:26FromDiscord<Chronos [She/Her]> Trying to think of how I should do GUIs rn... Rendering SVGs? Or just add the GUI components as parts of the game...
19:43:37FromDiscord<Chronos [She/Her]> With their sprites on the atlas
19:43:47FromDiscord<Chronos [She/Her]> It'd probably make the most sense to do that
19:54:32FromDiscord<demotomohiro> https://github.com/demotomohiro/invisinim/blob/main/mycode.nim↵You see only `import` in that code but it actually valid Nim code and echo text.
19:57:02FromDiscord<Elegantbeef> Unicode spaces?
20:00:10FromDiscord<demotomohiro> yes
20:01:16FromDiscord<Elegantbeef> Forgot to use type aliases
20:01:36FromDiscord<demotomohiro> U+3000
20:01:41FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4HW2
20:47:19FromDiscord<patitotective> sent a code paste, see https://play.nim-lang.org/#ix=4HWh
20:50:37FromDiscord<Elegantbeef> Hmm changes with 2.0 might mean I need to change how it works
20:52:47FromDiscord<patitotective> I'm using nim 1.6.12 though
20:56:26FromDiscord<Elegantbeef> Seems like its an issue with 1.6.12\ 😄
20:59:20FromDiscord<diogenesoftoronto> hey I am having trouble compiling my nim project. I get an invalid indentation error but I can't figure out where it is since in seems to appear in macros.nim i tried fixing that then it became unidentified... before i go done a rabbit hole i was wondering if there was something wrong with my code that i missed? using 1.6
21:00:00FromDiscord<diogenesoftoronto> the lsp does not appear to complain on any specific line either
21:01:29FromDiscord<diogenesoftoronto> this is core macros.nim btw
21:02:01FromDiscord<jviega> It's going to be in your code, I'm sure. You should paste the actual error message and then probably the relevent code
21:02:33FromDiscord<diogenesoftoronto> error: invalid indentation
21:02:53FromDiscord<Elegantbeef> What is the whole error stack?
21:04:00FromDiscord<diogenesoftoronto> ~/.choosenim/toolchains/nim-1.6.10/lib/core/macros.nim
21:04:14FromDiscord<diogenesoftoronto> (533,3)
21:04:33FromDiscord<diogenesoftoronto> https://media.discordapp.net/attachments/371759389889003532/1158147463258058802/image.png?ex=651b3060&is=6519dee0&hm=0adef141027cf992405f14265ebe586302c14939707ed3ff00c53090d32d1e2d&
21:04:44FromDiscord<sOkam! 🫐> In reply to @odexine "Why?": because sometimes I need to `specific.nim.cfg` without using the project-wide `nim.cfg`↵but it seems like there are 5 cfg files read and 4 switches to manage them 😦
21:04:44FromDiscord<Elegantbeef> Update to 1.6.14
21:04:44FromDiscord<Elegantbeef> Why are people using 1.6 and not 1.6.14
21:04:58FromDiscord<diogenesoftoronto> okay will do
21:08:04FromDiscord<diogenesoftoronto> lol it works now
21:09:02FromDiscord<diogenesoftoronto> when i went to install stable it said that was 1.6.10 my installed version
21:10:21FromDiscord<Elegantbeef> Well stable is now 2.0
21:11:33FromDiscord<diogenesoftoronto> ah
21:11:57FromDiscord<diogenesoftoronto> idk if i want to move to 2.0 yet
21:14:14FromDiscord<sOkam! 🫐> In reply to @diogenesoftoronto "idk if i want": 2.0 is like if it was 1.6.16... the version change was because of the default gc, not because of major breaking changes
21:14:26FromDiscord<diogenesoftoronto> hm okay
21:14:27FromDiscord<sOkam! 🫐> (edit) "1.6.16..." => "1.6.16 or 1.6.18..."
21:18:16FromDiscord<patitotective> sent a code paste, see https://play.nim-lang.org/#ix=4HWl
21:18:33FromDiscord<Elegantbeef> Recursive `==` mark it `noSideEffect`
21:24:32FromDiscord<patitotective> Here is `nodes.nim` https://github.com/Patitotective/kdl-nim/blob/main/src/kdl/nodes.nim#L278↵But I don't get which procedure to mark `noSideEffect`, I made all of the `contains` and `==` procedures functions and still get the same error
21:25:28FromDiscord<Elegantbeef> Should just be your `==`s
21:27:59FromDiscord<patitotective> :/
21:28:10FromDiscord<Elegantbeef> Your find might also need to be a func
21:28:14FromDiscord<Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4HWo
21:28:42FromDiscord<Elegantbeef> Either pixie or your svg isnt spec compliant
21:29:18FromDiscord<Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4HWp
21:29:19FromDiscord<Chronos [She/Her]> That's the svg
21:29:59FromDiscord<patitotective> In reply to @Elegantbeef "Your find might also": I guess I'm going back to 1.6.12 lol↵Still same error
21:33:15FromDiscord<Elegantbeef> Though making your code work with 2.0 shouldnt be that hard
21:33:24FromDiscord<Elegantbeef> make the procedures used a func and it should work
21:36:41FromDiscord<Elegantbeef> why 1.6.12 and not 1.6.1
21:36:42FromDiscord<Elegantbeef> 14
21:40:51FromDiscord<patitotective> In reply to @Elegantbeef "make the procedures used": when you say "used", do you mean all the procedures (all the ones that can be converted into func) in nodes.nim? because it errors at compile time
21:41:49FromDiscord<patitotective> In reply to @Elegantbeef "why 1.6.12 and not": it's just that `choosenim stable` switches to 1.6.12 so i thought it was the one
21:42:22FromDiscord<Elegantbeef> Well you have to update it
21:43:46FromDiscord<patitotective> kinda weird https://media.discordapp.net/attachments/371759389889003532/1158157334271492198/image.png?ex=651b3992&is=6519e812&hm=dfb9fdcab1ece190aea38cf7f1e0f169eb80a9faf931d3becfe0621c4a6f3ab5&
22:43:25FromDiscord<Elegantbeef> Oh @patitotective you did not write a `==` for your Node
22:46:13FromDiscord<Elegantbeef> Is all you need to do
22:46:17FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4HWz
22:46:24FromDiscord<Elegantbeef> The issue is that you have a recursive type which means the proc does not get marked `noSideEffect`
22:50:36FromDiscord<Elegantbeef> After that 2.0 causes a nice error that you should fix
23:35:50FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4HWH
23:36:23FromDiscord<Elegantbeef> Mesh is a referenoce object
23:36:24FromDiscord<Elegantbeef> dereference it
23:36:48FromDiscord<sOkam! 🫐> i thought that `.` dereferenced auto
23:36:59FromDiscord<Elegantbeef> Fields isnt a field
23:37:07FromDiscord<patitotective> sent a code paste, see https://play.nim-lang.org/#ix=4HWI
23:37:28FromDiscord<Elegantbeef> `==` does not work for case objects by default
23:37:30FromDiscord<sOkam! 🫐> In reply to @Elegantbeef "Fields isnt a field": so it only dereferences on field access?
23:37:33FromDiscord<Elegantbeef> But you implemented your own `==`
23:37:35FromDiscord<sOkam! 🫐> didnt know that
23:38:07FromDiscord<patitotective> In reply to @Elegantbeef "But you implemented your": oh, that's the issue, i didn't↵i did it for kdlval
23:38:09FromDiscord<patitotective> (edit) "In reply to @Elegantbeef "But you implemented your": oh, that's the issue, i didn't↵i did it for kdlval ... " added "only"
23:38:31FromDiscord<Elegantbeef> Well the issue is actually Nim's effect tracking on recursive calls does not resolve it
23:38:39FromDiscord<Elegantbeef> So you have to manually resolve it
23:48:13FromDiscord<Phil> How cursed or not cursed is having method call syntax on a generic type?
23:48:44FromDiscord<Phil> Wait, nevermind, answer came to my as I hit enter.↵Generic type leads to generic method, which basically is busted
23:49:07FromDiscord<Phil> (edit) removed "syntax"
23:52:16FromDiscord<patitotective> @ElegantBeouf wooops, i was defining `==` for nodes before the `==` for values so when it tried to compare the object variants of the values inside the nodes it errored :p
23:53:26FromDiscord<Elegantbeef> Generic methods work as long as only the ref object type changes
23:56:09FromDiscord<Phil> sent a long message, see http://ix.io/4HWM
23:56:29FromDiscord<Phil> (edit) "http://ix.io/4HWM" => "http://ix.io/4HWN"