<< 25-07-2025 >>

00:02:58*dv^_^ quit (Quit: dv^_^)
00:04:30*dv^_^ joined #nim
00:59:09*beholders_eye quit (Ping timeout: 260 seconds)
02:03:06*tiorock joined #nim
02:03:06*tiorock quit (Changing host)
02:03:06*tiorock joined #nim
02:03:09*rockcavera is now known as Guest7773
02:03:09*tiorock is now known as rockcavera
02:06:28*Guest7773 quit (Ping timeout: 240 seconds)
02:07:58*rockcavera quit (Ping timeout: 240 seconds)
02:37:08*amadaluzia joined #nim
02:41:38*amadaluzia quit (Ping timeout: 245 seconds)
04:40:35FromDiscord<dev1lroot> How do you guys deal with variable/import collisions? whenever I import something that is similarily named like "game/player" which contains the class and methods of a player and then define var player = Player() is says that player is already defined and refers to the import line, so I have to choose whether my imports or variables will be readable, or name it "var p" instead of "var player" or use crutches like "import game/player as
04:42:13FromDiscord<leorize> add `s`
04:42:23FromDiscord<leorize> `import game/players` instead
04:42:26FromDiscord<leorize> stuff like that
04:43:34FromDiscord<dev1lroot> what if I then wish to make it multiplayer and I again I will have to list players in var? this isn't fixing the issue but creates an another crutch
04:44:11FromDiscord<dev1lroot> the same crutch if I name all the variables in hungarian notation to make it still look good but avoiding the collision
04:44:56FromDiscord<leorize> an another question is where are you defining these variables?
04:45:06FromDiscord<dev1lroot> https://media.discordapp.net/attachments/371759389889003532/1398164124382531595/image.png?ex=68845d4f&is=68830bcf&hm=b54e4f5ef4579b33728b15829cd397f5d88d68db3b81d2c6765e125270739c16&
04:45:06FromDiscord<leorize> if it's in a proc there should be no collisions
04:45:51FromDiscord<dev1lroot> it is outside of proc in order to make it accessible to anything
04:47:03FromDiscord<leorize> your player is in `proc` so there should be no collisions
04:47:15FromDiscord<dev1lroot> my "var screen" isnt :3
04:48:04FromDiscord<leorize> then either add a prefix or use a context object
04:48:59FromDiscord<leorize> a context object is basically an object that stores all of your globals, then pass that around instead of using an actual global variable
04:49:04FromDiscord<leorize> makes it a lot easier to test
04:49:50FromDiscord<Elegantbeef> It also makes it more reusable \:d
05:38:33*skippy8 joined #nim
06:25:24*amadaluzia joined #nim
07:05:17FromDiscord<jfaz> Is there a way to enforce a Concept? Say I define a type and I want to ensure it qualifies, is there any way to make it not compile unless it qualifies the Concept constraints?
07:20:05FromDiscord<Elegantbeef> `static: assert T is Concept`
07:22:37FromDiscord<jfaz> In reply to @Elegantbeef "`static: assert T is": Oh this works, thanks
07:53:35*ntat joined #nim
08:12:57*andy-turner joined #nim
09:04:33*andy-turner quit (Quit: Leaving)
09:31:25FromDiscord<alex911_._.> Hi
09:33:38*tokyovigilante quit (Ping timeout: 248 seconds)
09:37:33*tokyovigilante joined #nim
10:33:24*beholders_eye joined #nim
10:52:12FromDiscord<lainlaylie> hello zig user
11:07:28*beholders_eye quit (Ping timeout: 240 seconds)
11:12:04FromDiscord<kapendev> No need for name calling 😔😐🫢
12:05:35*redj joined #nim
14:01:46*beholders_eye joined #nim
14:45:09*beholders_eye quit (Ping timeout: 260 seconds)
16:10:11*przmk quit (Read error: Connection reset by peer)
16:10:25*przmk joined #nim
17:07:42FromDiscord<heysokam> If you had a C library that you have full control of, and wanted to create a nim-ified API using function overloads and other nim features... how would you map the C functions to Nim?↵I'm currently using futhark, but it doesn't really look very Nim because the C side uses a lot of c ideas↵I was thinking of using `inline` or `template` and wrap the functions manually, but I don't know if there is potentially a better way↵Does anyone
17:08:24FromDiscord<heysokam> (edit) "If you had a C library that you have full control of, and wanted to create a nim-ified API using function overloads and other nim features... how would you map the C functions to Nim?↵I'm currently using futhark, but it doesn't really look very Nim because the C side uses a lot of c ideas↵I was thinking of using `inline` or `template` and wrap the ... functions" added "futhark-generated"
17:19:58*beholders_eye joined #nim
17:30:42FromDiscord<leorize> map raw API, then write your high-level wrappers
17:46:13*beholders_eye quit (Ping timeout: 245 seconds)
17:51:31FromDiscord<jfaz> In reply to @heysokam "If you had a": I'm new to Nim but Futhark has worked great, I'd end up doing my own API over it anyways so I don't mind that they're c-style since there's (from what I can tell) negligible overhead. What library are you trying to wrap?
17:54:13FromDiscord<heysokam> @leorize I mean, of course. I'm asking about the "how" part of that "write your high-level wrapper" part
17:57:00FromDiscord<heysokam> In reply to @jfaz "I'm new to Nim": For me its not about the overhead, but about the ergonomics↵Nim has a ton of features that are very useful to work with↵(eg: default values, overloads, custom "operators", etc)↵I was just wondering if `inline`, `template`, `proc` or something else would be better, and maybe some thoughts on common niceties to convert C style to Nim style
17:57:50FromDiscord<leorize> map it based on how you'd use it
17:57:50FromDiscord<leorize> so getters, setters, destructors
17:57:51FromDiscord<Elegantbeef> Procedures and objects with destructors is what I do
17:57:51FromDiscord<leorize> all easy stuff to map
17:57:51FromDiscord<Elegantbeef> I don't even think about `inline` or `template` myself
17:57:52FromDiscord<Elegantbeef> Surely either the procedure I'm calling will be more work, if it's not my profiler will tell me
17:57:53FromDiscord<Elegantbeef> The goal of a high level wrapper is to remove any of the Cisms from the library you want to write Nim, not C inside Nim(though some will argue that's all there is)
17:58:05FromDiscord<heysokam> bridge woke up all at once, lol
18:00:52FromDiscord<heysokam> kk, ty leo & beef ✍️
18:41:10*beholders_eye joined #nim
19:50:06FromDiscord<049980.xyz> is there directx11/12 stuff for nim?
20:13:09*perro quit (Ping timeout: 260 seconds)
20:14:05*perro joined #nim
21:14:51*ntat quit (Quit: Leaving)
22:22:39*beholders_eye quit (Ping timeout: 260 seconds)
22:30:00*amadaluzia quit (Quit: ZNC 1.10.1 - https://znc.in)
23:04:38FromDiscord<heysokam> In reply to @049980.xyz "is there directx11/12 stuff": haven't seen any. but should be easy to wrap with `futhark`
23:26:13*redj quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
23:55:00FromDiscord<Elegantbeef> @heysokam MS normally uses C++ for their system APIs so good luck using futhark
23:55:27FromDiscord<heysokam> Ah, didn't know
23:55:57FromDiscord<heysokam> I saw some pure C example code, though. should be possible with whatever they used there 🤔
23:57:55FromDiscord<jfaz> In reply to @049980.xyz "is there directx11/12 stuff": Ye DirectX is C++. Why not use Vulkan if you're willing to go down to dx12?