00:07:46 | NimEventer | New 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:54 | FromDiscord | <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:08 | FromDiscord | <theangryepicbanana> I swear I've ran into this before and I thought I fixed it |
00:18:20 | FromDiscord | <Elegantbeef> Are you compiling using a 32bit compiler? |
00:18:34 | FromDiscord | <Elegantbeef> Or do you not have the compiler bit set properly |
00:18:41 | FromDiscord | <theangryepicbanana> I'm pretty sure it's 64but |
00:18:43 | FromDiscord | <theangryepicbanana> (edit) "64but" => "64bit" |
00:18:48 | FromDiscord | <Elegantbeef> no clue what it is for mysys but it's generally like `--passC:"-m32"` or similar |
00:19:30 | FromDiscord | <theangryepicbanana> that didn't work unfortunately |
00:20:02 | FromDiscord | <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:18 | FromDiscord | <Elegantbeef> Ensure the backend compiler is the 64bit version and ensure you arent passing `--cpu:i386` |
00:20:22 | FromDiscord | <theangryepicbanana> ok |
00:30:45 | FromDiscord | <theangryepicbanana> nvm I got it working |
00:30:49 | FromDiscord | <theangryepicbanana> stupid windows path issue |
00:31:07 | FromDiscord | <Elegantbeef> Sorry i wasnt helpful 😛 |
00:56:28 | FromDiscord | <j-james> is pixie a good choice for high-ish performance rendering? |
00:56:46 | FromDiscord | <j-james> like for a desktop application |
00:57:04 | FromDiscord | <Elegantbeef> I mean that's what treeform is aiming at it's usage |
00:57:04 | FromDiscord | <Elegantbeef> I use it for text rendering in my framework |
01:15:35 | FromDiscord | <Rika> It should be very good for performance |
01:25:30 | FromDiscord | <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:36 | FromDiscord | <guzba> @j-james ^ |
01:44:44 | * | vicfred_ quit (Quit: Leaving) |
02:02:59 | FromDiscord | <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:22 | FromDiscord | <Elegantbeef> Though i'm fairly certain it has UB |
02:06:26 | madprops | im also bored wtf |
02:06:46 | madprops | echo posHealth |
02:06:49 | madprops | echo health |
02:32:23 | NimEventer | New Nimble package! pkginfo - A tiny utility package to extract Nimble information from any project, see https://github.com/openpeep/pkginfo |
02:36:05 | FromDiscord | <Rika> Hmm |
02:36:16 | FromDiscord | <Rika> Kinda weird to need something like this |
02:50:54 | FromDiscord | <j-james> how can i print out the result of a Future[T]? |
02:52:50 | FromDiscord | <Elegantbeef> `echo await myFut`? |
02:54:39 | FromDiscord | <j-james> `nim-1.6.6/lib/pure/asyncmacro.nim(130, 3) Error: 'yield' only allowed in an iterator` |
02:55:23 | FromDiscord | <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:41 | FromDiscord | <Rika> If you’re not in an async function use waitFor |
03:03:08 | * | systemdsucks joined #nim |
03:04:58 | FromDiscord | <lamersc> Nim site looks down? |
03:05:04 | FromDiscord | <lamersc> https://media.discordapp.net/attachments/371759389889003532/986103955987775488/IMG_6413.png |
03:05:29 | FromDiscord | <Rika> I can back that up, down for me too |
03:06:50 | FromDiscord | <xflywind> Yeah |
03:07:58 | FromDiscord | <lamersc> Andddd it’s back 😆 |
03:13:49 | FromDiscord | <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:20 | FromDiscord | <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:47 | FromDiscord | <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:26 | FromDiscord | <treeform> In reply to @Avahe "I'm interested in the": large scale - i guess with many moving parts |
03:26:48 | FromDiscord | <treeform> we'll probably make a video talking about it eventually |
03:46:02 | FromDiscord | <Prestige> Cool |
03:53:38 | FromDiscord | <Elegantbeef> Yea i've never really used ECS, gets pretty weird to reason about imo |
03:54:44 | FromDiscord | <Elegantbeef> It's one of the better compositional design paradigms though |
03:55:29 | FromDiscord | <Elegantbeef> Were you guys rolling your own ECS or using an existing library? |
03:56:02 | FromDiscord | <guzba> @ElegantBeef 👀 care to guess? |
03:56:16 | FromDiscord | <Elegantbeef> I assume the former but i'd hope the latter |
03:56:19 | FromDiscord | <Elegantbeef> Since polymorph exists |
03:59:13 | FromDiscord | <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:48 | FromDiscord | <guzba> no need to solve everything at the same time |
04:00:09 | FromDiscord | <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:50 | FromDiscord | <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:21 | FromDiscord | <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:40 | FromDiscord | <Prestige> ECS sounds neat on the surface but I've never seen a super elegant implementation |
04:55:52 | FromDiscord | <Elegantbeef> What do you find inelegant about polymorph? |
05:01:21 | * | jmd_ quit (Ping timeout: 244 seconds) |
05:03:00 | FromDiscord | <Prestige> I'd have to look through it again, don't remember the details off the top of my head |
05:03:23 | FromDiscord | <Elegantbeef> I mean i think i have a sort of similar view |
05:03:35 | FromDiscord | <Elegantbeef> But yea would be interested in hearing |
05:05:10 | FromDiscord | <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:48 | FromDiscord | <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:47 | FromDiscord | <Prestige> You're not using sdl? |
08:31:08 | FromDiscord | <uncle jim> In reply to @Avahe "You're not using sdl?": i'm not using sdl2_nim, i'm using sdl2 |
08:31:29 | FromDiscord | <uncle jim> the one on nim-lang github |
08:31:54 | FromDiscord | <uncle jim> dis↵https://github.com/nim-lang/sdl2 |
08:34:29 | FromDiscord | <uncle jim> @Prestige |
08:42:51 | * | noeontheend joined #nim |
08:51:38 | FromDiscord | <Prestige> Cool - same concept https://github.com/nim-lang/sdl2/blob/master/src/sdl2.nim#L1655 |
08:53:19 | FromDiscord | <uncle jim> wut's index and flags? |
08:58:46 | FromDiscord | <Prestige> It says there in the doc comment |
08:59:29 | FromDiscord | <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:49 | Amun-Ra | SDL_CreateRenderer is pretty straightforward |
09:12:09 | * | om3ga joined #nim |
09:20:39 | FromDiscord | <planetis> I don't like that in ECS the entities are as unsafe as pointers |
09:21:15 | FromDiscord | <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:54 | FromDiscord | <Josef> Can I use 64bit nim to compile 32bit programs? |
10:06:55 | FromDiscord | <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:44 | FromDiscord | <demotomohiro> After you install compiler for 32bit CPU, add cpu option like `--cpu:i386` or `--cpu:arm32`. |
10:09:45 | FromDiscord | <demotomohiro> It is just `--cpu:arm` if you want 32bit arm. |
10:13:59 | * | noeontheend joined #nim |
10:24:32 | FromDiscord | <jmgomez> sent a code paste, see https://paste.rs/sdK |
10:24:45 | FromDiscord | <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:47 | FromDiscord | <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:55 | FromDiscord | <jmgomez> sent a code paste, see https://paste.rs/tTM |
10:37:07 | FromDiscord | <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:35 | FromDiscord | <Forest> Any way for me to make an operator? Like |
11:55:51 | FromDiscord | <Forest> sent a code paste, see https://play.nim-lang.org/#ix=408S |
11:56:05 | FromDiscord | <demotomohiro> It is hard to read nim generated C++ with hashes and C++ templates. |
11:56:12 | FromDiscord | <Forest> sent a code paste, see https://play.nim-lang.org/#ix=408T |
11:57:21 | FromDiscord | <Forest> (also ik templates exist, this is just an example) |
11:58:53 | * | arkurious joined #nim |
11:59:04 | FromDiscord | <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:01 | FromDiscord | <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:41 | FromDiscord | <Forest> Ah it isn't |
12:03:51 | FromDiscord | <Forest> Thanks! |
12:05:17 | FromDiscord | <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:42 | FromDiscord | <jmgomez> sent a code paste, see https://paste.rs/JaS |
12:18:13 | * | gsalazar quit (Ping timeout: 256 seconds) |
12:24:49 | FromDiscord | <Rika> In reply to @neurocyte "I don't quite get": how would it work otherwise? |
12:25:26 | FromDiscord | <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:09 | FromDiscord | <Forest> Could have a special type of thing? |
13:27:43 | FromDiscord | <Forest> sent a code paste, see https://paste.rs/i3i |
13:27:57 | FromDiscord | <Forest> Or something that'd be better imo, a pragma |
13:28:32 | FromDiscord | <Forest> Can't remember how to do pragmas lmao |
13:28:47 | FromDiscord | <Yardanico> but then the syntax of the language would depend on user code |
13:28:57 | FromDiscord | <Yardanico> e.g. one lib has one operator with one precedence, another with another precedence |
13:29:05 | FromDiscord | <Yardanico> for the same operator |
13:29:26 | FromDiscord | <Forest> True :/ |
13:36:39 | FromDiscord | <ynfle (ynfle)> What kind of error message is `Warning: 'matchIter' is not GC-safe as it performs an indirect call here [GcUnsafe2]`? |
13:37:35 | FromDiscord | <ynfle (ynfle)> sent a code paste, see https://play.nim-lang.org/#ix=409f |
13:37:46 | FromDiscord | <ynfle (ynfle)> And it's "pointing" to `=>` |
13:38:08 | FromDiscord | <Yardanico> a closure is not gcsafe by default as it can capture outside variables |
13:38:26 | FromDiscord | <Yardanico> in your case it's not GC-safe I think as you use `transformation` if it's not a global |
13:38:45 | FromDiscord | <ynfle (ynfle)> Ya it's local, and it doesn't modify it |
13:38:57 | FromDiscord | <ynfle (ynfle)> It only modifies `state` which is also local |
13:39:03 | FromDiscord | <Yardanico> yes, but it accesses `transformation` |
13:39:07 | FromDiscord | <Yardanico> which is outside of the closure itself |
13:39:37 | FromDiscord | <ynfle (ynfle)> Because `JsonNode` is a ref object? |
13:39:58 | FromDiscord | <ynfle (ynfle)> Isn't `state` the closure here? |
13:41:37 | FromDiscord | <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:42 | FromDiscord | <ynfle (ynfle)> So now the problem is `state.transformers[transformationName](state)` |
13:47:11 | FromDiscord | <ynfle (ynfle)> With `Warning: 'apply' is not GC-safe as it performs an indirect call her` |
13:47:22 | FromDiscord | <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:27 | FromDiscord | <ynfle (ynfle)> The above line is in the apply proc |
13:48:24 | FromDiscord | <ynfle (ynfle)> state is a param to the proc that is an var object |
13:48:34 | FromDiscord | <ynfle (ynfle)> It has a table of a mapping from string to proc |
13:48:46 | FromDiscord | <ynfle (ynfle)> The procs modify the state of state further |
13:48:57 | FromDiscord | <ynfle (ynfle)> I don't think it's a closure |
13:49:58 | FromDiscord | <ynfle (ynfle)> (I witch the `apply` from before to a regular for loop and the issue went away) |
13:53:13 | FromDiscord | <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:34 | FromDiscord | <demotomohiro> Nim can call `=sink` when possible even if you don't use `a = move(b)`. |
13:59:41 | FromDiscord | <demotomohiro> https://nim-lang.org/docs/destructors.html#move-semantics |
14:05:58 | * | PMunch quit (Quit: Leaving) |
14:07:23 | FromDiscord | <jmgomez> sent a code paste, see https://paste.rs/DSD |
14:11:51 | FromDiscord | <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:23 | FromDiscord | <jmgomez> Ok, Im doing that for the copy will test to see with different keyworkds |
14:23:14 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=409v |
14:48:06 | FromDiscord | <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:48 | NimEventer | New thread by Jmgomez: Function call generating double wrapper in generic, see https://forum.nim-lang.org/t/9233 |
16:08:11 | FromDiscord | <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:24 | FromDiscord | <Prestige> Take a look at https://github.com/nim-lang/sdl2/blob/master/src/sdl2/gfx.nim#L121 @uncle jim |
16:52:10 | FromDiscord | <Prestige> I'm surprised there's no wrapper for SDL's hidapi, dang. I really dislike writing c wrappers |
17:03:41 | FromDiscord | <Prestige> What type should I be using for `const wchar_t serial_number` just a cstring? |
17:03:48 | FromDiscord | <ieltan> In reply to @ieltan "Has someone tried to": ? |
17:04:10 | FromDiscord | <ieltan> Upping my question :) |
17:04:10 | FromDiscord | <Rika> In reply to @Avahe "What type should I": no, cstrings use `char` and not `wchar_t` you want a wide string |
17:04:13 | FromDiscord | <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:29 | FromDiscord | <Rika> okay, `wchar_t` can potentially be 32 bits which nim seem to not account for in widestrs, |
17:05:34 | FromDiscord | <Rika> (edit) "seem" => "seems" | "widestrs," => "widestrs" |
17:05:47 | FromDiscord | <Prestige> 🤔 |
17:06:25 | FromDiscord | <Rika> are you on windows only |
17:06:29 | FromDiscord | <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:36 | FromDiscord | <Prestige> Me? Nah, only linux |
17:07:48 | FromDiscord | <Prestige> Probably should support everything though since it's SDL, if that's possible |
17:07:58 | FromDiscord | <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:20 | FromDiscord | <Prestige> oh I found `WideCString` in Nim |
17:10:40 | FromDiscord | <Prestige> Didn't know that existed |
17:11:05 | FromDiscord | <Prestige> `when defined(nimv2):` well then |
17:11:54 | FromDiscord | <Prestige> actually it's defined in the else as well. Guess this works |
17:21:52 | FromDiscord | <Rika> widecstring as ive said uses the 16 bit only characters |
17:22:02 | FromDiscord | <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:42 | om3ga | FYI /usr/lib/nim/posix/posix.nim(1093, 13) Hint: 'sig' is declared but not used [XDeclaredButNotUsed] |
19:04:10 | FromDiscord | <martinium> Are there any other AWS libs for Nim besides atoz? |
19:06:13 | FromDiscord | <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:07 | FromDiscord | <ynfle> In reply to @ynfle (ynfle) "So now the problem": Can anyone help with this? |
19:49:48 | FromDiscord | <Elegantbeef> `{.cast(gcsafe).}:` if you need |
19:50:14 | FromDiscord | <ynfle> But what is the issue |
19:50:27 | FromDiscord | <ynfle> I'm not accessing any closures or globals |
19:50:48 | FromDiscord | <Elegantbeef> Your `Transformer` type isnt gcsafe |
19:50:56 | FromDiscord | <Elegantbeef> So it goes "hey this isnt a gcsafe call" |
19:54:49 | FromDiscord | <martinium> Why does AWS make their API calls so tedious my goodness. |
19:54:52 | om3ga | /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:20 | FromDiscord | <martinium> I may need to tough it out and build an AWS SDK similar to boto3 |
19:59:56 | FromDiscord | <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:29 | FromDiscord | <Elegantbeef> No clue if the sugar moule supports pragma annotations |
20:00:36 | FromDiscord | <Elegantbeef> sugar module\ |
20:00:43 | FromDiscord | <ynfle> I switched to regular typedef |
20:01:11 | FromDiscord | <ynfle> `Transformer = proc (s: var Transformer): void {.gcsafe.}` |
20:01:21 | FromDiscord | <ynfle> Haha wrong definition |
20:01:31 | FromDiscord | <Elegantbeef> `s: var Transformer` |
20:01:39 | FromDiscord | <Elegantbeef> that's an impossible to instantiate type |
20:02:13 | FromDiscord | <ynfle> Ya |
20:02:35 | FromDiscord | <ynfle> So when I add the pragma to the typedef it doesn't give a warning |
20:02:37 | FromDiscord | <ynfle> Interesting |
20:02:43 | FromDiscord | <Elegantbeef> Of course not |
20:02:51 | FromDiscord | <Elegantbeef> It knows the procs are gcsafe |
20:03:16 | FromDiscord | <Elegantbeef> In Nim `noSideEffect` and `gcSafe` are apart of the type |
20:03:45 | FromDiscord | <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:10 | FromDiscord | <ynfle> Does it makes sense that the gcsafe annotation was removed when converting down? |
20:05:21 | FromDiscord | <Elegantbeef> Of course |
20:05:36 | FromDiscord | <Elegantbeef> It's not removed it just converted it to a type that doesnt have it |
20:05:58 | FromDiscord | <Elegantbeef> they're type operations it's like `var a: int = range[0..3](2)` |
20:06:25 | FromDiscord | <Elegantbeef> You cannot then do `a is range[0..3]` cause it's `int` |
20:06:37 | FromDiscord | <Elegantbeef> Even though it's source was a subrange type does not mean it's a subrange type |
20:06:51 | FromDiscord | <ynfle> Right |
20:06:54 | FromDiscord | <Elegantbeef> To know that the procedure is `gcsafe` when you convert it to `Transformer` would require runtime information |
20:08:05 | FromDiscord | <Elegantbeef> Hopefully that answers the question, but idk |
20:08:29 | FromDiscord | <ynfle> Yup |
20:18:59 | FromDiscord | <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:25 | FromDiscord | <Rika> That’s why I suggested manual wrapping |
20:19:42 | FromDiscord | <Rika> Only windows guarantees 16 bit characters |
20:19:57 | FromDiscord | <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:34 | FromDiscord | <Prestige> `type wchar {.importc: "wchar_t", nodecl.}` giving me an error: `illegal recursion in type 'wchar'` |
20:45:16 | FromDiscord | <Elegantbeef> would help if you gave the last half of that type def |
20:46:21 | FromDiscord | <Prestige> That's the whole typedef |
20:46:50 | FromDiscord | <Prestige> do I need = object or something? I don't know how wrapping c types works |
20:47:04 | FromDiscord | <Elegantbeef> you need `=` |
20:47:13 | rockcavera | try this cwchar_t {.importc: "wchar_t".} = when defined(windows): int16 else: int32 |
20:47:56 | rockcavera | opz |
20:50:13 | FromDiscord | <Prestige> Cool, thanks - hopefully can get this all working |
20:53:04 | rockcavera | https://play.nim-lang.org/#ix=40aS |
20:57:39 | FromDiscord | <Prestige> Trying to figure out how to create a new wstring now |
20:58:23 | FromDiscord | <Prestige> have https://play.nim-lang.org/#ix=40aT so far |
20:59:12 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=40aU |
21:00:03 | FromDiscord | <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:38 | rockcavera | `wchar_t *` C, on windows you can use WideCString |
21:03:50 | FromDiscord | <Prestige> is there a way to make a `=destroy` proc for an unchecked array? |
21:04:31 | FromDiscord | <Elegantbeef> You'd need to make it distinct |
21:04:40 | FromDiscord | <Elegantbeef> Nim only calls custom destructors for `distinct` or `object` |
21:04:53 | FromDiscord | <Prestige> ah |
21:06:30 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=40aX |
21:07:17 | FromDiscord | <Elegantbeef> Though that's a pointer to pointer |
21:07:23 | FromDiscord | <Prestige> Yeah, hmm |
21:07:56 | FromDiscord | <Prestige> sent a code paste, see https://play.nim-lang.org/#ix=40aY |
21:08:09 | FromDiscord | <Elegantbeef> well yea |
21:08:13 | FromDiscord | <Prestige> `signature for '=destroy' must be proc[T: object](x: var T)` |
21:08:13 | FromDiscord | <Elegantbeef> one you created a generic destructor |
21:08:45 | FromDiscord | <Elegantbeef> Yea that message just means int `var T` the `T` has to be an `object` |
21:11:37 | FromDiscord | <Prestige> Then what was the point of it being distinct? |
21:11:44 | FromDiscord | <Elegantbeef> distinct also works |
21:12:32 | FromDiscord | <Prestige> I have `wstring = distinct ptr UncheckedArray[wchar]` so why doesn't my destructor work? |
21:12:45 | FromDiscord | <Elegantbeef> The issue with a `distinct ptr T` is that it doesnt have a ref count |
21:12:56 | FromDiscord | <Elegantbeef> Cause you have weird generics |
21:13:16 | FromDiscord | <Elegantbeef> Also you use `wstring` before declaring the destructor |
21:13:37 | FromDiscord | <Elegantbeef> you also dont make `wstring` var |
21:16:18 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=40aZ works but double frees i think |
21:18:51 | FromDiscord | <Elegantbeef> Wait i'm just dumb 😄 |
21:19:07 | FromDiscord | <Elegantbeef> I was attempting to free the stack |
21:19:12 | FromDiscord | <Elegantbeef> 10/10 would free again |
21:19:32 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=40b1 here we go |
21:19:44 | FromDiscord | <Elegantbeef> You also probably want a copy or sink hook |
21:31:33 | FromDiscord | <Prestige> does gcfullcollect need to be called? |
21:31:50 | FromDiscord | <Elegantbeef> Of course not |
21:32:04 | NimEventer | New thread by Cnerd: Jester disable content-length header, see https://forum.nim-lang.org/t/9234 |
21:32:17 | FromDiscord | <Elegantbeef> We're using refc on the playground which isnt deterministic and sometimes can make things behave oddl |
21:32:47 | FromDiscord | <Prestige> for the final part.. how do I turn this into a `string` I can use? |
21:33:12 | FromDiscord | <Elegantbeef> No clue i dont even know what a wstr encodes |
21:33:43 | FromDiscord | <Prestige> utf I believe |
21:33:59 | FromDiscord | <Prestige> utf16 on windows, utf32 everywhere else? |
21:35:32 | FromDiscord | <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:34 | FromDiscord | <Elegantbeef> I could be wrong |
21:36:57 | FromDiscord | <Prestige> Why does this have to be so annoying, lol |
21:37:28 | FromDiscord | <enthus1ast> i think the winapi is older than utf8 |
21:38:24 | FromDiscord | <enthus1ast> maybe this helps\: https://khchen.github.io/winim/winstr.html |
21:39:16 | FromDiscord | <Prestige> I thought there'd be an easier way to deal with usb devices |
21:39:36 | FromDiscord | <Elegantbeef> What are you doing? |
21:39:57 | FromDiscord | <Prestige> Trying to use SDL to get info about usb devices, and read data from those devices directly |
21:39:57 | FromDiscord | <Prestige> https://github.com/libsdl-org/SDL/blob/main/src/hidapi/linux/hid.c#L883 |
21:40:44 | FromDiscord | <Prestige> looking at functions like https://wiki.libsdl.org/SDL_hid_get_product_string |
21:43:40 | FromDiscord | <Elegantbeef> https://github.com/BigBIueWhale/utf/blob/main/main.cpp#L70-L170 well have fun prestige |
21:45:54 | FromDiscord | <Prestige> yikes lol |
21:46:22 | FromDiscord | <bulatz> Can I employ channels_builtin in production? Is it bug-free now? |
21:46:26 | FromDiscord | <Elegantbeef> The utf32 to utf8 isnt too bad |
21:47:22 | FromDiscord | <Elegantbeef> Channels work, their issues are mainly on data copying |
21:54:12 | FromDiscord | <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:54 | FromDiscord | <Elegantbeef> Yea afaik |
21:55:15 | FromDiscord | <Elegantbeef> I guess there's also the issue of data ownership not presently working across them |
21:56:07 | FromDiscord | <tsoj> sent a code paste, see https://play.nim-lang.org/#ix=40b5 |
21:56:41 | FromDiscord | <Elegantbeef> You can use macros to error direcctly where you want with `error` and `warn` |
21:56:46 | FromDiscord | <bulatz> In reply to @Elegantbeef "I guess there's also": doc says "# Note that objects passed through channels will be deeply copied" |
21:57:20 | FromDiscord | <bulatz> (edit) "copied"" => "copied"↵so data ownership doesn't exist at all, isn't it?" |
21:57:56 | FromDiscord | <Elegantbeef> I mean you cannot giveup resources across the channel, they're copied |
21:58:08 | FromDiscord | <Elegantbeef> This will eventually be changed with `isolated` i believe |
21:59:15 | FromDiscord | <bulatz> yeah, but it's only efficiency issue, isn't it? |
21:59:22 | FromDiscord | <Elegantbeef> Yes |
21:59:43 | FromDiscord | <bulatz> thank you |
22:02:05 | FromDiscord | <bulatz> oh, one more question - are channels_builtin also works reliably in Nim 1.4 and 1.2? |
22:02:13 | FromDiscord | <Elegantbeef> No clue |
22:02:44 | FromDiscord | <Elegantbeef> I personally stick with stable |
22:05:34 | * | noeontheend joined #nim |
22:07:23 | FromDiscord | <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 |