<< 14-06-2022 >>

00:07:46NimEventerNew thread by Mardiyah: An unknown solution error on template, see https://forum.nim-lang.org/t/9232
00:12:03*derpydoo quit (Quit: derpydoo)
00:17:54FromDiscord<theangryepicbanana> trying to compile on windows 10 using msys2 but I'm getting this weird error. any ideas? https://media.discordapp.net/attachments/371759389889003532/986061885428338688/unknown.png
00:18:08FromDiscord<theangryepicbanana> I swear I've ran into this before and I thought I fixed it
00:18:20FromDiscord<Elegantbeef> Are you compiling using a 32bit compiler?
00:18:34FromDiscord<Elegantbeef> Or do you not have the compiler bit set properly
00:18:41FromDiscord<theangryepicbanana> I'm pretty sure it's 64but
00:18:43FromDiscord<theangryepicbanana> (edit) "64but" => "64bit"
00:18:48FromDiscord<Elegantbeef> no clue what it is for mysys but it's generally like `--passC:"-m32"` or similar
00:19:30FromDiscord<theangryepicbanana> that didn't work unfortunately
00:20:02FromDiscord<Elegantbeef> Yea it seems tobe a discrepancy between Nim present arch and dest arch, no clue the solution other than tweak the two
00:20:18FromDiscord<Elegantbeef> Ensure the backend compiler is the 64bit version and ensure you arent passing `--cpu:i386`
00:20:22FromDiscord<theangryepicbanana> ok
00:30:45FromDiscord<theangryepicbanana> nvm I got it working
00:30:49FromDiscord<theangryepicbanana> stupid windows path issue
00:31:07FromDiscord<Elegantbeef> Sorry i wasnt helpful 😛
00:56:28FromDiscord<j-james> is pixie a good choice for high-ish performance rendering?
00:56:46FromDiscord<j-james> like for a desktop application
00:57:04FromDiscord<Elegantbeef> I mean that's what treeform is aiming at it's usage
00:57:04FromDiscord<Elegantbeef> I use it for text rendering in my framework
01:15:35FromDiscord<Rika> It should be very good for performance
01:25:30FromDiscord<guzba> In reply to @Rika "It should be very": and constantly improving too, ive got several prs worth of stuff in the queue for very soon↵but yes desktop application is the intended use, if you want gpu acceleration for 2d ui stuff, look at also trying https://github.com/treeform/boxy
01:25:36FromDiscord<guzba> @j-james ^
01:44:44*vicfred_ quit (Quit: Leaving)
02:02:59FromDiscord<Elegantbeef> @treeform\: I was bored and now i'm a competitor in the sub 100 LOC ECS 😛 https://gist.github.com/beef331/3bdd7f02cd3756c82e6987d8ab5c6d4e
02:03:22FromDiscord<Elegantbeef> Though i'm fairly certain it has UB
02:06:26madpropsim also bored wtf
02:06:46madpropsecho posHealth
02:06:49madpropsecho health
02:32:23NimEventerNew Nimble package! pkginfo - A tiny utility package to extract Nimble information from any project, see https://github.com/openpeep/pkginfo
02:36:05FromDiscord<Rika> Hmm
02:36:16FromDiscord<Rika> Kinda weird to need something like this
02:50:54FromDiscord<j-james> how can i print out the result of a Future[T]?
02:52:50FromDiscord<Elegantbeef> `echo await myFut`?
02:54:39FromDiscord<j-james> `nim-1.6.6/lib/pure/asyncmacro.nim(130, 3) Error: 'yield' only allowed in an iterator`
02:55:23FromDiscord<j-james> i've tried that, setting it to a variable and echoing that variable, and making an `addCallback` function
02:56:18*systemdsucks quit (Ping timeout: 252 seconds)
02:56:41FromDiscord<Rika> If you’re not in an async function use waitFor
03:03:08*systemdsucks joined #nim
03:04:58FromDiscord<lamersc> Nim site looks down?
03:05:04FromDiscord<lamersc> https://media.discordapp.net/attachments/371759389889003532/986103955987775488/IMG_6413.png
03:05:29FromDiscord<Rika> I can back that up, down for me too
03:06:50FromDiscord<xflywind> Yeah
03:07:58FromDiscord<lamersc> Andddd it’s back 😆
03:13:49FromDiscord<treeform> In reply to @Elegantbeef "<@107140179025735680>\: I was bored": Cool. We tried to use ECS at large scale, it did not really fit our usecase and we ended up not doing ecs.
03:14:20FromDiscord<huantian> In reply to @j-james "`nim-1.6.6/lib/pure/asyncmacro.nim(130, 3) Error: '": Hm maybe that change should be backportrd to 1.6
03:24:47FromDiscord<Prestige> In reply to @treeform "Cool. We tried to": I'm interested in the details if you care to share, like why it didn't work out and what you mean by "large scale"
03:26:26FromDiscord<treeform> In reply to @Avahe "I'm interested in the": large scale - i guess with many moving parts
03:26:48FromDiscord<treeform> we'll probably make a video talking about it eventually
03:46:02FromDiscord<Prestige> Cool
03:53:38FromDiscord<Elegantbeef> Yea i've never really used ECS, gets pretty weird to reason about imo
03:54:44FromDiscord<Elegantbeef> It's one of the better compositional design paradigms though
03:55:29FromDiscord<Elegantbeef> Were you guys rolling your own ECS or using an existing library?
03:56:02FromDiscord<guzba> @ElegantBeef 👀 care to guess?
03:56:16FromDiscord<Elegantbeef> I assume the former but i'd hope the latter
03:56:19FromDiscord<Elegantbeef> Since polymorph exists
03:59:13FromDiscord<guzba> we experimented with a couple different approaches from scratch and will im sure revisit ecs at least a couple more times↵treeform has his own opinion he can share if he sees this↵mine is that we are still figuring out the project this was in, and we arent sure it was even going to offer any wins in our case, so it just got basically punted
03:59:48FromDiscord<guzba> no need to solve everything at the same time
04:00:09FromDiscord<Elegantbeef> Yea i know a lot of people attempt to shoehorn ECS as their solution to every problem and it just creates very annoying code
04:00:50FromDiscord<Elegantbeef> It's relatively common people try to use ECS to manage UI in their games and it's just a big headache
04:04:21FromDiscord<guzba> i think we both think the whole ecs thing is neat, so are pulled into wanting to use it↵who knows, maybe we will, but it really did affect a lot of things↵i cant remember it all exactly just now, but even down to like memory management even (if you have a seq of something as the backing, does it only ever get bigger?) do you refcount the ecs indexes? etc, fuzzy but i think that was a couple things
04:51:40FromDiscord<Prestige> ECS sounds neat on the surface but I've never seen a super elegant implementation
04:55:52FromDiscord<Elegantbeef> What do you find inelegant about polymorph?
05:01:21*jmd_ quit (Ping timeout: 244 seconds)
05:03:00FromDiscord<Prestige> I'd have to look through it again, don't remember the details off the top of my head
05:03:23FromDiscord<Elegantbeef> I mean i think i have a sort of similar view
05:03:35FromDiscord<Elegantbeef> But yea would be interested in hearing
05:05:10FromDiscord<Elegantbeef> I'm kinda silly so the forced usage of macros for type definitions always feels off to me
05:10:01*xet7 joined #nim
06:03:16*rockcavera quit (Remote host closed the connection)
06:19:48*PMunch joined #nim
06:24:42*xet7 quit (Ping timeout: 276 seconds)
06:25:21*xet7 joined #nim
07:07:10*xet7 quit (Ping timeout: 240 seconds)
07:09:29*gsalazar joined #nim
07:11:20*mahlon quit (Ping timeout: 248 seconds)
07:20:38*xet7 joined #nim
07:22:30*ltriant quit (Ping timeout: 240 seconds)
07:22:59*fallback quit (Ping timeout: 255 seconds)
08:05:12*xet7 quit (Ping timeout: 248 seconds)
08:18:46*xet7 joined #nim
08:22:48FromDiscord<uncle jim> In reply to @Avahe "https://github.com/Vladar4/sdl2_nim/blob/master/exa": that's not the lib i'm using
08:26:47FromDiscord<Prestige> You're not using sdl?
08:31:08FromDiscord<uncle jim> In reply to @Avahe "You're not using sdl?": i'm not using sdl2_nim, i'm using sdl2
08:31:29FromDiscord<uncle jim> the one on nim-lang github
08:31:54FromDiscord<uncle jim> dis↵https://github.com/nim-lang/sdl2
08:34:29FromDiscord<uncle jim> @Prestige
08:42:51*noeontheend joined #nim
08:51:38FromDiscord<Prestige> Cool - same concept https://github.com/nim-lang/sdl2/blob/master/src/sdl2.nim#L1655
08:53:19FromDiscord<uncle jim> wut's index and flags?
08:58:46FromDiscord<Prestige> It says there in the doc comment
08:59:29FromDiscord<Prestige> Also if you look at `importc: "SDL_CreateRenderer"` you'll see that `SDL_CreateRenderer` is the name of the function in C, so you can google it to find https://wiki.libsdl.org/SDL_CreateRenderer
09:09:49Amun-RaSDL_CreateRenderer is pretty straightforward
09:12:09*om3ga joined #nim
09:20:39FromDiscord<planetis> I don't like that in ECS the entities are as unsafe as pointers
09:21:15FromDiscord<planetis> Of course you have generations but they may overflow
09:23:04*xet7 quit (Ping timeout: 248 seconds)
09:24:56*noeontheend quit (Ping timeout: 246 seconds)
09:36:11*xet7 joined #nim
09:45:37*ltriant joined #nim
09:45:47*mahlon joined #nim
09:59:28*xet7 quit (Quit: Leaving)
09:59:49*xet7 joined #nim
10:03:54FromDiscord<Josef> Can I use 64bit nim to compile 32bit programs?
10:06:55FromDiscord<demotomohiro> In reply to @Josef "Can I use 64bit": I think so. At least, you need backend C compiler that can generate 32bit program.
10:08:44FromDiscord<demotomohiro> After you install compiler for 32bit CPU, add cpu option like `--cpu:i386` or `--cpu:arm32`.
10:09:45FromDiscord<demotomohiro> It is just `--cpu:arm` if you want 32bit arm.
10:13:59*noeontheend joined #nim
10:24:32FromDiscord<jmgomez> sent a code paste, see https://paste.rs/sdK
10:24:45FromDiscord<Recruit_main707> In reply to @demotomohiro "It is just `--cpu:arm`": personally i had some issues i never understood, but that should just work
10:26:47FromDiscord<jmgomez> BTW UMyClassToTest is an autogenerated type that has a counterpart in C++. The setter there is an autogen function that just set the value under the hood via the unreal reflection system (that should be ok)
10:36:55FromDiscord<jmgomez> sent a code paste, see https://paste.rs/tTM
10:37:07FromDiscord<jmgomez> (edit) "https://play.nim-lang.org/#ix=408D" => "https://paste.rs/Pag"
10:58:16*noeontheend_ joined #nim
11:00:08*noeontheend quit (Ping timeout: 248 seconds)
11:42:17*noeontheend_ quit (Ping timeout: 244 seconds)
11:47:07*eull joined #nim
11:55:35FromDiscord<Forest> Any way for me to make an operator? Like
11:55:51FromDiscord<Forest> sent a code paste, see https://play.nim-lang.org/#ix=408S
11:56:05FromDiscord<demotomohiro> It is hard to read nim generated C++ with hashes and C++ templates.
11:56:12FromDiscord<Forest> sent a code paste, see https://play.nim-lang.org/#ix=408T
11:57:21FromDiscord<Forest> (also ik templates exist, this is just an example)
11:58:53*arkurious joined #nim
11:59:04FromDiscord<demotomohiro> In reply to @Forest "Issue here is that": Are you sure it is an unicode charactor Nim supports? https://nim-lang.org/docs/manual.html#lexical-analysis-unicode-operators
12:02:01FromDiscord<demotomohiro> In reply to @jmgomez "Hey guys, What the": Maybe, one assignment does copy and another assignment does move.↵Maybe the second assignment was removed as compiler to optimize.
12:02:41FromDiscord<Forest> Ah it isn't
12:03:51FromDiscord<Forest> Thanks!
12:05:17FromDiscord<neurocyte> I don't quite get why nim has a fixed list of symbols that are allowed as operators. Seems pretty arbitrary to me. There are a gazillion useful mathematical symbols not on the list.
12:11:42FromDiscord<jmgomez> sent a code paste, see https://paste.rs/JaS
12:18:13*gsalazar quit (Ping timeout: 256 seconds)
12:24:49FromDiscord<Rika> In reply to @neurocyte "I don't quite get": how would it work otherwise?
12:25:26FromDiscord<Rika> how would nim know what intention you have with the operator with regards to precedence (without reading the signature)
12:34:12*xet7 quit (Ping timeout: 248 seconds)
12:47:09*xet7 joined #nim
13:27:09FromDiscord<Forest> Could have a special type of thing?
13:27:43FromDiscord<Forest> sent a code paste, see https://paste.rs/i3i
13:27:57FromDiscord<Forest> Or something that'd be better imo, a pragma
13:28:32FromDiscord<Forest> Can't remember how to do pragmas lmao
13:28:47FromDiscord<Yardanico> but then the syntax of the language would depend on user code
13:28:57FromDiscord<Yardanico> e.g. one lib has one operator with one precedence, another with another precedence
13:29:05FromDiscord<Yardanico> for the same operator
13:29:26FromDiscord<Forest> True :/
13:36:39FromDiscord<ynfle (ynfle)> What kind of error message is `Warning: 'matchIter' is not GC-safe as it performs an indirect call here [GcUnsafe2]`?
13:37:35FromDiscord<ynfle (ynfle)> sent a code paste, see https://play.nim-lang.org/#ix=409f
13:37:46FromDiscord<ynfle (ynfle)> And it's "pointing" to `=>`
13:38:08FromDiscord<Yardanico> a closure is not gcsafe by default as it can capture outside variables
13:38:26FromDiscord<Yardanico> in your case it's not GC-safe I think as you use `transformation` if it's not a global
13:38:45FromDiscord<ynfle (ynfle)> Ya it's local, and it doesn't modify it
13:38:57FromDiscord<ynfle (ynfle)> It only modifies `state` which is also local
13:39:03FromDiscord<Yardanico> yes, but it accesses `transformation`
13:39:07FromDiscord<Yardanico> which is outside of the closure itself
13:39:37FromDiscord<ynfle (ynfle)> Because `JsonNode` is a ref object?
13:39:58FromDiscord<ynfle (ynfle)> Isn't `state` the closure here?
13:41:37FromDiscord<demotomohiro> In reply to @jmgomez "There is definitely copy/move": Maybe wrap it with `=sink`? https://nim-lang.org/docs/destructors.html↵But I dont know if it works and fix your error.
13:43:21*rockcavera joined #nim
13:43:21*rockcavera quit (Changing host)
13:43:21*rockcavera joined #nim
13:46:42FromDiscord<ynfle (ynfle)> So now the problem is `state.transformers[transformationName](state)`
13:47:11FromDiscord<ynfle (ynfle)> With `Warning: 'apply' is not GC-safe as it performs an indirect call her`
13:47:22FromDiscord<demotomohiro> In reply to @neurocyte "I don't quite get": You can the reason here: https://github.com/nim-lang/RFCs/issues/388
13:47:27FromDiscord<ynfle (ynfle)> The above line is in the apply proc
13:48:24FromDiscord<ynfle (ynfle)> state is a param to the proc that is an var object
13:48:34FromDiscord<ynfle (ynfle)> It has a table of a mapping from string to proc
13:48:46FromDiscord<ynfle (ynfle)> The procs modify the state of state further
13:48:57FromDiscord<ynfle (ynfle)> I don't think it's a closure
13:49:58FromDiscord<ynfle (ynfle)> (I witch the `apply` from before to a regular for loop and the issue went away)
13:53:13FromDiscord<jmgomez> In reply to @demotomohiro "You can the reason": Not sure how to implement it. Should I supposed to do a = move(b) (so move calls cpp move constructor)
13:59:34FromDiscord<demotomohiro> Nim can call `=sink` when possible even if you don't use `a = move(b)`.
13:59:41FromDiscord<demotomohiro> https://nim-lang.org/docs/destructors.html#move-semantics
14:05:58*PMunch quit (Quit: Leaving)
14:07:23FromDiscord<jmgomez> sent a code paste, see https://paste.rs/DSD
14:11:51FromDiscord<demotomohiro> I don't know how to wrap C++'s move constructor in NIm. https://nim-lang.org/docs/manual.html#importcpp-pragma-wrapping-constructors
14:17:23FromDiscord<jmgomez> Ok, Im doing that for the copy will test to see with different keyworkds
14:23:14FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=409v
14:48:06FromDiscord<ieltan> Has someone tried to wrap libwayland in nim?
14:51:16*derpydoo joined #nim
14:59:19*tiorock joined #nim
14:59:19*tiorock quit (Changing host)
14:59:19*tiorock joined #nim
14:59:19*rockcavera is now known as Guest6119
14:59:19*Guest6119 quit (Killed (tantalum.libera.chat (Nickname regained by services)))
14:59:19*tiorock is now known as rockcavera
14:59:26*fallback joined #nim
15:09:54*kayabaNerve quit (Ping timeout: 276 seconds)
15:22:06*NimEventer quit (Ping timeout: 252 seconds)
15:22:12*NimEventer joined #nim
15:54:23*tiorock joined #nim
15:54:23*tiorock quit (Changing host)
15:54:23*tiorock joined #nim
15:54:23*rockcavera is now known as Guest7673
15:54:23*Guest7673 quit (Killed (lead.libera.chat (Nickname regained by services)))
15:54:23*tiorock is now known as rockcavera
15:54:32*rockcavera quit (Remote host closed the connection)
16:00:48NimEventerNew thread by Jmgomez: Function call generating double wrapper in generic, see https://forum.nim-lang.org/t/9233
16:08:11FromDiscord<uncle jim> how i drow rectangel in sdl2 wit nim?
16:43:57*xet7 quit (Ping timeout: 260 seconds)
16:46:21*kenran joined #nim
16:46:45*kenran quit (Client Quit)
16:47:24FromDiscord<Prestige> Take a look at https://github.com/nim-lang/sdl2/blob/master/src/sdl2/gfx.nim#L121 @uncle jim
16:52:10FromDiscord<Prestige> I'm surprised there's no wrapper for SDL's hidapi, dang. I really dislike writing c wrappers
17:03:41FromDiscord<Prestige> What type should I be using for `const wchar_t serial_number` just a cstring?
17:03:48FromDiscord<ieltan> In reply to @ieltan "Has someone tried to": ?
17:04:10FromDiscord<ieltan> Upping my question :)
17:04:10FromDiscord<Rika> In reply to @Avahe "What type should I": no, cstrings use `char` and not `wchar_t` you want a wide string
17:04:13FromDiscord<Rika> give me a moment
17:04:58*rockcavera joined #nim
17:04:58*rockcavera quit (Changing host)
17:04:58*rockcavera joined #nim
17:05:29FromDiscord<Rika> okay, `wchar_t` can potentially be 32 bits which nim seem to not account for in widestrs,
17:05:34FromDiscord<Rika> (edit) "seem" => "seems" | "widestrs," => "widestrs"
17:05:47FromDiscord<Prestige> 🤔
17:06:25FromDiscord<Rika> are you on windows only
17:06:29FromDiscord<Prestige> I'm wrapping this function where you pass in a wchar_t https://wiki.libsdl.org/SDL_hid_open if that makes a difference
17:06:36FromDiscord<Prestige> Me? Nah, only linux
17:07:48FromDiscord<Prestige> Probably should support everything though since it's SDL, if that's possible
17:07:58FromDiscord<Rika> then wrap it manually ig `type wchar {.importc: "wchar_t", nodecl.}` then mimic the ptr stuff `type wstring = ptr UncheckedArray[wchar]` im not sure about the headers needed
17:10:20FromDiscord<Prestige> oh I found `WideCString` in Nim
17:10:40FromDiscord<Prestige> Didn't know that existed
17:11:05FromDiscord<Prestige> `when defined(nimv2):` well then
17:11:54FromDiscord<Prestige> actually it's defined in the else as well. Guess this works
17:21:52FromDiscord<Rika> widecstring as ive said uses the 16 bit only characters
17:22:02FromDiscord<Rika> may not work with linux
18:09:29*Onionhammer3 joined #nim
18:12:10*MightyJoe joined #nim
18:13:32*laintree joined #nim
18:18:05*om3ga quit (*.net *.split)
18:18:06*cyraxjoe quit (*.net *.split)
18:18:08*lain quit (*.net *.split)
18:18:08*Jjp137 quit (*.net *.split)
18:18:08*Onionhammer quit (*.net *.split)
18:18:09*Onionhammer3 is now known as Onionhammer
18:21:06*om3ga joined #nim
18:37:53*laintree is now known as lain
18:54:42om3gaFYI /usr/lib/nim/posix/posix.nim(1093, 13) Hint: 'sig' is declared but not used [XDeclaredButNotUsed]
19:04:10FromDiscord<martinium> Are there any other AWS libs for Nim besides atoz?
19:06:13FromDiscord<demotomohiro> There are web sites you can search for Nim libraries:https://internet-of-tomohiro.netlify.app/nim/faq.en.html#libraries-is-there-list-of-libraries-or-packages-for-nimqmark
19:25:13*NimBot joined #nim
19:27:31*adium joined #nim
19:31:51*Amun-Ra joined #nim
19:44:28*jmdaemon joined #nim
19:45:58*pro joined #nim
19:49:07FromDiscord<ynfle> In reply to @ynfle (ynfle) "So now the problem": Can anyone help with this?
19:49:48FromDiscord<Elegantbeef> `{.cast(gcsafe).}:` if you need
19:50:14FromDiscord<ynfle> But what is the issue
19:50:27FromDiscord<ynfle> I'm not accessing any closures or globals
19:50:48FromDiscord<Elegantbeef> Your `Transformer` type isnt gcsafe
19:50:56FromDiscord<Elegantbeef> So it goes "hey this isnt a gcsafe call"
19:54:49FromDiscord<martinium> Why does AWS make their API calls so tedious my goodness.
19:54:52om3ga /usr/lib/nim/posix/posix.nim(1093, 13) Hint: 'sig' is declared but not used [XDeclaredButNotUsed] <-- pls ignore, I need to carefully read the manuals :)
19:55:20FromDiscord<martinium> I may need to tough it out and build an AWS SDK similar to boto3
19:59:56FromDiscord<ynfle> In reply to @Elegantbeef "Your `Transformer` type isnt": I labeled each proc and the typedef gcsafe and now the compiler jsut crashes
20:00:07*om3ga quit (Quit: Bye)
20:00:29FromDiscord<Elegantbeef> No clue if the sugar moule supports pragma annotations
20:00:36FromDiscord<Elegantbeef> sugar module\
20:00:43FromDiscord<ynfle> I switched to regular typedef
20:01:11FromDiscord<ynfle> `Transformer = proc (s: var Transformer): void {.gcsafe.}`
20:01:21FromDiscord<ynfle> Haha wrong definition
20:01:31FromDiscord<Elegantbeef> `s: var Transformer`
20:01:39FromDiscord<Elegantbeef> that's an impossible to instantiate type
20:02:13FromDiscord<ynfle> Ya
20:02:35FromDiscord<ynfle> So when I add the pragma to the typedef it doesn't give a warning
20:02:37FromDiscord<ynfle> Interesting
20:02:43FromDiscord<Elegantbeef> Of course not
20:02:51FromDiscord<Elegantbeef> It knows the procs are gcsafe
20:03:16FromDiscord<Elegantbeef> In Nim `noSideEffect` and `gcSafe` are apart of the type
20:03:45FromDiscord<Elegantbeef> You can implicitly convert down to unsafe but not up to safe without explicit casts
20:04:35*pro quit (Quit: pro)
20:05:10FromDiscord<ynfle> Does it makes sense that the gcsafe annotation was removed when converting down?
20:05:21FromDiscord<Elegantbeef> Of course
20:05:36FromDiscord<Elegantbeef> It's not removed it just converted it to a type that doesnt have it
20:05:58FromDiscord<Elegantbeef> they're type operations it's like `var a: int = range[0..3](2)`
20:06:25FromDiscord<Elegantbeef> You cannot then do `a is range[0..3]` cause it's `int`
20:06:37FromDiscord<Elegantbeef> Even though it's source was a subrange type does not mean it's a subrange type
20:06:51FromDiscord<ynfle> Right
20:06:54FromDiscord<Elegantbeef> To know that the procedure is `gcsafe` when you convert it to `Transformer` would require runtime information
20:08:05FromDiscord<Elegantbeef> Hopefully that answers the question, but idk
20:08:29FromDiscord<ynfle> Yup
20:18:59FromDiscord<Prestige> In reply to @Rika "widecstring as ive said": Looks like I'm only getting the first letter, so you're right, something funky is going on.
20:19:23*Jjp137 joined #nim
20:19:25FromDiscord<Rika> That’s why I suggested manual wrapping
20:19:42FromDiscord<Rika> Only windows guarantees 16 bit characters
20:19:57FromDiscord<Prestige> Cool, yeah I'll try that
20:32:44*Jjp137 quit (Ping timeout: 255 seconds)
20:33:03*Jjp137 joined #nim
20:37:31*derpydoo quit (Quit: derpydoo)
20:44:34FromDiscord<Prestige> `type wchar {.importc: "wchar_t", nodecl.}` giving me an error: `illegal recursion in type 'wchar'`
20:45:16FromDiscord<Elegantbeef> would help if you gave the last half of that type def
20:46:21FromDiscord<Prestige> That's the whole typedef
20:46:50FromDiscord<Prestige> do I need = object or something? I don't know how wrapping c types works
20:47:04FromDiscord<Elegantbeef> you need `=`
20:47:13rockcaveratry this cwchar_t {.importc: "wchar_t".} = when defined(windows): int16 else: int32
20:47:56rockcaveraopz
20:50:13FromDiscord<Prestige> Cool, thanks - hopefully can get this all working
20:53:04rockcaverahttps://play.nim-lang.org/#ix=40aS
20:57:39FromDiscord<Prestige> Trying to figure out how to create a new wstring now
20:58:23FromDiscord<Prestige> have https://play.nim-lang.org/#ix=40aT so far
20:59:12FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=40aU
21:00:03FromDiscord<Prestige> I wonder why the CWideString impl in nim uses unsafeNew, and why I couldn't use it for my type. Oh well
21:00:38rockcavera`wchar_t *` C, on windows you can use WideCString
21:03:50FromDiscord<Prestige> is there a way to make a `=destroy` proc for an unchecked array?
21:04:31FromDiscord<Elegantbeef> You'd need to make it distinct
21:04:40FromDiscord<Elegantbeef> Nim only calls custom destructors for `distinct` or `object`
21:04:53FromDiscord<Prestige> ah
21:06:30FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=40aX
21:07:17FromDiscord<Elegantbeef> Though that's a pointer to pointer
21:07:23FromDiscord<Prestige> Yeah, hmm
21:07:56FromDiscord<Prestige> sent a code paste, see https://play.nim-lang.org/#ix=40aY
21:08:09FromDiscord<Elegantbeef> well yea
21:08:13FromDiscord<Prestige> `signature for '=destroy' must be proc[T: object](x: var T)`
21:08:13FromDiscord<Elegantbeef> one you created a generic destructor
21:08:45FromDiscord<Elegantbeef> Yea that message just means int `var T` the `T` has to be an `object`
21:11:37FromDiscord<Prestige> Then what was the point of it being distinct?
21:11:44FromDiscord<Elegantbeef> distinct also works
21:12:32FromDiscord<Prestige> I have `wstring = distinct ptr UncheckedArray[wchar]` so why doesn't my destructor work?
21:12:45FromDiscord<Elegantbeef> The issue with a `distinct ptr T` is that it doesnt have a ref count
21:12:56FromDiscord<Elegantbeef> Cause you have weird generics
21:13:16FromDiscord<Elegantbeef> Also you use `wstring` before declaring the destructor
21:13:37FromDiscord<Elegantbeef> you also dont make `wstring` var
21:16:18FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=40aZ works but double frees i think
21:18:51FromDiscord<Elegantbeef> Wait i'm just dumb 😄
21:19:07FromDiscord<Elegantbeef> I was attempting to free the stack
21:19:12FromDiscord<Elegantbeef> 10/10 would free again
21:19:32FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=40b1 here we go
21:19:44FromDiscord<Elegantbeef> You also probably want a copy or sink hook
21:31:33FromDiscord<Prestige> does gcfullcollect need to be called?
21:31:50FromDiscord<Elegantbeef> Of course not
21:32:04NimEventerNew thread by Cnerd: Jester disable content-length header, see https://forum.nim-lang.org/t/9234
21:32:17FromDiscord<Elegantbeef> We're using refc on the playground which isnt deterministic and sometimes can make things behave oddl
21:32:47FromDiscord<Prestige> for the final part.. how do I turn this into a `string` I can use?
21:33:12FromDiscord<Elegantbeef> No clue i dont even know what a wstr encodes
21:33:43FromDiscord<Prestige> utf I believe
21:33:59FromDiscord<Prestige> utf16 on windows, utf32 everywhere else?
21:35:32FromDiscord<Elegantbeef> You'd need to convert it into utf8 to be able to use it with things expecting string afaik
21:35:33*jmdaemon quit (Quit: ZNC 1.8.2 - https://znc.in)
21:35:34FromDiscord<Elegantbeef> I could be wrong
21:36:57FromDiscord<Prestige> Why does this have to be so annoying, lol
21:37:28FromDiscord<enthus1ast> i think the winapi is older than utf8
21:38:24FromDiscord<enthus1ast> maybe this helps\: https://khchen.github.io/winim/winstr.html
21:39:16FromDiscord<Prestige> I thought there'd be an easier way to deal with usb devices
21:39:36FromDiscord<Elegantbeef> What are you doing?
21:39:57FromDiscord<Prestige> Trying to use SDL to get info about usb devices, and read data from those devices directly
21:39:57FromDiscord<Prestige> https://github.com/libsdl-org/SDL/blob/main/src/hidapi/linux/hid.c#L883
21:40:44FromDiscord<Prestige> looking at functions like https://wiki.libsdl.org/SDL_hid_get_product_string
21:43:40FromDiscord<Elegantbeef> https://github.com/BigBIueWhale/utf/blob/main/main.cpp#L70-L170 well have fun prestige
21:45:54FromDiscord<Prestige> yikes lol
21:46:22FromDiscord<bulatz> Can I employ channels_builtin in production? Is it bug-free now?
21:46:26FromDiscord<Elegantbeef> The utf32 to utf8 isnt too bad
21:47:22FromDiscord<Elegantbeef> Channels work, their issues are mainly on data copying
21:54:12FromDiscord<bulatz> In reply to @Elegantbeef "Channels work, their issues": I.e. there only problems already mentioned in the official doc https://nim-lang.org/docs/channels_builtin.html and nothing else?
21:54:54FromDiscord<Elegantbeef> Yea afaik
21:55:15FromDiscord<Elegantbeef> I guess there's also the issue of data ownership not presently working across them
21:56:07FromDiscord<tsoj> sent a code paste, see https://play.nim-lang.org/#ix=40b5
21:56:41FromDiscord<Elegantbeef> You can use macros to error direcctly where you want with `error` and `warn`
21:56:46FromDiscord<bulatz> In reply to @Elegantbeef "I guess there's also": doc says "# Note that objects passed through channels will be deeply copied"
21:57:20FromDiscord<bulatz> (edit) "copied"" => "copied"↵so data ownership doesn't exist at all, isn't it?"
21:57:56FromDiscord<Elegantbeef> I mean you cannot giveup resources across the channel, they're copied
21:58:08FromDiscord<Elegantbeef> This will eventually be changed with `isolated` i believe
21:59:15FromDiscord<bulatz> yeah, but it's only efficiency issue, isn't it?
21:59:22FromDiscord<Elegantbeef> Yes
21:59:43FromDiscord<bulatz> thank you
22:02:05FromDiscord<bulatz> oh, one more question - are channels_builtin also works reliably in Nim 1.4 and 1.2?
22:02:13FromDiscord<Elegantbeef> No clue
22:02:44FromDiscord<Elegantbeef> I personally stick with stable
22:05:34*noeontheend joined #nim
22:07:23FromDiscord<Elegantbeef> @tsoj\: do you have a more elaborate example of what you're after?
22:09:43*wallabra_ joined #nim
22:10:00*wallabra quit (Ping timeout: 248 seconds)
22:10:58*wallabra_ is now known as wallabra
22:12:24*eull quit (Quit: Konversation terminated!)
22:16:10*wallabra_ joined #nim
22:17:08*wallabra quit (Ping timeout: 255 seconds)
22:17:48*wallabra_ is now known as wallabra
22:36:08*oprypin quit (Ping timeout: 248 seconds)
22:52:20*oprypin joined #nim
23:00:42*arkurious quit (Quit: Leaving)
23:11:17*noeontheend quit (Ping timeout: 260 seconds)
23:19:32*wallabra_ joined #nim
23:20:37*wallabra quit (Ping timeout: 260 seconds)
23:20:53*wallabra_ is now known as wallabra
23:56:35*wallabra quit (Ping timeout: 255 seconds)
23:57:36*wallabra joined #nim