00:02:23 | * | cnx joined #nim |
00:14:00 | NimEventer | New Nimble package! worldtree - A small, lightweight ECS framework for Nim., see https://github.com/keithaustin/worldtree |
00:37:32 | FromDiscord | <sOkam! 🫐> In reply to @alendrik "<@251576885799026688> As a follow": +1. thats the best nim intro tutorial without a doubt |
00:38:43 | FromDiscord | <Elegantbeef> Damn yet another ECS that fails the pointer indirection test 😄 |
00:38:53 | FromDiscord | <Elegantbeef> `Component = ref object of RootObj` |
00:40:04 | FromDiscord | <sOkam! 🫐> In reply to @Elegantbeef "Damn yet another ECS": that's that test about? 🤔 |
00:41:30 | FromDiscord | <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:40 | FromDiscord | <Langosta> THEN, you can start your Object Oriented hierarchy |
00:41:52 | FromDiscord | <Langosta> But maybe I'm just not seeing something here |
00:42:03 | FromDiscord | <Langosta> Glad the ecosystem is growing nonetheless :) |
00:48:07 | FromDiscord | <Elegantbeef> One of the benefits of an ECS is not having pointer indirection and having fast iterations |
00:48:25 | FromDiscord | <Elegantbeef> it's all about cache coherency |
00:49:17 | FromDiscord | <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:58 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4GcW |
00:52:08 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4GcX |
00:52:24 | FromDiscord | <Elegantbeef> And this is optimistic |
00:52:55 | FromDiscord | <Elegantbeef> The heap allocations should be contiguous since it's allocated all at once and without any other heap segmentation |
00:55:14 | FromDiscord | <Elegantbeef> But yea it doesnt really matter much, just always a litmus of how performant a given ECS might be |
00:57:16 | FromDiscord | <Langosta> What are the benefits of inheritance in this case that come at the cost of performance? |
00:57:46 | FromDiscord | <Elegantbeef> It's easier to write in Nim than the alternative |
00:58:01 | FromDiscord | <Elegantbeef> The alternative requires making your own TypeID system and manage your own data |
00:58:35 | FromDiscord | <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:46 | FromDiscord | <Elegantbeef> There is also a minor benefit in that you can use any type as a component |
00:59:02 | FromDiscord | <Elegantbeef> Which means you can use a `bool` or any other primitive if you really really want |
00:59:28 | FromDiscord | <Elegantbeef> There isnt really anything wrong with using inheritance though, it's more the whole pointer indirection |
01:00:12 | FromDiscord | <Elegantbeef> It's not like you want to swap between a Cat and Dog component |
01:01:09 | FromDiscord | <Elegantbeef> Though I personally prefer the idea of using row typing and joining types over inheritance |
01:01:19 | FromDiscord | <Elegantbeef> An example of that lives here https://github.com/beef331/nimtrest/blob/master/rowed.nim#L91-L116 |
01:01:36 | FromDiscord | <Elegantbeef> Here I am rambling again |
01:02:10 | FromDiscord | <Langosta> No, this is super cool. Thank you for sharing |
01:02:52 | FromDiscord | <Langosta> I've never even heard of row typing so it's very interesting to learn about these things |
01:03:06 | FromDiscord | <Langosta> This may be a dumb question, but are you actually a bot? |
01:03:16 | FromDiscord | <Elegantbeef> Sadly, nope |
01:03:19 | FromDiscord | <Langosta> you seem to be pulling from your own repo haha |
01:03:25 | FromDiscord | <Langosta> oh ok that makes sense |
01:03:49 | FromDiscord | <Langosta> how did you make it so discord recognizes you as one? |
01:04:03 | FromDiscord | <Elegantbeef> I use matrix to chat here |
01:04:03 | FromDiscord | <Elegantbeef> This server has a matrix and irc bridge setup |
01:04:11 | FromDiscord | <Elegantbeef> Which means I just chat using a matrix client here |
01:04:41 | FromDiscord | <Langosta> That is super neat |
01:05:47 | FromDiscord | <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:24 | FromDiscord | <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:17 | FromDiscord | <Langosta> So is it related to "prefer composition over inheritance" As in, you're making objects as composites of other objects? |
01:07:41 | FromDiscord | <Langosta> sorry, I'm relatively new to a lot of this. Thank you for your patience |
01:08:48 | FromDiscord | <Elegantbeef> Exactly |
01:10:10 | FromDiscord | <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:06 | FromDiscord | <Langosta> I see, you still gain the OOP functionality while sidestepping the performance and OOP hiearchy |
01:11:17 | FromDiscord | <Langosta> (edit) "I see, you still gain the OOP functionality while sidestepping the performance and OOP hiearchy ... " added "costs" |
01:11:45 | FromDiscord | <Elegantbeef> Well some OOP functionality |
01:12:51 | FromDiscord | <Langosta> I guess you still lose some stuff that comes with "is a" |
01:12:57 | FromDiscord | <Elegantbeef> You lose runtime dispatch and up/down casting |
01:12:58 | FromDiscord | <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:32 | FromDiscord | <Elegantbeef> Yea you lose the relationship stuff |
01:14:03 | FromDiscord | <Langosta> oh I see. Any relationships need to be explicitly documented I guess. |
01:14:25 | FromDiscord | <Langosta> and as you said, are treated by the compiler differently |
01:15:12 | FromDiscord | <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:00 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4Gda |
01:16:11 | FromDiscord | <Elegantbeef> But that just requires me to implement all of that, which is somewhat a hassle |
01:17:31 | FromDiscord | <saint._._.> How do I cast a cstring to an unsigned char |
01:17:53 | FromDiscord | <saint._._.> Like how do I do casting to other ctypes in my nim code |
01:18:21 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4Gde |
01:20:48 | FromDiscord | <Langosta> In reply to @Elegantbeef "But that just requires": That's super interesting nonetheless |
01:21:14 | FromDiscord | <Langosta> I would love to help implement on my offtime when I ever get a better understanding of nim's inner workings |
01:24:12 | FromDiscord | <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:17 | FromDiscord | <saint._._.> sent a code paste, see https://play.nim-lang.org/#ix=4Gdh |
01:24:26 | FromDiscord | <Elegantbeef> Of course not |
01:24:31 | FromDiscord | <saint._._.> Okie |
01:24:41 | FromDiscord | <saint._._.> Also what is the difference if I put = object |
01:24:43 | FromDiscord | <saint._._.> Or = pointer |
01:24:55 | FromDiscord | <Elegantbeef> `pointer` is a void pointer |
01:24:57 | FromDiscord | <Elegantbeef> `object` is not |
01:25:04 | FromDiscord | <saint._._.> What is object |
01:25:11 | FromDiscord | <saint._._.> When I'm doing a importc type thing |
01:25:23 | FromDiscord | <saint._._.> `type lxb_char_t {.importc: "lxb_char_t" header: "./lexbor/core/types.h".} = object` |
01:25:47 | FromDiscord | <saint._._.> vs pointer for that |
01:25:55 | FromDiscord | <Elegantbeef> You wouldnt use `pointer` |
01:26:28 | FromDiscord | <Elegantbeef> you might do `{. ..., byref.} = object` if they use the type as an opaque pointer |
01:26:28 | FromDiscord | <saint._._.> Okay, also so say I declare that type as unsigned char |
01:26:34 | FromDiscord | <saint._._.> But when I create a cstring isn't it a char |
01:26:45 | FromDiscord | <saint._._.> And so how do I cast that to an unsigned char |
01:26:48 | FromDiscord | <Haze System (they/them)> sent a code paste, see https://play.nim-lang.org/#ix=4Gdk |
01:27:00 | FromDiscord | <Elegantbeef> 32bit Nim on 64bit OS |
01:27:13 | FromDiscord | <Elegantbeef> I mean the above should work afaik |
01:27:27 | FromDiscord | <Elegantbeef> but if it doesnt you can do `cast[ptr cuchar](myCstring)` |
01:27:33 | FromDiscord | <Elegantbeef> If the above works do not do that |
01:27:42 | FromDiscord | <saint._._.> right |
01:27:47 | FromDiscord | <saint._._.> Thanks i'll try that out |
01:27:53 | FromDiscord | <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:44 | FromDiscord | <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:17 | FromDiscord | <Elegantbeef> It should install 64bit on windows afaik |
01:29:32 | FromDiscord | <Elegantbeef> You also might have a 32bit mingw |
01:30:19 | FromDiscord | <Langosta> what C compiler do you have on windows |
01:30:23 | FromDiscord | <Langosta> or should that not matter? |
01:30:35 | FromDiscord | <Langosta> IT shouldn't unless you're building on win |
01:30:39 | FromDiscord | <Haze System (they/them)> choosenim should download the compiler automatically |
01:30:39 | FromDiscord | <Langosta> I think |
01:30:44 | FromDiscord | <Langosta> o |
01:30:44 | FromDiscord | <Elegantbeef> It needs to be 64bit if you're on 64bit windows |
01:31:00 | FromDiscord | <Haze System (they/them)> i do have mingw installed, at least 64bit, dunno about 32bit |
01:31:08 | FromDiscord | <Elegantbeef> Perhaps you have 2 mingws in your path and it's grabbing a 32bit |
01:31:10 | FromDiscord | <Haze System (they/them)> and 32bit yeh |
01:31:16 | FromDiscord | <Elegantbeef> you can always do `nim -v` |
01:31:23 | FromDiscord | <Haze System (they/them)> i didnt even know it uses mingw |
01:31:41 | FromDiscord | <Elegantbeef> Gcc is the default compiler where it can be |
01:31:43 | FromDiscord | <Elegantbeef> otherwise it's clang |
01:31:48 | FromDiscord | <Haze System (they/them)> ah |
01:32:41 | FromDiscord | <Langosta> is it possible to build your project on linux, and cross-compile to windows? |
01:32:47 | FromDiscord | <Elegantbeef> It is mingw exists |
01:32:50 | FromDiscord | <Langosta> with some when: wizardry |
01:33:03 | FromDiscord | <Haze System (they/them)> i dont even seem to have mingw on my path... |
01:33:15 | FromDiscord | <Elegantbeef> `-d:mingw` will compile to windows assuming you have mingw and the source supports it |
01:33:23 | FromDiscord | <Elegantbeef> Isnt it `gcc.exe`? |
01:34:55 | FromDiscord | <Haze System (they/them)> sent a code paste, see https://play.nim-lang.org/#ix=4Gdn |
01:35:06 | FromDiscord | <Haze System (they/them)> i am confused |
01:35:43 | FromDiscord | <Elegantbeef> `nim -v`? |
01:36:10 | FromDiscord | <Haze System (they/them)> sent a code paste, see https://play.nim-lang.org/#ix=4Gdo |
01:36:13 | FromDiscord | <Elegantbeef> that's 32bit nim |
01:36:19 | FromDiscord | <Haze System (they/them)> yes |
01:36:20 | FromDiscord | <Haze System (they/them)> idk why |
01:36:59 | FromDiscord | <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:14 | FromDiscord | <saint._._.> How do I import that type? do I do = object, or something else |
01:37:26 | FromDiscord | <saint._._.> Like do I have to do what the base type is when I import something? |
01:37:32 | FromDiscord | <Elegantbeef> If you don't know the type how do you import it 😄 |
01:37:42 | FromDiscord | <saint._._.> And if it's like some form of char then I use cstring? |
01:37:55 | FromDiscord | <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:00 | FromDiscord | <Elegantbeef> You mainly need to get a binary representation that matches the C expected |
01:38:16 | FromDiscord | <saint._._.> Oh okay |
01:38:23 | FromDiscord | <saint._._.> So if it's a struct then I use object |
01:38:35 | FromDiscord | <saint._._.> And if it's some type of char I use cstring and some type of int I use int? |
01:38:43 | FromDiscord | <Elegantbeef> Yes |
01:38:54 | FromDiscord | <saint._._.> Gotcha |
01:38:56 | FromDiscord | <Elegantbeef> "some type of char" is not really right though |
01:39:06 | FromDiscord | <Elegantbeef> cstring is a `char` or equal |
01:39:14 | FromDiscord | <Elegantbeef> So `unsigned char` is the same binary representation |
01:39:23 | FromDiscord | <Elegantbeef> but `unsigned char` is of course not a cstring |
01:45:01 | FromDiscord | <saint._._.> Yeah |
01:45:08 | FromDiscord | <saint._._.> What is char then |
01:45:13 | FromDiscord | <saint._._.> In nim |
01:45:24 | FromDiscord | <saint._._.> Just char? |
01:45:43 | FromDiscord | <Elegantbeef> single byte distinct byte |
01:52:15 | FromDiscord | <saint._._.> Gotcha |
01:52:22 | FromDiscord | <saint._._.> Thank u @ElegantBeouf |
01:59:17 | FromDiscord | <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:46 | FromDiscord | <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:01 | FromDiscord | <Nelson> so... what can i do? or better, what SHOULD i do? |
02:00:15 | FromDiscord | <Elegantbeef> You can fork it, or use zippy if it suffices |
02:01:08 | FromDiscord | <Nelson> zippy? does it support tar.gz? |
02:01:11 | FromDiscord | <Elegantbeef> I belive so |
02:01:29 | FromDiscord | <Elegantbeef> believe\ |
02:01:30 | FromDiscord | <Nelson> cool, i will check it ouit |
02:01:38 | FromDiscord | <Nelson> hey this thing is cool as hell |
02:01:45 | FromDiscord | <Nelson> thanks |
02:15:18 | * | cnx joined #nim |
03:07:00 | FromDiscord | <breadpudding> My setpixel function is done :D https://media.discordapp.net/attachments/371759389889003532/1151353309618262096/image.png |
03:07:11 | FromDiscord | <huantian> pretty gradient |
03:09:50 | FromDiscord | <Elegantbeef> Are we OS yet? |
03:10:37 | FromDiscord | <breadpudding> Heh |
03:10:57 | FromDiscord | <breadpudding> I'm going from 0 to Shell pretty quickly |
03:11:24 | FromDiscord | <Elegantbeef> What's next font rendering? 😄 |
03:12:02 | FromDiscord | <breadpudding> Since I'm writing a DOS, more than likely. |
03:12:25 | FromDiscord | <breadpudding> I was tempted to go straight to having a desktop environment but I need to keep it small. |
03:12:58 | FromDiscord | <Elegantbeef> Pixie could help in that front, but might have issues with how it loads fonts |
03:13:47 | FromDiscord | <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:36 | FromDiscord | <Elegantbeef> I see a cast! |
03:16:48 | FromDiscord | <breadpudding> Maybe a few |
03:18:01 | FromDiscord | <huantian> your code looks like the example code someone would use in a video explaining guard clauses |
03:18:03 | FromDiscord | <huantian> 😛 |
03:18:17 | FromDiscord | <breadpudding> I'm a C programmer and I've been writing Nim for less than a week. |
03:18:40 | FromDiscord | <breadpudding> I guess that's to be expected |
03:18:44 | FromDiscord | <huantian> hey please don't take it personally haha |
03:19:13 | FromDiscord | <breadpudding> There's some things I'm not proud of, but it works. |
03:19:41 | FromDiscord | <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:04 | FromDiscord | <huantian> sent a code paste, see https://play.nim-lang.org/#ix=4GdL |
03:21:11 | FromDiscord | <breadpudding> Fair enough |
03:21:20 | FromDiscord | <breadpudding> Maybe I'll do some cleanup |
03:21:20 | FromDiscord | <huantian> though i do know that not everyone subscribes to this kinda early return |
03:21:26 | FromDiscord | <huantian> so it's definitely a personal preference thin |
03:21:28 | FromDiscord | <huantian> (edit) "thin" => "thing" |
03:21:38 | FromDiscord | <breadpudding> It reduces the amount of indentation so I'll take it |
03:22:03 | FromDiscord | <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:25 | FromDiscord | <breadpudding> Since Nim is very Python-like in its syntax, that helps. |
03:34:05 | FromDiscord | <Elegantbeef> Also worth noting a bad state generally should be the first enum field |
03:35:39 | FromDiscord | <breadpudding> Usually `0` is "success" in most cases right? |
03:36:08 | FromDiscord | <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:20 | FromDiscord | <breadpudding> Fair enough |
03:37:21 | FromDiscord | <huantian> In reply to @breadpudding "Usually `0` is "success"": you raise a good point here tho |
03:37:40 | FromDiscord | <huantian> i wonder why that'd be the case |
03:37:53 | FromDiscord | <breadpudding> Mostly legacy purposes |
05:18:45 | NimEventer | New 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:00 | FromDiscord | <enthus1ast> In karax, how can i read data attributes in a callback? |
06:30:19 | FromDiscord | <enthus1ast> in js it should work like this mynode.dataset.foo |
06:33:47 | FromDiscord | <enthus1ast> ok it works like this\: `n.getAttr("data-dayreason")` |
06:38:33 | FromDiscord | <litlighilit> in a .nimble file,↵how to import a .nim file in /src |
06:38:56 | FromDiscord | <litlighilit> `import ./src/xx`↵↵doesn't work |
06:39:34 | PMunch | `import src/xx` |
06:39:36 | FromDiscord | <odexine> why do you want to import a nim file in your nimble file? |
06:39:44 | PMunch | or `import "./src/xx"` |
06:40:14 | PMunch | But be aware that Nimble flattens the src folder, so this will likely fail after the module is installed |
06:42:13 | FromDiscord | <litlighilit> yeah, so I said it doesn't work↵(<@709044657232936960_=50=4dunch=5b=49=52=43=5d>) |
06:44:21 | PMunch | But you didn't have the quotes.. |
06:49:59 | FromDiscord | <litlighilit> Not still |
06:51:00 | * | cnx quit (Ping timeout: 240 seconds) |
06:51:57 | PMunch | What is the error you get? |
06:53:46 | FromDiscord | <litlighilit> Error\: cannot open file\: ./src/xx |
06:54:22 | FromDiscord | <litlighilit> It doesn't work because when installing, `xx` will not be contained in module's dir |
06:55:22 | FromDiscord | <litlighilit> I have tried adding `includeFiles = @["xx.nim"]` to .nimble |
06:55:42 | FromDiscord | <litlighilit> but it'll cause a warning |
06:57:36 | FromDiscord | <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:24 | FromDiscord | <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:24 | FromDiscord | <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:11 | FromDiscord | <Elegantbeef> @that_dude.\: not that I know of but it wouldnt be too hard to make an iterator |
08:27:11 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4GeD |
08:27:14 | FromDiscord | <that_dude.> The main idea was to collect multiple iterators or things like that in general |
08:31:35 | FromDiscord | <Elegantbeef> There isnt a great way of writing that in Nim due to how badly iterators compose sadly |
08:36:49 | FromDiscord | <that_dude.> f |
08:51:20 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4GeF |
08:52:45 | FromDiscord | <that_dude.> That's really cool |
08:54:16 | FromDiscord | <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:22 | FromDiscord | <Elegantbeef> Collect is much more complicated than it needs to be due to the whole "infer the collection we want" |
08:57:39 | FromDiscord | <that_dude.> sent a code paste, see https://play.nim-lang.org/#ix=4GeH |
08:58:38 | FromDiscord | <Elegantbeef> Eh |
08:58:43 | FromDiscord | <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:28 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4GeI |
08:59:47 | FromDiscord | <that_dude.> Damn. I need to sleep lol |
08:59:55 | FromDiscord | <Elegantbeef> It's totally doable to do it your way, but yea you need to rewrite the entire tree |
09:00:21 | FromDiscord | <that_dude.> Which sounds way worse lol |
09:01:05 | FromDiscord | <Elegantbeef> Yea presently collect only has to rewrite the very last expression based off whether you use `{}` or `{a, b}` or `a` |
09:02:40 | FromDiscord | <Elegantbeef> One could technically make a `join` template so you can do `myIter.join(myOtherIter).join(otherIterator).collect` |
09:03:10 | FromDiscord | <Elegantbeef> I probably should add that to my itermacros stuff now that I say that |
09:03:24 | FromDiscord | <that_dude.> Ey I guess I'm useful? |
09:52:28 | FromDiscord | <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:42 | FromDiscord | <nnsee> oh, wait, I see he's already submitted an issue on github |
09:54:40 | * | arkanoid joined #nim |
09:59:18 | PMunch | Ah yes, that's a strange issue. I thought Futhark already supported that |
10:03:47 | NimEventer | New 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:48 | arkanoid | choosenim doesn't like new atlas tool. It doesn't make it available in .nimble/bin |
10:09:04 | FromDiscord | <sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4GeS |
10:10:53 | FromDiscord | <ezquerra> In reply to @arkanoid "choosenim doesn't like new": Yes, that makes it harder to use than it should |
10:11:43 | arkanoid | I have not used it yet. I just wanted to try it out |
10:12:17 | FromDiscord | <sOkam! 🫐> What i've tried so far its pretty good. But its a big mindshift from nimble, for sure |
10:17:21 | FromDiscord | <sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4GeT |
10:17:53 | PMunch | Huh? |
10:18:28 | PMunch | Oh, there was a large code-snippet you referenced |
10:18:35 | FromDiscord | <sOkam! 🫐> ye |
10:20:19 | FromDiscord | <sOkam! 🫐> does nim coerce functions into pointers automatically, such that `LogCallback` is sent as `ptr LogCallback` or something? 🤔 |
10:25:49 | FromDiscord | <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:58 | FromDiscord | <odexine> but yes, choosenim isnt updated to make a shim for atlas |
10:29:08 | FromDiscord | <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:20 | FromDiscord | <sOkam! 🫐> is there a way to explicitly generate a `const char` from nim code for binding an argument for C interop? |
10:30:39 | PMunch | codegenDecl I believe is the only way |
10:31:36 | PMunch | https://github.com/nim-lang/Nim/issues/19588#issuecomment-1059960999 |
10:32:02 | PMunch | Apparently importc can be used like that as well |
10:32:21 | FromDiscord | <sOkam! 🫐> ty pmunch 🙏 |
10:41:16 | FromDiscord | <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:39 | FromDiscord | <jmgomez> (edit) "home)" => "home" |
10:52:43 | FromDiscord | <nnsee> In reply to @odexine "hack is to `cd": surely a symlink would be better here |
10:53:10 | FromDiscord | <nnsee> so atlas gets "automatically updated" whenever the nim binary is updated |
10:53:11 | FromDiscord | <odexine> symlinks arent used for reasons i am unsure of |
10:53:21 | FromDiscord | <nnsee> that's odd |
10:53:22 | PMunch | Windows doesn't have them |
10:53:22 | FromDiscord | <odexine> wait, what do you mean exactly |
10:53:26 | FromDiscord | <odexine> oh |
10:53:31 | FromDiscord | <nnsee> it's literally the whole premise of busybox for example |
10:53:44 | FromDiscord | <odexine> nimble DOES symlink bins installed by packages though so i have no idea |
10:53:53 | FromDiscord | <nnsee> In reply to @PMunch "Windows doesn't have them": wait, really? lol |
10:54:00 | PMunch | Apparently |
10:54:01 | FromDiscord | <ezquerra> Windows has junctions thare pretty similar to symlinks |
10:54:04 | FromDiscord | <odexine> windows does have symlinks iirc |
10:54:12 | PMunch | Or it doesn't allow execution of links or something |
10:54:14 | FromDiscord | <ezquerra> (edit) "thare" => "which are" |
10:54:17 | FromDiscord | <odexine> really |
10:54:33 | PMunch | I just remember that Windows is the reason why they aren't simply links |
10:55:08 | FromDiscord | <ezquerra> In anycase, whatever choosenim is doing for the nim and nimble executables, it should do the same for atlas |
10:55:13 | FromDiscord | <ezquerra> (edit) "anycase," => "any case," |
10:57:23 | FromDiscord | <sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4Gf2 |
11:08:00 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=4Gf6 |
11:12:49 | FromDiscord | <sOkam! 🫐> In reply to @jmgomez "exportc should work": Im importing them 🤔 |
11:13:44 | FromDiscord | <sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4Gf7 |
11:28:30 | * | jmdaemon quit (Ping timeout: 252 seconds) |
11:42:36 | NimEventer | New thread by cmc: Improving Examples and Documentation, see https://forum.nim-lang.org/t/10477 |
11:57:17 | arkanoid | with nim 2.0.0, is it still suggested to use nim's asyncdispatch, or move to chronos? |
12:05:59 | FromDiscord | <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:17 | FromDiscord | <taperfade> what is async |
12:48:22 | FromDiscord | <taperfade> what does it mean |
12:50:07 | FromDiscord | <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:22 | FromDiscord | <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:41 | arkanoid | what's the correct way to avoid an async program to terminate if an exception is raised inside an async proc? |
13:33:17 | arkanoid | I have rolled my own solution, but I don't know if it is the right way or I am reinventing the wheel |
13:34:17 | FromDiscord | <Chronos [She/Her]> Likely to catch simply catch the error |
13:35:03 | FromDiscord | <Chronos [She/Her]> (edit) removed "catch" |
13:36:36 | arkanoid | Chronos, how? |
13:39:00 | FromDiscord | <Chronos [She/Her]> Afaik surrounding asyncCheck with try and except (or await, depends if you want the result obviously) |
13:39:10 | FromDiscord | <Chronos [She/Her]> Or even waitFor but you know that and I'm being redundant right now haha |
13:40:09 | arkanoid | Chronos, no, it doest |
13:40:30 | * | rockcavera joined #nim |
13:40:46 | FromDiscord | <Chronos [She/Her]> It doesn't? Huh... |
13:41:07 | FromDiscord | <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:08 | FromDiscord | <odexine> it doesnt what? |
13:41:20 | FromDiscord | <leorize> make your entry point async and you can `try`-`except` with it |
13:41:25 | FromDiscord | <Chronos [She/Her]> I'd assume they mean it doesn't catch the errors |
13:41:25 | FromDiscord | <odexine> only await/waitfor will allow for try-except catching iirc |
13:41:37 | FromDiscord | <odexine> asyncCheck doesnt do try-except |
13:41:57 | FromDiscord | <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:03 | FromDiscord | <odexine> with asynccheck you'd have to attach the error handling as a callback |
13:42:24 | FromDiscord | <odexine> asyncCheck only attaches an error handler that rethrows on await/waitFor iirc |
13:42:28 | FromDiscord | <leorize> asyncCheck never made sense to me tbh |
13:42:40 | FromDiscord | <odexine> asyncCheck is a strange name for what it really does |
13:42:56 | arkanoid | for example, this program terminates instead of catching the exception https://play.nim-lang.org/#ix=4GfZ |
13:45:57 | FromDiscord | <odexine> the runforever is what should have the try except iirc |
13:46:05 | arkanoid | I 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:25 | arkanoid | I can confirm that wrapping runForever does work, and the program does not terminate https://play.nim-lang.org/#ix=4Gg3 thanks! |
13:51:27 | arkanoid | so basically asynccheck is mostly useful only if wrapping runForever or waitFor. This is not quite clear from the documentation |
13:52:08 | arkanoid | considering 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:15 | FromDiscord | <leorize> https://play.nim-lang.org/#ix=4Gg5 \<- try this |
13:52:59 | arkanoid | leorize, that is quite similar to what I've already created on my own |
13:53:01 | FromDiscord | <leorize> asyncCheck is basically that callback I wrote but raise afterwards |
13:53:51 | arkanoid | leorize this is what I am using right now https://play.nim-lang.org/#ix=4Gg5 |
13:54:20 | FromDiscord | <leorize> you need to share again cuz that's my link \:p |
13:54:28 | arkanoid | ups, sorry |
13:54:38 | arkanoid | https://play.nim-lang.org/#ix=4Gg8 |
13:55:43 | arkanoid | but I kinda find more elegant to address the error wherever I need on the stacktrace, and not where it could be raised |
13:56:32 | arkanoid | so it's ok to wrap runForever as a catch-all solution to avoid program termination |
13:56:34 | FromDiscord | <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:59 | arkanoid | dispatcher leak? |
13:58:06 | FromDiscord | <leorize> unhandled exceptions leaking via dispatcher |
13:59:57 | arkanoid | ok, but what do you mean also by "attacking the source"? |
14:02:00 | FromDiscord | <taperfade> yooooooooo https://media.discordapp.net/attachments/371759389889003532/1151518143399862282/image.png |
14:02:44 | FromDiscord | <taperfade> reading the docs actually helps no way |
14:03:01 | FromDiscord | <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:40 | FromDiscord | <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:15 | FromDiscord | <taperfade> winim |
15:11:32 | FromDiscord | <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:05 | NimEventer | New thread by aiac: How to compare rune with char ?, see https://forum.nim-lang.org/t/10478 |
15:24:07 | NimEventer | New thread by aiac: How to compare rune with char?, see https://forum.nim-lang.org/t/10479 |
15:24:23 | FromDiscord | <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:12 | NimEventer | New 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:41 | emery | odexine: 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:22 | emery | some deps are not submodules but the build system creates symlinks from the nix packages instead |
16:00:23 | FromDiscord | <odexine> okay, thanks for replying |
16:00:34 | * | junaid_ joined #nim |
16:00:59 | emery | I use --path:… everwhere to specify deps |
16:01:11 | FromDiscord | <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:01 | FromDiscord | <pixel_nerd_linux> sent a long message, see http://ix.io/4GgR |
16:08:35 | FromDiscord | <leorize> you can try concepts |
16:09:08 | FromDiscord | <leorize> but if you want runtime interface then design similar to that module is a simple way to get it done |
16:11:43 | FromDiscord | <Phil> sent a long message, see http://ix.io/4GgS |
16:11:49 | emery | odexine: I don't have a public example of it, but its a build system with a lot of "NIM_FLAGS += --path:../../foo" |
16:11:55 | FromDiscord | <Phil> (edit) "http://ix.io/4GgS" => "https://paste.rs/ZKB3x" |
16:12:11 | FromDiscord | <odexine> sounds funky |
16:12:27 | FromDiscord | <odexine> also kinda sounds just like what atlas does |
16:12:35 | FromDiscord | <odexine> thanks for replying again |
16:12:44 | FromDiscord | <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:05 | FromDiscord | <taperfade> winim docs are awful |
16:13:20 | FromDiscord | <taperfade> idk what to do ugh |
16:17:51 | FromDiscord | <toma400> In reply to @taperfade "winim": Dang, the best library that seem to never get out of Windows. Nice work tho ❤️ |
16:18:50 | FromDiscord | <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:10 | FromDiscord | <toma400> I learned Nigui entirely from reading its `nigui.nim` file, no documentation reading at all |
16:19:38 | FromDiscord | <toma400> Obviously it's not as easy in every case, but it's good workaround if docs are bad/lacking |
16:20:45 | FromDiscord | <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:52 | FromDiscord | <toma400> (edit) "broadly," => "broadly to everyone here," |
16:21:02 | FromDiscord | <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:04 | FromDiscord | <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:30 | FromDiscord | <Phil> sent a long message, see http://ix.io/4GgT |
16:22:42 | FromDiscord | <Phil> Note that the difference between 1.6 and 2.0 is not gargantuan |
16:22:45 | FromDiscord | <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:22 | FromDiscord | <Phil> For the most part it's "db_connection libs now went from std to a db_connector package" |
16:24:11 | FromDiscord | <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:15 | FromDiscord | <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:25 | FromDiscord | <enthus1ast> Read the ms docs for their api↵(@taperfade) |
16:29:50 | FromDiscord | <enthus1ast> It's mostly just a wrapper |
16:31:31 | FromDiscord | <enthus1ast> On msdn |
16:36:31 | FromDiscord | <enthus1ast> and its a pretty good wrapper to be honest \:) |
16:38:16 | * | xmachina joined #nim |
16:42:25 | * | m5zs7k joined #nim |
16:52:39 | FromDiscord | <keithdaustin> sent a long message, see http://ix.io/4Gh1 |
16:53:32 | FromDiscord | <toma400> sent a long message, see https://paste.rs/uitg6 |
16:54:29 | FromDiscord | <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:25 | FromDiscord | <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:34 | FromDiscord | <m4ul3r> In reply to @taperfade "winim docs are awful": Winim is just a wrapper, the real docs are the msdn |
16:56:17 | FromDiscord | <m4ul3r> What enthus1ast said |
16:56:49 | FromDiscord | <inv2004> Hi, how can I add condition for `requires` in nimble file ? |
16:56:55 | FromDiscord | <enthus1ast> @toma400\: uhh i think you mean wnim? |
16:57:04 | FromDiscord | <inv2004> sent a code paste, see https://paste.rs/1Ss9o |
16:57:43 | FromDiscord | <enthus1ast> @toma400\: wnim \:= gui library ; winim \:= win api wrapper |
16:58:17 | FromDiscord | <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:52 | FromDiscord | <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:33 | NimEventer | New 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:52 | FromDiscord | <kingterrytheterrible12> is there gtk4 bindings for nim |
18:07:04 | FromDiscord | <Phil> owlkettle |
18:07:13 | FromDiscord | <kingterrytheterrible12> In reply to @isofruit "owlkettle": no |
18:07:15 | FromDiscord | <kingterrytheterrible12> it memory leaks |
18:07:38 | FromDiscord | <Phil> Fix the memory leaks 😛 |
18:09:39 | FromDiscord | <kingterrytheterrible12> In reply to @isofruit "Fix the memory leaks": no |
18:09:39 | FromDiscord | <Phil> Also if Faisal is your github user then please for the love of god adopt better etiquette |
18:09:46 | FromDiscord | <kingterrytheterrible12> In reply to @isofruit "Also if Faisal is": yes |
18:10:08 | FromDiscord | <kingterrytheterrible12> all i said was "bro fix it" and he started crying |
18:12:27 | FromDiscord | <m4ul3r> Well don’t just say “bro fix it” and offer something constructive rather than junk <:joy_think:1119766500413284482> |
18:12:35 | FromDiscord | <kingterrytheterrible12> In reply to @m4ul3r "Well don’t just say": i did |
18:12:46 | FromDiscord | <kingterrytheterrible12> if you would actually read |
18:12:51 | FromDiscord | <kingterrytheterrible12> https://github.com/can-lehmann/owlkettle/issues/73 |
18:12:52 | FromDiscord | <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:07 | FromDiscord | <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:16 | FromDiscord | <kingterrytheterrible12> In reply to @isofruit "1) You made a": fuck i'll make my own bindings |
18:13:41 | FromDiscord | <kingterrytheterrible12> you really ship a memory leaky bullshit then you ask me about my attitude |
18:13:46 | FromDiscord | <kingterrytheterrible12> yeah no |
18:14:02 | FromDiscord | <nnsee> did you pay for it? |
18:14:09 | FromDiscord | <kingterrytheterrible12> In reply to @nnsee "did you pay for": no |
18:14:09 | FromDiscord | <nnsee> this guy is working on this for free |
18:14:15 | FromDiscord | <nnsee> you are NOT entitled to that attitude |
18:14:18 | FromDiscord | <kingterrytheterrible12> free for FREEDOM |
18:14:28 | FromDiscord | <Phil> In reply to @kingterrytheterrible12 "you really ship a": Absolutely. |
18:14:41 | FromDiscord | <kingterrytheterrible12> anyways its licensed on MIT im just gonna fork it or make my own GTK bindings |
18:15:28 | FromDiscord | <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:58 | FromDiscord | <kingterrytheterrible12> In reply to @can.l "If you fork it": probably not |
18:16:16 | FromDiscord | <nnsee> on that parasite grindset |
18:16:43 | FromDiscord | <kingterrytheterrible12> its a shame since i like the idea of owlkettle |
18:16:52 | FromDiscord | <kingterrytheterrible12> but the bugs i get is too much |
18:18:22 | FromDiscord | <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:28 | FromDiscord | <m4ul3r> The author pretty much told you it’s expected from the gtk library |
18:18:41 | FromDiscord | <kingterrytheterrible12> In reply to @can.l "Which bugs did you": clone libre-pathadder and see for yourself |
18:18:54 | FromDiscord | <kingterrytheterrible12> the dialog pop up shakes a bit then goes to normal |
18:19:07 | FromDiscord | <nnsee> user error |
18:27:21 | FromDiscord | <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:26 | FromDiscord | <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:03 | FromDiscord | <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:13 | FromDiscord | <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:33 | FromDiscord | <kingterrytheterrible12> In reply to @isofruit "Troubleshooting video: I'm having": how to record screen |
18:30:39 | FromDiscord | <Phil> You on Linux and gnome? |
18:30:43 | FromDiscord | <kingterrytheterrible12> yes |
18:30:47 | FromDiscord | <kingterrytheterrible12> cinnamon |
18:30:50 | FromDiscord | <m4ul3r> obs is a way |
18:30:59 | FromDiscord | <Phil> Errrr no clue on cinnamon |
18:31:11 | FromDiscord | <Phil> Gnome comes bundled with piece of software, maybe they share the hotkey? |
18:31:16 | FromDiscord | <kingterrytheterrible12> give gnome app it working same way |
18:31:19 | FromDiscord | <Phil> CTRL SHIFT ALT R |
18:31:45 | FromDiscord | <kingterrytheterrible12> ye bro it no work |
18:31:50 | FromDiscord | <kingterrytheterrible12> i figure out a way |
18:35:33 | FromDiscord | <kingterrytheterrible12> yeah its not visiable on camera |
18:35:44 | FromDiscord | <kingterrytheterrible12> but its very clear when you see it with your eyes |
18:36:15 | FromDiscord | <m4ul3r> Doesn't sound like an error with the library, probably a graphics issue then |
18:36:43 | FromDiscord | <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:02 | FromDiscord | <kingterrytheterrible12> left to right sideway |
18:37:28 | FromDiscord | <kingterrytheterrible12> this direction https://media.discordapp.net/attachments/371759389889003532/1151587468391485531/image.png |
18:37:31 | FromDiscord | <Phil> And when the window opens or when the popup shows up after clicking the button? |
18:37:40 | FromDiscord | <kingterrytheterrible12> In reply to @isofruit "And when the window": pop up |
18:37:44 | FromDiscord | <kingterrytheterrible12> dialog |
18:38:10 | FromDiscord | <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:17 | FromDiscord | <Phil> You on nvidia, AMD or an intel iGPU? |
18:38:23 | FromDiscord | <kingterrytheterrible12> In reply to @toma400 "Imagine you will make": xd |
18:38:26 | FromDiscord | <kingterrytheterrible12> In reply to @isofruit "You on nvidia, AMD": nvidia |
18:38:33 | FromDiscord | <Phil> X11 or wayland? |
18:38:37 | FromDiscord | <kingterrytheterrible12> X11 |
18:38:43 | FromDiscord | <sulfasolate> what are people using for http webservers? |
18:38:49 | FromDiscord | <Phil> Hmmmm okay let me see on X11 if I get it there |
18:38:50 | FromDiscord | <kingterrytheterrible12> In reply to @sulfasolate "what are people using": mummy |
18:39:07 | FromDiscord | <Phil> In reply to @sulfasolate "what are people using": Httpx, which is an httpbeast fork |
18:39:11 | FromDiscord | <kingterrytheterrible12> yeah now that i think about it |
18:39:14 | FromDiscord | <Phil> (edit) "In reply to @sulfasolate "what are people using": Httpx, which is an httpbeast fork ... " added "and is used by prologue" |
18:39:17 | FromDiscord | <inv2004> how to get 1000 stars on github nim project? |
18:39:24 | FromDiscord | <Phil> Okay I don''t get it on wayland with an intel iGPU, let me check on X11 |
18:39:28 | FromDiscord | <inv2004> (edit) "how to get 1000 stars on github nim project? ... " added "- I think that everyone needs it 🙂" |
18:39:32 | FromDiscord | <kingterrytheterrible12> i'm sorry for being rude @can.l, i will try to help fix the bugs in the project |
18:39:50 | FromDiscord | <sulfasolate> thanks phil |
18:39:58 | FromDiscord | <can.l> In reply to @kingterrytheterrible12 "i'm sorry for being": That is appreciated. |
18:40:28 | FromDiscord | <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:59 | FromDiscord | <inv2004> (edit) removed "🙂" |
18:41:04 | FromDiscord | <Phil> In reply to @kingterrytheterrible12 "BTW i hope to": I use zsh so I really don't care what's in bashrc |
18:41:08 | FromDiscord | <inv2004> (edit) removed "that" |
18:41:10 | FromDiscord | <kingterrytheterrible12> alright |
18:41:11 | FromDiscord | <Phil> I can manually delete the contents in there anyway |
18:41:54 | FromDiscord | <Phil> Wow X11 is the opposite of smooth, I really only notice that contrast atm coming from wayland |
18:42:52 | FromDiscord | <kingterrytheterrible12> In reply to @isofruit "*Wow* X11 is the": i am nvidia slave |
18:43:00 | FromDiscord | <kingterrytheterrible12> wayland dont work |
18:44:04 | FromDiscord | <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:14 | FromDiscord | <Phil> And yeah I can understand that pain |
18:44:35 | FromDiscord | <Phil> My desktop and work machine also both run nvidia stuff =/ |
18:45:14 | FromDiscord | <kingterrytheterrible12> hm im not sure if its just a very cinnamon spesific issue or what |
18:45:17 | FromDiscord | <kingterrytheterrible12> (edit) "spesific" => "specific" |
18:45:46 | FromDiscord | <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:33 | FromDiscord | <kingterrytheterrible12> In reply to @isofruit "I mean maybe we": ubuntu/mint |
18:46:38 | FromDiscord | <Phil> Ohhhhhhhh |
18:46:49 | FromDiscord | <Phil> Then that could actually be a thing, let me check if there's a cli command on arch |
18:46:58 | FromDiscord | <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:18 | FromDiscord | <kingterrytheterrible12> `libgtk-4-dev` |
18:47:26 | FromDiscord | <nnsee> the application also works fine here with no shaking |
18:47:37 | FromDiscord | <nnsee> it's an issue with your system |
18:47:54 | FromDiscord | <kingterrytheterrible12> sent a code paste, see https://play.nim-lang.org/#ix=4GhN |
18:48:01 | FromDiscord | <kingterrytheterrible12> 4.6.9 nice |
18:49:43 | FromDiscord | <Phil> Hmm I'm on 4.12.1 |
18:49:50 | FromDiscord | <nnsee> same |
18:50:02 | FromDiscord | <kingterrytheterrible12> its the non rolling release experince |
18:50:03 | FromDiscord | <Phil> I still wouldn't immediately jump to blaming the GPU |
18:50:20 | FromDiscord | <kingterrytheterrible12> im stuck with bugs for another 6 months |
18:50:23 | FromDiscord | <Phil> Is there a way for you to update your libgtk-4 version? |
18:50:23 | FromDiscord | <nnsee> you're not running on some high refresh rate with no waiting for vblank or anything? |
18:50:32 | FromDiscord | <kingterrytheterrible12> In reply to @nnsee "you're not running on": is 75hz high? |
18:50:43 | FromDiscord | <Phil> Not quite |
18:50:57 | FromDiscord | <nnsee> not particularly, but it would explain why it doesn't show up in a recording |
18:51:02 | FromDiscord | <Phil> Well it's higher than what I have, 60HZ on my end |
18:51:10 | FromDiscord | <Phil> (edit) "60HZ" => "60Ht" |
18:51:13 | FromDiscord | <Phil> (edit) "60Ht" => "60Hz" |
18:51:17 | FromDiscord | <nnsee> (assuming it records at 60, which is the default everywhere) |
18:51:28 | FromDiscord | <Phil> https://media.discordapp.net/attachments/371759389889003532/1151590991757856848/image.png |
18:51:55 | FromDiscord | <Phil> Can you select a 60Hz refresh rate? |
18:51:59 | FromDiscord | <nnsee> well that's quite an esoteric resolution |
18:52:04 | FromDiscord | <nnsee> is this a VM or something? |
18:52:07 | FromDiscord | <Phil> In reply to @nnsee "well that's quite an": Framework |
18:52:09 | FromDiscord | <Phil> (edit) "In reply to @nnsee "well that's quite an": Framework ... " added "laptop" |
18:52:12 | FromDiscord | <nnsee> ah |
18:52:20 | FromDiscord | <Phil> 13 inch model, comes with a 3:2 ratio that leads to this resolution |
18:52:27 | FromDiscord | <kingterrytheterrible12> anyways i sleep i have work tomorrow |
18:52:37 | FromDiscord | <kingterrytheterrible12> i will try to fix owlkettle after work tomorrow |
18:52:40 | FromDiscord | <Phil> Alrighty, sleep tight! |
18:52:47 | FromDiscord | <nnsee> night |
18:52:47 | FromDiscord | <kingterrytheterrible12> thanks! |
18:54:09 | FromDiscord | <Phil> Okay, back to wayland, this X11 experience is weird as hell |
19:00:25 | * | ntat quit (Quit: leaving) |
19:02:04 | FromDiscord | <ShalokShalom (ShalokShalom)> Oh nice, how is it? The AMD model?↵(@Phil) |
19:02:20 | FromDiscord | <ShalokShalom (ShalokShalom)> Elegantbeef\: You may like that |
19:02:26 | FromDiscord | <ShalokShalom (ShalokShalom)> https://github.com/titzer/wizard-engine |
19:02:51 | FromDiscord | <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:51 | FromDiscord | <Phil> Ah shit, we should keep this to #offtopic |
19:05:13 | FromDiscord | <ShalokShalom (ShalokShalom)> They were just selling the 11th gen motherboard for 200 bucks↵(@Phil) |
19:07:04 | FromDiscord | <Phil> In reply to @ShalokShalom (ShalokShalom) "They were just selling": See #offtopic for my response 😛 |
19:07:29 | FromDiscord | <ShalokShalom (ShalokShalom)> Is that on Matrix? |
19:07:47 | FromDiscord | <Phil> #nim-offtopic |
19:08:23 | FromDiscord | <Phil> You got a gitter? |
19:10:58 | FromDiscord | <inv2004> I was sure I opened linux chat when checked last few pages |
19:11:37 | FromDiscord | <Phil> In reply to @ShalokShalom (ShalokShalom) "Is that on Matrix?": Invited your account to offtopic |
19:11:50 | FromDiscord | <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:38 | FromDiscord | <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:17 | FromDiscord | <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:56 | FromDiscord | <Chronos [She/Her]> I don't really understand licensing much lol |
19:29:47 | FromDiscord | <Phil> sent a long message, see http://ix.io/4GhS |
19:29:55 | FromDiscord | <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:44 | FromDiscord | <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:36 | FromDiscord | <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:44 | FromDiscord | <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:23 | FromDiscord | <Chronos [She/Her]> Eh... I'll do GPL 3 to be safe |
19:32:29 | FromDiscord | <Elegantbeef> I'd love to see a civil case over dynamic linking to GPL code |
19:33:11 | FromDiscord | <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:24 | FromDiscord | <Elegantbeef> If it is against gpl to do such, that implies that you can own a interface with no implementation |
19:34:14 | FromDiscord | <Phil> Which I think already is a case covered by Sun vs. google android and their java interface reimplementation IIRC |
19:34:38 | FromDiscord | <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:48 | FromDiscord | <Phil> In that case, have an `Installation` section in your README.md |
19:34:52 | FromDiscord | <Phil> Or your nimibook |
19:35:06 | FromDiscord | <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:53 | FromDiscord | <Phil> I mean, Sun/Oracle lost that one as the judges stated you can't own an interface IIRC |
19:36:32 | FromDiscord | <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:34 | FromDiscord | <can.l> Ah, it might cover the opposite direction. |
19:37:52 | FromDiscord | <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:24 | FromDiscord | <Phil> Wait a second... were destroy hooks originally `proc destroy` instead of `proc =destroy`? |
19:39:41 | FromDiscord | <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:55 | FromDiscord | <Elegantbeef> Dont think so rainbow |
19:40:00 | FromDiscord | <Elegantbeef> I believe so phil |
19:42:46 | * | xet7 joined #nim |
19:44:18 | FromDiscord | <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:46 | FromDiscord | <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:59 | FromDiscord | <Phil> Like, I assume there to be some `proc =destroy` somewhere, just can't seem to find em |
19:46:13 | FromDiscord | <can.l> See the compiler output, I just had a quick look and saw that they are actually finalizers. |
19:46:32 | FromDiscord | <Phil> As in, the C output? |
19:46:36 | FromDiscord | <can.l> (so maybe issue naming could be improved) |
19:46:50 | FromDiscord | <ShalokShalom (ShalokShalom)> GPL3 or later↵(@Chronos [She/Her]) |
19:46:52 | FromDiscord | <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:12 | FromDiscord | <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:34 | FromDiscord | <Phil> Ohhh that's how |
19:47:37 | FromDiscord | <ShalokShalom (ShalokShalom)> the license allows you to license under GPL 4, if that ever releases |
19:47:38 | FromDiscord | <Phil> You run nim c |
19:47:42 | FromDiscord | <Phil> (edit) "You run nim c ... " added "owlkettle.nim" |
19:47:43 | FromDiscord | <can.l> yes |
19:47:54 | FromDiscord | <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:07 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4GhZ |
19:50:32 | FromDiscord | <can.l> Use a destroy hook instead of the finalizer ( new(result, finalizer=finalizer)) |
19:50:40 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4Gi0 |
19:51:50 | FromDiscord | <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:37 | FromDiscord | <can.l> I assume that the compiler does not like the `finalizer=finalizer`. |
19:53:31 | FromDiscord | <Phil> I'm pretty sure it doesn't like the result |
19:53:52 | FromDiscord | <Phil> Since it's complaining about `var T` and that's at the column where it starts getting the first parameter |
19:53:53 | FromDiscord | <Chronos [She/Her]> Also.. Should I just do `{.emit: "#include <espeak-ng/speak_lib.h>".}` then I can just `importc` the procs? |
19:54:44 | FromDiscord | <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:53 | FromDiscord | <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:43 | FromDiscord | <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:20 | FromDiscord | <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:09 | FromDiscord | <Chronos [She/Her]> In reply to @can.l "There is a header": Oh sweet! |
20:01:42 | FromDiscord | <Chronos [She/Her]> Wait LLVM backend...? Does it mean nlvm? |
20:03:31 | * | jmdaemon joined #nim |
20:07:08 | FromDiscord | <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:21 | FromDiscord | <can.l> Usually you create one for each object. |
20:08:28 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4Gic |
20:08:29 | FromDiscord | <can.l> (edit) "object." => "object type." |
20:08:57 | FromDiscord | <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:16 | FromDiscord | <can.l> It needs to be `PixbufObj` (where `Pixbuf = ref PixbufObj` and `PixbufObj = object ...`) |
20:10:05 | FromDiscord | <Phil> Oh the issue is that PixBuf is a ref object? Wha? |
20:12:18 | FromDiscord | <kingterrytheterrible12> In reply to @isofruit "Because I don't get": i think it has to be a generic |
20:12:24 | FromDiscord | <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:23 | FromDiscord | <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:48 | FromDiscord | <Phil> (edit) "GdkPixBuf" => "GdkPixBuf, which is a distinct pointer to said data structure within GTK" |
20:14:43 | FromDiscord | <Phil> And the destructor then is for PixBufObj I take it? |
20:14:49 | FromDiscord | <raynei486> why do destructors need to be generic? |
20:14:50 | FromDiscord | <can.l> jup |
20:15:06 | FromDiscord | <raynei486> What if I'm creating a destructor for a simple object |
20:15:20 | FromDiscord | <Phil> In reply to @kingterrytheterrible12 "i think it has": Didn't have to be... I think so far |
20:18:52 | FromDiscord | <kingterrytheterrible12> In reply to @isofruit "Because I don't get": it just told you in err |
20:18:54 | FromDiscord | <kingterrytheterrible12> no? |
20:20:18 | FromDiscord | <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:42 | FromDiscord | <kingterrytheterrible12> okay |
20:23:54 | * | tanami joined #nim |
20:25:31 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4Gij |
20:27:11 | FromDiscord | <kingterrytheterrible12> In reply to @isofruit "Okay so from a": if this throws exeption it will leak |
20:27:16 | FromDiscord | <kingterrytheterrible12> due to nim compiler bug |
20:27:21 | FromDiscord | <kingterrytheterrible12> https://github.com/nim-lang/Nim/issues/22672 |
20:27:44 | FromDiscord | <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:53 | FromDiscord | <kingterrytheterrible12> xd |
20:27:53 | FromDiscord | <Phil> Also you wanted to sleep IIRC 😛 |
20:27:54 | FromDiscord | <kingterrytheterrible12> ok |
20:28:04 | FromDiscord | <kingterrytheterrible12> no irc only discord |
20:28:08 | FromDiscord | <kingterrytheterrible12> In reply to @isofruit "Also you wanted to": i couldnt |
20:29:44 | FromDiscord | <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:07 | FromDiscord | <kingterrytheterrible12> ^_^ |
20:30:08 | FromDiscord | <Phil> pmunch , your take? |
20:30:12 | * | tanami quit (Ping timeout: 240 seconds) |
20:30:16 | FromDiscord | <Phil> (edit) "chances" => "changes" |
20:30:39 | FromDiscord | <kingterrytheterrible12> rumors say pmunch switch to rust |
20:31:50 | * | tanami joined #nim |
20:33:20 | FromDiscord | <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:36 | FromDiscord | <nervecenter> (edit) "when" => "one" |
20:34:00 | FromDiscord | <kingterrytheterrible12> In reply to @nervecenter "For good reason? Switching": rumors say you dont know what a joke is |
20:34:14 | FromDiscord | <kingterrytheterrible12> this is pmunch |
20:34:17 | FromDiscord | <nervecenter> eh I wasn't keeping track of the convo |
20:34:27 | FromDiscord | <kingterrytheterrible12> doubt he would switch |
20:34:32 | FromDiscord | <Chronos [She/Her]> Tbh debating on just porting the enum to Nim instead of importing it |
20:34:45 | FromDiscord | <Chronos [She/Her]> Mostly bc idk how to correctly wrap it |
20:34:46 | FromDiscord | <kingterrytheterrible12> In reply to @chronos.vitaqua "Tbh debating on just": futhrak? |
20:34:51 | FromDiscord | <kingterrytheterrible12> you dont |
20:34:53 | FromDiscord | <Chronos [She/Her]> Nope, manually |
20:34:54 | FromDiscord | <kingterrytheterrible12> futhrak |
20:35:01 | FromDiscord | <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:14 | FromDiscord | <Chronos [She/Her]> As a learning opportunity + it's a simple lib |
20:36:00 | FromDiscord | <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:56 | FromDiscord | <kingterrytheterrible12> i started a language war by a joke |
20:37:00 | FromDiscord | <raynei486> Why I can't I define a destructor for a `ptr` type 😦 |
20:37:06 | FromDiscord | <raynei486> Is this not the proper signature? |
20:37:13 | FromDiscord | <raynei486> sent a code paste, see https://play.nim-lang.org/#ix=4Gil |
20:38:09 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4Gim |
20:38:27 | FromDiscord | <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:52 | FromDiscord | <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:26 | FromDiscord | <Phil> I think more like wrapper for CFile (?), I don't know jack |
20:43:39 | FromDiscord | <Phil> Or a destructor directly for CFile if you can |
20:45:06 | FromDiscord | <raynei486> Alright |
20:45:52 | FromDiscord | <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:02 | FromDiscord | <jviega> Mine tend to just have one field, being the C object ref 🙂 |
20:47:06 | FromDiscord | <Elegantbeef> You either need `object` or `distinct` |
20:47:57 | FromDiscord | <Chronos [She/Her]> Beef, you're smart, what do I do when wrapping C code with Enums :p |
20:49:27 | FromDiscord | <Phil> Okay I can trigger the pixibuf destructor |
20:49:59 | FromDiscord | <Elegantbeef> importc and declare the enums in their ordinal order |
20:52:07 | FromDiscord | <Chronos [She/Her]> In reply to @Elegantbeef "importc and declare the": So `type MyEnum = enum {.importc: "...".}`? |
20:52:13 | FromDiscord | <Chronos [She/Her]> Also how about for variables :p |
20:52:30 | FromDiscord | <Chronos [She/Her]> And constants within the code lol |
20:52:35 | FromDiscord | <Elegantbeef> No not that way the pragma goes on the type name |
20:52:39 | FromDiscord | <Elegantbeef> Constants within the code? |
20:52:44 | FromDiscord | <Elegantbeef> Are we talking about enums or defines? |
20:53:06 | FromDiscord | <Chronos [She/Her]> Both- First part was enums, now asking about defines- |
20:53:10 | FromDiscord | <Chronos [She/Her]> In reply to @Elegantbeef "No not that way": Alright! |
20:53:39 | FromDiscord | <Elegantbeef> @raynei486 for your File stuff you'll likely need to change it to `type File = distinct ptr CFile` |
20:53:58 | FromDiscord | <Elegantbeef> Defines you can just import as constants if you want |
20:56:09 | FromDiscord | <Chronos [She/Her]> In reply to @Elegantbeef "Defines you can just": How? :p |
20:56:14 | FromDiscord | <raynei486> In reply to @Elegantbeef "<@733059160924749855> for your File": Why the distinct? |
20:56:17 | FromDiscord | <Chronos [She/Her]> I am Chronically Stupid™️ |
20:56:43 | FromDiscord | <Elegantbeef> Cause Nim only allows custom hooks on `object` or `distinct` |
20:56:43 | FromDiscord | <Elegantbeef> Do not think you can use destructors on `ptr object` |
20:56:55 | FromDiscord | <Elegantbeef> `const myConst = 10` |
20:56:58 | FromDiscord | <Elegantbeef> Believe it or not that's valid Nim 😛 |
20:57:18 | FromDiscord | <raynei486> In reply to @Elegantbeef "Cause Nim only allows": ah okay |
20:57:51 | FromDiscord | <Chronos [She/Her]> In reply to @Elegantbeef "Believe it or not": Ah alright lol |
20:58:18 | FromDiscord | <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:48 | FromDiscord | <Elegantbeef> You generally want to use fixed size integers |
20:58:49 | FromDiscord | <Elegantbeef> Unless the C api doesnt use them |
20:58:52 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4Gir |
20:59:49 | FromDiscord | <Chronos [She/Her]> In reply to @Elegantbeef "You generally want to": It just says `int` so- |
21:00:03 | * | jeremysnetcat joined #nim |
21:00:11 | FromDiscord | <Chronos [She/Her]> Hmmm maaaybe I'll just futhark this |
21:00:20 | FromDiscord | <Chronos [She/Her]> Then write a higher level wrapper |
21:00:20 | FromDiscord | <Elegantbeef> int is int32 generally |
21:00:31 | FromDiscord | <Chronos [She/Her]> good to know! |
21:01:10 | FromDiscord | <jviega> In what environment do you mean? |
21:01:21 | FromDiscord | <raynei486> sent a code paste, see https://play.nim-lang.org/#ix=4Giv |
21:01:30 | FromDiscord | <Elegantbeef> You need to write your own `isNil` |
21:01:33 | FromDiscord | <raynei486> Is it because a `File` is no longer a `ptr CFile` |
21:01:35 | FromDiscord | <jviega> In C it's always the native word size which is usually 64 bits 🙂 |
21:01:53 | FromDiscord | <demotomohiro> !eval echo sizeof(cint) |
21:01:56 | NimBot | 4 |
21:01:58 | * | jeremysnetcat quit (Quit: jeremysnetcat) |
21:02:03 | FromDiscord | <Elegantbeef> No `int` is 32bit generally in C |
21:02:33 | FromDiscord | <Elegantbeef> Yes raynei, distincts lose all operations of their base type |
21:03:17 | FromDiscord | <raynei486> this is more work than I expected |
21:03:25 | FromDiscord | <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:51 | FromDiscord | <jviega> On x86 in particular, the penalty for being non-word aligned is far more real than the extra memory |
21:04:10 | FromDiscord | <Elegantbeef> Cause C is 80 billion years old and it seemed like a good idea 😛 |
21:04:25 | FromDiscord | <demotomohiro> iirc, `int` in C in x86_64 become 32bit so that you can easily reuse code written for 32bit CPUs. |
21:04:35 | FromDiscord | <jviega> When I was a younger man it was the native machine size, back when it was all either 16 or 32 |
21:05:08 | FromDiscord | <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:35 | FromDiscord | <Elegantbeef> Did you misplace you walker? |
21:12:12 | FromDiscord | <jmgomez> hey @demotomohiro FYI the initializers PR is waiting to be merged https://github.com/nim-lang/Nim/pull/22694 |
21:13:38 | FromDiscord | <jmgomez> the test file covers the issue that you had |
21:14:51 | FromDiscord | <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:56 | FromDiscord | <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:33 | FromDiscord | <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:17 | FromDiscord | <demotomohiro> If an object contains such a type as field, don't add '{}' when defining that type in generated C++ code. |
21:21:17 | FromDiscord | <jmgomez> I dont know. `{}` Is used because it also inits members fields inside the body of a struct |
21:21:42 | FromDiscord | <jmgomez> not all info is available at the codegen stage, but I guess it's a matter to fine tune it later |
21:25:15 | FromDiscord | <jmgomez> Are you sure `{}` doesnt work with explicit ctors? |
21:26:12 | FromDiscord | <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:16 | FromDiscord | <demotomohiro> https://wandbox.org/permlink/hmFVsv2TnVVh0EQV |
21:31:36 | FromDiscord | <jmgomez> ah I see what you mean, but why just dont use a pointer? |
21:32:50 | FromDiscord | <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:05 | FromDiscord | <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:16 | FromDiscord | <jmgomez> ok, but the `{}` issue on ref already existed, right? |
21:37:31 | FromDiscord | <jmgomez> Not sure who did that, but it was like that already for some importcpp types |
21:38:02 | FromDiscord | <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:13 | FromDiscord | <jmgomez> (edit) "an" => "and" |
21:42:02 | FromDiscord | <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:14 | FromDiscord | <jmgomez> but the place where they are gen, dont change |
21:50:09 | FromDiscord | <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:27 | FromDiscord | <demotomohiro> In reply to @jmgomez "just to clarify it,": OK |
21:53:59 | FromDiscord | <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:34 | FromDiscord | <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:49 | FromDiscord | <Chronos [She/Her]> Hello there and welcome back o7 |
22:15:21 | FromDiscord | <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:22 | FromDiscord | <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:28 | FromDiscord | <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:39 | FromDiscord | <Elegantbeef> How does it get much more complicated? |
22:29:44 | * | genr8eofl__ joined #nim |
22:31:17 | FromDiscord | <Elegantbeef> The more complicated part is that they use inheritance, which means destructors just do not work by default with them |
22:31:47 | FromDiscord | <raynei486> 😦 |
22:32:13 | * | genr8eofl_ quit (Ping timeout: 258 seconds) |
22:33:36 | FromDiscord | <raynei486> I don't wanna touch too much stuff |
22:33:42 | FromDiscord | <raynei486> maybe I should just not change streams for now |
22:36:48 | FromDiscord | <Elegantbeef> Finalisers exist so that could work for streams perhaps |
22:45:15 | FromDiscord | <raynei486> hmm never heard of them |
22:45:21 | FromDiscord | <raynei486> They don't seem to be mentioned in the manual either |
22:45:40 | FromDiscord | <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:03 | FromDiscord | <millymox> Can anybody direct me to a nim package that has encryption? preferrably Sha1 or AES |
22:57:45 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/sha1.html |
22:57:45 | FromDiscord | <raynei486> I mean it's basically a vtable↵Wouldn't it work if I could declare destructors with `method` |
22:57:55 | FromDiscord | <raynei486> (edit) "I mean it's ... basically" added "currently" |
22:58:09 | FromDiscord | <raynei486> ok my brain hurts I'll work on this tomorrow |
22:58:23 | FromDiscord | <Elegantbeef> I mean it could work, but I mean finalisers exist now |
22:59:38 | FromDiscord | <raynei486> I saw discussions of deprecating finalisers though |
22:59:56 | FromDiscord | <Elegantbeef> Where? |
23:02:31 | FromDiscord | <raynei486> https://github.com/nim-lang/RFCs/issues/504 |
23:03:20 | FromDiscord | <Elegantbeef> Ah |
23:04:06 | FromDiscord | <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:08 | FromDiscord | <leorize> you should just look for an openssl wrapper |
23:05:15 | FromDiscord | <leorize> or look at some status-im stuff |
23:05:24 | FromDiscord | <leorize> not many in nim do crypto |
23:05:47 | FromDiscord | <leorize> there's a libsodium wrapper if that library works for you |
23:08:51 | FromDiscord | <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 |