<< 07-04-2025 >>

00:04:24*amadaluzia_ left #nim (ERC 5.6.0.30.1 (IRC client for GNU Emacs 30.1))
00:09:22FromDiscord<heysokam> is there an `[]` operator for ordered sets?
00:13:29FromDiscord<aintea> sent a code paste, see https://play.nim-lang.org/#pasty=kJWIncwS
00:17:09FromDiscord<heysokam> In reply to @aintea "Is there any real": `$` is implied in echo, and most varargs functions that want a string
00:17:50FromDiscord<heysokam> the only usecase is if you want to explicitly do the conversion for a function that wants a string but doesn't know how to convert by itself
00:20:14FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#pasty=hAVDETiy
00:20:23FromDiscord<aintea> No I mean the parameter that can take either a string or an int
00:21:01FromDiscord<heysokam> ah that depends on the usecase of the function↵its basically a generic function if you do that
00:22:56FromDiscord<aintea> It works for return types too
00:25:42FromDiscord<heysokam> its the same as `func toString[T :int | string](val :T) :string= ...`, really
01:07:17*GnuYawk quit (Quit: The Lounge - https://thelounge.chat)
01:07:40*GnuYawk joined #nim
02:12:02FromDiscord<Robyn [She/Her]> In reply to @aintea "Is there any real": for `int or string`?
02:12:32FromDiscord<Robyn [She/Her]> that's just a type class and is equivalent to `int | string`, like sOkam said
02:42:50*rockcavera quit (Remote host closed the connection)
04:11:43*nils` quit (Ping timeout: 265 seconds)
04:19:44*ntat joined #nim
04:50:01FromDiscord<goerge_lsd> that looks pretty ugly if you ask me @ElegantBeef , the https://play.nim-lang.org/#pasty=UMYtGFBH
04:57:51FromDiscord<pmunch> In reply to @fabric.input_output "wait why can't futhark": Are your Nimble installed binaries not in your PATH?
05:01:37FromDiscord<pmunch> @ElegantBeef, well you can mock like this: https://github.com/PMunch/echooverride
05:02:01FromDiscord<pmunch> @linuxbro as well ^
05:04:50FromDiscord<devlop_gaming> Does anyone know why nim can't load SDL3.dll?
05:05:22FromDiscord<devlop_gaming> sent a code paste, see https://play.nim-lang.org/#pasty=SAInfvtG
05:06:24FromDiscord<ajusa> sent a code paste, see https://play.nim-lang.org/#pasty=snMVviXl
05:07:13FromDiscord<devlop_gaming> In reply to @ajusa "try echoing `SDL_GetError() `?": I need that?
05:07:41FromDiscord<ajusa> sent a code paste, see https://play.nim-lang.org/#pasty=piKWQWwo
05:07:50FromDiscord<ajusa> In reply to @devlop_gaming "I need that?": depends on which OS you are on, windows?
05:07:59FromDiscord<devlop_gaming> In reply to @ajusa "depends on which OS": Yes
05:08:39FromDiscord<ajusa> See what the error prints out, if it says missing DLL then try downloading it from https://github.com/mmozeiko/build-sdl3/releases/tag/2025-04-06 and see if that works
05:08:51FromDiscord<ajusa> I remember doing that for SDL2 on windows a long time ago, I'm assuming it's the same for SDL3
05:09:16FromDiscord<ajusa> (edit) "https://play.nim-lang.org/#pasty=yiqcGFpT" => "https://play.nim-lang.org/#pasty=erJarkMb"
05:09:24FromDiscord<devlop_gaming> Same error
05:09:54FromDiscord<ajusa> In reply to @devlop_gaming "Same error": what's the error? Is it "cannot load DLL"?
05:10:06FromDiscord<devlop_gaming> Yes
05:10:57FromDiscord<ajusa> Weird, maybe someone else can help you. If you have the DLL in the same directory as the exe file everything _should_ work, not sure why it isn't for you
05:11:21FromDiscord<devlop_gaming> I di actually need the dll?
05:12:44FromDiscord<ajusa> In reply to @devlop_gaming "I di actually need": yeah
05:12:54FromDiscord<devlop_gaming> (edit) removed "di"
05:14:10FromDiscord<devlop_gaming> Now it's working
05:30:24*m5zs7k quit (Ping timeout: 245 seconds)
05:35:04*m5zs7k joined #nim
05:39:55FromDiscord<Elegantbeef> @ajusa what's the point of the tuple `[]` is only for static values so it's no different to `states.title.update`
05:46:09FromDiscord<Elegantbeef> @pmunch that falls under macros
05:46:40FromDiscord<Elegantbeef> https://github.com/beef331/nimtrest/blob/master/rickles.nim I also have this dumb thing but it requires annotating `mockit`
05:53:16FromDiscord<devlop_gaming> sent a code paste, see https://play.nim-lang.org/#pasty=INCiSGGF
05:53:36FromDiscord<devlop_gaming> I been trying to figure this out for nearly an hour now
05:53:57FromDiscord<Elegantbeef> `bool == 0` is not valid Nim
05:54:14FromDiscord<Elegantbeef> `while SdlPollEvent(ev)`
05:56:13FromDiscord<devlop_gaming> In reply to @Elegantbeef "`while SdlPollEvent(ev)`": Ok now i am getting this error↵↵ Error: not all cases are covered;
05:56:26FromDiscord<Elegantbeef> case statements are exhaustive
05:56:29FromDiscord<lainlaylie> you need to cover all cases
05:57:00FromDiscord<devlop_gaming> Is there a way around this?
05:57:11FromDiscord<Elegantbeef> Read the manual
05:57:45FromDiscord<lainlaylie> https://nim-lang.org/docs/manual.html#statements-and-expressions-case-statement
05:57:46FromDiscord<devlop_gaming> On what?
05:57:58FromDiscord<Elegantbeef> Really on everything
05:58:34FromDiscord<devlop_gaming> What you mean?
05:58:51FromDiscord<Elegantbeef> You should read the entire manual and tutorial to learn how Nim works
06:00:15FromDiscord<devlop_gaming> Bruh
06:02:35FromDiscord<lainlaylie> to solve your specific problem, read just the section i linked
06:02:50FromDiscord<lainlaylie> then, spend a day reading the manual. it's impossible to use nim effectively without knowing nim
06:02:58FromDiscord<devlop_gaming> I read it and solved it along with other issues
06:03:37FromDiscord<devlop_gaming> In reply to @lainlaylie "then, spend a day": I don't have a "day" i have less than 2 hours a day
06:03:51FromDiscord<lainlaylie> 2 hours is probably enough
06:05:51FromDiscord<devlop_gaming> I said less. Plus i'm only learning this bc of issues i faced with linux.
06:06:00FromDiscord<ajusa> In reply to @Elegantbeef "<@102899813149855744> what's the point": so the goal here was to dynamically switch between a "title" screen and a "game" screen, while avoiding OOP. I figured I'd use an enum to see which object should be called. VVVVV has a giant switch case, so I was wondering if I could avoid that by having some sort of mapping between an enum and objects
06:06:37FromDiscord<lainlaylie> ok, spend less than two hours a day for a couple days then...
06:07:08FromDiscord<Elegantbeef> right but [] is static
06:07:15FromDiscord<ajusa> And I see that after I changed it to use a variable, compilation does fail, as it cannot reason about it at compile time
06:07:19FromDiscord<ajusa> yep
06:07:35FromDiscord<devlop_gaming> In reply to @lainlaylie "ok, spend *less* than": If I have the time
06:07:54FromDiscord<Elegantbeef> i can show a way in a second that decouples it all
06:09:23FromDiscord<ajusa> sent a code paste, see https://play.nim-lang.org/#pasty=mTMCjegt
06:12:12FromDiscord<devlop_gaming> Nim is similar to python so how much experience would I even need in nim to be able to develop full applications?
06:14:08FromDiscord<lainlaylie> nim is not really similar to python in any meaningful way
06:15:46FromDiscord<Elegantbeef> @ajusa https://play.nim-lang.org/#pasty=spgELwlo
06:18:21FromDiscord<ajusa> using fieldPairs with a pragma is very smart
06:18:37FromDiscord<Elegantbeef> I heavily use it
06:18:47FromDiscord<Elegantbeef> You could of course do the same with just a tuple and define a `[]` that works with `int`
06:18:59*nils` joined #nim
06:19:09FromDiscord<ajusa> instead of static int? Yeah that's pretty much the same thing
06:19:28FromDiscord<ajusa> never would have come up with that on my own (well maybe the fieldPairs, but I haven't used pragmas like that at all). Thank you as always Beef!
06:19:48FromDiscord<Elegantbeef> No problem, especially for serialisation custom pragmas are nifty
06:19:58FromDiscord<devlop_gaming> In reply to @lainlaylie "nim is not really": Soo my previous experiences wouldn't work here?
06:24:12FromDiscord<pmunch> In reply to @devlop_gaming "I actually need the": What? Of course you need the DLL to load the DLL. Or did I misunderstand something? And it doesn't have to be in the same folder as the executable, but the program needs to know where to find it, and one of the default places to look is next to the executable.
06:24:40FromDiscord<pmunch> In reply to @Elegantbeef "<@392962235737047041> that falls under": There's not a single macro in that repo though 🤔
06:24:58FromDiscord<lainlaylie> In reply to @devlop_gaming "Soo my previous experiences": most programming concepts are transferable between languages
06:25:13FromDiscord<Elegantbeef> You're using a term rewriting macro
06:25:27FromDiscord<Elegantbeef> "But it's a template" Hey I didn't name it
06:26:05FromDiscord<Elegantbeef> > Term rewriting macros are macros or templates↵The manual agrees with me 😛
06:27:10FromDiscord<pmunch> Haha, I was hoping you wouldn't notice that 😛
06:27:35FromDiscord<pmunch> But as far as macro usage goes this is pretty mild
06:27:58FromDiscord<Elegantbeef> Right it's nothing like mine that is thunking generic procedures to allow explicit instantiation
06:28:42FromDiscord<devlop_gaming> In reply to @lainlaylie "most programming concepts are": So i shouldn't have trouble learning the basics then
06:29:14FromDiscord<pmunch> In reply to @devlop_gaming "Soo my previous experiences": Both yes and no. General programming experience will obviously help. But even though Nim looks like Python syntax-wise they are still quite dissimilar as you've already noticed. So if you go in with the attitude that you can just write Python and change a couple syntax things you might be in for a rough time.
06:31:50FromDiscord<lainlaylie> you can get pretty far with just the basics -- object types, procs, and so on -- which are just the stock standard procedural language stuff
06:32:07FromDiscord<devlop_gaming> In reply to @pmunch "Both yes and no.": Well apparently not that tough of a time. The only thing i rlly struggled with is setting up my event loop.
06:32:32FromDiscord<lainlaylie> as you get familiar with the basics you can start worrying about macros and things
06:32:46FromDiscord<lainlaylie> though what do i know, i learned nim too long ago to remember how i did it
07:15:25FromDiscord<mbekkomo> is there a fontconfig binding for Nim 2.x?
08:04:49FromDiscord<pmunch> Doesn't look like it
08:05:02FromDiscord<pmunch> There is a package for fontconfig, but it is 8 years since the last commit
08:05:16FromDiscord<pmunch> You could probably use Futhark to wrap it though
08:10:19*beholders_eye joined #nim
08:37:47*beholders_eye quit (Ping timeout: 268 seconds)
08:45:10FromDiscord<pmunch> @ElegantBeef, figured out my shader issue by the way. The missing link was `glGenerateMipmap(GL_TEXTURE_2D)`
08:58:15*beholders_eye joined #nim
09:12:57FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#pasty=xnyIvMaM
09:16:42FromDiscord<lainlaylie> https://nim-lang.org/docs/manual.html#procedures-command-invocation-syntax
09:16:51FromDiscord<lainlaylie> > This command invocation syntax also works for expressions, but then only a single argument may follow. This restriction means echo f 1, f 2 is parsed as echo(f(1), f(2)) and not as echo(f(1, f(2))).
09:17:56FromDiscord<heysokam> yea I know about that. but this case is not a function call
09:18:22FromDiscord<heysokam> an inner call, i mean↵it is not `thing.add call(), call()`, but `thing.add data, data`
09:20:08FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#pasty=NbZiHsPX
09:22:54FromDiscord<lainlaylie> hm
09:30:21FromDiscord<lainlaylie> yeah, something about the let statement doesnt like the bare comma being there
09:30:37FromDiscord<lainlaylie> though i have no idea what it's trying to parse it as, given that `let x = 1, y = 2` is not a thing
09:42:29*beholders_eye quit (Ping timeout: 245 seconds)
10:40:24*beholders_eye joined #nim
11:06:53*beholders_eye quit (Ping timeout: 244 seconds)
11:49:37*andreas_ quit (Read error: Connection reset by peer)
11:49:49*andreas_ joined #nim
11:50:36*beholders_eye joined #nim
11:59:31FromDiscord<janakali> sent a code paste, see https://play.nim-lang.org/#pasty=bbHxfazA
12:00:30FromDiscord<janakali> (edit) "https://play.nim-lang.org/#pasty=OGMDiuoX" => "https://play.nim-lang.org/#pasty=IEMUKjHi"
12:03:43*beholders_eye quit (Ping timeout: 244 seconds)
12:05:43FromDiscord<devlop_gaming> Is there a way to create methods for objects?
12:09:35FromDiscord<janakali> sent a code paste, see https://play.nim-lang.org/#pasty=mDYKUjmk
12:09:52FromDiscord<janakali> (edit) "https://play.nim-lang.org/#pasty=sxVidzlx" => "https://play.nim-lang.org/#pasty=xXlhZmgt"
12:10:04FromDiscord<devlop_gaming> I see
12:10:33FromDiscord<janakali> (edit) "https://play.nim-lang.org/#pasty=PSJkBrgN" => "https://play.nim-lang.org/#pasty=GGfQrkPA"
13:04:07*beholders_eye joined #nim
14:59:09*nils` quit (Ping timeout: 245 seconds)
15:34:09*beholders_eye quit (Ping timeout: 245 seconds)
15:48:16FromDiscord<fabric.input_output> In reply to @heysokam "if it helps: https://github.com/heysokam/glFB/blob/": yeah loadExtensions did the trick
15:48:33FromDiscord<fabric.input_output> In reply to @pmunch "Are your Nimble installed": oops no they weren't
15:51:28*disso-peach joined #nim
16:41:43FromDiscord<pmunch> In reply to @fabric.input_output "oops no they weren't": That'll do it
16:42:09FromDiscord<fabric.input_output> yeah
16:49:48*beholders_eye joined #nim
16:59:42*nils` joined #nim
17:03:45*coldfeet joined #nim
17:10:34*cornfeedhobo quit (Quit: ZNC - https://znc.in)
17:20:48*cornfeedhobo joined #nim
17:24:58*przmk joined #nim
17:29:08*przmk quit (Changing host)
17:29:08*przmk joined #nim
18:33:44*amadaluzia joined #nim
18:36:13*amadaluzia quit (Client Quit)
18:37:11*amadaluzia joined #nim
18:42:08*amadaluzia quit (Quit: Hi, this is Paul Allen. I'm being called away to London for a few days. Meredith, I'll call you when I get back. Hasta la vista, baby.)
18:43:27FromDiscord<nervecenter> sent a code paste, see https://play.nim-lang.org/#pasty=aSrjwYCl
18:43:37*amadaluzia joined #nim
19:11:14*coldfeet quit (Quit: Lost terminal)
19:12:28*om3ga quit (Read error: Connection reset by peer)
19:14:27*om3ga joined #nim
19:17:21*m5zs7k quit (Ping timeout: 252 seconds)
19:20:49*m5zs7k joined #nim
19:39:14*m5zs7k quit (Ping timeout: 265 seconds)
19:42:16*m5zs7k joined #nim
20:54:00*ntat quit (Quit: leaving)
21:21:25*amadaluzia_ joined #nim
21:21:25*amadaluzia quit (Ping timeout: 248 seconds)
22:59:56*andreas_ quit (Quit: Konversation terminated!)
23:00:08*andreas_ joined #nim
23:11:36*beholders_eye quit (Ping timeout: 268 seconds)
23:54:56FromDiscord<heysokam> In reply to @janakali "found this commit from": damn, you digged deep for that one 🙈 ty for the find