<< 06-04-2025 >>

00:31:52FromDiscord<pmunch> Hmm
00:33:00FromDiscord<pmunch> glBindBuffer only lasts until the next one is bound, so I think I might be overriding one buffer with another..
01:21:53*beholders_eye quit (Ping timeout: 268 seconds)
01:22:53FromDiscord<pmunch> Ugh, it's almost half 4 AM..
01:24:43FromDiscord<Elegantbeef> Oddest way to say almost 2 am
01:33:45FromDiscord<pmunch> Haha, 3:30 rather
01:38:09FromDiscord<pmunch> I really should head off to bed
03:05:15*rez joined #nim
03:24:43*rez quit (Quit: l8r)
04:01:27*nils` quit (Ping timeout: 252 seconds)
04:01:34*rez joined #nim
04:07:21*rez quit (Quit: l8r)
04:07:56*rez joined #nim
04:51:18*rez quit (Quit: much snoozes...)
04:54:15*rez joined #nim
05:21:58*nils` joined #nim
05:24:11*rez quit (Quit: l8r)
06:12:30*nils` quit (Ping timeout: 260 seconds)
06:52:57*coldfeet joined #nim
07:01:22*nils` joined #nim
07:04:30*derpydoo joined #nim
07:27:31*ntat joined #nim
07:35:20FromDiscord<chip2n> sent a code paste, see https://play.nim-lang.org/#pasty=HNapYJOI
07:39:32FromDiscord<heysokam> how could I turn this char set into a regular string that has all of the characters one after the other?↵`const chars = ${32.char .. 255.char}`↵Right now, `$` is only giving me the `{'a', 'b', ....}` representation
07:47:08FromDiscord<leorize> try `var str: string; str.add "constant"`↵(@chip2n)
07:51:15FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#pasty=PtTXwbiN
07:52:07FromDiscord<lainlaylie> sent a code paste, see https://play.nim-lang.org/#pasty=OgbIDfuS
07:53:13FromDiscord<chip2n> In reply to @leorize "try `var str: string;": That works as well - another way seems to be `s.str.add("some string")` (this is assuming `s.str` is empty to start with).
07:58:04FromDiscord<Elegantbeef> @chip2n you should also be able to do `prepareMutation(str)`
07:59:11FromDiscord<Elegantbeef> If you're trying to do anything related to HCR https://github.com/beef331/potato will have some stuff you can steal, though I keep old DLLs loaded in memory so I can migrate fine
08:05:14FromDiscord<chip2n> In reply to @Elegantbeef "<@164348690385862657> you should also": This seems to be exactly what I need - also made things clearer regarding CoW for string literals. Thanks!↵Yep, it's for HCR (tried the built in hotCodeReloading stuff but didn't seem to work with raylib, so trying to roll my own). I'll check out potato 🙂
08:17:49*SchweinDeBurg quit (Quit: WeeChat 4.7.0-dev)
08:29:47*SchweinDeBurg joined #nim
08:57:02*andy-turner joined #nim
08:59:31FromDiscord<heysokam> what's the best way to map multiple `set[char]` to multiple `enum` values?
09:02:02FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#pasty=VotyfmEu
09:03:50FromDiscord<heysokam> (edit) "https://play.nim-lang.org/#pasty=zQwEKDRj" => "https://play.nim-lang.org/#pasty=pPdFFnWz"
09:05:38FromDiscord<lainlaylie> example use case?
09:07:23FromDiscord<heysokam> In reply to @lainlaylie "example use case?": https://github.com/heysokam/minim/blob/560ffd9ddf15f8146655f93ab21ac39fcf1ad518/src/minim/rules.zig#L75-L98
09:08:07FromDiscord<heysokam> if I give `'a'` I should get `someEnum.lower`
09:08:22FromDiscord<heysokam> etc
09:17:24FromDiscord<lainlaylie> sent a code paste, see https://play.nim-lang.org/#pasty=ArUFxRsC
09:25:26FromDiscord<eebahn> is there no data structure for it?
09:27:27FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#pasty=vJrzVjhh
09:40:05FromDiscord<lainlaylie> you could do a `array[char, someEnum]` lookup table or something
09:59:44FromDiscord<rakgew> maybe `std/strtabs` works for your use-case?↵(@heysokam)
11:01:31FromDiscord<heysokam> that doesn't solve the many-to-one, does it 🤔
11:01:42FromDiscord<heysokam> I'd need to manually create an entry for each
11:11:30FromDiscord<rakgew> depends. if it is about mapping from string "a" to str "A" it might, but if the input as enum is fixed, then probably not.
11:12:16FromDiscord<rakgew> if they are known at compile time, a macro could handle that.↵(@heysokam)
11:19:42FromDiscord<heysokam> I think I'll go with a function. seems the least troublesome
11:21:06FromDiscord<rakgew> right, definitively easier in terms of complexity
11:28:18FromDiscord<aintea> Is there a way to infer a pragma to all procedures in the current project other than hardcoding it ?
11:30:54FromDiscord<heysokam> not that I know of. but you could make an alias for it, if its complex, and use a one-word alias instead of a longer one
11:31:47FromDiscord<lainlaylie> push/pop?
11:35:33FromDiscord<aintea> In reply to @heysokam "not that I know": it's not complex, it's just a basic `{.raises: []}`
11:35:37FromDiscord<aintea> (edit) "[]}`" => "[].}`"
11:36:22FromDiscord<heysokam> ah, true. you could have a file with `push` that you `include thefile`
11:36:38FromDiscord<heysokam> not project-wide, but might make it simpler
11:46:10*derpydoo quit (Quit: derpydoo)
12:08:51FromDiscord<buwubie> Hello! Sorry to bother, but, can anybody guide me how to import a module that is higher in the file tree? https://media.discordapp.net/attachments/371759389889003532/1358413137153490965/image.png?ex=67f3c051&is=67f26ed1&hm=2b6d19d74e218e23382f6ac6fa0d5dc6b3c710d41a324c7c9931c4185b3b857c&
12:26:19FromDiscord<TӨMΛ ☠> sent a code paste, see https://play.nim-lang.org/#pasty=WrbUIiXg
12:26:39FromDiscord<TӨMΛ ☠> Trying to make Nico tile spreadsheet work but this is giving me such a headache
12:30:54FromDiscord<eebahn> In reply to @toma400 "Nim is so funky": `from std/os import /`
12:32:34FromDiscord<eebahn> don't reinvent the wheel with `&`, `/` for paths already does that in a cross platform way
12:33:20*coldfeet quit (Quit: Lost terminal)
12:33:28FromDiscord<lainlaylie> I think the question is why↵`assets\` is in there twice
12:34:10FromDiscord<eebahn> yes, but just mentioning the extra comment
12:36:36FromDiscord<eebahn> I remember nico being demanding about assets locations↵might be that something is converting the paths internally in a different way depending on usage
12:38:35FromDiscord<TӨMΛ ☠> In reply to @eebahn "don't reinvent the wheel": I always use `&`, oopsies 😅
12:39:01FromDiscord<TӨMΛ ☠> Btw does Nico work only on spritesheets, isn't there a way to draw single sprites separately?
12:39:43FromDiscord<TӨMΛ ☠> ~~Well, I assume I could just import each sprite as separate spritesheet~~
12:40:16FromDiscord<TӨMΛ ☠> (edit) "spritesheet~~" => "spritesheet, as stupid as it would be~~"
12:49:00FromDiscord<nnsee> sent a code paste, see https://play.nim-lang.org/#pasty=OMGkQqIm
12:49:24FromDiscord<nnsee> trying to figure out if the extra `assets\` is added before or after your own `r"assets\"`
13:08:38*andreas_ quit (Quit: Konversation terminated!)
13:08:49*andreas_ joined #nim
13:10:25FromDiscord<TӨMΛ ☠> `added\tiles/grass.png`
13:10:39FromDiscord<TӨMΛ ☠> Interesting that this time it didn't make it double
13:11:39FromDiscord<TӨMΛ ☠> Actually it's kinda crazy, replaced the `added` with `assets` and now it's working properly :o
13:13:08FromDiscord<buwubie> any ideea how to properly separate prototypes and definitions? https://media.discordapp.net/attachments/371759389889003532/1358429318170284203/image.png?ex=67f3cf63&is=67f27de3&hm=f0097d522c651fb6af6a60eeeafa9740e2b1cca75add8ace46e0fdad981f4c32&
13:41:21*coldfeet joined #nim
13:54:03*alexdaguy joined #nim
13:56:25*amadaluzia joined #nim
14:01:18FromDiscord<lainlaylie> i think forward declarations need to be in the same module
14:14:11*beholders_eye joined #nim
14:26:49FromDiscord<buwubie> Oh, that is, not fun :). Thank you
14:31:50FromDiscord<spotlightkid> What type is `tile.image`? Probably something (nico) overloaded the the `&` operator for this type.↵(@TӨMΛ ☠)
14:33:23FromDiscord<spotlightkid> or the `$` operator.
14:43:04FromDiscord<TӨMΛ ☠> In reply to @spotlightkid "What type is `tile.image`?": Just `string`, it's path of the image
15:02:40*nils` quit (Ping timeout: 268 seconds)
15:06:35FromDiscord<spotlightkid> Hmm, strange. Hard to diagnose further without seeing more of your code.
15:21:21*alexdaguy quit (Quit: w)
15:25:12*amadaluzia_ joined #nim
15:26:50*amadaluzia_ quit (Changing host)
15:26:50*amadaluzia_ joined #nim
15:37:34FromDiscord<nnsee> In reply to @toma400 "Actually it's kinda crazy,": maybe something in the cache was messed up
16:10:17FromDiscord<heysokam> In reply to @buwubie "any ideea how to": you don't need that↵if you -necessarily- do (mutual recursion is the only reason, really) then they must be on the same module as mentioned↵but you don't need forward declares in nim, unless for that uber-rare case of functions calling each other recursively
16:11:19FromDiscord<heysokam> if you are looking for private functions, then dont make them public and call `import thing {.all.}`
16:17:04FromDiscord<buwubie> I am looking to separate them into files cause the files will get extremely big and will become unreadable
16:17:24FromDiscord<buwubie> (edit) "files" => "one file"
16:19:52FromDiscord<heysokam> then import the functions
16:20:23FromDiscord<heysokam> modules support what you just described perfectly fine
16:21:41FromDiscord<heysokam> does `while thing():` call `thing()` on every iteration, or only once? 🤔
16:22:50Amun-Raevery
16:26:56*nils` joined #nim
16:26:58*amadaluzia quit (Ping timeout: 244 seconds)
16:48:36FromDiscord<aintea> Yes
16:51:01FromDiscord<aintea> If you want a one time call for is better I guess
16:51:26FromDiscord<aintea> Or just assign the result of `thing` to a variable
16:55:53FromDiscord<lainlaylie> if it only evaluated the condition once, every while loop would either never run or loop infinitely, isnt it?
17:01:54Amun-Rathat'd also mean while somevar: … is evaluated only once
18:07:47*zgasma quit (Ping timeout: 252 seconds)
18:31:12FromDiscord<aintea> Yes exactly
18:31:43FromDiscord<aintea> In reply to @Amun-Ra "that'd also mean while": No it's evaluated at each iteration, you just want to not modify this variable
18:35:24*beholders_eye quit (Ping timeout: 245 seconds)
18:36:20Amun-Raaintea: you need to read the backlog a little bit more… ;)
18:39:55FromDiscord<aintea> Oh
19:08:40amadaluzia_trying out nim a bit more, is there a way to make this more readable?
19:08:42amadaluzia_https://play.nim-lang.org/#pasty=JrIniNRE
19:10:26amadaluzia_more specifically, the echo statement
19:11:32amadaluzia_it looks like terror
19:13:41FromDiscord<Elegantbeef> https://play.nim-lang.org/#pasty=GBGWuyXK
19:13:42FromDiscord<Elegantbeef> There we go
19:15:35amadaluzia_cheers!
19:16:23amadaluzia_didn't know that echo took integers
19:16:32FromDiscord<Elegantbeef> It doesn't
19:16:44FromDiscord<Elegantbeef> It takes strings and anything that isn't a string it calls `$` on
19:16:51amadaluzia_gotcha
19:17:47*amadaluzia joined #nim
19:31:14*ntat quit (Quit: leaving)
20:00:24FromDiscord<fabric.input_output> In reply to @pmunch "Linking issue?": no, I get this https://media.discordapp.net/attachments/371759389889003532/1358531809196900503/image.png?ex=67f42ed7&is=67f2dd57&hm=36b28fff04b42bf8c282819ed90a7d6404388406eb6ac316abcabf02181ed0ca&
20:09:34*coldfeet quit (Quit: Lost terminal)
20:20:11FromDiscord<Elegantbeef> @fabric.input_output did you init opengl?
20:21:11FromDiscord<fabric.input_output> I did `glfwInit()` an in my C++ project it initializes opengl aswell
20:21:44FromDiscord<Elegantbeef> Are you sure it init's opengl?
20:21:53FromDiscord<Elegantbeef> ah yes possessive init 😄
20:22:17FromDiscord<fabric.input_output> (edit) "an" => "and"
20:23:08FromDiscord<fabric.input_output> there is literally only `glfwInit()` in my C++ project and it just works
20:24:02FromDiscord<fabric.input_output> maybe glfw has its stuff separate from nim-lang/opengl?
20:24:21FromDiscord<Elegantbeef> I've not use gflw so just know that you're supposed to call `glCreateContext` to actually init opengl
20:26:20FromDiscord<Elegantbeef> Actually that might be an sdl function now that I say that outloud
20:26:41FromDiscord<Elegantbeef> Ah it is, carry on then 😄
20:27:56FromDiscord<Elegantbeef> https://www.glfw.org/docs/3.3/groupcontext.html#ga1c04dc242268f827290fe40aa1c91157 though there is this
20:27:57FromDiscord<fabric.input_output> glfwCreateWindow is supposed to create the context 🤔
20:28:45FromDiscord<Elegantbeef> Do you have the opengl error handler setup?
20:28:52FromDiscord<Elegantbeef> It might provide more information
20:28:55FromDiscord<Elegantbeef> I mean debug handler
20:30:15FromDiscord<fabric.input_output> you mean https://www.glfw.org/docs/3.3/groupinit.html#gaff45816610d53f0b83656092a4034f40 ?
20:30:47FromDiscord<fabric.input_output> sent a code paste, see https://play.nim-lang.org/#pasty=orwKfehR
20:33:15FromDiscord<Elegantbeef> I assume you questioning means it didn't work 😄
20:33:58FromDiscord<fabric.input_output> the window is created but it fails at glViewport
20:34:09FromDiscord<fabric.input_output> so clearly there's something sus going on
20:34:17FromDiscord<Elegantbeef> What glfw package are you using?
20:35:11FromDiscord<fabric.input_output> nimgl/glfw
20:35:30FromDiscord<fabric.input_output> I think they have their own opengl so maybe that's the issue?
20:36:31FromDiscord<fabric.input_output> trying it out rn
20:37:10FromDiscord<Elegantbeef> Oh yea if you're mixing opengl loaders you're liable to run into troubles
20:37:56FromDiscord<pmunch> Time for GDB I guess
20:38:49FromDiscord<pmunch> By the way, anyone else have issues with the C to Nim line number wrapping when using GDB?
20:43:50FromDiscord<Elegantbeef> I've not used debuggers enough to notice any issues
21:12:30FromDiscord<heysokam> In reply to @fabric.input_output "nimgl/glfw": that lib is wildly outdated and abandoned
21:12:41FromDiscord<fabric.input_output> damn
21:12:58FromDiscord<fabric.input_output> what do I use? raw glfw?
21:13:00FromDiscord<heysokam> wrap it with futhark
21:13:44FromDiscord<goerge_lsd> what do you think about this working code deepseek made. I wanted composable streams: https://play.nim-lang.org/#pasty=mHUvQTkl
21:14:24FromDiscord<heysokam> In reply to @fabric.input_output "what do I use?": I wrapped this myself, based on treeform/staticglfw https://github.com/heysokam/nglfw↵But a futhark wrapper will be more up to date because you will have ownership of the version you use
21:15:45FromDiscord<fabric.input_output> ok
21:20:07*andy-turner quit (Quit: Leaving)
21:25:17FromDiscord<fabric.input_output> damn https://github.com/heysokam/nglfw/blob/master/src/nglfw/compile.nim
21:27:43FromDiscord<Elegantbeef> There's so much wrong with that stream stuffs
21:28:34FromDiscord<goerge_lsd> @ElegantBeef you're welcome to implement Elegant composable streams : P
21:28:46FromDiscord<Elegantbeef> `Composable` stream doesn't need to exist it does nothing
21:28:48FromDiscord<Elegantbeef> `method`s are not used
21:28:49FromDiscord<goerge_lsd> much easier in rust with its Read/Write traits
21:29:26FromDiscord<goerge_lsd> wdym it doesn't need to exist ? It has an extra field, the inner Stream
21:30:19FromDiscord<Elegantbeef> Which it calls into for its reading
21:32:58FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=kiaYPOkd
21:33:29FromDiscord<fabric.input_output> wait why can't futhark find opir
21:33:49FromDiscord<fabric.input_output> https://media.discordapp.net/attachments/371759389889003532/1358555316052037632/image.png?ex=67f444bc&is=67f2f33c&hm=cb217d0a91afd44482d8ba041009749b1ae640941380db389cdd3de44a8ccfec&
21:34:06FromDiscord<goerge_lsd> Can you please make a minimal working example Beef ? with xor/base64 or whatever
21:34:33FromDiscord<goerge_lsd> My original use case was gzip compress/decompress form net socket, so I asked it to make this to get a feel of how it would look like
21:37:09FromDiscord<goerge_lsd> gzip will be harder, have to figure out what methods from the zlib i have to use. Nim has GzFileStream, but that directly uses a file based method of the library
21:38:50*amadaluzia quit (Ping timeout: 260 seconds)
21:39:11*amadaluzia joined #nim
21:40:58FromDiscord<heysokam> In reply to @fabric.input_output "wait why can't futhark": did you nimble install?
21:41:09FromDiscord<fabric.input_output> I installed it as a dep
21:42:17FromDiscord<heysokam> @pmunch might have some insights
21:42:42FromDiscord<linuxbro> How can I get convert a `string` to `seq[byte]`?
21:43:26FromDiscord<fabric.input_output> bruh wth I haven't been able to do anything
21:43:35FromDiscord<fabric.input_output> I might just do this in C++
21:43:50FromDiscord<heysokam> doesn't nglfw work?
21:43:56FromDiscord<heysokam> it should just work
21:43:58FromDiscord<fabric.input_output> I haven't tried that
21:44:32FromDiscord<heysokam> I recommended futhark because its the most up to date you will get. but last time I checked, nglfw still worked well
21:45:20FromDiscord<fabric.input_output> is it on nimble or do I github link it?
21:45:27FromDiscord<heysokam> github
21:45:30FromDiscord<fabric.input_output> ok
21:45:36FromDiscord<heysokam> none of my libs are on nimble, so need gh link
21:45:57FromDiscord<heysokam> also, add it as @head just in case I forgot a tag somewhere
21:46:06FromDiscord<fabric.input_output> why do the tag version have 4 parts
21:46:29FromDiscord<heysokam> not sure what you mean
21:46:45FromDiscord<fabric.input_output> https://media.discordapp.net/attachments/371759389889003532/1358558570203054171/image.png?ex=67f447c3&is=67f2f643&hm=a5f8417042955349aa62b5cb2bc80d4e602623a698a18f429b1970f4e0642ad3&
21:47:39FromDiscord<heysokam> oh, its explained in the readme, or in the nimble file
21:47:53FromDiscord<heysokam> first 3 numbers are in sync with the glfw repo
21:49:05FromDiscord<heysokam> so its saying `iteration #3 for glfw 3.3.8`
21:50:10FromDiscord<fabric.input_output> I see
21:50:19FromDiscord<Elegantbeef> Ah I take it slightly back the inner stream is required since it's a Nimcall
21:50:35FromDiscord<Elegantbeef> Actually... nope
21:57:39FromDiscord<fabric.input_output> and now we're back to the original issue
21:57:44FromDiscord<fabric.input_output> bruh
22:00:20FromDiscord<fabric.input_output> oh I think I needed to call loadExtensions
22:01:30FromDiscord<Elegantbeef> https://play.nim-lang.org/#pasty=UMYtGFBH
22:01:45FromDiscord<Elegantbeef> There is another solution that just brushes around issues I had with effects and tracking
22:02:46FromDiscord<Elegantbeef> change it to take an `openArray[char]` or what have you, but it allows composing operations ontop of streams without making a type per operation
22:05:49FromDiscord<Elegantbeef> @goerge_lsd just to make sure you see it
22:06:28FromDiscord<goerge_lsd> did you cook that now ?
22:08:31FromDiscord<Elegantbeef> No I totally had an inane solution just sitting on a shelf
22:09:04FromDiscord<linuxbro> Can I replace a libraries version of a function with my own? For example, replacing `net.dial` with a `mockDial` function for testing that doesn't rely on a remote server actually existing.
22:09:37FromDiscord<Elegantbeef> There is `patchfile` but there is no mocking in Nim
22:10:23FromDiscord<Elegantbeef> patch file, macros, or binary manipulation are your ways to mock if you so wish
22:43:42FromDiscord<heysokam> In reply to @fabric.input_output "oh I think I": if it helps: https://github.com/heysokam/glFB/blob/master/src/glFB/gl.nim
22:44:28FromDiscord<heysokam> https://github.com/heysokam/glFB/blob/15b49848bea8d4ea67535163a951af58f4d6b748/src/glFB/screen.nim#L226
22:45:03FromDiscord<heysokam> Which is basically an alias for https://github.com/heysokam/glFB/blob/15b49848bea8d4ea67535163a951af58f4d6b748/src/glFB/gl/api.nim#L74
23:23:50*amadaluzia quit (Ping timeout: 260 seconds)
23:35:21FromDiscord<heysokam> is it not possible to store an `OrderedSet[T]` inside a `Table[string, OrderedSet[T]]`?
23:35:40FromDiscord<heysokam> I'm getting: `system.nim(1802, 7) Error: parallel 'fields' iterator does not work for 'case' objects` 🤔
23:37:25FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#pasty=nAyUpqHB
23:45:22FromDiscord<heysokam> apparently the tagged union object was causing the issue, not the orderedset