<< 13-09-2023 >>

00:02:23*cnx joined #nim
00:14:00NimEventerNew Nimble package! worldtree - A small, lightweight ECS framework for Nim., see https://github.com/keithaustin/worldtree
00:37:32FromDiscord<sOkam! 🫐> In reply to @alendrik "<@251576885799026688> As a follow": +1. thats the best nim intro tutorial without a doubt
00:38:43FromDiscord<Elegantbeef> Damn yet another ECS that fails the pointer indirection test 😄
00:38:53FromDiscord<Elegantbeef> `Component = ref object of RootObj`
00:40:04FromDiscord<sOkam! 🫐> In reply to @Elegantbeef "Damn yet another ECS": that's that test about? 🤔
00:41:30FromDiscord<Langosta> In reply to @heysokam "that's that test about?": I think what it means is that in nim (if you're going to go the OOP route with inheritance), then your top level object needs to FIRST ref object of RootObj
00:41:40FromDiscord<Langosta> THEN, you can start your Object Oriented hierarchy
00:41:52FromDiscord<Langosta> But maybe I'm just not seeing something here
00:42:03FromDiscord<Langosta> Glad the ecosystem is growing nonetheless :)
00:48:07FromDiscord<Elegantbeef> One of the benefits of an ECS is not having pointer indirection and having fast iterations
00:48:25FromDiscord<Elegantbeef> it's all about cache coherency
00:49:17FromDiscord<Elegantbeef> Not to say you cannot make an ECS with a OOP component, you're just missing out on one of the easily got benefits of it
00:49:35*krux02_ quit (Remote host closed the connection)
00:51:58FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4GcW
00:52:08FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4GcX
00:52:24FromDiscord<Elegantbeef> And this is optimistic
00:52:55FromDiscord<Elegantbeef> The heap allocations should be contiguous since it's allocated all at once and without any other heap segmentation
00:55:14FromDiscord<Elegantbeef> But yea it doesnt really matter much, just always a litmus of how performant a given ECS might be
00:57:16FromDiscord<Langosta> What are the benefits of inheritance in this case that come at the cost of performance?
00:57:46FromDiscord<Elegantbeef> It's easier to write in Nim than the alternative
00:58:01FromDiscord<Elegantbeef> The alternative requires making your own TypeID system and manage your own data
00:58:35FromDiscord<Elegantbeef> https://github.com/beef331/nimtrest/blob/master/yeacs.nim is a simple ECS that uses struct of arrays and has no pointer indirection
00:58:46FromDiscord<Elegantbeef> There is also a minor benefit in that you can use any type as a component
00:59:02FromDiscord<Elegantbeef> Which means you can use a `bool` or any other primitive if you really really want
00:59:28FromDiscord<Elegantbeef> There isnt really anything wrong with using inheritance though, it's more the whole pointer indirection
01:00:12FromDiscord<Elegantbeef> It's not like you want to swap between a Cat and Dog component
01:01:09FromDiscord<Elegantbeef> Though I personally prefer the idea of using row typing and joining types over inheritance
01:01:19FromDiscord<Elegantbeef> An example of that lives here https://github.com/beef331/nimtrest/blob/master/rowed.nim#L91-L116
01:01:36FromDiscord<Elegantbeef> Here I am rambling again
01:02:10FromDiscord<Langosta> No, this is super cool. Thank you for sharing
01:02:52FromDiscord<Langosta> I've never even heard of row typing so it's very interesting to learn about these things
01:03:06FromDiscord<Langosta> This may be a dumb question, but are you actually a bot?
01:03:16FromDiscord<Elegantbeef> Sadly, nope
01:03:19FromDiscord<Langosta> you seem to be pulling from your own repo haha
01:03:25FromDiscord<Langosta> oh ok that makes sense
01:03:49FromDiscord<Langosta> how did you make it so discord recognizes you as one?
01:04:03FromDiscord<Elegantbeef> I use matrix to chat here
01:04:03FromDiscord<Elegantbeef> This server has a matrix and irc bridge setup
01:04:11FromDiscord<Elegantbeef> Which means I just chat using a matrix client here
01:04:41FromDiscord<Langosta> That is super neat
01:05:47FromDiscord<Elegantbeef> Back to the other conversation, row polymorphism is quite nifty. Instead of defining procedures to operate on specific types you specify them to operate on shapes
01:06:24FromDiscord<Elegantbeef> Which means if you have something like that `join` macro you can make types of other types, then you get access to other procedures
01:07:17FromDiscord<Langosta> So is it related to "prefer composition over inheritance" As in, you're making objects as composites of other objects?
01:07:41FromDiscord<Langosta> sorry, I'm relatively new to a lot of this. Thank you for your patience
01:08:48FromDiscord<Elegantbeef> Exactly
01:10:10FromDiscord<Elegantbeef> Instead of making a base type that you inherit from you just go "Any object of X shape can use this", when adding in the join macro this enables expanding types in something akin to inheritance but really with a flat hierarchy cause you cannot have type X be type Y at runtime as they're just 'struct's
01:11:06FromDiscord<Langosta> I see, you still gain the OOP functionality while sidestepping the performance and OOP hiearchy
01:11:17FromDiscord<Langosta> (edit) "I see, you still gain the OOP functionality while sidestepping the performance and OOP hiearchy ... " added "costs"
01:11:45FromDiscord<Elegantbeef> Well some OOP functionality
01:12:51FromDiscord<Langosta> I guess you still lose some stuff that comes with "is a"
01:12:57FromDiscord<Elegantbeef> You lose runtime dispatch and up/down casting
01:12:58FromDiscord<Elegantbeef> With `Entity -> Player` and `Entity -> Enemy` in an OOP world both can be inside `Entity` but with the row typed(unless you enable runtime row polymorphism, which is possible) you cannot store them in the same place
01:13:32FromDiscord<Elegantbeef> Yea you lose the relationship stuff
01:14:03FromDiscord<Langosta> oh I see. Any relationships need to be explicitly documented I guess.
01:14:25FromDiscord<Langosta> and as you said, are treated by the compiler differently
01:15:12FromDiscord<Elegantbeef> I do have some desire in enabling runtime row typing, but it's a lot more work than just the stuff I already have, one big issue with the row polymorphism in Nim is since `row tuple[x, y, z: int]` and `row tuple[x, y: int]` expand into a concept you cannot overload row procs with rows
01:16:00FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4Gda
01:16:11FromDiscord<Elegantbeef> But that just requires me to implement all of that, which is somewhat a hassle
01:17:31FromDiscord<saint._._.> How do I cast a cstring to an unsigned char
01:17:53FromDiscord<saint._._.> Like how do I do casting to other ctypes in my nim code
01:18:21FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4Gde
01:20:48FromDiscord<Langosta> In reply to @Elegantbeef "But that just requires": That's super interesting nonetheless
01:21:14FromDiscord<Langosta> I would love to help implement on my offtime when I ever get a better understanding of nim's inner workings
01:24:12FromDiscord<keithdaustin> I wrote that package, and to be honest with you, I didn't really know anything about pointer indirection, so thank you for the info! This is my first project in Nim, so currently it has a bunch of potential issues and plenty more stuff that can be improved, so any more info/suggestions I can get are greatly appreciated
01:24:17FromDiscord<saint._._.> sent a code paste, see https://play.nim-lang.org/#ix=4Gdh
01:24:26FromDiscord<Elegantbeef> Of course not
01:24:31FromDiscord<saint._._.> Okie
01:24:41FromDiscord<saint._._.> Also what is the difference if I put = object
01:24:43FromDiscord<saint._._.> Or = pointer
01:24:55FromDiscord<Elegantbeef> `pointer` is a void pointer
01:24:57FromDiscord<Elegantbeef> `object` is not
01:25:04FromDiscord<saint._._.> What is object
01:25:11FromDiscord<saint._._.> When I'm doing a importc type thing
01:25:23FromDiscord<saint._._.> `type lxb_char_t {.importc: "lxb_char_t" header: "./lexbor/core/types.h".} = object`
01:25:47FromDiscord<saint._._.> vs pointer for that
01:25:55FromDiscord<Elegantbeef> You wouldnt use `pointer`
01:26:28FromDiscord<Elegantbeef> you might do `{. ..., byref.} = object` if they use the type as an opaque pointer
01:26:28FromDiscord<saint._._.> Okay, also so say I declare that type as unsigned char
01:26:34FromDiscord<saint._._.> But when I create a cstring isn't it a char
01:26:45FromDiscord<saint._._.> And so how do I cast that to an unsigned char
01:26:48FromDiscord<Haze System (they/them)> sent a code paste, see https://play.nim-lang.org/#ix=4Gdk
01:27:00FromDiscord<Elegantbeef> 32bit Nim on 64bit OS
01:27:13FromDiscord<Elegantbeef> I mean the above should work afaik
01:27:27FromDiscord<Elegantbeef> but if it doesnt you can do `cast[ptr cuchar](myCstring)`
01:27:33FromDiscord<Elegantbeef> If the above works do not do that
01:27:42FromDiscord<saint._._.> right
01:27:47FromDiscord<saint._._.> Thanks i'll try that out
01:27:53FromDiscord<Elegantbeef> `cast` is a reinterpret cast and should only be used if you know what you're doing
01:28:12*cnx quit (Ping timeout: 240 seconds)
01:28:44FromDiscord<Haze System (they/them)> In reply to @Elegantbeef "32bit Nim on 64bit": oh i see. how do i install amd64 through choosenim? can i?
01:29:17FromDiscord<Elegantbeef> It should install 64bit on windows afaik
01:29:32FromDiscord<Elegantbeef> You also might have a 32bit mingw
01:30:19FromDiscord<Langosta> what C compiler do you have on windows
01:30:23FromDiscord<Langosta> or should that not matter?
01:30:35FromDiscord<Langosta> IT shouldn't unless you're building on win
01:30:39FromDiscord<Haze System (they/them)> choosenim should download the compiler automatically
01:30:39FromDiscord<Langosta> I think
01:30:44FromDiscord<Langosta> o
01:30:44FromDiscord<Elegantbeef> It needs to be 64bit if you're on 64bit windows
01:31:00FromDiscord<Haze System (they/them)> i do have mingw installed, at least 64bit, dunno about 32bit
01:31:08FromDiscord<Elegantbeef> Perhaps you have 2 mingws in your path and it's grabbing a 32bit
01:31:10FromDiscord<Haze System (they/them)> and 32bit yeh
01:31:16FromDiscord<Elegantbeef> you can always do `nim -v`
01:31:23FromDiscord<Haze System (they/them)> i didnt even know it uses mingw
01:31:41FromDiscord<Elegantbeef> Gcc is the default compiler where it can be
01:31:43FromDiscord<Elegantbeef> otherwise it's clang
01:31:48FromDiscord<Haze System (they/them)> ah
01:32:41FromDiscord<Langosta> is it possible to build your project on linux, and cross-compile to windows?
01:32:47FromDiscord<Elegantbeef> It is mingw exists
01:32:50FromDiscord<Langosta> with some when: wizardry
01:33:03FromDiscord<Haze System (they/them)> i dont even seem to have mingw on my path...
01:33:15FromDiscord<Elegantbeef> `-d:mingw` will compile to windows assuming you have mingw and the source supports it
01:33:23FromDiscord<Elegantbeef> Isnt it `gcc.exe`?
01:34:55FromDiscord<Haze System (they/them)> sent a code paste, see https://play.nim-lang.org/#ix=4Gdn
01:35:06FromDiscord<Haze System (they/them)> i am confused
01:35:43FromDiscord<Elegantbeef> `nim -v`?
01:36:10FromDiscord<Haze System (they/them)> sent a code paste, see https://play.nim-lang.org/#ix=4Gdo
01:36:13FromDiscord<Elegantbeef> that's 32bit nim
01:36:19FromDiscord<Haze System (they/them)> yes
01:36:20FromDiscord<Haze System (they/them)> idk why
01:36:59FromDiscord<saint._._.> Sorry I'm still confused, For `type lxb_char_t {.importc: "lxb_char_t" header: "./lexbor/core/types.h".} = object` say I don't really know what lxb_char_t actually is
01:37:14FromDiscord<saint._._.> How do I import that type? do I do = object, or something else
01:37:26FromDiscord<saint._._.> Like do I have to do what the base type is when I import something?
01:37:32FromDiscord<Elegantbeef> If you don't know the type how do you import it 😄
01:37:42FromDiscord<saint._._.> And if it's like some form of char then I use cstring?
01:37:55FromDiscord<saint._._.> In reply to @Elegantbeef "If you don't know": Well if I don't want to keep digging into what it is
01:38:00FromDiscord<Elegantbeef> You mainly need to get a binary representation that matches the C expected
01:38:16FromDiscord<saint._._.> Oh okay
01:38:23FromDiscord<saint._._.> So if it's a struct then I use object
01:38:35FromDiscord<saint._._.> And if it's some type of char I use cstring and some type of int I use int?
01:38:43FromDiscord<Elegantbeef> Yes
01:38:54FromDiscord<saint._._.> Gotcha
01:38:56FromDiscord<Elegantbeef> "some type of char" is not really right though
01:39:06FromDiscord<Elegantbeef> cstring is a `char` or equal
01:39:14FromDiscord<Elegantbeef> So `unsigned char` is the same binary representation
01:39:23FromDiscord<Elegantbeef> but `unsigned char` is of course not a cstring
01:45:01FromDiscord<saint._._.> Yeah
01:45:08FromDiscord<saint._._.> What is char then
01:45:13FromDiscord<saint._._.> In nim
01:45:24FromDiscord<saint._._.> Just char?
01:45:43FromDiscord<Elegantbeef> single byte distinct byte
01:52:15FromDiscord<saint._._.> Gotcha
01:52:22FromDiscord<saint._._.> Thank u @ElegantBeouf
01:59:17FromDiscord<Nelson> Small question, I'm using this library named Untar (https://github.com/dom96/untar) and I dont quite like how it uses static linking only for Windows
01:59:46FromDiscord<Nelson> I know exactly what to change to enforce static linking on all systems, but then if i change the source, there's no way i could tell nim to go on and treat a folder as a module
02:00:01FromDiscord<Nelson> so... what can i do? or better, what SHOULD i do?
02:00:15FromDiscord<Elegantbeef> You can fork it, or use zippy if it suffices
02:01:08FromDiscord<Nelson> zippy? does it support tar.gz?
02:01:11FromDiscord<Elegantbeef> I belive so
02:01:29FromDiscord<Elegantbeef> believe\
02:01:30FromDiscord<Nelson> cool, i will check it ouit
02:01:38FromDiscord<Nelson> hey this thing is cool as hell
02:01:45FromDiscord<Nelson> thanks
02:15:18*cnx joined #nim
03:07:00FromDiscord<breadpudding> My setpixel function is done :D https://media.discordapp.net/attachments/371759389889003532/1151353309618262096/image.png
03:07:11FromDiscord<huantian> pretty gradient
03:09:50FromDiscord<Elegantbeef> Are we OS yet?
03:10:37FromDiscord<breadpudding> Heh
03:10:57FromDiscord<breadpudding> I'm going from 0 to Shell pretty quickly
03:11:24FromDiscord<Elegantbeef> What's next font rendering? 😄
03:12:02FromDiscord<breadpudding> Since I'm writing a DOS, more than likely.
03:12:25FromDiscord<breadpudding> I was tempted to go straight to having a desktop environment but I need to keep it small.
03:12:58FromDiscord<Elegantbeef> Pixie could help in that front, but might have issues with how it loads fonts
03:13:47FromDiscord<breadpudding> I probably could have written this a bit neater but I was fighting the type system a bit: https://github.com/cbpudding/mapledos/blob/main/kernel/mapledos.nim#L20
03:16:36FromDiscord<Elegantbeef> I see a cast!
03:16:48FromDiscord<breadpudding> Maybe a few
03:18:01FromDiscord<huantian> your code looks like the example code someone would use in a video explaining guard clauses
03:18:03FromDiscord<huantian> 😛
03:18:17FromDiscord<breadpudding> I'm a C programmer and I've been writing Nim for less than a week.
03:18:40FromDiscord<breadpudding> I guess that's to be expected
03:18:44FromDiscord<huantian> hey please don't take it personally haha
03:19:13FromDiscord<breadpudding> There's some things I'm not proud of, but it works.
03:19:41FromDiscord<huantian> i just meant that in a tongue and cheeck way of saying you could reduce nesting in that main function if you invert the if condition and `return` early
03:21:04FromDiscord<huantian> sent a code paste, see https://play.nim-lang.org/#ix=4GdL
03:21:11FromDiscord<breadpudding> Fair enough
03:21:20FromDiscord<breadpudding> Maybe I'll do some cleanup
03:21:20FromDiscord<huantian> though i do know that not everyone subscribes to this kinda early return
03:21:26FromDiscord<huantian> so it's definitely a personal preference thin
03:21:28FromDiscord<huantian> (edit) "thin" => "thing"
03:21:38FromDiscord<breadpudding> It reduces the amount of indentation so I'll take it
03:22:03FromDiscord<breadpudding> I chose Nim for OS development because I wanted it to be something someone could sit down, take an afternoon, and understand the whole thing even if they haven't touched OSDev in their life.
03:22:25FromDiscord<breadpudding> Since Nim is very Python-like in its syntax, that helps.
03:34:05FromDiscord<Elegantbeef> Also worth noting a bad state generally should be the first enum field
03:35:39FromDiscord<breadpudding> Usually `0` is "success" in most cases right?
03:36:08FromDiscord<Elegantbeef> No clue the issue is that Nim zeros memory so if you accidently do not set a result you do not want it to silently look like it worked
03:36:20FromDiscord<breadpudding> Fair enough
03:37:21FromDiscord<huantian> In reply to @breadpudding "Usually `0` is "success"": you raise a good point here tho
03:37:40FromDiscord<huantian> i wonder why that'd be the case
03:37:53FromDiscord<breadpudding> Mostly legacy purposes
05:18:45NimEventerNew thread by Buckwheat: Nim and SSL issues on NetBSD 9.3, see https://forum.nim-lang.org/t/10475
05:52:15*advesperacit joined #nim
06:29:41*PMunch joined #nim
06:30:00FromDiscord<enthus1ast> In karax, how can i read data attributes in a callback?
06:30:19FromDiscord<enthus1ast> in js it should work like this mynode.dataset.foo
06:33:47FromDiscord<enthus1ast> ok it works like this\: `n.getAttr("data-dayreason")`
06:38:33FromDiscord<litlighilit> in a .nimble file,↵how to import a .nim file in /src
06:38:56FromDiscord<litlighilit> `import ./src/xx`↵↵doesn't work
06:39:34PMunch`import src/xx`
06:39:36FromDiscord<odexine> why do you want to import a nim file in your nimble file?
06:39:44PMunchor `import "./src/xx"`
06:40:14PMunchBut be aware that Nimble flattens the src folder, so this will likely fail after the module is installed
06:42:13FromDiscord<litlighilit> yeah, so I said it doesn't work↵(<@709044657232936960_=50=4dunch=5b=49=52=43=5d>)
06:44:21PMunchBut you didn't have the quotes..
06:49:59FromDiscord<litlighilit> Not still
06:51:00*cnx quit (Ping timeout: 240 seconds)
06:51:57PMunchWhat is the error you get?
06:53:46FromDiscord<litlighilit> Error\: cannot open file\: ./src/xx
06:54:22FromDiscord<litlighilit> It doesn't work because when installing, `xx` will not be contained in module's dir
06:55:22FromDiscord<litlighilit> I have tried adding `includeFiles = @["xx.nim"]` to .nimble
06:55:42FromDiscord<litlighilit> but it'll cause a warning
06:57:36FromDiscord<litlighilit> Okey↵I've been trapped in this for a long time↵But sorry that I have to leave for 3hr
07:02:44*cnx joined #nim
07:25:24FromDiscord<sOkam! 🫐> In reply to @litlighilit "I have tried adding": I had that issue myself when trying to be smart about extending the nimble buildsystem. That will only work while you are only local dev, and it will fail for every user of the lib↵Sadly, nimble does not understand this structure, and you need to have all of the nimble functionality contained in that same nimble file, or else it wont work after trying to use the library as a library
07:27:24FromDiscord<that_dude.> sent a code paste, see https://play.nim-lang.org/#ix=4Gep
07:32:18*rockcavera quit (Remote host closed the connection)
07:43:41*azimut joined #nim
08:26:11FromDiscord<Elegantbeef> @that_dude.\: not that I know of but it wouldnt be too hard to make an iterator
08:27:11FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4GeD
08:27:14FromDiscord<that_dude.> The main idea was to collect multiple iterators or things like that in general
08:31:35FromDiscord<Elegantbeef> There isnt a great way of writing that in Nim due to how badly iterators compose sadly
08:36:49FromDiscord<that_dude.> f
08:51:20FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4GeF
08:52:45FromDiscord<that_dude.> That's really cool
08:54:16FromDiscord<that_dude.> I tried peeking into the way `collect` was defined and realised I didn't understand macros well enough to try to understandit
08:56:22FromDiscord<Elegantbeef> Collect is much more complicated than it needs to be due to the whole "infer the collection we want"
08:57:39FromDiscord<that_dude.> sent a code paste, see https://play.nim-lang.org/#ix=4GeH
08:58:38FromDiscord<Elegantbeef> Eh
08:58:43FromDiscord<that_dude.> But my intuition says you would need to scan for `yield` idents and then rewrite each node/item? into it's own iterator where needed
08:59:28FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4GeI
08:59:47FromDiscord<that_dude.> Damn. I need to sleep lol
08:59:55FromDiscord<Elegantbeef> It's totally doable to do it your way, but yea you need to rewrite the entire tree
09:00:21FromDiscord<that_dude.> Which sounds way worse lol
09:01:05FromDiscord<Elegantbeef> Yea presently collect only has to rewrite the very last expression based off whether you use `{}` or `{a, b}` or `a`
09:02:40FromDiscord<Elegantbeef> One could technically make a `join` template so you can do `myIter.join(myOtherIter).join(otherIterator).collect`
09:03:10FromDiscord<Elegantbeef> I probably should add that to my itermacros stuff now that I say that
09:03:24FromDiscord<that_dude.> Ey I guess I'm useful?
09:52:28FromDiscord<nnsee> PMunch, a friend of mine wanted to use Nim for the first time yesterday to write an LD_PRELOAD stub to sniff ioctls (he's reverse engineering drivers), and primarily wanted to easily import C headers and pretty print the sniffed data - I pointed towards Futhark, but he seemed to have some issues with it
09:52:42FromDiscord<nnsee> oh, wait, I see he's already submitted an issue on github
09:54:40*arkanoid joined #nim
09:59:18PMunchAh yes, that's a strange issue. I thought Futhark already supported that
10:03:47NimEventerNew thread by Dabod: Is it possible to make enum + set[T] support bitmask style and size > uint16?, see https://forum.nim-lang.org/t/10476
10:08:48arkanoidchoosenim doesn't like new atlas tool. It doesn't make it available in .nimble/bin
10:09:04FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4GeS
10:10:53FromDiscord<ezquerra> In reply to @arkanoid "choosenim doesn't like new": Yes, that makes it harder to use than it should
10:11:43arkanoidI have not used it yet. I just wanted to try it out
10:12:17FromDiscord<sOkam! 🫐> What i've tried so far its pretty good. But its a big mindshift from nimble, for sure
10:17:21FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4GeT
10:17:53PMunchHuh?
10:18:28PMunchOh, there was a large code-snippet you referenced
10:18:35FromDiscord<sOkam! 🫐> ye
10:20:19FromDiscord<sOkam! 🫐> does nim coerce functions into pointers automatically, such that `LogCallback` is sent as `ptr LogCallback` or something? 🤔
10:25:49FromDiscord<odexine> In reply to @arkanoid "I have not used": hack is to `cd .nimble/bin` and `cp ./nim ./atlas` (the nim binaries are just shims that read the "app filename")
10:25:58FromDiscord<odexine> but yes, choosenim isnt updated to make a shim for atlas
10:29:08FromDiscord<sOkam! 🫐> In reply to @heysokam "does nim coerce functions": ah i found it. apparently its because of mapping `cstring` to a `const char`, since nim's cstring is actually a `char` not const
10:30:20FromDiscord<sOkam! 🫐> is there a way to explicitly generate a `const char` from nim code for binding an argument for C interop?
10:30:39PMunchcodegenDecl I believe is the only way
10:31:36PMunchhttps://github.com/nim-lang/Nim/issues/19588#issuecomment-1059960999
10:32:02PMunchApparently importc can be used like that as well
10:32:21FromDiscord<sOkam! 🫐> ty pmunch 🙏
10:41:16FromDiscord<jmgomez> In reply to @PMunch "https://github.com/nim-lang/Nim/issues/19588#issuec": Im on my phone now (will make sure to update the issue) once I get back home) but there is a much nicer solution for c++ using member to produce functors https://nim-lang.github.io/Nim/manual_experimental.html#member-pragma↵See the last example (in nue I have a functor macro that produces it from any proc)
10:41:39FromDiscord<jmgomez> (edit) "home)" => "home"
10:52:43FromDiscord<nnsee> In reply to @odexine "hack is to `cd": surely a symlink would be better here
10:53:10FromDiscord<nnsee> so atlas gets "automatically updated" whenever the nim binary is updated
10:53:11FromDiscord<odexine> symlinks arent used for reasons i am unsure of
10:53:21FromDiscord<nnsee> that's odd
10:53:22PMunchWindows doesn't have them
10:53:22FromDiscord<odexine> wait, what do you mean exactly
10:53:26FromDiscord<odexine> oh
10:53:31FromDiscord<nnsee> it's literally the whole premise of busybox for example
10:53:44FromDiscord<odexine> nimble DOES symlink bins installed by packages though so i have no idea
10:53:53FromDiscord<nnsee> In reply to @PMunch "Windows doesn't have them": wait, really? lol
10:54:00PMunchApparently
10:54:01FromDiscord<ezquerra> Windows has junctions thare pretty similar to symlinks
10:54:04FromDiscord<odexine> windows does have symlinks iirc
10:54:12PMunchOr it doesn't allow execution of links or something
10:54:14FromDiscord<ezquerra> (edit) "thare" => "which are"
10:54:17FromDiscord<odexine> really
10:54:33PMunchI just remember that Windows is the reason why they aren't simply links
10:55:08FromDiscord<ezquerra> In anycase, whatever choosenim is doing for the nim and nimble executables, it should do the same for atlas
10:55:13FromDiscord<ezquerra> (edit) "anycase," => "any case,"
10:57:23FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4Gf2
11:08:00FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=4Gf6
11:12:49FromDiscord<sOkam! 🫐> In reply to @jmgomez "exportc should work": Im importing them 🤔
11:13:44FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4Gf7
11:28:30*jmdaemon quit (Ping timeout: 252 seconds)
11:42:36NimEventerNew thread by cmc: Improving Examples and Documentation, see https://forum.nim-lang.org/t/10477
11:57:17arkanoidwith nim 2.0.0, is it still suggested to use nim's asyncdispatch, or move to chronos?
12:05:59FromDiscord<odexine> @ehmry i apologise if you do not like being mention-notified, but i'd like to ask about how you generally set up your nix devShells when you have nimble dependencies; i only know how to specify them as buildInputs...
12:42:51*xet7 quit (Remote host closed the connection)
12:48:17FromDiscord<taperfade> what is async
12:48:22FromDiscord<taperfade> what does it mean
12:50:07FromDiscord<odexine> it means that the function is asynchronous, further means that the function "can suspend execution" as in stop midway at specified points
12:50:22FromDiscord<odexine> it's a bit hard to distill the meaning into a short explainer for a beginner
12:55:35*via quit (Server closed connection)
12:55:42*via joined #nim
13:32:41arkanoidwhat's the correct way to avoid an async program to terminate if an exception is raised inside an async proc?
13:33:17arkanoidI have rolled my own solution, but I don't know if it is the right way or I am reinventing the wheel
13:34:17FromDiscord<Chronos [She/Her]> Likely to catch simply catch the error
13:35:03FromDiscord<Chronos [She/Her]> (edit) removed "catch"
13:36:36arkanoidChronos, how?
13:39:00FromDiscord<Chronos [She/Her]> Afaik surrounding asyncCheck with try and except (or await, depends if you want the result obviously)
13:39:10FromDiscord<Chronos [She/Her]> Or even waitFor but you know that and I'm being redundant right now haha
13:40:09arkanoidChronos, no, it doest
13:40:30*rockcavera joined #nim
13:40:46FromDiscord<Chronos [She/Her]> It doesn't? Huh...
13:41:07FromDiscord<Chronos [She/Her]> I actually didn't know that, then the only way is probably to handle it within your code itself then
13:41:08FromDiscord<odexine> it doesnt what?
13:41:20FromDiscord<leorize> make your entry point async and you can `try`-`except` with it
13:41:25FromDiscord<Chronos [She/Her]> I'd assume they mean it doesn't catch the errors
13:41:25FromDiscord<odexine> only await/waitfor will allow for try-except catching iirc
13:41:37FromDiscord<odexine> asyncCheck doesnt do try-except
13:41:57FromDiscord<Chronos [She/Her]> Huh I swore asyncCheck said it'd let you check for errors and stuff... I'm just an idiot then sorry aha
13:42:03FromDiscord<odexine> with asynccheck you'd have to attach the error handling as a callback
13:42:24FromDiscord<odexine> asyncCheck only attaches an error handler that rethrows on await/waitFor iirc
13:42:28FromDiscord<leorize> asyncCheck never made sense to me tbh
13:42:40FromDiscord<odexine> asyncCheck is a strange name for what it really does
13:42:56arkanoidfor example, this program terminates instead of catching the exception https://play.nim-lang.org/#ix=4GfZ
13:45:57FromDiscord<odexine> the runforever is what should have the try except iirc
13:46:05arkanoidI do understand that the exception lives in the dispatcher and not in the sync code, and I could poll or await the future and exctract the error, but my question is about how (if?) to solve this problem using library function already provided by asyncdispatch
13:48:25arkanoidI can confirm that wrapping runForever does work, and the program does not terminate https://play.nim-lang.org/#ix=4Gg3 thanks!
13:51:27arkanoidso basically asynccheck is mostly useful only if wrapping runForever or waitFor. This is not quite clear from the documentation
13:52:08arkanoidconsidering how Nim is attractive for python developers, I'm also quite surprised how async in Nim works more similar to javascript async than python async
13:52:15FromDiscord<leorize> https://play.nim-lang.org/#ix=4Gg5 \<- try this
13:52:59arkanoidleorize, that is quite similar to what I've already created on my own
13:53:01FromDiscord<leorize> asyncCheck is basically that callback I wrote but raise afterwards
13:53:51arkanoidleorize this is what I am using right now https://play.nim-lang.org/#ix=4Gg5
13:54:20FromDiscord<leorize> you need to share again cuz that's my link \:p
13:54:28arkanoidups, sorry
13:54:38arkanoidhttps://play.nim-lang.org/#ix=4Gg8
13:55:43arkanoidbut I kinda find more elegant to address the error wherever I need on the stacktrace, and not where it could be raised
13:56:32arkanoidso it's ok to wrap runForever as a catch-all solution to avoid program termination
13:56:34FromDiscord<leorize> I'd say the dispatcher leak is more or less an implementation detail and it's more reliable to attack the source
13:56:59arkanoiddispatcher leak?
13:58:06FromDiscord<leorize> unhandled exceptions leaking via dispatcher
13:59:57arkanoidok, but what do you mean also by "attacking the source"?
14:02:00FromDiscord<taperfade> yooooooooo https://media.discordapp.net/attachments/371759389889003532/1151518143399862282/image.png
14:02:44FromDiscord<taperfade> reading the docs actually helps no way
14:03:01FromDiscord<taperfade> time to make another weird thing to put on my github
14:27:29*advesperacit quit ()
14:28:12*PMunch quit (Quit: Leaving)
14:43:40FromDiscord<toma400> In reply to @taperfade "reading the docs actually": Oh yeah, docs are ultimately my favourite place to search info for (at least if they are well written 🥰)↵Out of curiosity, what lib do you use for that? ^^
14:56:15FromDiscord<taperfade> winim
15:11:32FromDiscord<Phil> In reply to @taperfade "yooooooooo": Neat! Now add a button to that will create a file with a random piece of text inside if you click it as a first small exercise 😄
15:19:05NimEventerNew thread by aiac: How to compare rune with char ?, see https://forum.nim-lang.org/t/10478
15:24:07NimEventerNew thread by aiac: How to compare rune with char?, see https://forum.nim-lang.org/t/10479
15:24:23FromDiscord<Mike> Hey are there any good solutions for http auth that anyone knows about? I've been playing with nim-httpauth but it seems pretty dead\: https://github.com/FedericoCeratto/nim-httpauth/tree/master/tests
15:31:12NimEventerNew thread by aiac: How to compare rune with char, see https://forum.nim-lang.org/t/10480
15:42:40*xmachina quit (Quit: WeeChat 4.0.4)
15:52:04*ntat joined #nim
15:59:41emeryodexine: I don't have a good dev-shell solution, I have my nim dependencies as submodules in a personal monorepo and a hacky build-system over it all
16:00:22emerysome deps are not submodules but the build system creates symlinks from the nix packages instead
16:00:23FromDiscord<odexine> okay, thanks for replying
16:00:34*junaid_ joined #nim
16:00:59emeryI use --path:… everwhere to specify deps
16:01:11FromDiscord<odexine> hoh? how does that function? (you can just link one of your repos that do that and ill read it if you dont mind)
16:08:01FromDiscord<pixel_nerd_linux> sent a long message, see http://ix.io/4GgR
16:08:35FromDiscord<leorize> you can try concepts
16:09:08FromDiscord<leorize> but if you want runtime interface then design similar to that module is a simple way to get it done
16:11:43FromDiscord<Phil> sent a long message, see http://ix.io/4GgS
16:11:49emeryodexine: I don't have a public example of it, but its a build system with a lot of "NIM_FLAGS += --path:../../foo"
16:11:55FromDiscord<Phil> (edit) "http://ix.io/4GgS" => "https://paste.rs/ZKB3x"
16:12:11FromDiscord<odexine> sounds funky
16:12:27FromDiscord<odexine> also kinda sounds just like what atlas does
16:12:35FromDiscord<odexine> thanks for replying again
16:12:44FromDiscord<Phil> Here links to the feature:↵https://nim-lang.org/docs/manual_experimental.html#concepts↵Note that while concepts are in the experimental section, they've been around for a bit and at least beef used it successfully already afaik
16:13:05FromDiscord<taperfade> winim docs are awful
16:13:20FromDiscord<taperfade> idk what to do ugh
16:17:51FromDiscord<toma400> In reply to @taperfade "winim": Dang, the best library that seem to never get out of Windows. Nice work tho ❤️
16:18:50FromDiscord<toma400> In reply to @taperfade "winim docs are awful": Tbh, I'd suggest you to read source code. Nim is quite the best language for learning out of code written by people. If you know how procedure structure works, a lot of things is understandable at first glance
16:19:10FromDiscord<toma400> I learned Nigui entirely from reading its `nigui.nim` file, no documentation reading at all
16:19:38FromDiscord<toma400> Obviously it's not as easy in every case, but it's good workaround if docs are bad/lacking
16:20:45FromDiscord<toma400> ---↵Also, asking a bit more broadly, but in general if you think about GUI library, what features are three most important UI elements you think of? (the most used/needed)
16:20:52FromDiscord<toma400> (edit) "broadly," => "broadly to everyone here,"
16:21:02FromDiscord<toma400> (edit) "---↵Also, asking a bit more broadly to everyone here, but in general if you think about GUI library, what ... features" added "three" | removed "three"
16:21:04FromDiscord<pixel_nerd_linux> In reply to @isofruit "Here links to the": Thanks, I'll look into it. Will that feature change much in the future or is it "kind of" stable ?↵Also I'm using Nim 1.6, do concepts work with 1.6 ?↵By the way how often are people in the Nim community updating ? Is everyone using Nim 2.0 by now ?↵I may start with the std/streams approach and later move to concepts.
16:22:30FromDiscord<Phil> sent a long message, see http://ix.io/4GgT
16:22:42FromDiscord<Phil> Note that the difference between 1.6 and 2.0 is not gargantuan
16:22:45FromDiscord<toma400> In reply to @pixel_nerd_linux "Thanks, I'll look into": I was trying to stay on 1.6.12 for longer, but since glFB/NGLFW was required to have 2.0, I switched quite early. I don't regret, this decision changed my life a bit ❤️
16:23:22FromDiscord<Phil> For the most part it's "db_connection libs now went from std to a db_connector package"
16:24:11FromDiscord<Phil> The rest is more under the hood stuff, bugfixes and mostly just transparent changes to you, nothing wild.↵Upgrading to make sure a package works on both versions is fairly simple most of the time.
16:26:15FromDiscord<pixel_nerd_linux> In reply to @isofruit "For the most part": Nice, thanks! The change log isn't that big, so I likely make the switch to 2.0
16:29:25FromDiscord<enthus1ast> Read the ms docs for their api↵(@taperfade)
16:29:50FromDiscord<enthus1ast> It's mostly just a wrapper
16:31:31FromDiscord<enthus1ast> On msdn
16:36:31FromDiscord<enthus1ast> and its a pretty good wrapper to be honest \:)
16:38:16*xmachina joined #nim
16:42:25*m5zs7k joined #nim
16:52:39FromDiscord<keithdaustin> sent a long message, see http://ix.io/4Gh1
16:53:32FromDiscord<toma400> sent a long message, see https://paste.rs/uitg6
16:54:29FromDiscord<toma400> In a way Nimfire I'm working on is trying to be "GUI-driven PyGame", but heck, I doubt it will get as far to be even comparable with those GUI libs here, and even if, it's a long way to go ;-; definitely not suitable for making some software in the time being
16:55:25FromDiscord<toma400> I guess Fidget is closest to ideal right now, but gosh, it has so confusing structure/docs somehow. It feels very simple at first glance, but I'm always lost reading its code
16:55:34FromDiscord<m4ul3r> In reply to @taperfade "winim docs are awful": Winim is just a wrapper, the real docs are the msdn
16:56:17FromDiscord<m4ul3r> What enthus1ast said
16:56:49FromDiscord<inv2004> Hi, how can I add condition for `requires` in nimble file ?
16:56:55FromDiscord<enthus1ast> @toma400\: uhh i think you mean wnim?
16:57:04FromDiscord<inv2004> sent a code paste, see https://paste.rs/1Ss9o
16:57:43FromDiscord<enthus1ast> @toma400\: wnim \:= gui library ; winim \:= win api wrapper
16:58:17FromDiscord<toma400> In reply to @enthus1ast "<@656540400546480128>\: uhh i think": That one, sorry 😅 always messing those up since wnim is based on winim iirc
16:58:52FromDiscord<enthus1ast> i actually found the docs good enough
17:09:35*xmachina quit (Quit: WeeChat 4.0.4)
17:10:05*jkl joined #nim
17:11:11*xmachina joined #nim
17:18:33NimEventerNew thread by knoah: Program "Walk Through" Capability, see https://forum.nim-lang.org/t/10481
17:22:43*jmdaemon joined #nim
17:33:03*xmachina quit (Quit: WeeChat 4.0.4)
17:37:06*rockcavera quit (Read error: Connection reset by peer)
17:37:32*rockcavera joined #nim
17:37:32*rockcavera quit (Changing host)
17:37:32*rockcavera joined #nim
17:47:43*xmachina joined #nim
18:05:52FromDiscord<kingterrytheterrible12> is there gtk4 bindings for nim
18:07:04FromDiscord<Phil> owlkettle
18:07:13FromDiscord<kingterrytheterrible12> In reply to @isofruit "owlkettle": no
18:07:15FromDiscord<kingterrytheterrible12> it memory leaks
18:07:38FromDiscord<Phil> Fix the memory leaks 😛
18:09:39FromDiscord<kingterrytheterrible12> In reply to @isofruit "Fix the memory leaks": no
18:09:39FromDiscord<Phil> Also if Faisal is your github user then please for the love of god adopt better etiquette
18:09:46FromDiscord<kingterrytheterrible12> In reply to @isofruit "Also if Faisal is": yes
18:10:08FromDiscord<kingterrytheterrible12> all i said was "bro fix it" and he started crying
18:12:27FromDiscord<m4ul3r> Well don’t just say “bro fix it” and offer something constructive rather than junk <:joy_think:1119766500413284482>
18:12:35FromDiscord<kingterrytheterrible12> In reply to @m4ul3r "Well don’t just say": i did
18:12:46FromDiscord<kingterrytheterrible12> if you would actually read
18:12:51FromDiscord<kingterrytheterrible12> https://github.com/can-lehmann/owlkettle/issues/73
18:12:52FromDiscord<Phil> In reply to @kingterrytheterrible12 "all i said was": 1) You made a demand. Can.l doesn't owe you shit. In fact, no OSS dev does, so you literally do not get to have that attitude. The guy has time to allocate and that kind of comment literally just makes you not want to work on it.↵2) How is that any kind of not douchebag response when all he did was point out where the issue is for now
18:13:07FromDiscord<Phil> (edit) "In reply to @kingterrytheterrible12 "all i said was": 1) You made a demand. Can.l doesn't owe you shit. In fact, no OSS dev does, so you literally do not get to have that attitude. The guy has ... time" added "sparse"
18:13:16FromDiscord<kingterrytheterrible12> In reply to @isofruit "1) You made a": fuck i'll make my own bindings
18:13:41FromDiscord<kingterrytheterrible12> you really ship a memory leaky bullshit then you ask me about my attitude
18:13:46FromDiscord<kingterrytheterrible12> yeah no
18:14:02FromDiscord<nnsee> did you pay for it?
18:14:09FromDiscord<kingterrytheterrible12> In reply to @nnsee "did you pay for": no
18:14:09FromDiscord<nnsee> this guy is working on this for free
18:14:15FromDiscord<nnsee> you are NOT entitled to that attitude
18:14:18FromDiscord<kingterrytheterrible12> free for FREEDOM
18:14:28FromDiscord<Phil> In reply to @kingterrytheterrible12 "you really ship a": Absolutely.
18:14:41FromDiscord<kingterrytheterrible12> anyways its licensed on MIT im just gonna fork it or make my own GTK bindings
18:15:28FromDiscord<can.l> In reply to @kingterrytheterrible12 "anyways its licensed on": If you fork it and fix the leaks, why not contribute back? Then everybody else can also benefit from your improvements 😄
18:15:58FromDiscord<kingterrytheterrible12> In reply to @can.l "If you fork it": probably not
18:16:16FromDiscord<nnsee> on that parasite grindset
18:16:43FromDiscord<kingterrytheterrible12> its a shame since i like the idea of owlkettle
18:16:52FromDiscord<kingterrytheterrible12> but the bugs i get is too much
18:18:22FromDiscord<can.l> In reply to @kingterrytheterrible12 "but the bugs i": Which bugs did you encounter thusfar? As far as I am aware, the only thing you saw is the thing you opened an issue about, but as I previously stated on GitHub the behaviour you saw is to be expected and not an issue.
18:18:28FromDiscord<m4ul3r> The author pretty much told you it’s expected from the gtk library
18:18:41FromDiscord<kingterrytheterrible12> In reply to @can.l "Which bugs did you": clone libre-pathadder and see for yourself
18:18:54FromDiscord<kingterrytheterrible12> the dialog pop up shakes a bit then goes to normal
18:19:07FromDiscord<nnsee> user error
18:27:21FromDiscord<Phil> Troubleshooting video:↵I'm having trouble identifying said shaking.↵As documented I simply ran make setup, make release and then ran the binary https://media.discordapp.net/attachments/371759389889003532/1151584924214759564/Screencast_from_2023-09-13_20-25-30.webm
18:27:26FromDiscord<m4ul3r> @kingterrytheterrible12 you have bugs in your own code? Would you like constructive feedback to fix it or just someone to say “bro fix it”
18:29:03FromDiscord<Phil> The worst I can say is that it doesn't respect my dark theme on the desktop but I assume that requires some extra bits and bobs
18:29:13FromDiscord<Phil> (edit) "The worst I can say is that it doesn't respect my dark theme on the desktop but I assume that requires some extra bits and bobs ... " added "for setup"
18:30:33FromDiscord<kingterrytheterrible12> In reply to @isofruit "Troubleshooting video: I'm having": how to record screen
18:30:39FromDiscord<Phil> You on Linux and gnome?
18:30:43FromDiscord<kingterrytheterrible12> yes
18:30:47FromDiscord<kingterrytheterrible12> cinnamon
18:30:50FromDiscord<m4ul3r> obs is a way
18:30:59FromDiscord<Phil> Errrr no clue on cinnamon
18:31:11FromDiscord<Phil> Gnome comes bundled with piece of software, maybe they share the hotkey?
18:31:16FromDiscord<kingterrytheterrible12> give gnome app it working same way
18:31:19FromDiscord<Phil> CTRL SHIFT ALT R
18:31:45FromDiscord<kingterrytheterrible12> ye bro it no work
18:31:50FromDiscord<kingterrytheterrible12> i figure out a way
18:35:33FromDiscord<kingterrytheterrible12> yeah its not visiable on camera
18:35:44FromDiscord<kingterrytheterrible12> but its very clear when you see it with your eyes
18:36:15FromDiscord<m4ul3r> Doesn't sound like an error with the library, probably a graphics issue then
18:36:43FromDiscord<Phil> I tend to not notice details like that and I am admittedly not particularly perceptive.↵Should I be looking for left-right shaking? up-down? all directions?
18:37:02FromDiscord<kingterrytheterrible12> left to right sideway
18:37:28FromDiscord<kingterrytheterrible12> this direction https://media.discordapp.net/attachments/371759389889003532/1151587468391485531/image.png
18:37:31FromDiscord<Phil> And when the window opens or when the popup shows up after clicking the button?
18:37:40FromDiscord<kingterrytheterrible12> In reply to @isofruit "And when the window": pop up
18:37:44FromDiscord<kingterrytheterrible12> dialog
18:38:10FromDiscord<toma400> In reply to @kingterrytheterrible12 "its a shame since": Imagine you will make your own GTK bindings, someone will comment about leaks/bugs and you will respond you have no time, then this guy will fork it instead of PRing... the cycle goes on, and yet every GTK binding will have issues that owner has not enough time to resolve
18:38:17FromDiscord<Phil> You on nvidia, AMD or an intel iGPU?
18:38:23FromDiscord<kingterrytheterrible12> In reply to @toma400 "Imagine you will make": xd
18:38:26FromDiscord<kingterrytheterrible12> In reply to @isofruit "You on nvidia, AMD": nvidia
18:38:33FromDiscord<Phil> X11 or wayland?
18:38:37FromDiscord<kingterrytheterrible12> X11
18:38:43FromDiscord<sulfasolate> what are people using for http webservers?
18:38:49FromDiscord<Phil> Hmmmm okay let me see on X11 if I get it there
18:38:50FromDiscord<kingterrytheterrible12> In reply to @sulfasolate "what are people using": mummy
18:39:07FromDiscord<Phil> In reply to @sulfasolate "what are people using": Httpx, which is an httpbeast fork
18:39:11FromDiscord<kingterrytheterrible12> yeah now that i think about it
18:39:14FromDiscord<Phil> (edit) "In reply to @sulfasolate "what are people using": Httpx, which is an httpbeast fork ... " added "and is used by prologue"
18:39:17FromDiscord<inv2004> how to get 1000 stars on github nim project?
18:39:24FromDiscord<Phil> Okay I don''t get it on wayland with an intel iGPU, let me check on X11
18:39:28FromDiscord<inv2004> (edit) "how to get 1000 stars on github nim project? ... " added "- I think that everyone needs it 🙂"
18:39:32FromDiscord<kingterrytheterrible12> i'm sorry for being rude @can.l, i will try to help fix the bugs in the project
18:39:50FromDiscord<sulfasolate> thanks phil
18:39:58FromDiscord<can.l> In reply to @kingterrytheterrible12 "i'm sorry for being": That is appreciated.
18:40:28FromDiscord<kingterrytheterrible12> In reply to @isofruit "Okay I don''t get": BTW i hope to god you borked my program before running it or your gonna have too much bullshit in path
18:40:59FromDiscord<inv2004> (edit) removed "🙂"
18:41:04FromDiscord<Phil> In reply to @kingterrytheterrible12 "BTW i hope to": I use zsh so I really don't care what's in bashrc
18:41:08FromDiscord<inv2004> (edit) removed "that"
18:41:10FromDiscord<kingterrytheterrible12> alright
18:41:11FromDiscord<Phil> I can manually delete the contents in there anyway
18:41:54FromDiscord<Phil> Wow X11 is the opposite of smooth, I really only notice that contrast atm coming from wayland
18:42:52FromDiscord<kingterrytheterrible12> In reply to @isofruit "*Wow* X11 is the": i am nvidia slave
18:43:00FromDiscord<kingterrytheterrible12> wayland dont work
18:44:04FromDiscord<Phil> Okay I can't replicate anything that looks like a shaking on X11 either.↵And I've got my face near glued to the screen, so 🤷 ↵I am tempted to claim its an nvidia issue but without more sample size that's cheap talk from my end
18:44:14FromDiscord<Phil> And yeah I can understand that pain
18:44:35FromDiscord<Phil> My desktop and work machine also both run nvidia stuff =/
18:45:14FromDiscord<kingterrytheterrible12> hm im not sure if its just a very cinnamon spesific issue or what
18:45:17FromDiscord<kingterrytheterrible12> (edit) "spesific" => "specific"
18:45:46FromDiscord<Phil> I mean maybe we got different gtk4 versions? Library version mismatch is another possible source... no wait we're both on arch
18:46:33FromDiscord<kingterrytheterrible12> In reply to @isofruit "I mean maybe we": ubuntu/mint
18:46:38FromDiscord<Phil> Ohhhhhhhh
18:46:49FromDiscord<Phil> Then that could actually be a thing, let me check if there's a cli command on arch
18:46:58FromDiscord<Phil> https://askubuntu.com/questions/78377/is-there-a-way-to-know-which-gtk-version-is-installed-using-the-command-line↵Here's some for you
18:47:18FromDiscord<kingterrytheterrible12> `libgtk-4-dev`
18:47:26FromDiscord<nnsee> the application also works fine here with no shaking
18:47:37FromDiscord<nnsee> it's an issue with your system
18:47:54FromDiscord<kingterrytheterrible12> sent a code paste, see https://play.nim-lang.org/#ix=4GhN
18:48:01FromDiscord<kingterrytheterrible12> 4.6.9 nice
18:49:43FromDiscord<Phil> Hmm I'm on 4.12.1
18:49:50FromDiscord<nnsee> same
18:50:02FromDiscord<kingterrytheterrible12> its the non rolling release experince
18:50:03FromDiscord<Phil> I still wouldn't immediately jump to blaming the GPU
18:50:20FromDiscord<kingterrytheterrible12> im stuck with bugs for another 6 months
18:50:23FromDiscord<Phil> Is there a way for you to update your libgtk-4 version?
18:50:23FromDiscord<nnsee> you're not running on some high refresh rate with no waiting for vblank or anything?
18:50:32FromDiscord<kingterrytheterrible12> In reply to @nnsee "you're not running on": is 75hz high?
18:50:43FromDiscord<Phil> Not quite
18:50:57FromDiscord<nnsee> not particularly, but it would explain why it doesn't show up in a recording
18:51:02FromDiscord<Phil> Well it's higher than what I have, 60HZ on my end
18:51:10FromDiscord<Phil> (edit) "60HZ" => "60Ht"
18:51:13FromDiscord<Phil> (edit) "60Ht" => "60Hz"
18:51:17FromDiscord<nnsee> (assuming it records at 60, which is the default everywhere)
18:51:28FromDiscord<Phil> https://media.discordapp.net/attachments/371759389889003532/1151590991757856848/image.png
18:51:55FromDiscord<Phil> Can you select a 60Hz refresh rate?
18:51:59FromDiscord<nnsee> well that's quite an esoteric resolution
18:52:04FromDiscord<nnsee> is this a VM or something?
18:52:07FromDiscord<Phil> In reply to @nnsee "well that's quite an": Framework
18:52:09FromDiscord<Phil> (edit) "In reply to @nnsee "well that's quite an": Framework ... " added "laptop"
18:52:12FromDiscord<nnsee> ah
18:52:20FromDiscord<Phil> 13 inch model, comes with a 3:2 ratio that leads to this resolution
18:52:27FromDiscord<kingterrytheterrible12> anyways i sleep i have work tomorrow
18:52:37FromDiscord<kingterrytheterrible12> i will try to fix owlkettle after work tomorrow
18:52:40FromDiscord<Phil> Alrighty, sleep tight!
18:52:47FromDiscord<nnsee> night
18:52:47FromDiscord<kingterrytheterrible12> thanks!
18:54:09FromDiscord<Phil> Okay, back to wayland, this X11 experience is weird as hell
19:00:25*ntat quit (Quit: leaving)
19:02:04FromDiscord<ShalokShalom (ShalokShalom)> Oh nice, how is it? The AMD model?↵(@Phil)
19:02:20FromDiscord<ShalokShalom (ShalokShalom)> Elegantbeef\: You may like that
19:02:26FromDiscord<ShalokShalom (ShalokShalom)> https://github.com/titzer/wizard-engine
19:02:51FromDiscord<Phil> In reply to @ShalokShalom (ShalokShalom) "Oh nice, how is": Nah, the first one, plan on upgrading to AMD this winter and use the second motherboard for a homeserver to run a next-cloud instance on the local network
19:03:51FromDiscord<Phil> Ah shit, we should keep this to #offtopic
19:05:13FromDiscord<ShalokShalom (ShalokShalom)> They were just selling the 11th gen motherboard for 200 bucks↵(@Phil)
19:07:04FromDiscord<Phil> In reply to @ShalokShalom (ShalokShalom) "They were just selling": See #offtopic for my response 😛
19:07:29FromDiscord<ShalokShalom (ShalokShalom)> Is that on Matrix?
19:07:47FromDiscord<Phil> #nim-offtopic
19:08:23FromDiscord<Phil> You got a gitter?
19:10:58FromDiscord<inv2004> I was sure I opened linux chat when checked last few pages
19:11:37FromDiscord<Phil> In reply to @ShalokShalom (ShalokShalom) "Is that on Matrix?": Invited your account to offtopic
19:11:50FromDiscord<Phil> (edit) "In reply to @ShalokShalom (ShalokShalom) "Is that on Matrix?": Invited your account to offtopic ... " added "(maybe multiple, I also found another gitter account)"
19:25:21*jmdaemon quit (Ping timeout: 252 seconds)
19:25:38FromDiscord<Chronos [She/Her]> Hey so I'm making a binding for espeak-ng (there's an outdated one which is just using the command line), and I just wanna know how I should license it...?
19:26:17FromDiscord<Chronos [She/Her]> Espeak-ng is GPL3, but if you're using GPL3 code directly then you have to also license your code under GPL3, right? Does that mean that my lib also has to be GPL3?
19:26:56FromDiscord<Chronos [She/Her]> I don't really understand licensing much lol
19:29:47FromDiscord<Phil> sent a long message, see http://ix.io/4GhS
19:29:55FromDiscord<Phil> > So if GPL-licensed code ever gets included in your project, for example via linking against a GPL'd library, you must also provide your whole project under the GPL.
19:30:44FromDiscord<Phil> However, you can have multiple licenses in your code and publish some bits under GPL and other bits under not GPL as long as they're clearly separate:↵https://www.softwarefreedom.org/resources/2007/gpl-non-gpl-collaboration.html
19:31:36FromDiscord<Phil> If you dynamically link against GPL code you may also be in the clear as that is very much up to debate, only the LGPL addresses that one explicitly
19:31:44FromDiscord<Phil> > There's some disagreement on whether GPL comes into play when a library is dynamically linked; GNU are of the opinion that it does, and provides the alternative license LGPL, or recommends adding exceptions to GPL.
19:32:23FromDiscord<Chronos [She/Her]> Eh... I'll do GPL 3 to be safe
19:32:29FromDiscord<Elegantbeef> I'd love to see a civil case over dynamic linking to GPL code
19:33:11FromDiscord<Chronos [She/Her]> Hmmm not sure how I should tell the user they need espeak installed via Nimble, they have a way right?
19:33:24FromDiscord<Elegantbeef> If it is against gpl to do such, that implies that you can own a interface with no implementation
19:34:14FromDiscord<Phil> Which I think already is a case covered by Sun vs. google android and their java interface reimplementation IIRC
19:34:38FromDiscord<Phil> In reply to @chronos.vitaqua "Hmmm not sure how": Could you rephrase?↵Is this just about where to document how to install your lib/application?
19:34:48FromDiscord<Phil> In that case, have an `Installation` section in your README.md
19:34:52FromDiscord<Phil> Or your nimibook
19:35:06FromDiscord<Elegantbeef> Excuse me whilst I run a program to generate a bunch of header files and empty C programs to accompany them so I own the world!
19:35:53FromDiscord<Phil> I mean, Sun/Oracle lost that one as the judges stated you can't own an interface IIRC
19:36:32FromDiscord<can.l> In reply to @Elegantbeef "If it is against": Isn't there a "System Library" exception in the GPL that kind of covers this?
19:37:34FromDiscord<can.l> Ah, it might cover the opposite direction.
19:37:52FromDiscord<Elegantbeef> > A GPL linking exception modifies the GNU General Public License (GPL) in a way that enables software projects which provide library code to be "linked to" the programs that use them, without applying the full terms of the GPL to the using program.
19:39:24FromDiscord<Phil> Wait a second... were destroy hooks originally `proc destroy` instead of `proc =destroy`?
19:39:41FromDiscord<rainbowasteroids> In reply to @Elegantbeef "I'd love to see": Has there been any civil cases about the GPL? Especially one against proprietary projects?
19:39:55FromDiscord<Elegantbeef> Dont think so rainbow
19:40:00FromDiscord<Elegantbeef> I believe so phil
19:42:46*xet7 joined #nim
19:44:18FromDiscord<can.l> In reply to @isofruit "Wait a second... were": Just in case this is owlkettle related and you are referring to the detroy proc in the cairo module, that is not a =destroy hook, but needs to be called manually, because cairo context are currently not automatically memory managed.
19:45:46FromDiscord<Phil> In reply to @can.l "Just in case this": It is related and I'm currently searching for said =destroy hooks mentioned in the issue 😅
19:45:59FromDiscord<Phil> Like, I assume there to be some `proc =destroy` somewhere, just can't seem to find em
19:46:13FromDiscord<can.l> See the compiler output, I just had a quick look and saw that they are actually finalizers.
19:46:32FromDiscord<Phil> As in, the C output?
19:46:36FromDiscord<can.l> (so maybe issue naming could be improved)
19:46:50FromDiscord<ShalokShalom (ShalokShalom)> GPL3 or later↵(@Chronos [She/Her])
19:46:52FromDiscord<can.l> owlkettle/widgets.nim(2002, 6) Warning: A custom '=destroy' hook which takes a 'var T' parameter is deprecated; it should take a 'T' parameter [Deprecated]
19:47:12FromDiscord<can.l> owlkettle/widgets.nim(470, 6) Warning: A custom '=destroy' hook which takes a 'var T' parameter is deprecated; it should take a 'T' parameter [Deprecated]
19:47:34FromDiscord<Phil> Ohhh that's how
19:47:37FromDiscord<ShalokShalom (ShalokShalom)> the license allows you to license under GPL 4, if that ever releases
19:47:38FromDiscord<Phil> You run nim c
19:47:42FromDiscord<Phil> (edit) "You run nim c ... " added "owlkettle.nim"
19:47:43FromDiscord<can.l> yes
19:47:54FromDiscord<Chronos [She/Her]> In reply to @isofruit "Could you rephrase? Is": No, I mean having system dependencies, to an external library that's not in Nim, I swear that's a thing
19:50:07FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4GhZ
19:50:32FromDiscord<can.l> Use a destroy hook instead of the finalizer ( new(result, finalizer=finalizer))
19:50:40FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4Gi0
19:51:50FromDiscord<can.l> I believe you need to regularly instantiate the GdkPixbuf (`GdkPixbuf(gdk: gtk)`) and add a `=destroy` hook instead of the finalizer.
19:52:37FromDiscord<can.l> I assume that the compiler does not like the `finalizer=finalizer`.
19:53:31FromDiscord<Phil> I'm pretty sure it doesn't like the result
19:53:52FromDiscord<Phil> Since it's complaining about `var T` and that's at the column where it starts getting the first parameter
19:53:53FromDiscord<Chronos [She/Her]> Also.. Should I just do `{.emit: "#include <espeak-ng/speak_lib.h>".}` then I can just `importc` the procs?
19:54:44FromDiscord<can.l> In reply to @isofruit "I'm pretty sure it": Does the warning disappear when you change it to not use result?
19:54:53FromDiscord<Chronos [She/Her]> Aaaaand last question: Best way to bind to C enum? ...maybe I should just use Futhark
19:55:13*tanami quit (Ping timeout: 252 seconds)
19:55:43FromDiscord<can.l> In reply to @chronos.vitaqua "Also.. Should I just": There is a header pragma that should do that for you: https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-header-pragma
19:56:20FromDiscord<Phil> In reply to @can.l "Does the warning disappear": You get a compiler error that the new overload with a finalizer parameter only works with var T
19:57:25*junaid_ quit (Remote host closed the connection)
20:01:09FromDiscord<Chronos [She/Her]> In reply to @can.l "There is a header": Oh sweet!
20:01:42FromDiscord<Chronos [She/Her]> Wait LLVM backend...? Does it mean nlvm?
20:03:31*jmdaemon joined #nim
20:07:08FromDiscord<Phil> Okay I don't understand.↵Are `=destroy` hooks to always only be used for all object-types and you make one generic for all?
20:08:21FromDiscord<can.l> Usually you create one for each object.
20:08:28FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4Gic
20:08:29FromDiscord<can.l> (edit) "object." => "object type."
20:08:57FromDiscord<Phil> So from that the only thing I can gather is that it expects destroy hooks to be generic which makes no sense to me
20:09:16FromDiscord<can.l> It needs to be `PixbufObj` (where `Pixbuf = ref PixbufObj` and `PixbufObj = object ...`)
20:10:05FromDiscord<Phil> Oh the issue is that PixBuf is a ref object? Wha?
20:12:18FromDiscord<kingterrytheterrible12> In reply to @isofruit "Because I don't get": i think it has to be a generic
20:12:24FromDiscord<can.l> Please also test that the hook is actually called by adding an `echo` or something, it would be quite bad if Nim just never calls it 😉
20:13:23FromDiscord<Phil> Absolutely, once I actually wrap my head around the entire part where PixBuf is now a ref-type alias over PixBufObj which is a value-type wrapper around GdkPixBuf
20:13:48FromDiscord<Phil> (edit) "GdkPixBuf" => "GdkPixBuf, which is a distinct pointer to said data structure within GTK"
20:14:43FromDiscord<Phil> And the destructor then is for PixBufObj I take it?
20:14:49FromDiscord<raynei486> why do destructors need to be generic?
20:14:50FromDiscord<can.l> jup
20:15:06FromDiscord<raynei486> What if I'm creating a destructor for a simple object
20:15:20FromDiscord<Phil> In reply to @kingterrytheterrible12 "i think it has": Didn't have to be... I think so far
20:18:52FromDiscord<kingterrytheterrible12> In reply to @isofruit "Because I don't get": it just told you in err
20:18:54FromDiscord<kingterrytheterrible12> no?
20:20:18FromDiscord<Phil> In reply to @kingterrytheterrible12 "it just told you": Reasonably sure the error message there was just bad and "T" didn't mean it had to be generic but rather it could be whatever.↵It makes no sense to allow you to set auto-called procs for deallocating if you can't customize deallocation per object since nim needs to be able to deal with data it receives from other dynamically linked libs and that (de)allocation behaviour may be sup
20:20:42FromDiscord<kingterrytheterrible12> okay
20:23:54*tanami joined #nim
20:25:31FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4Gij
20:27:11FromDiscord<kingterrytheterrible12> In reply to @isofruit "Okay so from a": if this throws exeption it will leak
20:27:16FromDiscord<kingterrytheterrible12> due to nim compiler bug
20:27:21FromDiscord<kingterrytheterrible12> https://github.com/nim-lang/Nim/issues/22672
20:27:44FromDiscord<Phil> Let me get something to run first before I do it right, I can't even get the destructors to actually run, one problem at a time
20:27:53FromDiscord<kingterrytheterrible12> xd
20:27:53FromDiscord<Phil> Also you wanted to sleep IIRC 😛
20:27:54FromDiscord<kingterrytheterrible12> ok
20:28:04FromDiscord<kingterrytheterrible12> no irc only discord
20:28:08FromDiscord<kingterrytheterrible12> In reply to @isofruit "Also you wanted to": i couldnt
20:29:44FromDiscord<Phil> Yeah so far all these 2 chances succeed at doing is make the warning go away, but they don't seem to actually get executed >_>
20:30:07FromDiscord<kingterrytheterrible12> ^_^
20:30:08FromDiscord<Phil> pmunch , your take?
20:30:12*tanami quit (Ping timeout: 240 seconds)
20:30:16FromDiscord<Phil> (edit) "chances" => "changes"
20:30:39FromDiscord<kingterrytheterrible12> rumors say pmunch switch to rust
20:31:50*tanami joined #nim
20:33:20FromDiscord<nervecenter> For good reason? Switching from a language where you don't think about memory in most scenarios to when where you have to think about memory semantics in every scenario should probably be well-justified.
20:33:36FromDiscord<nervecenter> (edit) "when" => "one"
20:34:00FromDiscord<kingterrytheterrible12> In reply to @nervecenter "For good reason? Switching": rumors say you dont know what a joke is
20:34:14FromDiscord<kingterrytheterrible12> this is pmunch
20:34:17FromDiscord<nervecenter> eh I wasn't keeping track of the convo
20:34:27FromDiscord<kingterrytheterrible12> doubt he would switch
20:34:32FromDiscord<Chronos [She/Her]> Tbh debating on just porting the enum to Nim instead of importing it
20:34:45FromDiscord<Chronos [She/Her]> Mostly bc idk how to correctly wrap it
20:34:46FromDiscord<kingterrytheterrible12> In reply to @chronos.vitaqua "Tbh debating on just": futhrak?
20:34:51FromDiscord<kingterrytheterrible12> you dont
20:34:53FromDiscord<Chronos [She/Her]> Nope, manually
20:34:54FromDiscord<kingterrytheterrible12> futhrak
20:35:01FromDiscord<Phil> In reply to @nervecenter "For good reason? Switching": That point makes no sense in any context I could imagine this convo going tbh 😄
20:35:14FromDiscord<Chronos [She/Her]> As a learning opportunity + it's a simple lib
20:36:00FromDiscord<Phil> Just because Nim doesn't force you to deal with memory allocation yourself (unless you start wrapping other libs, that's where it becomes necessary/mandatory) doesn't mean it's terrible at it or that Rust suddenly becomes a cure in any capacity
20:36:02*krux02_ joined #nim
20:36:56FromDiscord<kingterrytheterrible12> i started a language war by a joke
20:37:00FromDiscord<raynei486> Why I can't I define a destructor for a `ptr` type 😦
20:37:06FromDiscord<raynei486> Is this not the proper signature?
20:37:13FromDiscord<raynei486> sent a code paste, see https://play.nim-lang.org/#ix=4Gil
20:38:09FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4Gim
20:38:27FromDiscord<Phil> But that is based on all of like 2 half read nim doc articles and 10 minutes of playing around
20:39:13*tanami quit (Ping timeout: 252 seconds)
20:39:50*tanami joined #nim
20:41:52FromDiscord<raynei486> I'm currently working on [this](https://github.com/nim-lang/RFCs/issues/534), so since `File` is a `ptr CFile`, I would have to define a constructor for `CFile`?
20:43:26FromDiscord<Phil> I think more like wrapper for CFile (?), I don't know jack
20:43:39FromDiscord<Phil> Or a destructor directly for CFile if you can
20:45:06FromDiscord<raynei486> Alright
20:45:52FromDiscord<jviega> Yes, that's basically right, I don't think they ever call a destructor on a ref object. You need a nim proxy of type Object that the GC will collect
20:46:02FromDiscord<jviega> Mine tend to just have one field, being the C object ref 🙂
20:47:06FromDiscord<Elegantbeef> You either need `object` or `distinct`
20:47:57FromDiscord<Chronos [She/Her]> Beef, you're smart, what do I do when wrapping C code with Enums :p
20:49:27FromDiscord<Phil> Okay I can trigger the pixibuf destructor
20:49:59FromDiscord<Elegantbeef> importc and declare the enums in their ordinal order
20:52:07FromDiscord<Chronos [She/Her]> In reply to @Elegantbeef "importc and declare the": So `type MyEnum = enum {.importc: "...".}`?
20:52:13FromDiscord<Chronos [She/Her]> Also how about for variables :p
20:52:30FromDiscord<Chronos [She/Her]> And constants within the code lol
20:52:35FromDiscord<Elegantbeef> No not that way the pragma goes on the type name
20:52:39FromDiscord<Elegantbeef> Constants within the code?
20:52:44FromDiscord<Elegantbeef> Are we talking about enums or defines?
20:53:06FromDiscord<Chronos [She/Her]> Both- First part was enums, now asking about defines-
20:53:10FromDiscord<Chronos [She/Her]> In reply to @Elegantbeef "No not that way": Alright!
20:53:39FromDiscord<Elegantbeef> @raynei486 for your File stuff you'll likely need to change it to `type File = distinct ptr CFile`
20:53:58FromDiscord<Elegantbeef> Defines you can just import as constants if you want
20:56:09FromDiscord<Chronos [She/Her]> In reply to @Elegantbeef "Defines you can just": How? :p
20:56:14FromDiscord<raynei486> In reply to @Elegantbeef "<@733059160924749855> for your File": Why the distinct?
20:56:17FromDiscord<Chronos [She/Her]> I am Chronically Stupid™️
20:56:43FromDiscord<Elegantbeef> Cause Nim only allows custom hooks on `object` or `distinct`
20:56:43FromDiscord<Elegantbeef> Do not think you can use destructors on `ptr object`
20:56:55FromDiscord<Elegantbeef> `const myConst = 10`
20:56:58FromDiscord<Elegantbeef> Believe it or not that's valid Nim 😛
20:57:18FromDiscord<raynei486> In reply to @Elegantbeef "Cause Nim only allows": ah okay
20:57:51FromDiscord<Chronos [She/Her]> In reply to @Elegantbeef "Believe it or not": Ah alright lol
20:58:18FromDiscord<Chronos [She/Her]> Now uh, last question: Do I use the C types from Nim? For strings I know I have to, but for ints and stuff?
20:58:48FromDiscord<Elegantbeef> You generally want to use fixed size integers
20:58:49FromDiscord<Elegantbeef> Unless the C api doesnt use them
20:58:52FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4Gir
20:59:49FromDiscord<Chronos [She/Her]> In reply to @Elegantbeef "You generally want to": It just says `int` so-
21:00:03*jeremysnetcat joined #nim
21:00:11FromDiscord<Chronos [She/Her]> Hmmm maaaybe I'll just futhark this
21:00:20FromDiscord<Chronos [She/Her]> Then write a higher level wrapper
21:00:20FromDiscord<Elegantbeef> int is int32 generally
21:00:31FromDiscord<Chronos [She/Her]> good to know!
21:01:10FromDiscord<jviega> In what environment do you mean?
21:01:21FromDiscord<raynei486> sent a code paste, see https://play.nim-lang.org/#ix=4Giv
21:01:30FromDiscord<Elegantbeef> You need to write your own `isNil`
21:01:33FromDiscord<raynei486> Is it because a `File` is no longer a `ptr CFile`
21:01:35FromDiscord<jviega> In C it's always the native word size which is usually 64 bits 🙂
21:01:53FromDiscord<demotomohiro> !eval echo sizeof(cint)
21:01:56NimBot4
21:01:58*jeremysnetcat quit (Quit: jeremysnetcat)
21:02:03FromDiscord<Elegantbeef> No `int` is 32bit generally in C
21:02:33FromDiscord<Elegantbeef> Yes raynei, distincts lose all operations of their base type
21:03:17FromDiscord<raynei486> this is more work than I expected
21:03:25FromDiscord<jviega> Oh yeah of course, I don't know why I'm brain farting, I use `uint64_t `all over the damn place. I never use 32-bit ints, I don't see why people should case to save the space
21:03:51FromDiscord<jviega> On x86 in particular, the penalty for being non-word aligned is far more real than the extra memory
21:04:10FromDiscord<Elegantbeef> Cause C is 80 billion years old and it seemed like a good idea 😛
21:04:25FromDiscord<demotomohiro> iirc, `int` in C in x86_64 become 32bit so that you can easily reuse code written for 32bit CPUs.
21:04:35FromDiscord<jviega> When I was a younger man it was the native machine size, back when it was all either 16 or 32
21:05:08FromDiscord<jviega> Anyone else old enough to remember far pointers? UGH
21:07:18*xmachina quit (Quit: WeeChat 4.0.4)
21:09:39*xmachina joined #nim
21:11:35FromDiscord<Elegantbeef> Did you misplace you walker?
21:12:12FromDiscord<jmgomez> hey @demotomohiro FYI the initializers PR is waiting to be merged https://github.com/nim-lang/Nim/pull/22694
21:13:38FromDiscord<jmgomez> the test file covers the issue that you had
21:14:51FromDiscord<demotomohiro> In reply to @jmgomez "hey <@288750616510201856> FYI the": Thank you for your effort!↵But does https://github.com/nim-lang/RFCs/issues/532 works with types like std::lock_guard?↵https://en.cppreference.com/w/cpp/thread/lock_guard/lock_guard
21:15:56FromDiscord<demotomohiro> That takes takes reference to other object.↵Constructing std::lock_guard with default std::mutex doesn't make much sense for me.
21:16:33FromDiscord<demotomohiro> I think if a C++ class is imported a with `importcpp` and `requiresInit` pragma, the compiler requires explicitly calling constructor to initializing the object would be better.
21:17:17FromDiscord<demotomohiro> If an object contains such a type as field, don't add '{}' when defining that type in generated C++ code.
21:21:17FromDiscord<jmgomez> I dont know. `{}` Is used because it also inits members fields inside the body of a struct
21:21:42FromDiscord<jmgomez> not all info is available at the codegen stage, but I guess it's a matter to fine tune it later
21:25:15FromDiscord<jmgomez> Are you sure `{}` doesnt work with explicit ctors?
21:26:12FromDiscord<jmgomez> Or what do you mean? If you have a snnipet to test it I can take a look
21:29:48*gshumway quit (Server closed connection)
21:30:16FromDiscord<demotomohiro> https://wandbox.org/permlink/hmFVsv2TnVVh0EQV
21:31:36FromDiscord<jmgomez> ah I see what you mean, but why just dont use a pointer?
21:32:50FromDiscord<jmgomez> if you are interfacing with a library, you could also inherit from it in Nim and do as you please in the child. No?
21:34:05FromDiscord<demotomohiro> In the case of std::lock_guard, its constructor always requires mutex_type argument and constructing it without mutex doesn't make sense.↵https://en.cppreference.com/w/cpp/thread/lock_guard/lock_guard
21:35:00*gshumway joined #nim
21:37:16FromDiscord<jmgomez> ok, but the `{}` issue on ref already existed, right?
21:37:31FromDiscord<jmgomez> Not sure who did that, but it was like that already for some importcpp types
21:38:02FromDiscord<jmgomez> if we are lucky an `noInit` is not used in fields, maybe we could reuse it to indicate the backend that it shouldnt `{}` those fields
21:38:13FromDiscord<jmgomez> (edit) "an" => "and"
21:42:02FromDiscord<jmgomez> In reply to @jmgomez "Not sure who did": just to clarify it, the only thing the PR does is to expand the issue by allowing user to decide what goes inside them i.e `{ someVars }`
21:42:14FromDiscord<jmgomez> but the place where they are gen, dont change
21:50:09FromDiscord<demotomohiro> In reply to @jmgomez "if we are lucky": > if we are lucky and noInit is not used in fields, maybe we could reuse it to indicate the backend that it shouldnt {} those fields↵I think it will be fine for C++ types that requires constructor with parameter but default param doesn't work.
21:50:27FromDiscord<demotomohiro> In reply to @jmgomez "just to clarify it,": OK
21:53:59FromDiscord<jmgomez> In reply to @demotomohiro "> if we are": I dont quite follow that. If you can repro it as things are now it would be great to have an issue for it and we can continue the conver on GH
22:07:34FromDiscord<millymox> Hello nimfans nobody knows me but i used to be in here lurking until i got into a car accident which left me unable to program for a few months, nonetheless im back and am ready to use Nim as therapy ☕
22:11:49FromDiscord<Chronos [She/Her]> Hello there and welcome back o7
22:15:21FromDiscord<millymox> In reply to @chronos.vitaqua "Hello there and welcome": Howdy, which nim extension is the correct one to use? I see 2
22:20:22FromDiscord<Chronos [She/Her]> In reply to @millymox "Howdy, which nim extension": Yeah, the one by saem is the up-to-date one aha
22:26:28FromDiscord<raynei486> I thought adding destructors to streams would be trivial, but it's so much more complex with the addition of custom `close` implementations...
22:28:39FromDiscord<Elegantbeef> How does it get much more complicated?
22:29:44*genr8eofl__ joined #nim
22:31:17FromDiscord<Elegantbeef> The more complicated part is that they use inheritance, which means destructors just do not work by default with them
22:31:47FromDiscord<raynei486> 😦
22:32:13*genr8eofl_ quit (Ping timeout: 258 seconds)
22:33:36FromDiscord<raynei486> I don't wanna touch too much stuff
22:33:42FromDiscord<raynei486> maybe I should just not change streams for now
22:36:48FromDiscord<Elegantbeef> Finalisers exist so that could work for streams perhaps
22:45:15FromDiscord<raynei486> hmm never heard of them
22:45:21FromDiscord<raynei486> They don't seem to be mentioned in the manual either
22:45:40FromDiscord<Elegantbeef> https://nim-lang.org/docs/system.html#new%2Cref.T%2Cproc%28ref.T%29
22:54:14*jmdaemon quit (Ping timeout: 245 seconds)
22:57:03FromDiscord<millymox> Can anybody direct me to a nim package that has encryption? preferrably Sha1 or AES
22:57:45FromDiscord<Elegantbeef> https://nim-lang.org/docs/sha1.html
22:57:45FromDiscord<raynei486> I mean it's basically a vtable↵Wouldn't it work if I could declare destructors with `method`
22:57:55FromDiscord<raynei486> (edit) "I mean it's ... basically" added "currently"
22:58:09FromDiscord<raynei486> ok my brain hurts I'll work on this tomorrow
22:58:23FromDiscord<Elegantbeef> I mean it could work, but I mean finalisers exist now
22:59:38FromDiscord<raynei486> I saw discussions of deprecating finalisers though
22:59:56FromDiscord<Elegantbeef> Where?
23:02:31FromDiscord<raynei486> https://github.com/nim-lang/RFCs/issues/504
23:03:20FromDiscord<Elegantbeef> Ah
23:04:06FromDiscord<millymox> In reply to @Elegantbeef "https://nim-lang.org/docs/sha1.html": Installed checksums and it says it can’t open src/checksums/sha1
23:05:08FromDiscord<leorize> you should just look for an openssl wrapper
23:05:15FromDiscord<leorize> or look at some status-im stuff
23:05:24FromDiscord<leorize> not many in nim do crypto
23:05:47FromDiscord<leorize> there's a libsodium wrapper if that library works for you
23:08:51FromDiscord<millymox> In reply to @leorize "there's a libsodium wrapper": Thanks am going to use this
23:35:36*rockcavera quit (Read error: Connection reset by peer)
23:36:03*rockcavera joined #nim
23:36:03*rockcavera quit (Changing host)
23:36:03*rockcavera joined #nim
23:45:36*krux02_ quit (Quit: Leaving)
23:47:47*jmdaemon joined #nim