00:07:56 | FromDiscord | <Gumber> we try hard to break sshit |
00:07:58 | FromDiscord | <Gumber> (edit) "sshit" => "shit" |
00:09:18 | FromDiscord | <Gumber> @geekrelief looking at your stuff now 🙂 |
00:09:37 | FromDiscord | <geekrelief> In reply to @Gumber "<@!109484839480107008> looking at your": cool, btw, I tried out tcc and it works fine |
00:09:46 | FromDiscord | <Gumber> okay so it's a vcc thing |
00:09:48 | FromDiscord | <geekrelief> gcc has issues linking |
00:09:52 | FromDiscord | <geekrelief> vcc has warnings |
00:09:56 | FromDiscord | <Gumber> okay |
00:10:08 | FromDiscord | <Gumber> well I mean that's good news |
00:10:12 | FromDiscord | <geekrelief> here's an example of the gcc error `C:/Users/geekr/scoop/apps/gcc/current/bin/../lib/gcc/x86_64-w64-mingw32/9.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: ↵C:\Users\geekr\nimcache\tm_gen_d\stdlib_dynlib.nim.c.o:stdlib_dynlib.nim.c:(.text+0x0): multiple definition of `NtCurrentTeb'; ` |
00:10:17 | FromDiscord | <Gumber> means it's just compiler specific crap |
00:10:21 | FromDiscord | <Gumber> should be easy to sort out |
00:10:30 | FromDiscord | <geekrelief> yeah, it's strange. I'm using gcc for my godot binding without issue. |
00:10:45 | FromDiscord | <Gumber> I don't know anything about GDNative really |
00:10:47 | FromDiscord | <geekrelief> I usually get warnings with vcc but I can safely ignore them. |
00:10:49 | FromDiscord | <Gumber> or using Nim with Godot |
00:11:02 | FromDiscord | <geekrelief> yeah it was just a sanity check to make sure my gcc install isn't broken |
00:11:04 | FromDiscord | <Gumber> what warnings do you get with vcc right now again? |
00:11:28 | FromDiscord | <geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3Ayb |
00:12:11 | FromDiscord | <geekrelief> I was messing around with pysche-c for parsing C, so I had msys installed. I was wondering if that was making things screwy, but I uninstalled it. |
00:12:53 | FromDiscord | <Gumber> hmmm |
00:18:40 | FromDiscord | <lel> hey, i just started looking at nim and have a question about the stdlib. i wanted to read a file fully into memory, and there's `io.readAll`, but that seems to return a string. i see that there's `io.readBytes` where i can supply my own buffer. But there seems to be no `io.readAllBytes`. am i missing something here? seems strange to me to assume that a file only contains string data |
00:19:14 | FromDiscord | <Elegantbeef> Strings are bytes! You can always `cast[seq[byte]](yourString)` |
00:19:20 | FromDiscord | <Elegantbeef> Well byte sequences |
00:20:31 | FromDiscord | <lel> ah i see, that makes sense. i suppose i have been writing in languages where strings are not char arrays too much lately m( thanks! |
00:20:54 | FromDiscord | <lel> (edit) "ah i see, that makes sense. i suppose i have been writing in languages where strings are not ... char" added "(considered)" |
00:21:33 | FromDiscord | <Elegantbeef> There is the caveat of interop, `seq[byte] ` -\> `string` -\> `cstring` is an issue due to the byte not inserting a `'\0'` after the last entry |
00:21:51 | FromDiscord | <geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3Ayf |
00:21:52 | FromDiscord | <Elegantbeef> But if you're staying in Nim you dont have much issue |
00:22:33 | FromDiscord | <Gumber> what is p? |
00:22:42 | FromDiscord | <Gumber> I'm guessing a pointer to an opaque type? |
00:22:51 | FromDiscord | <geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3Ayg |
00:22:52 | FromDiscord | <Gumber> yeah so it's a 32 bit pointer |
00:22:58 | FromDiscord | <Gumber> so 4 bytes ov |
00:23:05 | FromDiscord | <Gumber> casts that to an unsigned long - same size |
00:23:14 | FromDiscord | <Gumber> cast it to whatever `ULONG_PTR` is |
00:23:31 | FromDiscord | <Gumber> I'm guessing that's an alias somewhere in the machinery via a preprocessor macro |
00:23:32 | FromDiscord | <geekrelief> is long 32 bits? or is that architecture dependent? |
00:23:39 | FromDiscord | <Gumber> an unsigned long is 32 bits |
00:23:44 | FromDiscord | <Gumber> and unsigned long long is 64 |
00:23:53 | FromDiscord | <geekrelief> this is in basetsd.h for windows |
00:24:00 | FromDiscord | <Gumber> yeah |
00:24:53 | FromDiscord | <geekrelief> hmm |
00:25:31 | FromDiscord | <Gumber> sorry wife came in and spilled fish oil pills all over the floor |
00:25:42 | FromDiscord | <Gumber> okay so then |
00:25:47 | FromDiscord | <geekrelief> np |
00:25:53 | FromDiscord | <Gumber> it gets casted back to a pointer to an opaque type |
00:26:14 | FromDiscord | <Gumber> what is ULONG_PTR? |
00:26:37 | FromDiscord | <geekrelief> sent a code paste, see https://play.nim-lang.org/#ix= |
00:27:43 | FromDiscord | <geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3Ayh |
00:28:38 | FromDiscord | <Gumber> okay so it's a sixty four bit unsigned integer |
00:28:54 | FromDiscord | <Gumber> or a pointer to one rather |
00:29:10 | FromDiscord | <Gumber> wait hold on a sec |
00:29:25 | FromDiscord | <geekrelief> yeah, I guess the cast order is (void ) --> (unsigned long)? |
00:29:26 | FromDiscord | <Gumber> no it's just a sixty four bit unsigned integer |
00:29:45 | * | rockcavera joined #nim |
00:29:45 | * | rockcavera quit (Changing host) |
00:29:45 | * | rockcavera joined #nim |
00:30:32 | FromDiscord | <Gumber> casts go right to left |
00:30:43 | FromDiscord | <Gumber> you can check out operator precedence here: https://docs.microsoft.com/en-us/cpp/c-language/precedence-and-order-of-evaluation?view=msvc-160 |
00:30:54 | FromDiscord | <geekrelief> but wouldn't that mean an expansion from 32 to 64 bits is occuring? |
00:31:02 | FromDiscord | <geekrelief> the warning wouldn't make sense right? |
00:32:11 | FromDiscord | <Gumber> no it makes perfvect sense |
00:32:14 | FromDiscord | <geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3Ayj |
00:32:15 | FromDiscord | <Gumber> well hold on |
00:32:19 | FromDiscord | <Gumber> this is super annoying - not you |
00:32:27 | FromDiscord | <Gumber> my wife is like telling me shit she's finding in the garage as she find sit |
00:32:34 | FromDiscord | <Gumber> while i'm trying to help you debug this issue |
00:32:37 | FromDiscord | <geekrelief> haha |
00:32:38 | FromDiscord | <Gumber> and my ADHD is going absolutely nuts |
00:32:51 | FromDiscord | <geekrelief> maybe go help your wife first 🙂 |
00:33:01 | FromDiscord | <Elegantbeef> Nah geek is more important |
00:33:20 | FromDiscord | <Gumber> no she doesn't need help is the thing |
00:33:28 | FromDiscord | <Gumber> she's just like telling me this shit for absolutely no reason |
00:33:39 | FromDiscord | <Gumber> we have a bunch of crap out in our garage still from when we moved in |
00:34:28 | FromDiscord | <geekrelief> I'm sure she has her reasons. 🙂 |
00:34:39 | FromDiscord | <Gumber> to the house we bought this past March - and we had a busy summer and stuff with the marriage, and going back to Virginia and stuff (this is ot btw but I'll try to type it one message)↵↵so as she's coming across stuff in the garage, she's telling me what she's finding like - oh it's a bottle of acetaminophen and she wants me to acknowledge it |
00:34:55 | FromDiscord | <Gumber> well first she was trying to make me feel bad about not using shit I think and now she's just doing it for I dunno wtf reason |
00:35:06 | FromDiscord | <Gumber> she went into the kitchen thank god so maybe I can concentrate a bit noew |
00:35:08 | FromDiscord | <Gumber> (edit) "noew" => "now" |
00:35:19 | FromDiscord | <Gumber> I love her to death but I mean grrrrrrrr lmao |
00:35:34 | FromDiscord | <Gumber> it's fine - I have my shit quirks and annoying habits too |
00:35:43 | FromDiscord | <geekrelief> hehe alright. maybe you should talk it out? |
00:35:44 | FromDiscord | <Elegantbeef> "You love her to death, but if she keeps this up you wont have to love her long" 😛 |
00:35:45 | FromDiscord | <Gumber> so back to your issue - it makes sense because what's happening is this |
00:35:53 | FromDiscord | <Gumber> nah we're fine lol we're not mad or anything |
00:35:54 | FromDiscord | <Gumber> lol |
00:36:01 | FromDiscord | <Gumber> nah we're bffs |
00:36:09 | FromDiscord | <Gumber> have known her since I was 22 and I'm 36 now |
00:36:26 | FromDiscord | <Gumber> you have a pointer to an opaque type so it could be any size |
00:36:47 | FromDiscord | <Gumber> I don't know what POINTER_32 is one sec |
00:37:11 | FromDiscord | <geekrelief> it's `ptr32` not sure what that means |
00:37:29 | FromDiscord | <geekrelief> https://docs.microsoft.com/en-us/cpp/cpp/ptr32-ptr64?view=msvc-160 |
00:37:37 | FromDiscord | <geekrelief> native point on 32 bit system |
00:37:50 | FromDiscord | <Gumber> https://docs.microsoft.com/en-us/cpp/cpp/ptr32-ptr64?view=msvc-160 |
00:37:51 | FromDiscord | <geekrelief> (edit) "point" => "pointer" |
00:37:53 | * | kayabaNerve joined #nim |
00:38:12 | FromDiscord | <geekrelief> so p is a 32 bit pointer |
00:38:21 | FromDiscord | <Gumber> this is an important bit |
00:38:31 | FromDiscord | <Gumber> sent a code paste, see https://play.nim-lang.org/#ix=3Ayk |
00:38:53 | FromDiscord | <Gumber> so it could be a 64 bit pointer on a 64 bit system |
00:39:01 | FromDiscord | <Gumber> so it could be truncated to a 32 bit |
00:39:02 | FromDiscord | <geekrelief> ah |
00:39:03 | FromDiscord | <Gumber> see what's going on here? |
00:39:06 | FromDiscord | <geekrelief> yes |
00:39:13 | FromDiscord | <Gumber> so the warnings are valid |
00:39:31 | FromDiscord | <Gumber> now let's look at C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winnt.h(8712): warning C4103: alignment changed after including header, may be due to missing #pragma pack(pop) |
00:39:36 | FromDiscord | <Gumber> (edit) "C:\Program" => "`C:\Program" | "pack(pop)" => "pack(pop)`" |
00:39:38 | FromDiscord | <geekrelief> ok |
00:40:39 | FromDiscord | <Gumber> somewhere there is a #pragma pack(push, some_packing_alignment) |
00:40:44 | FromDiscord | <Gumber> (edit) "#pragma" => "`#pragma" | "some_packing_alignment)" => "some_packing_alignment)`" |
00:40:48 | FromDiscord | <Gumber> that isn't being popped |
00:41:09 | FromDiscord | <geekrelief> dammit I shouldn't have made that assumption about `POINTER_32`.. |
00:41:33 | FromDiscord | <Gumber> and it's in a header file somewhere that's being included |
00:45:19 | FromDiscord | <Gumber> okay so on that line - `#include "pshpack4.h"` |
00:45:36 | FromDiscord | <Gumber> sent a code paste, see https://play.nim-lang.org/#ix=3Ayl |
00:46:50 | FromDiscord | <Gumber> so it's going to result in `#pragma pack(push,4)` |
00:47:28 | FromDiscord | <geekrelief> yeah |
00:47:55 | FromDiscord | <Gumber> I think anyway - because I don't think they're using the MIDL compiler |
00:48:03 | FromDiscord | <Gumber> wouldn't make much sense here at all |
00:48:31 | FromDiscord | <Gumber> on line 8812 you see - `#include "poppack.h"` |
00:48:37 | FromDiscord | <geekrelief> yeah I see it |
00:48:45 | FromDiscord | <geekrelief> I guess we can safely ignore these |
00:50:02 | FromDiscord | <Gumber> yeah I wouldn't worry about them |
00:50:12 | FromDiscord | <Gumber> none of them are in user land |
00:50:23 | FromDiscord | <Gumber> okay gcc error now |
00:50:28 | FromDiscord | <geekrelief> cool, yeah gcc |
00:50:47 | FromDiscord | <Gumber> so it's from the linker |
00:50:52 | FromDiscord | <Gumber> basically a duplicate symbol |
00:50:58 | FromDiscord | <Gumber> `NtCurrentTeb` |
00:51:26 | FromDiscord | <geekrelief> There's a few of them |
00:51:40 | FromDiscord | <Gumber> so some library is being linked twice |
00:51:47 | FromDiscord | <geekrelief> `GetCurrentFiber` and `GetFiberData` too |
00:51:48 | FromDiscord | <Gumber> https://docs.microsoft.com/en-us/windows/win32/api/winnt/nf-winnt-ntcurrentteb |
00:52:01 | FromDiscord | <Gumber> or the symbol occurs twice in two different libraries |
00:52:09 | FromDiscord | <Gumber> wait that's worded incorrectly |
00:52:16 | FromDiscord | <Gumber> the symbol occurs in two different libraries that are being linked |
00:52:25 | FromDiscord | <Gumber> or is being exported rather is a better way to phrase it |
00:53:10 | FromDiscord | <Gumber> I'm not even quite sure how all this is being linked |
00:53:58 | FromDiscord | <Gumber> sent a code paste, see https://play.nim-lang.org/#ix=3Ayn |
00:55:13 | FromDiscord | <Gumber> can you share the generated Nim file with me? |
00:55:22 | FromDiscord | <geekrelief> sure |
00:56:02 | FromDiscord | <geekrelief> generated file https://media.discordapp.net/attachments/371759389889003532/893662570442027078/tm.nim |
00:56:08 | FromDiscord | <Gumber> thanks |
00:56:13 | FromDiscord | <geekrelief> np |
00:57:17 | FromDiscord | <geekrelief> that file is just an artifact of toast |
00:57:54 | FromDiscord | <Gumber> yeah I'm not even seeing where foundation is linked |
00:57:58 | FromDiscord | <Gumber> foundation.dll or foundation.lib |
00:58:19 | FromDiscord | <geekrelief> they aren't linked. I can get these errors from compiling tm_gen.nim |
00:58:26 | FromDiscord | <Gumber> oh I gotcha |
00:59:16 | FromDiscord | <Gumber> hmm I think I might have a suspicion as to what is going on, but let me check.... |
00:59:28 | FromDiscord | <geekrelief> ok |
01:00:55 | FromDiscord | <Gumber> try passing `-c` to `gcc` |
01:01:04 | FromDiscord | <geekrelief> Yeah I did that before |
01:01:08 | FromDiscord | <Gumber> didn't work? |
01:01:10 | FromDiscord | <geekrelief> that just avoids linking |
01:01:14 | FromDiscord | <geekrelief> so you wouldn't get the errors |
01:01:29 | FromDiscord | <Gumber> well you don't want to link to just generate the nim bindings right? |
01:01:35 | FromDiscord | <Gumber> you only want to link when you build your example |
01:01:46 | FromDiscord | <Gumber> oh I see wait |
01:01:50 | FromDiscord | <geekrelief> right, but .. |
01:01:53 | FromDiscord | <Gumber> it's going to need to compile nimterop too |
01:02:00 | FromDiscord | <Gumber> and link to that |
01:02:04 | FromDiscord | <Gumber> hmm |
01:02:10 | FromDiscord | <geekrelief> well I mean it works fine |
01:02:19 | FromDiscord | <geekrelief> I can just pass -c to get the wrapper |
01:02:30 | FromDiscord | <geekrelief> then I compile with vcc |
01:02:35 | FromDiscord | <Gumber> but when you compile with the wrapper you still get those errors? |
01:02:43 | FromDiscord | <geekrelief> yes |
01:02:49 | FromDiscord | <Gumber> well if you compile the wrapper with mingw |
01:02:57 | FromDiscord | <Gumber> or rather if you compile the wrapper generator with mingw |
01:03:11 | FromDiscord | <Gumber> you should compile whatever imports the mingw with mingw too |
01:03:20 | FromDiscord | <Gumber> (edit) "mingw" => "bindings" |
01:03:23 | FromDiscord | <Gumber> sorry brain fart |
01:05:04 | FromDiscord | <geekrelief> if I generate the binding and compile the binding with gcc/mingw the errors popup |
01:05:15 | FromDiscord | <Gumber> okay |
01:05:29 | FromDiscord | <Gumber> even if you use `-c` to generate the bindings right? |
01:05:33 | FromDiscord | <geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3Ays |
01:05:58 | FromDiscord | <geekrelief> let me regenerate the binding.. I think the wrapper will be the same though.. |
01:06:01 | FromDiscord | <Gumber> okay |
01:06:14 | FromDiscord | <Gumber> yeah I really don't think this is the issue but |
01:06:18 | FromDiscord | <Gumber> I thought it was at first |
01:06:30 | FromDiscord | <geekrelief> yeah, -c with tm_gen.nim and compiled minimal, still has errors |
01:06:34 | FromDiscord | <Gumber> yeah okay |
01:06:39 | FromDiscord | <Gumber> so Nim's stdlib includes that symbol |
01:06:50 | FromDiscord | <Gumber> in `stdlib_system.nim.c` |
01:07:03 | FromDiscord | <Gumber> that's where it's first encountering it |
01:07:35 | FromDiscord | <Gumber> and then mingw is probably linking to it from here: https://github.com/Alexpux/mingw-w64/blob/master/mingw-w64-tools/widl/include/winnt.h |
01:07:59 | FromDiscord | <Gumber> well maybe not that file hold on |
01:09:43 | FromDiscord | <Gumber> oh yeah it is defined there |
01:09:45 | FromDiscord | <Gumber> `extern struct _TEB WINAPI NtCurrentTeb(void);` |
01:10:13 | FromDiscord | <geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3Ayu |
01:10:17 | FromDiscord | <Gumber> second line |
01:10:28 | FromDiscord | <Gumber> well those three lines right there |
01:10:48 | FromDiscord | <geekrelief> yeah yours just looks a little different |
01:10:56 | FromDiscord | <Gumber> oh I just pulled that off github |
01:11:07 | FromDiscord | <Gumber> probably not even a correct file - let's go with yours |
01:11:17 | FromDiscord | <Gumber> either way I think this is what we're dealing with |
01:11:51 | FromDiscord | <geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3Ayv |
01:12:18 | FromDiscord | <Gumber> yeah but that one is guarded |
01:12:26 | FromDiscord | <Gumber> those are all in the same file? |
01:12:31 | FromDiscord | <Gumber> and those are defining functions |
01:12:38 | FromDiscord | <geekrelief> oh yeah.. for some reason I say ifdef on the first one |
01:12:45 | FromDiscord | <Gumber> yeah |
01:13:05 | FromDiscord | <Gumber> I dunno wtf is going on there honestly |
01:13:15 | FromDiscord | <geekrelief> yeah same file |
01:13:17 | FromDiscord | <Gumber> I think it's just like making an alias to those functions |
01:13:27 | FromDiscord | <Gumber> with a implicit cast of the return type |
01:13:44 | FromDiscord | <Gumber> https://stackoverflow.com/questions/32547952/multiple-multiple-definition-of-while-compiling-simple-hello-world |
01:13:46 | FromDiscord | <Gumber> I think this is the issue |
01:15:50 | FromDiscord | <Gumber> it's definitely not an issue with the binding generator |
01:16:04 | FromDiscord | <Gumber> it's an issue with the compilation of the bindings themselves |
01:16:12 | FromDiscord | <geekrelief> I wonder if it's an issue with my install of gcc |
01:16:53 | FromDiscord | <geekrelief> the stackoverflow issue suggest that the libraries are linked multiple times |
01:17:23 | FromDiscord | <Gumber> yeah I mean that's the underlying issue |
01:17:33 | FromDiscord | <Gumber> the issue isn't exacxtly the same |
01:17:36 | FromDiscord | <Gumber> (edit) "exacxtly" => "exactly" |
01:17:50 | FromDiscord | <Gumber> but somehow libgcc s getting linked twice statically |
01:17:52 | FromDiscord | <geekrelief> right, so what is doing the linking? |
01:17:55 | FromDiscord | <Gumber> (edit) "s" => "is" |
01:18:12 | FromDiscord | <Gumber> well when you compile the bindings with nim and mingw I"m guessing it gets linked statically |
01:18:19 | FromDiscord | <Gumber> but you're not producing an executable soooo |
01:18:33 | FromDiscord | <Gumber> or even a shared library |
01:18:45 | FromDiscord | <Gumber> but you are producing some object files |
01:19:01 | FromDiscord | <Gumber> I'm just doing a rubber duck thing right now btw |
01:19:11 | FromDiscord | <geekrelief> no worries |
01:19:24 | FromDiscord | <Gumber> I think the last sentence in the answer is the jist of what's happening here |
01:19:28 | FromDiscord | <Gumber> sent a code paste, see https://play.nim-lang.org/#ix= |
01:19:42 | FromDiscord | <Gumber> if you don't generate the bindings separately |
01:19:44 | FromDiscord | <Gumber> this still happens? |
01:20:28 | FromDiscord | <geekrelief> Actually I've never tried that because of the linking errors. I just generated the wrapper separately first. |
01:20:32 | FromDiscord | <Gumber> give that a shot |
01:20:35 | FromDiscord | <Gumber> see what happens |
01:20:48 | FromDiscord | <Gumber> if they disappear and you get new linker errors |
01:20:50 | FromDiscord | <Gumber> that's your issue |
01:20:51 | FromDiscord | <geekrelief> How would I set that up? |
01:20:57 | FromDiscord | <Gumber> I think it's an arg to nimterop |
01:20:59 | FromDiscord | <Gumber> one sec |
01:21:26 | FromDiscord | <Gumber> so I think.... |
01:21:45 | FromDiscord | <Gumber> sent a code paste, see https://play.nim-lang.org/#ix=3Ayz |
01:21:58 | FromDiscord | <Gumber> and then make a nim file that imports `tm_gen.nim` and compile that |
01:22:33 | FromDiscord | <geekrelief> Can I modify minimal.nim and swap tm with tm_gen? |
01:22:38 | FromDiscord | <Gumber> sure |
01:23:09 | FromDiscord | <geekrelief> same errors |
01:23:32 | FromDiscord | <Gumber> shittttt |
01:23:39 | FromDiscord | <Gumber> ugh man I hate mingw |
01:24:02 | FromDiscord | <geekrelief> yeah |
01:24:17 | FromDiscord | <geekrelief> alright, I'll just put in the readme you gotta use vcc or tcc |
01:24:19 | FromDiscord | <Gumber> nimterop gets compiled and calls toast which generates your bindings |
01:24:26 | FromDiscord | <geekrelief> yeah |
01:24:32 | FromDiscord | <Gumber> and then your bindings are getting compiled by mingw |
01:24:36 | FromDiscord | <Gumber> along with your program |
01:24:40 | FromDiscord | <Gumber> and both are being linked to libgcc |
01:24:45 | FromDiscord | <Gumber> but I don't know how to fix it.... |
01:26:14 | FromDiscord | <geekrelief> actually, I'm not sure I really understand the nature of the problem |
01:26:30 | FromDiscord | <Gumber> so when you compile code you don't go automatically from source to executable right |
01:26:33 | FromDiscord | <Gumber> object files get produced |
01:26:40 | FromDiscord | <geekrelief> `tm.nim` is imported into `minimal.nim` would all the symbols be resolved during linking? |
01:26:59 | FromDiscord | <Gumber> and those object files are linked to static libraries and an executable is produced |
01:27:20 | FromDiscord | <Gumber> so object files are being produced that are being linked to two copies of libgcc |
01:27:29 | FromDiscord | <Gumber> and that's why you're getting the duplicate symbols |
01:27:32 | FromDiscord | <geekrelief> I guess if there's a collision the linker would know which to choose |
01:27:44 | FromDiscord | <geekrelief> (edit) "would" => "wouldn't" | "choose" => "choose?" |
01:27:47 | FromDiscord | <Gumber> well it's not so much the linker that's at fault here |
01:27:59 | FromDiscord | <Gumber> it's the way mingw works and the way nimterop is set up to work |
01:28:20 | FromDiscord | <geekrelief> Maybe I'll ping shashlick and see if he knows what's up |
01:28:28 | FromDiscord | <Gumber> he might |
01:28:31 | FromDiscord | <Gumber> one sec let me look into nimterops code |
01:28:40 | FromDiscord | <geekrelief> he reached out to me the other day and offered to help |
01:28:45 | FromDiscord | <Gumber> I can probably better explain it if I can find the loc that will shine the light on this |
01:28:46 | FromDiscord | <Gumber> oh cool |
01:30:56 | * | neurocyte01320 joined #nim |
01:30:56 | * | neurocyte01320 quit (Changing host) |
01:30:56 | * | neurocyte01320 joined #nim |
01:33:19 | * | neurocyte0132 quit (Ping timeout: 252 seconds) |
01:33:19 | * | neurocyte01320 is now known as neurocyte0132 |
01:33:32 | FromDiscord | <geekrelief> I pinged shashlick. I'll let you know if anything comes of it. In the meantime, thanks for your help. I'll just a note in the readme and create an issue about gcc in the repo. |
01:33:44 | FromDiscord | <geekrelief> (edit) "I pinged shashlick. I'll let you know if anything comes of it. In the meantime, thanks for your help. I'll just ... a" added "post" |
01:34:40 | FromDiscord | <geekrelief> I think I've had enough of dealing with this for today. 🙂 I'm happy that tcc works though! |
01:34:47 | FromDiscord | <Gumber> okay I can explain it |
01:34:54 | FromDiscord | <Gumber> but yeah that's cool |
01:35:05 | FromDiscord | <Gumber> so toast is getting compiled and turning into toast.exe |
01:35:12 | FromDiscord | <Gumber> and there's one static linking of libgcc |
01:35:17 | FromDiscord | <Gumber> toast.exe gets invoked to produce the bindings |
01:35:23 | FromDiscord | <Gumber> object files are linked to libgcc |
01:35:32 | FromDiscord | <Gumber> you compile those and now you have to libgcc |
01:35:38 | FromDiscord | <Gumber> make sense @geekrelief ? |
01:36:15 | FromDiscord | <geekrelief> The bindings are just nim, so I don't understand where the object files are coming from. |
01:36:38 | FromDiscord | <Gumber> when you compile the nim code to c |
01:36:45 | FromDiscord | <Gumber> the c compiler gets invoked |
01:36:51 | FromDiscord | <Gumber> and produces some object files |
01:37:01 | FromDiscord | <Gumber> so nimterop itself gets compiled |
01:37:20 | FromDiscord | <Gumber> and gets linked statically to libgcc by mingw to produce some object files |
01:37:23 | FromDiscord | <Gumber> because toast.exe needs to be produced |
01:37:42 | FromDiscord | <Gumber> nimterop then invokes toast.exe to generate your bindings |
01:38:15 | FromDiscord | <Gumber> to compile your bindings, you depend on nimterop |
01:38:45 | FromDiscord | <Gumber> and remember nimterop has produced object files already |
01:38:56 | FromDiscord | <Gumber> so you're going to link to those object files in your host program |
01:39:07 | FromDiscord | <Gumber> and nim is going to invoke mingw to compile your program |
01:39:19 | FromDiscord | <Gumber> well nimterop is going to invoke nim to invoke mingw to compile your program |
01:39:23 | FromDiscord | <Gumber> if you're not generated the bindings seprately |
01:39:29 | FromDiscord | <Gumber> but even if you are your'e still going to depend on those object files |
01:39:36 | FromDiscord | <Gumber> because then you'll need to depend on nimterop |
01:39:44 | FromDiscord | <Gumber> and once again mingw will link libgcc |
01:39:54 | FromDiscord | <geekrelief> ok I think I understand now |
01:39:54 | FromDiscord | <Gumber> so now you have duplicate symbols in separate object files |
01:40:00 | FromDiscord | <Gumber> yeah it's hairy af man |
01:40:03 | FromDiscord | <Gumber> but that's what happens |
01:40:08 | FromDiscord | <Gumber> it's all cause of how nimterop works in the end |
01:40:15 | FromDiscord | <geekrelief> yeah I was wondering why nimterop is this convoluted |
01:40:30 | FromDiscord | <Gumber> yeah you might have better luck with @PMunch 's furthak |
01:40:33 | FromDiscord | <geekrelief> I was going through the codebase and had a couple of wtf moments |
01:40:35 | FromDiscord | <Gumber> or just roll the bindings by hand |
01:40:38 | FromDiscord | <Gumber> I don't think it would be that bad with c2nim |
01:40:44 | FromDiscord | <Gumber> but I know you're just trying to make progress |
01:40:46 | FromDiscord | <Gumber> yeah |
01:40:54 | FromDiscord | <Gumber> well - it was a yeoman's effort for sure |
01:41:06 | FromDiscord | <Gumber> it's a lot of fucking code and no one had really tried to do what shaslick was doing |
01:41:10 | FromDiscord | <geekrelief> I don't want to depend on llvm for futhark |
01:41:18 | FromDiscord | <Gumber> (edit) "shaslick" => "shashlick" | "doing" => "doing, at least not in the Nim community yet" |
01:41:21 | FromDiscord | <Gumber> ah okay |
01:41:27 | FromDiscord | <Gumber> yeah I would go for c2nim + perl |
01:41:32 | FromDiscord | <Gumber> and pcre |
01:41:36 | FromDiscord | <geekrelief> I'm not sure it's reasonable to ask people to do all that setup for 1 binding |
01:41:40 | FromDiscord | <Gumber> I agree |
01:41:51 | FromDiscord | <geekrelief> I mean nimterop works for vcc and tcc |
01:41:53 | FromDiscord | <Gumber> I can't even be bothered to install LLVM to use rust xD |
01:41:54 | FromDiscord | <Gumber> yeah |
01:42:00 | FromDiscord | <Gumber> if that's enough for you on windows then you're probablyg ood |
01:42:03 | FromDiscord | <Gumber> (edit) "probablyg ood" => "probably good" |
01:42:12 | FromDiscord | <Gumber> but hey - I gotta run and get some stuff done |
01:42:17 | FromDiscord | <geekrelief> yeah, I just wanted to understand the nature of the problem. |
01:42:18 | FromDiscord | <Gumber> and I'm glad we were able to figure this stuff out 🙂 |
01:42:22 | FromDiscord | <geekrelief> thanks for all the help! |
01:42:26 | FromDiscord | <geekrelief> take care! |
01:42:27 | FromDiscord | <Gumber> yeah of course! I always like to do that too! |
01:42:29 | FromDiscord | <Gumber> any time! you too bud! |
02:10:43 | * | rockcavera quit (Ping timeout: 252 seconds) |
02:16:05 | FromDiscord | <juan_carlos> Theres something to convert a `seq[seq[]]` to CSV in StdLib?, I know I can do 2 for loops, but wondering if theres something better?. |
02:19:15 | * | arkurious quit (Quit: Leaving) |
02:37:31 | FromDiscord | <Gumber> In reply to @juan_carlos "Theres something to convert": only csv module I'm aware of is `parsecsv` |
02:37:38 | FromDiscord | <Gumber> but I imagine you could come up with something using `sequtils` |
02:37:41 | FromDiscord | <Gumber> fairly easily |
02:37:54 | FromDiscord | <Gumber> give me one sec and I'll do it |
02:39:36 | * | rockcavera joined #nim |
02:39:36 | * | rockcavera quit (Changing host) |
02:39:36 | * | rockcavera joined #nim |
02:44:16 | FromDiscord | <Gumber> @juan_carlos something like - https://play.nim-lang.org/#ix=3AyM ? |
02:45:28 | FromDiscord | <Gumber> obviously it's very simplistic and you'd need to do some escaping and take in some parameters to specify delimiters etc |
02:45:34 | FromDiscord | <Gumber> but I mean it's the basics |
02:53:30 | FromDiscord | <Gumber> you could do this in a much more preformant way with 2d arrays instead of sequences |
02:53:36 | FromDiscord | <Gumber> in terms of space time complexity |
02:53:49 | FromDiscord | <Gumber> but you'd be hard capped in terms of capacity |
02:54:41 | FromDiscord | <Gumber> only dynamic allocations then would be the strings |
02:54:55 | FromDiscord | <Gumber> and I'm assuming you don't know the content of the 2d matrix at compile time |
02:55:34 | FromDiscord | <Gumber> actually those wouldn't be dynamic |
02:55:52 | FromDiscord | <Gumber> sorry - I'm a bit tired but you'd just set a max length on the strings too and allocate those up front as well |
02:56:37 | * | xet7 quit (Remote host closed the connection) |
02:58:18 | * | xet7 joined #nim |
03:29:26 | FromDiscord | <juan_carlos> Cool, thanks. |
03:29:48 | FromDiscord | <Gumber> yeah, np!!! |
03:35:14 | FromDiscord | <retkid> whats a good way to write a recursive statement |
03:35:29 | FromDiscord | <retkid> i have a function that returns a list that the function needs to be applied top |
03:35:30 | FromDiscord | <retkid> (edit) "top" => "to" |
03:35:36 | FromDiscord | <retkid> that returns a list... |
03:36:02 | FromDiscord | <retkid> not quite sure how to rap my head around it |
03:38:08 | FromDiscord | <retkid> like that? |
03:38:11 | FromDiscord | <retkid> sent a code paste, see https://play.nim-lang.org/#ix=3AyZ |
03:38:46 | * | Guest9486 joined #nim |
03:38:55 | Guest9486 | hello everyone. |
03:39:34 | Guest9486 | I am wandering that if there is a way to obtain the type of a variable. For example, var i:int=0, can we obtain its type by a function? |
03:40:01 | Guest9486 | Similar with the type as in the python |
03:40:47 | FromDiscord | <Elegantbeef> `typeof(i)` |
03:41:20 | Guest9486 | Thank you |
03:41:55 | Guest9486 | it works as I just tried. |
03:42:41 | FromDiscord | <Elegantbeef> no problem |
03:58:08 | FromDiscord | <Gumber> In reply to @retkid "i have a function": I'm not even sure what you're trying to get at here... |
03:58:24 | FromDiscord | <Gumber> which function needs to be applied to the list? |
03:58:26 | FromDiscord | <Gumber> the same function? |
03:58:32 | FromDiscord | <retkid> yes. |
03:58:33 | FromDiscord | <cabboose> Use a proxy template or procedure with a forward declaration↵(@retkid) |
03:58:40 | FromDiscord | <Elegantbeef> https://streamable.com/2m1xvk it verks! |
03:58:41 | FromDiscord | <Gumber> in your example you have `example2` |
03:58:44 | FromDiscord | <Gumber> where does that come from? |
03:59:06 | FromDiscord | <Gumber> it's the same as doing recursion in any other imperative / procedural language |
03:59:14 | FromDiscord | <retkid> this is jut some code i wrote half-hazardly before rushing off to do something else |
03:59:32 | FromDiscord | <retkid> none of that has any meaning |
03:59:44 | FromDiscord | <Gumber> okay so you just want to know how to do recursion in Nim? Do what cabboose said |
04:00:06 | FromDiscord | <retkid> In reply to @cabboose "Use a proxy template": can you link me something in the docs |
04:01:22 | FromDiscord | <Gumber> proxy templates are not unique to Nim |
04:01:29 | FromDiscord | <Gumber> they're an abstraction |
04:01:30 | FromDiscord | <retkid> i meant the second thing |
04:01:38 | FromDiscord | <Gumber> just look in the manual for forward declaration |
04:02:17 | FromDiscord | <Gumber> but I will find the relevant section for you, hold on |
04:02:29 | FromDiscord | <retkid> theres 2 sections |
04:02:52 | FromDiscord | <retkid> this is just a function declaration? |
04:03:19 | FromDiscord | <Gumber> https://nim-lang.github.io/Nim/manual.html#procedures |
04:03:29 | FromDiscord | <Gumber> it's a procedure declaration without a body |
04:03:46 | FromDiscord | <Gumber> so you can reference the symbol before it is implemented |
04:05:03 | FromDiscord | <Gumber> maybe seeing some recursive code in Nim would help you: https://rosettacode.org/wiki/Tree_traversal#Nim |
04:05:13 | * | Gustavo6046 quit (Quit: ZNC 1.8.2 - https://znc.in) |
04:05:27 | * | Gustavo6046 joined #nim |
04:06:01 | * | supakeen quit (Quit: WeeChat 3.3) |
04:06:30 | * | supakeen joined #nim |
04:06:42 | FromDiscord | <Gumber> (edit) "maybe seeing some ... recursivetree" added "simple" | "code" => "tree traversal" |
04:07:00 | FromDiscord | <Gumber> or if you want the classic example |
04:07:33 | FromDiscord | <Gumber> sent a code paste, see https://play.nim-lang.org/#ix=3Az6 |
04:07:41 | FromDiscord | <retkid> i think im just overcomplicating this lol |
04:07:43 | FromDiscord | <Gumber> probably |
04:07:53 | FromDiscord | <Gumber> maybe read the wikipedia page on recursion? |
04:08:09 | FromDiscord | <Gumber> https://en.wikipedia.org/wiki/Recursion#In_computer_science |
04:09:10 | FromDiscord | <Gumber> there's also a specialized form of recursion called tail-recursion |
04:09:37 | FromDiscord | <Gumber> but to understanding it, reading all of this page would be beneficial to you - https://en.wikipedia.org/wiki/Tail_call |
04:10:07 | FromDiscord | <Gumber> (edit) "to" => "as far as" | "it," => "it goes," |
04:30:18 | FromDiscord | <geekrelief> In reply to @Elegantbeef "https://streamable.com/2m1xvk it verks!": oooh is this using nimscripter? |
04:33:44 | FromDiscord | <geekrelief> In reply to @Elegantbeef "https://streamable.com/2m1xvk it verks!": What have you been up to?! Anyway I can borrow this for The Machinery? 😄 |
04:33:47 | * | rockcavera quit (Remote host closed the connection) |
04:34:21 | FromDiscord | <Elegantbeef> I've been rewriting the interop |
04:34:24 | FromDiscord | <Elegantbeef> So in theory yes you can |
04:34:33 | FromDiscord | <Elegantbeef> Still on a branch cause need to document it more |
04:34:56 | FromDiscord | <Elegantbeef> This interop is the more efficient due using raw PNode logic |
04:35:17 | FromDiscord | <geekrelief> Awesome, pls let me know when it's ready for sharing! Thanks! |
04:35:32 | FromDiscord | <Elegantbeef> Well it's "ready" 😛 |
04:35:47 | FromDiscord | <geekrelief> it's the 'bigrewrite' branch? |
04:35:53 | FromDiscord | <Elegantbeef> Yea |
04:36:06 | FromDiscord | <Elegantbeef> Look at `tests/example` for a usage |
04:36:17 | FromDiscord | <geekrelief> you read my mind! thx |
04:37:13 | FromDiscord | <Elegantbeef> For that drawim example https://play.nim-lang.org/#ix=3Az7 is all the extra code i wrote |
04:38:14 | FromDiscord | <Elegantbeef> There are some bugs presently with Nim -\> Nimscript dont know if it's cause of me or the VM but there is an error inside the VM popping up |
04:39:23 | FromDiscord | <geekrelief> Nice, I'll take a look tomorrow. I'm a bit fried from dealing with gcc and nimterop. Luckily, vcc and tcc are working smoothly. |
04:39:57 | FromDiscord | <geekrelief> In reply to @Elegantbeef "There are some bugs": For reference, what's the eror? |
04:40:00 | FromDiscord | <geekrelief> (edit) "eror?" => "error?" |
04:40:16 | FromDiscord | <Elegantbeef> Sending a json node -\> Nimscript causes an assertion defect |
04:40:53 | FromDiscord | <geekrelief> ok. thanks. signing off, g'night |
04:41:18 | FromDiscord | <Elegantbeef> Buh bye, feel free to ask if you have any questions or want to give any input on the design/ergonomics of it |
04:42:50 | FromDiscord | <Elegantbeef> I do want to try nico or drawim with wasm + nimscripter to see we can get an online educational drawing library like p5js \:D |
05:07:36 | FromDiscord | <impbox [ftsf]> Yass, I'll try get Nico working with 1.6 today |
05:09:53 | FromDiscord | <Elegantbeef> Lol nothing like a kick in the pants 🙂 |
05:18:29 | * | Guest9486 quit (Quit: Client closed) |
05:49:06 | FromDiscord | <impbox [ftsf]> at least i've got 1.6 running now, so hopefully fixing nico isn't a big job |
05:53:53 | FromDiscord | <impbox [ftsf]> `Warning: suspicious code` |
06:21:06 | FromDiscord | <impbox [ftsf]> `Warning: implicit conversion to 'cstring' from a non-const location this will become a compile time error in the future [CStringConv]` is there a reason for this? should we not convert to cstring? |
06:21:44 | FromDiscord | <impbox [ftsf]> i wish all the things like `CStringConv` were a link to documentation why you shouldn't do something |
06:22:01 | FromDiscord | <impbox [ftsf]> "A dangerous implicit conversion to cstring now triggers a [CStringConv] warning. This warning will become an error in future versions! Use an explicit conversion like cstring(x) in order to silence the warning." |
06:22:04 | FromDiscord | <impbox [ftsf]> why is it dangerous? |
06:22:11 | FromDiscord | <impbox [ftsf]> how can I make it not dangerous? |
06:22:19 | FromDiscord | <xflywind> add .cstring explicitly |
06:22:24 | FromDiscord | <impbox [ftsf]> sure, that will silence it |
06:22:31 | FromDiscord | <impbox [ftsf]> but will it make it not dangerous? |
06:22:46 | FromDiscord | <impbox [ftsf]> if i'm doing something dangerous i want to stop doing the dangerous thing not silence it |
06:23:41 | FromDiscord | <retkid> can i make a for statement |
06:23:53 | FromDiscord | <retkid> that expands as the list inwhich its based on expands? |
06:23:56 | FromDiscord | <retkid> (edit) "inwhich" => "in which" |
06:24:33 | FromDiscord | <retkid> sent a code paste, see https://play.nim-lang.org/#ix=3Azr |
06:24:33 | FromDiscord | <retkid> loops forever |
06:24:45 | FromDiscord | <impbox [ftsf]> seems like it? |
06:24:59 | FromDiscord | <impbox [ftsf]> looks like it should loop forever |
06:24:59 | FromDiscord | <retkid> unless that already doesa that |
06:25:02 | FromDiscord | <retkid> (edit) "doesa" => "does a" |
06:25:05 | FromDiscord | <Elegantbeef> Nah you cannot mutate the iteration location |
06:25:09 | FromDiscord | <impbox [ftsf]> did you try it? |
06:25:10 | FromDiscord | <Elegantbeef> Use a while loop |
06:25:17 | FromDiscord | <retkid> ahhh |
06:25:20 | FromDiscord | <retkid> nice call |
06:25:20 | FromDiscord | <retkid> eya |
06:25:23 | FromDiscord | <retkid> (edit) "eya" => "yea" |
06:25:26 | FromDiscord | <retkid> just use it as an iterator |
06:26:00 | FromDiscord | <Elegantbeef> Actually that's just in Nim's seq iterator |
06:26:06 | FromDiscord | <Elegantbeef> If you override that iterator you can |
06:26:14 | FromDiscord | <impbox [ftsf]> you can make an iterator that will let you do it |
06:26:23 | FromDiscord | <impbox [ftsf]> iterators are pretty cool |
06:26:27 | FromDiscord | <retkid> In reply to @Elegantbeef "Actually that's just in": yep |
06:26:29 | FromDiscord | <retkid> thats what i thought |
06:28:35 | FromDiscord | <retkid> sent a code paste, see https://play.nim-lang.org/#ix=3Azt |
06:28:46 | FromDiscord | <retkid> sent a code paste, see https://play.nim-lang.org/#ix=3Azu |
06:29:03 | FromDiscord | <retkid> wait |
06:29:22 | FromDiscord | <retkid> (edit) "https://play.nim-lang.org/#ix=3Azu" => "https://play.nim-lang.org/#ix=3Azv" |
06:29:28 | FromDiscord | <retkid> that wont create any problems as long as you dont pop the list |
06:29:32 | FromDiscord | <retkid> then it might create some issues |
06:29:43 | * | Guest34 joined #nim |
06:29:55 | FromDiscord | <retkid> but, simplicity is good here |
06:35:35 | * | Vladar joined #nim |
06:36:37 | FromDiscord | <impbox [ftsf]> aww low/high(value) deprecated, I liked it, now I need to remember what type something is |
06:36:54 | FromDiscord | <impbox [ftsf]> or add typeof |
06:36:54 | FromDiscord | <Elegantbeef> `typeof(a).low` 😛 |
06:38:49 | FromDiscord | <xflywind> implicit cstring conversion is disabled because it is more dangerous. explicit cstring conversion is still as unsafe as before. |
06:39:20 | FromDiscord | <impbox [ftsf]> what's unsafe about it? |
06:39:29 | * | Guest34 quit (Quit: Client closed) |
06:39:42 | FromDiscord | <Elegantbeef> Depending on what the C does with the char\ it may point to bad memory later |
06:40:15 | FromDiscord | <Elegantbeef> In most cases it can be considered a safe operation |
06:40:21 | FromDiscord | <impbox [ftsf]> okay |
06:40:39 | FromDiscord | <impbox [ftsf]> so it's not the conversion that's unsafe, it's that C might do something unsafe with it? |
06:40:59 | FromDiscord | <xflywind> for example, returns a cstring which points to a local string on procs because string may be gc collected |
06:41:16 | FromDiscord | <xflywind> (edit) removed "because string may be gc collected" |
06:41:21 | FromDiscord | <Elegantbeef> Nim puts a `\0` after the last character so yea it's safe Nim -\> C |
06:42:03 | FromDiscord | <xflywind> sent a code paste, see https://play.nim-lang.org/#ix=3AzA |
06:42:18 | FromDiscord | <xflywind> https://nim-lang.github.io/Nim/manual.html#types-cstring-type |
07:00:36 | * | Gustavo6046 quit (Remote host closed the connection) |
07:00:53 | * | Gustavo6046 joined #nim |
07:03:52 | FromDiscord | <impbox [ftsf]> woo nico all working nice in 1.6 now, hopefully it still works with 1.4 |
07:08:35 | FromDiscord | <impbox [ftsf]> @ElegantBeef new nico updated to work with 1.6 \o/ ready to be nimscripted |
07:08:54 | FromDiscord | <Elegantbeef> fun |
07:12:30 | FromDiscord | <impbox [ftsf]> can I just {.push:exportToScript.} ? |
07:12:38 | FromDiscord | <Elegantbeef> Nope |
07:12:43 | FromDiscord | <impbox [ftsf]> T_T |
07:12:57 | FromDiscord | <Elegantbeef> Those push pragmas do not play with macros well |
07:13:09 | FromDiscord | <Elegantbeef> I will have a block exportToScript |
07:13:42 | FromDiscord | <Elegantbeef> But also proc overloads dont work across the bridge, so generics/typeclasses are a no go |
07:14:32 | FromDiscord | <Elegantbeef> It's possible to support i suppose |
07:17:12 | FromDiscord | <Elegantbeef> Typeclasses atleast might be, generics certainly cannot be |
07:19:08 | FromDiscord | <haxscramper> When you create `proc generic[T]` on the nimscript side, I don't think it is possible to figure out exact type that was passed |
07:19:26 | FromDiscord | <haxscramper> So you need to generate `proc generic[T] = when ....` |
07:19:33 | FromDiscord | <haxscramper> And dispatch into concrete procs |
07:19:46 | FromDiscord | <haxscramper> At least passed PNode does not have enough information IIRC |
07:19:47 | FromDiscord | <Elegantbeef> Well yea nimscript cannot generate generics |
07:20:27 | FromDiscord | <Elegantbeef> Typeclasses might work though since it's a fixed set, but it'll be complicated |
07:22:57 | * | max22- joined #nim |
07:31:58 | FromDiscord | <impbox [ftsf]> @ElegantBeef does it support default args? |
07:32:11 | FromDiscord | <Elegantbeef> Havent tried it yet |
07:32:18 | FromDiscord | <Elegantbeef> Theoretically should |
07:32:59 | FromDiscord | <Rika> About to back read a thousand messages, wish me luck I guess |
07:35:11 | FromDiscord | <Elegantbeef> Presently i have a nice bug with float -\> VM |
07:35:27 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3AzH |
07:35:37 | FromDiscord | <impbox [ftsf]> close enough |
07:36:34 | FromDiscord | <Elegantbeef> Both are relatively 0 yes 😛 |
07:37:22 | FromDiscord | <Rika> Probably a float bit size issue? |
07:37:32 | FromDiscord | <Rika> Or a misalignment |
07:37:39 | FromDiscord | <impbox [ftsf]> using an analog path to transfer stuff between nim and VM |
07:38:05 | FromDiscord | <impbox [ftsf]> cast to uint64 and compare the bits? |
07:38:46 | FromDiscord | <Rika> Can’t easily cast in VM |
07:42:07 | FromDiscord | <impbox [ftsf]> dang it |
07:42:23 | FromDiscord | <Elegantbeef> Fixed it! |
07:44:39 | FromDiscord | <Elegantbeef> I accidentally was converting all types to Pnodes instead of just non primitives |
07:46:15 | FromDiscord | <cabboose> Cringe |
08:43:31 | FromDiscord | <dom96> 'morning |
08:43:38 | FromDiscord | <Rika> gm |
08:43:49 | FromDiscord | <cabboose> Good arvo |
08:44:03 | FromDiscord | <impbox [ftsf]> o/ gday |
08:44:56 | FromDiscord | <cabboose> Howrya livin cobba |
08:45:01 | * | kayabaNerve quit (Ping timeout: 252 seconds) |
09:12:19 | * | Amun-Ra joined #nim |
09:35:49 | FromDiscord | <dom96> Lots of hacktoberfest candidate issues in the choosenim repo 🙂 |
09:37:40 | FromDiscord | <dom96> first I need to fix it and the CI but once that's done if anyone is interested I'm happy to give pointers |
09:40:04 | supakeen | seems fun :) |
09:41:18 | FromDiscord | <dom96> oh no https://media.discordapp.net/attachments/371759389889003532/893794757971685406/unknown.png |
09:41:39 | FromDiscord | <dom96> seems like another zippy bug :/ |
09:43:45 | supakeen | what about it? |
09:44:09 | FromDiscord | <dom96> very high memory usage |
09:45:28 | supakeen | oh right but another bug does it have many? |
09:48:20 | FromDiscord | <dom96> only one other I've found and fixed already |
09:48:55 | FromDiscord | <dom96> so not too bad, but high memory usage sounds tough to resolve |
09:49:20 | supakeen | well one can always see if the same happens with the libzip bindings |
09:49:31 | supakeen | some compression things like to use a lot of memory if they can |
09:53:42 | * | tinytoast joined #nim |
10:25:05 | * | kayabaNerve joined #nim |
10:39:36 | FromDiscord | <caramel.py> sent a long message, see http://ix.io/3AAs |
10:41:22 | FromDiscord | <dom96> !matrix |
10:41:23 | FromDiscord | <matrix-appservice-discord-t2bot> sent a long message, see http://ix.io/3qay |
10:41:35 | FromDiscord | <dom96> !matrix ban caramel.py |
10:41:38 | FromDiscord | <matrix-appservice-discord-t2bot> ERROR: No users matching caramel.py found |
10:42:11 | FromDiscord | <dom96> !matrix ban @caramel.py:matrix.org |
10:42:17 | FromDiscord | <matrix-appservice-discord-t2bot> sent a long message, see http://ix.io/3AAt |
10:45:27 | * | Vladar quit (Remote host closed the connection) |
10:48:16 | * | Vladar joined #nim |
10:51:01 | FromDiscord | <jmgomez> Hey guys, can Nim inherit from a Cpp class? |
10:53:52 | FromDiscord | <haxscramper> I've done this several times, but current implementation is not really good. So it is better to go step back and consider what exactly do you want to do? |
10:54:42 | FromDiscord | <haxscramper> And there are some important points that need to be accounter for, depending on your use case |
10:56:30 | FromDiscord | <jmgomez> Im considering to integrate nim with an existing cpp framework |
10:57:36 | FromDiscord | <jmgomez> Also, if you have a Cpp class A, which you inherit in nim as B. Any chance another cpp library could inherit it as C? I guess that's too much asking, rhgt |
11:00:56 | FromDiscord | <haxscramper> This can be done |
11:01:09 | FromDiscord | <haxscramper> In reply to @jmgomez "Im considering to integrate": Which framework |
11:01:30 | FromDiscord | <Recruit_main707> what i do is creating a cpp class N that inherits from cpp class A, then wrap that cpp class N and provide functions that can be called by its cpp methods |
11:01:31 | FromDiscord | <haxscramper> In the simplest form you can `importcpp` Cxx object as `{.inheritable, pure.}` |
11:01:38 | FromDiscord | <haxscramper> and then inherit nim things from it |
11:01:54 | FromDiscord | <haxscramper> `{.inheritable, pure, byref, header: "<header>".}` |
11:02:23 | FromDiscord | <haxscramper> Note that I wrote byref explicitly, this way `importcpp` from parent object methods would work as well |
11:02:52 | FromDiscord | <haxscramper> https://github.com/haxscramper/hcparse/issues/1#issuecomment-865188794 |
11:03:34 | FromDiscord | <haxscramper> I haven't fully figure out implications of using `byref` instead of `bycopy`, but so far it seems to cause no untraceable interop bugs |
11:04:30 | FromDiscord | <jmgomez> In reply to @haxscramper "Which framework": UE. That's good news. I would like to integrate it first as a scripting lang (or even in a corner) to get used to it but I just want to make sure and understand what's possible before going crazy |
11:04:40 | FromDiscord | <haxscramper> there are also |
11:04:49 | FromDiscord | <haxscramper> well, if you need to only override methods |
11:04:55 | FromDiscord | <haxscramper> then there is a different approach as well |
11:05:19 | FromDiscord | <jmgomez> (edit) "and" => "I" |
11:05:21 | FromDiscord | <Recruit_main707> overriding is the hard part, specially without messing with vtables |
11:05:37 | FromDiscord | <haxscramper> https://github.com/haxscramper/hcparse/issues/2 https://github.com/haxscramper/hcparse/blob/master/src/hcparse/boost_wave/boost_wave.hpp#L53 |
11:05:54 | FromDiscord | <haxscramper> In reply to @Recruit_main707 "overriding is the hard": you can get smart and not touch vtables |
11:06:11 | FromDiscord | <haxscramper> basically the idea is - derive once again, and make all methods call nim closures |
11:06:22 | FromDiscord | <haxscramper> and then overriding method is as simple as |
11:06:30 | FromDiscord | <haxscramper> `myObj = someClosure` |
11:06:50 | FromDiscord | <Recruit_main707> ive managed to do it, but messed up with emit quite a bit and im forced to use `include`instead of `import` so that the c++ code is in the correct place |
11:07:07 | FromDiscord | <haxscramper> https://github.com/haxscramper/hcparse/blob/master/src/hcparse/boost_wave/boost_wave.cpp#L244-L264 |
11:07:20 | FromDiscord | <haxscramper> C++ side for closure override |
11:07:40 | FromDiscord | <jmgomez> I see, the use case it would be more like only override back in cpp (C) the methods that already existed in A. Not sure the implications with the vtables there |
11:08:12 | FromDiscord | <jmgomez> What Im trying to say is that I wouldnt be creating virtual methods in Nim. Just in Cpp |
11:08:31 | * | pch_ joined #nim |
11:08:37 | FromDiscord | <haxscramper> mostly yes, though you can touch vtable if you want https://github.com/nim-lang/Nim/wiki/Playing-with-CPP--VTABLE-from-Nim |
11:08:49 | FromDiscord | <haxscramper> this can even be automated with macros |
11:09:01 | FromDiscord | <haxscramper> so final result would be just as good-looking as regular |
11:09:05 | FromDiscord | <haxscramper> in theory |
11:09:08 | FromDiscord | <Recruit_main707> now we only need the macro :p |
11:09:27 | FromDiscord | <haxscramper> "you can probably write a macro for that" |
11:09:40 | FromDiscord | <haxscramper> famous last words |
11:10:15 | FromDiscord | <Rika> @ beef |
11:10:31 | FromDiscord | <jmgomez> Okay, this has been really helpful. Will get more familiar with Nim before moving forwards but definitely I appreciate your help! |
11:10:46 | * | kinkinkijkin quit (Ping timeout: 252 seconds) |
11:28:53 | * | sagax quit (Ping timeout: 264 seconds) |
11:40:38 | * | jjido joined #nim |
11:42:41 | * | max22- quit (Ping timeout: 264 seconds) |
11:55:12 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
12:06:02 | * | supakeen quit (Quit: WeeChat 3.3) |
12:06:55 | * | supakeen joined #nim |
12:30:37 | * | max22- joined #nim |
12:45:54 | FromDiscord | <tandy> is there a way to make nim tell me when im importing something from nativesockets? |
12:46:11 | FromDiscord | <tandy> im trying to compile for the js backend and i cant see where im going wrong |
12:47:39 | FromDiscord | <haxscramper> nim devel has `--processing:filenames` that lists all imports |
12:48:12 | FromDiscord | <haxscramper> https://github.com/nim-lang/RFCs/issues/411#issuecomment-904959558 |
12:48:53 | FromDiscord | <tandy> oh thats useful |
12:49:04 | FromDiscord | <tandy> wait did uri somehow require nativesockets now? |
12:51:40 | FromDiscord | <tandy> hmm it always did i guess |
12:52:19 | FromDiscord | <tandy> is there an encodeURL proc for the js backend? |
12:54:43 | FromDiscord | <lel> can someone give me a hint on how to deal with a dynamic number of arguments for a string to be formatted? basically i'm wondering if it's possible to use `strformat` like `vprintf()` in C or `fmt.Printf(foo, bar...)` in go. maybe i'm missing something, but it doesn't seem possible from looking at the docs? |
12:55:54 | FromDiscord | <xflywind> In reply to @tandy "wait did uri somehow": https://nim-lang.github.io/Nim/uri.html#6 |
12:56:00 | FromDiscord | <xflywind> it is pure |
12:56:29 | FromDiscord | <haxscramper> https://nim-lang.org/docs/strutils.html#format%2Cstring%2Cvarargs%5Bstring%2C%5D strutils support runtime string formatting↵(@lel) |
12:57:02 | FromDiscord | <lel> @haxscramper ah thanks, that's what i was looking for |
13:04:27 | * | arkurious joined #nim |
13:05:52 | FromDiscord | <KingDarBoja> I saw a ping here, what happened? |
13:07:54 | FromDiscord | <cabboose> There’s no pingas yeeright m8 |
13:08:06 | FromDiscord | <Rika> damn, you a boomer? |
13:09:21 | NimEventer | New post on r/nim by thelolrus: 10am EST LIVE Nim Game programming - Ludum Dare 49, see https://reddit.com/r/nim/comments/pzut5r/10am_est_live_nim_game_programming_ludum_dare_49/ |
13:20:41 | FromDiscord | <cabboose> Can I skip docgen with a pragma for a proc? |
13:20:44 | FromDiscord | <Vishal> what is this server for? |
13:20:49 | FromDiscord | <Vishal> Game-Dev? |
13:21:20 | FromDiscord | <cabboose> It’s for the nim programming language |
13:21:30 | FromDiscord | <cabboose> There is a sub channel for game-dev |
13:27:16 | FromDiscord | <Vishal> nim is used for..? |
13:27:44 | FromDiscord | <dom96> programming 😄 |
13:30:13 | FromDiscord | <tandy> coool↵(<@709044657232936960_=4eim=45venter=5b=49=52=43=5d>) |
13:30:17 | FromDiscord | <haxscramper> no |
13:30:38 | FromDiscord | <Vishal> In reply to @dom96 "programming 😄": thx |
13:30:42 | FromDiscord | <haxscramper> nim doc is very smort |
13:31:07 | FromDiscord | <Vishal> In reply to @cabboose "It’s for the nim": he already told me that thoug↵I meant as in what is its purpose mostly?↵↵gaming |
13:31:11 | FromDiscord | <Vishal> (edit) "mostly?↵↵gaming" => "mostly?↵↵gaming?" |
13:31:18 | FromDiscord | <Yardanico> In reply to @Vishal "he already told me": "gaming" is when you play games |
13:31:22 | FromDiscord | <Vishal> (edit) "In reply to @cabboose "It’s for the nim": he already told me that thoug↵I meant as in what is its purpose mostly?↵↵gaming?" => "sent a long message, see http://ix.io/3AB3" |
13:31:31 | FromDiscord | <Yardanico> there's no "specific" purpose, you just use it to create anything you want |
13:31:43 | FromDiscord | <Vishal> (edit) "http://ix.io/3AB3" => "http://ix.io/3AB4" |
13:32:04 | FromDiscord | <Vishal> In reply to @Yardanico "there's no "specific" purpose,": correct↵but just like python is good for AI ML↵in that sense |
13:32:40 | FromDiscord | <Vishal> see you guys someday!↵↵bye @everyone |
13:33:07 | FromDiscord | <dom96> aww, I was gonna make a LOTR reference |
13:33:08 | FromDiscord | <Yardanico> bad attempt |
13:33:20 | FromDiscord | <Vishal> In reply to @dom96 "aww, I was gonna": hm? |
13:33:23 | FromDiscord | <Vishal> In reply to @Yardanico "bad attempt": hm? |
13:33:30 | FromDiscord | <Yardanico> In reply to @Vishal "hm?": you tried to use <at> everyone |
13:33:39 | FromDiscord | <Vishal> In reply to @Yardanico "you tried to use": i knw |
13:33:40 | FromDiscord | <dom96> One language to rule them all 🙂 |
13:33:55 | FromDiscord | <Vishal> In reply to @dom96 "One language to rule": that helps thx |
13:34:06 | FromDiscord | <Vishal> I got the jist |
13:34:20 | FromDiscord | <Vishal> In reply to @dom96 "aww, I was gonna": whats LOTR? |
13:34:29 | FromDiscord | <dom96> Lord of the Rings |
13:34:41 | FromDiscord | <lel> sent a long message, see http://ix.io/3AB6 |
13:35:11 | FromDiscord | <Yardanico> how do you want to format your string? can you show an example of what you expect? |
13:35:13 | FromDiscord | <haxscramper> `seq[T]` is a `varargs[T]` |
13:35:25 | FromDiscord | <Yardanico> maybe you just want `join` from strutils ? |
13:35:33 | FromDiscord | <haxscramper> `seq/openarray` is acceptable for `varargs` |
13:36:11 | FromDiscord | <lel> i want to call format string, with a dynamic string and a dynamic seq of uint16, they are not uniform, so they're not all formatted the same |
13:39:33 | FromDiscord | <Rika> your seq has to be `seq[string]` |
13:39:50 | FromDiscord | <Rika> otherwise it will not match `varargs[string]` |
13:40:10 | FromDiscord | <Rika> !eval import strutils; import sequtils; echo "$#".format(@[2,3,5,6].mapIt($it)) |
13:40:12 | NimBot | 2 |
13:40:24 | FromDiscord | <Rika> import strutils; echo \"\$#\".format(@[2,3,5,6]) |
13:40:37 | FromDiscord | <Rika> ah, didnt eval |
13:40:42 | FromDiscord | <Rika> !eval import strutils; echo "$#".format(@[2,3,5,6]) |
13:40:45 | NimBot | @[2, 3, 5, 6] |
13:40:55 | FromDiscord | <Yardanico> :D |
13:41:07 | FromDiscord | <Yardanico> rika defeated by nimbot |
13:41:15 | FromDiscord | <lel> ok, i see, yeah i can construct a string seq out of them manually, but usually... that's exactly what printf does for you... so i didn't consider that |
13:41:18 | FromDiscord | <Rika> ? i just forgot to write eval lol |
13:41:32 | FromDiscord | <Rika> it is |
13:41:35 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/893855231081844756/unknown.png |
13:41:54 | FromDiscord | <Rika> ? what's the issue? |
13:42:12 | FromDiscord | <Yardanico> you said that the seq has to be seq[string] but you successfully formatted a seq[int] |
13:42:16 | FromDiscord | <Yardanico> because there's https://nim-lang.org/docs/strutils.html#format%2Cstring%2Cvarargs%5Bstring%2C%5D |
13:42:21 | FromDiscord | <Rika> it does for the intent of what lel wants |
13:42:22 | FromDiscord | <Rika> context |
13:42:32 | FromDiscord | <Rika> if it's not seq[string] it will not match varargs[string] and will instead be stringified |
13:42:48 | FromDiscord | <Yardanico> ah yeah mean it like that |
13:42:49 | FromDiscord | <Rika> yard please xd |
13:42:55 | FromDiscord | <Rika> of course |
13:43:04 | FromDiscord | <Yardanico> In reply to @Rika "yard please xd": i can't read into your mind, y'know |
13:43:20 | FromDiscord | <Rika> you can read the past messages |
13:43:33 | FromDiscord | <Rika> "but when i do strutils.format(foostr, barseq) it takes barseq as one argument instead of taking it as the varargs" |
13:48:12 | FromDiscord | <lel> sent a code paste, see https://play.nim-lang.org/#ix=3ABb |
13:52:45 | FromDiscord | <lel> in go, i would just use the spread operator `.format(foostr, barseq...)`. what i could do to my understading is cast these to strings manually, construct a new seq which is `foobar = @[foostr, barseq...]` and then use that with `unpackVarargs(strutils.format, foobar)`. |
13:53:14 | FromDiscord | <Rika> i just showed that barseq has to be a seq[string] |
13:53:16 | FromDiscord | <Yardanico> then just do it as Rika said |
13:53:26 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3ABe |
13:53:36 | FromDiscord | <Rika> yes i know that it's not usually supposed to be like that |
13:57:07 | FromDiscord | <Rika> yard do you think `seq[not T]` should match `varargs[T, convfunc]`? |
14:09:27 | FromDiscord | <cabboose> That’s silly. I might export an implementation proc for use by helper modules within my library/package without wanting it to include it in the docgen 🤨 |
14:09:42 | FromDiscord | <cabboose> Having to write “INTERNAL USE GO AWAY” is silly |
14:12:28 | FromDiscord | <dom96> @cabboose you could probably hack it into the docgen fairly easily, maybe you could write a quick PR? 🙂 |
14:14:17 | FromDiscord | <haxscramper> yeah |
14:14:20 | FromDiscord | <haxscramper> prs are welcome |
14:14:26 | FromDiscord | <cabboose> ima\_2362477.jpeg https://media.discordapp.net/attachments/371759389889003532/893863498692575262/ima_2362477.jpeg |
14:14:26 | FromDiscord | <haxscramper> tooling sucks but prs are welcome |
14:14:43 | FromDiscord | <haxscramper> there is like so much stuff missing for nim docgen |
14:14:48 | FromDiscord | <cabboose> I don’t actually know how to do pragmas and implement their behaviour |
14:14:50 | FromDiscord | <cabboose> But eventually |
14:14:54 | FromDiscord | <haxscramper> `@internal`, `@arg`, `@return`, `@inject` |
14:15:08 | FromDiscord | <haxscramper> and this should not be a pragma btw |
14:15:11 | FromDiscord | <cabboose> I have to study for exam on Monday but I’m just doing some cleaning for loony |
14:15:11 | FromDiscord | <haxscramper> ah |
14:15:41 | FromDiscord | <dom96> why shouldn't it be a pragma? |
14:15:43 | FromDiscord | <haxscramper> because we should not be adding pragmas to the language in order to make up for external tools |
14:15:47 | FromDiscord | <haxscramper> not being good enough |
14:15:56 | FromDiscord | <haxscramper> and docgen should be an external tool |
14:16:19 | FromDiscord | <haxscramper> it can be trivially implemented outside of compiler |
14:17:08 | FromDiscord | <haxscramper> there is so much holes nim `nim doc` it is not even funny to suggest fixing IMO, it basically just scraps `.nim` file and puts it into `.html` |
14:17:16 | FromDiscord | <dom96> to be fair, you can define pragmas outside the compiler too |
14:17:19 | FromDiscord | <haxscramper> no structuring, barely formatting, no docgen-specific tools |
14:17:28 | FromDiscord | <haxscramper> those are macro pragmas↵(@dom96) |
14:17:31 | FromDiscord | <dom96> yes yes, everything sucks |
14:17:31 | FromDiscord | <haxscramper> or template pragmas |
14:17:41 | FromDiscord | <dom96> maybe time to actually fix stuff instead of complaining about it? |
14:17:50 | FromDiscord | <cabboose> Ooo boy |
14:17:57 | FromDiscord | <cabboose> I’m gonna go study lol |
14:18:03 | FromDiscord | <cabboose> Nope |
14:18:38 | FromDiscord | <haxscramper> As I said just now, there is literally as much missing functionality in nim doc as there is `nim doc` itself↵(@dom96) |
14:18:52 | FromDiscord | <haxscramper> so there is nothing really that can be "fixed" |
14:18:58 | FromDiscord | <haxscramper> it's the same situation with c2nim |
14:19:03 | FromDiscord | <haxscramper> everyone writes their own tool |
14:19:13 | FromDiscord | <haxscramper> because there is nothing to build on |
14:19:22 | FromDiscord | <dom96> `nim doc` has received many improvements over the years |
14:19:31 | FromDiscord | <haxscramper> just nobody really cares about docgen being good enough, so not everyone is writing docgen |
14:19:37 | FromDiscord | <dom96> so clearly it's not something that is completely unimproveable |
14:19:57 | FromDiscord | <haxscramper> oh, no, except every single project having to implement their own documentation stitcher because nim doc can't even handle `--project` |
14:21:15 | FromDiscord | <Rika> In reply to @cabboose "That’s silly. I might": cabboose cant you just `when not defined(nimdoc):` or so? im not sure |
14:21:27 | FromDiscord | <dom96> There is an argument to be made that the core team should focus on filling these gaps, but I'm sure it would be resolved if Status (or another org that needs it and is willing to pay) needed it |
14:21:50 | FromDiscord | <cabboose> Ooo yeah that would be what I need ay↵(@Rika) |
14:21:58 | FromDiscord | <dom96> In reply to @Rika "cabboose cant you just": oh yeah, that will work |
14:22:03 | FromDiscord | <haxscramper> this would work only if proc is never used in the same module↵(@Rika) |
14:22:21 | FromDiscord | <cabboose> Oh yeah good point |
14:22:23 | FromDiscord | <Rika> wdym |
14:22:24 | FromDiscord | <haxscramper> so only if it is declared, but used somewere else |
14:22:24 | FromDiscord | <dom96> just wrap all usages with the same 😄 |
14:22:25 | FromDiscord | <cabboose> Fak |
14:22:32 | FromDiscord | <Rika> oh true i get it |
14:22:37 | FromDiscord | <haxscramper> or if `nim doc --project` is not running |
14:22:40 | FromDiscord | <cabboose> I want other ones to be exposed though |
14:22:41 | FromDiscord | <haxscramper> in this case it is 100% useless |
14:22:57 | FromDiscord | <Rika> `when not defined(nimdoc):` proc exported↵outside, proc not exported and is blank |
14:22:58 | FromDiscord | <Rika> ? |
14:23:01 | FromDiscord | <Rika> kinda stupid hack |
14:23:10 | FromDiscord | <Rika> blank as in ` = discard` |
14:23:31 | FromDiscord | <haxscramper> this is `@internal{}` tag functionality |
14:23:44 | FromDiscord | <cabboose> That’s pain but would probably work for now cheers rika |
14:24:23 | FromDiscord | <Rika> hows the @ tags supposed to work hax? |
14:25:19 | FromDiscord | <dom96> hacks is what makes the programming world move forward, you can't avoid them forever |
14:25:52 | FromDiscord | <Rika> hacks are temporary yet permanent |
14:25:56 | FromDiscord | <dom96> so use it and make a note referencing an issue to add proper support for it in the docgen 🙂 |
14:27:28 | FromDiscord | <haxscramper> just like doxygen javadoc, typescript doc etc↵(@Rika) |
14:27:40 | FromDiscord | <haxscramper> you putproc ar() +## @INTERNAL |
14:27:49 | FromDiscord | <Rika> i am not a fan |
14:27:57 | FromDiscord | <haxscramper> and documentation generator understands it |
14:28:20 | FromDiscord | <haxscramper> sent a long message, see http://ix.io/3ABn |
14:28:38 | FromDiscord | <Rika> raise (ref Defect)(nil) |
14:28:40 | FromDiscord | <haxscramper> Functions, templates, procedures, macros, multiple embedded DSL, compile-time validation, compilation to different backends |
14:28:50 | FromDiscord | <Rika> okay |
14:28:55 | FromDiscord | <Rika> it makes more sense now i guess |
14:28:59 | FromDiscord | <haxscramper> objects, ref objects, bitset flags used for configuration of different things |
14:29:08 | FromDiscord | <Rika> im still iffy about comment annotations |
14:29:17 | FromDiscord | <haxscramper> I can't even say that I `@inject{}` some variable in a meaningful way |
14:29:32 | FromDiscord | <haxscramper> Or what `tuple[code: int, err: string]` means |
14:29:54 | FromDiscord | <haxscramper> There is zero semantic information in documentation anyway |
14:30:59 | FromDiscord | <haxscramper> And so on |
14:31:03 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3ABo |
14:31:22 | FromDiscord | <haxscramper> Or you know |
14:31:27 | FromDiscord | <haxscramper> going back to basic stuff |
14:31:44 | FromDiscord | <haxscramper> being able to generate documentation for `--project` and not ending up with huge pile of garbage |
14:31:48 | FromDiscord | <dom96> yeah, documentation for tracked exceptions would be awesome |
14:31:58 | FromDiscord | <haxscramper> https://haxscramper.github.io/hmisc/theindex.html |
14:32:03 | FromDiscord | <haxscramper> like look at this POS |
14:32:14 | FromDiscord | <dom96> and forcing each defined exception to be documented would be a nice feature |
14:32:32 | FromDiscord | <haxscramper> I want to know if anyone here can just open this and say like "yeah, that's how `nim doc2 --project` should function" |
14:32:42 | FromDiscord | <haxscramper> exactluy↵(@dom96) |
14:32:47 | FromDiscord | <haxscramper> there are tons of stuff to experiment on |
14:32:58 | FromDiscord | <haxscramper> and if I just go with PRs I would either have to spend developer's time |
14:33:04 | FromDiscord | <haxscramper> on trying to come up with good solution |
14:33:07 | FromDiscord | <haxscramper> fromt he first time |
14:33:12 | FromDiscord | <haxscramper> which is impossible |
14:33:31 | FromDiscord | <haxscramper> or I can develop my external tool that works with all of this |
14:33:40 | FromDiscord | <haxscramper> scrap it twenty times and then come up with good solutio |
14:34:07 | FromDiscord | <haxscramper> so `nim doc` just like c2nim is a lowest common denominator |
14:34:18 | FromDiscord | <haxscramper> it works not too bad to immediately fix it |
14:34:23 | FromDiscord | <haxscramper> But it is not smart in any way |
14:34:47 | FromDiscord | <haxscramper> ah |
14:34:50 | FromDiscord | <cabboose> They’re good. I mean a person either cares enough about their documentation to want a standardised way for it to be nice or doesn’t and just writes comments everywhere↵(@Rika) |
14:35:05 | FromDiscord | <cabboose> But you don’t have to go full gung ho if you don’t want to |
14:35:08 | FromDiscord | <haxscramper> also it does not understand the code, it just rearranges comments somehhat |
14:35:20 | FromDiscord | <haxscramper> for example these enum documentation comments |
14:35:21 | FromDiscord | <Rika> well im still unsure why certain things shouldnt be pragmas |
14:35:49 | FromDiscord | <haxscramper> well, there is a `import {.docgen.}` proposal already |
14:35:57 | FromDiscord | <haxscramper> I mean, mixing module system with documentation generation |
14:36:00 | FromDiscord | <haxscramper> what could be better |
14:36:04 | FromDiscord | <Rika> In reply to @Rika "well im still unsure": most things of course should be commentsl ike idk author or w/e |
14:36:23 | FromDiscord | <Rika> but i dont know why you wouldnt want the `internal` thing above to be a pragma |
14:36:37 | FromDiscord | <haxscramper> https://haxscramper.github.io/hcparse-doc/src/hcparse/libclang.html#CXCursorKind jsut look at it |
14:36:43 | FromDiscord | <haxscramper> and tell me enums should not be put in tables |
14:37:01 | FromDiscord | <haxscramper> but this would take god-who-knows how much time to prove to everyone |
14:37:27 | FromDiscord | <haxscramper> but I can't just ask nim doc to give me simple json, because it outputs this html-mixed-with-json thing |
14:38:21 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3ABp |
14:38:27 | FromDiscord | <haxscramper> Doesn't create `htmldocs` dir when asking for json |
14:38:31 | FromDiscord | <cabboose> I’m not that much of a developer; but I’m probably more on the lines of not wanting doc stuff to be part of source code you know? The more pragmas I have to use the more messy things get↵(@Rika) |
14:39:03 | FromDiscord | <Rika> idk man im more of the reverse |
14:40:10 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3ABs |
14:40:13 | FromDiscord | <haxscramper> That's how nim doc gives me json |
14:40:16 | FromDiscord | <haxscramper> yay, way to goi |
14:40:20 | FromDiscord | <haxscramper> so much code understanding |
14:40:32 | FromDiscord | <haxscramper> `"code": <verbatim original code>` |
14:41:12 | FromDiscord | <haxscramper> In reply to @dom96 "yes yes, everything sucks": so going back to this comment |
14:41:20 | FromDiscord | <haxscramper> yes everything about nim doc does sucjk |
14:41:22 | FromDiscord | <haxscramper> (edit) "sucjk" => "suck" |
14:41:53 | FromDiscord | <haxscramper> and "prs are welcome" is not how this should be handled before there is some basic understanding of what features there must be |
14:42:21 | FromDiscord | <haxscramper> If we just start throwing random prs all around this would solve nothing and spend a lot more time |
14:42:39 | FromDiscord | <haxscramper> especially spend core developer's time |
14:42:39 | FromDiscord | <dom96> "PRs are welcome" is a short-cut to: please help us out |
14:42:49 | FromDiscord | <haxscramper> there is no thing to help about |
14:43:03 | FromDiscord | <haxscramper> this thing have to be reinvented from scratch at this point |
14:43:29 | FromDiscord | <dom96> well I disagree, but feel free to write a doc gen from scratch |
14:43:38 | FromDiscord | <haxscramper> already doin it |
14:43:55 | FromDiscord | <dom96> it's one piece of tooling that won't fracture the community |
14:44:06 | FromDiscord | <haxscramper> yeah, not fracturing commuity |
14:44:10 | FromDiscord | <dom96> so yeah, by all means |
14:44:57 | FromDiscord | <cabboose> We all love nim. All will be k |
14:45:41 | FromDiscord | <Rika> why not all will be nim |
14:45:52 | FromDiscord | <dom96> All will be Nimians |
14:45:56 | FromDiscord | <dom96> or Nimmers |
14:46:00 | FromDiscord | <dom96> we should do a poll about this |
14:46:15 | FromDiscord | <Rika> nimian sounsd like youre calling us monkeys |
14:46:16 | FromDiscord | <Rika> lmfao |
14:46:26 | FromDiscord | <cabboose> Pls no more polls 🥴 |
14:46:29 | FromDiscord | <dom96> Homo Nimians |
14:46:37 | FromDiscord | <cabboose> Too many dreams dashed |
14:46:55 | FromDiscord | <dom96> what polls dashed your dreams? 😮 |
14:47:12 | FromDiscord | <cabboose> That one that ended with year of tooling |
14:47:26 | FromDiscord | <cabboose> That was 🪦 |
14:47:42 | FromDiscord | <dom96> huh, the Nim community survey? |
14:49:05 | FromDiscord | <haxscramper> sent a long message, see http://ix.io/3ABu |
14:49:13 | FromDiscord | <haxscramper> well, nimble certainly got some effort put in |
14:50:01 | FromDiscord | <dom96> true, I guess you could say the IC efforts are to improve nimsuggest |
14:50:06 | FromDiscord | <tandy> is status paying for tooling? |
14:50:38 | FromDiscord | <haxscramper> status paid for https://github.com/nim-lang/nimble/pull/913 |
14:50:45 | FromDiscord | <dom96> Status is paying for lockfiles (and the other features they added) |
14:50:58 | FromDiscord | <haxscramper> and they mentioned on seveal occasions that they were looking for someone to work on tooling |
14:50:59 | FromDiscord | <tandy> oh cool |
14:51:11 | FromDiscord | <haxscramper> but I haven't seen any progress on that part |
14:51:11 | FromDiscord | <dom96> But they also contribute a lot to Nim core |
14:51:18 | FromDiscord | <dom96> (monetarily) |
14:51:26 | FromDiscord | <tandy> surprised you havent taken that up ahhah |
14:51:41 | FromDiscord | <tandy> haxdoc in std lib when |
14:51:49 | FromDiscord | <haxscramper> never |
14:51:50 | FromDiscord | <haxscramper> ever |
14:52:09 | FromDiscord | <haxscramper> this is not going to be added to the stdlib because stuff like this has no business being in stdlib |
15:03:45 | FromDiscord | <gnu+linux user> seems nims implementation of setCursorXPos is not working correctly on dragonflybsd 's tty |
15:04:08 | FromDiscord | <gnu+linux user> it anyways starts writing to stdout at 0 |
15:05:25 | FromDiscord | <gnu+linux user> its fine for freebsd's and linux's tty |
15:06:45 | * | jjido joined #nim |
15:12:50 | * | Guest97 joined #nim |
15:21:47 | * | Guest97 quit (Quit: Client closed) |
15:23:21 | FromDiscord | <exelotl> is there a nim sets equivalent to `foo ^= (1 << myFlag)` |
15:23:50 | FromDiscord | <exelotl> i.e. toggle myFlag bit on or off |
15:26:04 | FromDiscord | <exelotl> sent a code paste, see https://play.nim-lang.org/#ix=3ABJ |
15:26:54 | FromDiscord | <haxscramper> You can overload `^=` for `var set[enum]` |
15:27:10 | FromDiscord | <haxscramper> I don't think there is any built-in for this functionality though |
15:27:40 | FromDiscord | <haxscramper> or `.flip` |
15:32:26 | FromDiscord | <Rika> toggle might be a nicer name |
15:34:07 | FromDiscord | <haxscramper> it has different number of characters from excl |
15:34:12 | FromDiscord | <haxscramper> very important yeah |
15:35:04 | FromDiscord | <cabboose> Like you want the complement of a set?↵(@exelotl) |
15:35:32 | FromDiscord | <cabboose> If you have devel check out setutils |
15:35:39 | FromDiscord | <cabboose> Or have a look at the lib on the repo |
15:35:45 | FromDiscord | <cabboose> Std/setutils |
15:37:47 | FromDiscord | <Rika> no |
15:38:07 | FromDiscord | <Rika> he only wants to flip one flag |
15:38:10 | FromDiscord | <Rika> not eveyrthing |
15:40:21 | FromDiscord | <cabboose> But if it’s a set wouldnt you just excl that flag |
15:40:32 | FromDiscord | <Rika> flip |
15:40:34 | FromDiscord | <Rika> as in |
15:40:35 | FromDiscord | <Rika> toggle |
15:40:42 | FromDiscord | <cabboose> Ok |
15:40:44 | FromDiscord | <Rika> if its excluded you include it, if its included you exclude it |
15:40:50 | FromDiscord | <cabboose> Convert it to a uint |
15:40:55 | FromDiscord | <cabboose> XOR that flag |
15:41:14 | FromDiscord | <Rika> i assume he doesnt want to go that route |
15:41:25 | FromDiscord | <cabboose> fair |
15:42:27 | FromDiscord | <Goel> We need more Nim surveys |
15:48:52 | * | costledger_ joined #nim |
15:51:21 | * | costledger_ left #nim (#nim) |
15:54:22 | FromDiscord | <exelotl> In reply to @Rika "i assume he doesnt": it does make it a 1-liner, but doesn't work in the VM :( |
15:54:33 | FromDiscord | <exelotl> `let flags = cast[CellFlags](cast[uint](k.flags) xor (1 shl cfHFlip.uint))` |
15:54:48 | FromDiscord | <exelotl> and it's pretty ugly lol |
15:55:30 | FromDiscord | <Rika> just make the proc lmao imo its better |
15:55:36 | FromDiscord | <Rika> like what hax said |
15:56:48 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
15:56:55 | FromDiscord | <exelotl> I wonder if the C compiler knows how to optimise the 4 liner |
15:57:06 | FromDiscord | <exelotl> since that's what I'll have to put in the proc |
15:59:08 | FromDiscord | <haxscramper> if you care about that you might as well put it into `template` instead of a proc to save on call time↵(@exelotl) |
16:00:00 | FromDiscord | <exelotl> yeah, or make it inline |
16:05:18 | FromDiscord | <mtckmeek9891> so why isnt Nim getting the attention it deservea |
16:05:43 | FromDiscord | <cabboose> What you mean |
16:06:00 | FromDiscord | <mtckmeek9891> like why arwnt more people using it |
16:06:19 | FromDiscord | <dom96> are you using it? |
16:06:43 | FromDiscord | <mtckmeek9891> ive done some reading and Nim truly seems awesome. no im not cuz i just found out about it 2 days ago..,3., |
16:08:00 | FromDiscord | <mtckmeek9891> im just sayin it seems like a very handy language and i guess im just a little surprised ive never heard of it b4 |
16:08:02 | FromDiscord | <cabboose> It’s a language still with a lot of competition |
16:08:07 | FromDiscord | <dom96> Reason Nr.1: marketing. Nim needs more and better marketing 🙂 |
16:08:11 | FromDiscord | <cabboose> And is niche |
16:08:32 | FromDiscord | <Yardanico> wouldn't say that nim is exactly "niche" at this point honestly |
16:08:55 | FromDiscord | <mtckmeek9891> it seems very diverse |
16:09:12 | FromDiscord | <mtckmeek9891> its like Lua but on pcp |
16:09:16 | FromDiscord | <mtckmeek9891> or something |
16:10:30 | FromDiscord | <cabboose> Ye it’s pretty damn good |
16:10:33 | FromDiscord | <cabboose> Get on it |
16:27:18 | FromDiscord | <Yardanico> trying to make cosmonim work again... https://media.discordapp.net/attachments/371759389889003532/893896933247176734/unknown.png |
16:27:37 | FromDiscord | <Yardanico> for some reason it doesn't really like externs or something, maybe need to try writing C code that does the same extern stuff as nim |
16:36:25 | * | Gustavo6046 quit (Ping timeout: 252 seconds) |
16:37:21 | * | Gustavo6046 joined #nim |
16:50:11 | FromDiscord | <dom96> you guys ever seen this error when running build_all.sh? https://media.discordapp.net/attachments/371759389889003532/893902693326782534/unknown.png |
16:56:46 | FromDiscord | <dom96> either I'm missing something or this has been broken for 3 months... https://github.com/nim-lang/Nim/blame/devel/tools/deps.nim#L32 |
17:22:41 | FromDiscord | <Yardanico> i think i'm going insane with this cosmopolitan stuff, it's like there's something wrong with the stack itself (or the registers) |
17:23:08 | FromDiscord | <Yardanico> if the addInt line is uncommented, it runs and prints that message, but if it's not uncommented, that upper printf isn't even executed https://media.discordapp.net/attachments/371759389889003532/893910985813930144/unknown.png |
17:23:33 | FromDiscord | <Yardanico> (edit) "uncommented," => "commented," | "uncommented," => "commented," |
17:31:18 | FromDiscord | <dom96> grrr, old versions of Nim source code have a `build_all.sh` and it just plain doesn't work :/ |
18:03:27 | * | max22- quit (Ping timeout: 240 seconds) |
18:04:14 | * | jjido joined #nim |
18:21:53 | FromDiscord | <matkuki> Hi all.↵I have code that has an object with a lot of fields that are assigned to from parsed data: https://play.nim-lang.org/#ix=3ACf↵In the example I give only 3 fields, but in real code it's more like 40. ↵Question: Is there a way to replace the `if` statements with something like a macro that goes over all items in the FIELDS table and generates `if` statements instead? |
18:23:12 | FromDiscord | <Yardanico> @matkuki will all your strings be in form "letters<semicolon>"? |
18:23:22 | FromDiscord | <Yardanico> if so, you don't need to have a lot of these if statements because that'll be quite inefficient and cumbersome |
18:23:36 | FromDiscord | <Yardanico> if it's just letters + semicolon then you can just parse the string until the semicolon |
18:23:54 | FromDiscord | <Yardanico> is the format you'trying to parse public? |
18:25:29 | FromDiscord | <Yardanico> but anyway, even if you were to stick to your style of code, yes, you can write a macro like that |
18:25:38 | FromDiscord | <Yardanico> oh, seems like you always split by : |
18:25:52 | FromDiscord | <matkuki> `will all your strings be in form "letters<semicolon>"`↵Yes↵`is the format you'trying to parse public?`↵Yes, it's the yeelight protocol response. But in general I wish to know if there is a mechanism to remove the `if`s? |
18:26:17 | FromDiscord | <Yardanico> yes |
18:26:22 | FromDiscord | <Yardanico> you can split by : to get the string and then use `case` |
18:26:40 | FromDiscord | <Yardanico> and of course if you don't want to do that manually you can write a small macro |
18:27:01 | FromDiscord | <Yardanico> lemme make an example |
18:27:10 | FromDiscord | <matkuki> Thank you 👍 |
18:30:59 | NimEventer | New post on r/nim by viitorfermier: What would be the steps required of `wrapping` a Python package in a crosplatform Nim executable?, see https://reddit.com/r/nim/comments/q00mza/what_would_be_the_steps_required_of_wrapping_a/ |
18:39:02 | * | max22- joined #nim |
18:41:29 | FromDiscord | <Yardanico> @matkuki https://play.nim-lang.org/#ix=3ACo |
18:41:49 | FromDiscord | <Yardanico> the macro can be probably made a bit nicer, and also you can actually make it so that that constant table isn't needed at all |
18:41:53 | FromDiscord | <Yardanico> with custom pragmas right in the object |
18:42:10 | FromDiscord | <Yardanico> you can uncomment the last "echo repr result" to see how the macro-generated code looks like |
18:43:16 | FromDiscord | <matkuki> @Yardanico That's fantastic! Thank you! Need to study this. |
18:53:47 | * | max22- quit (Ping timeout: 240 seconds) |
18:54:10 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3ACt |
19:27:21 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
19:30:17 | FromDiscord | <matkuki> @Yardanico 👍 |
19:32:50 | FromDiscord | <dom96> TIL tar and curl now ship with Windows |
19:36:39 | nrds | <Prestige99> wow, it's evolving 🙂 |
19:54:49 | FromDiscord | <Gumber> honestly I think Microsoft is pretty uniquely positioned in the OS game |
19:55:09 | FromDiscord | <Gumber> like they've started to embrace FOSS to some degree |
19:55:17 | FromDiscord | <Gumber> they realize the value of the linux kernel and operating system |
19:55:24 | FromDiscord | <Gumber> they've started to EEE that basically |
19:55:36 | FromDiscord | <Gumber> I don't think they can ever get to the final E but |
19:55:52 | FromDiscord | <Gumber> the other two E's do nothing but bolster Microsoft's reputation in the open source / free software community |
19:56:01 | FromDiscord | <Gumber> and also it's great virtualization research |
19:56:15 | FromDiscord | <Gumber> like I think embracing Linux is one of the smartest thing MS has ever done |
19:57:24 | FromDiscord | <Gumber> Wine had to be made for Linux |
19:57:44 | FromDiscord | <Gumber> Windows subsystem for Linux did NOT have to be made, but it was extremely smart to make it |
19:58:00 | FromDiscord | <Gumber> (edit) "Windows subsystem for Linux did NOT have to be made, but it was ... extremelymove" added "an" | "anextremely smart ... to" added "move" |
19:59:40 | FromDiscord | <Gumber> I think Windows 11 is finally going to have a decent store |
19:59:54 | FromDiscord | <Gumber> so something comparable to apple's |
20:00:07 | FromDiscord | <Gumber> snipping built in |
20:00:32 | FromDiscord | <Gumber> 64-bit ARM emulation |
20:01:16 | FromDiscord | <Gumber> if you're stuck on windows for gamedev reasons, it's nice when it gets better 🙂 |
20:02:22 | FromDiscord | <dom96> Anyone up for testing new choosenim? 🙂 |
20:08:06 | * | Vladar quit (Quit: Leaving) |
20:12:30 | FromDiscord | <Gumber> not if it risks messing up my current install |
20:13:43 | FromDiscord | <Gumber> if there's no risk, then sure I will do it 🙂 |
20:14:04 | FromDiscord | <Gumber> my current install would be 1.4.8 windows download |
20:14:07 | FromDiscord | <Gumber> from nim-lang.org |
20:14:14 | FromDiscord | <dom96> I mean, you can just backup your .choosenim folder if you're worried |
20:14:20 | FromDiscord | <Gumber> I don't use choosenim presently |
20:14:49 | FromDiscord | <Gumber> but I am willing to help you test whatever if it won't mess up my other install - sorry I probably should have provided that info about my current install up front |
20:15:13 | FromDiscord | <Gumber> I just am working on my game and I don't want to have to debug a broken environment is all 🙂 |
20:16:39 | FromDiscord | <dom96> where is your current install? |
20:20:56 | FromDiscord | <Gumber> my H drive |
20:21:13 | FromDiscord | <Gumber> `H:\Projects\nim-1.4.8` |
20:22:58 | FromDiscord | <Jakes1403> sent a code paste, see https://play.nim-lang.org/#ix=3ACT |
20:23:48 | FromDiscord | <Jakes1403> sent a code paste, see https://play.nim-lang.org/#ix=3ACU |
20:24:44 | FromDiscord | <Elegantbeef> last thing should be `index.addr` or `index[0].addr` if using a seq |
20:27:04 | FromDiscord | <Jakes1403> sent a code paste, see https://play.nim-lang.org/#ix=3ACV |
20:27:53 | FromDiscord | <Elegantbeef> well yet i's `let` |
20:28:03 | FromDiscord | <Elegantbeef> `let` requires `unsafeaddr` due to the immutabillity, though there is an RFC to remove that since it's just tedious |
20:28:19 | FromDiscord | <Elegantbeef> `addr` is already unsafe so `unsafeaddr` is just silly name + api |
20:29:20 | FromDiscord | <Gumber> anyone ever debug a Nim program using windbg? |
20:29:35 | * | jjido joined #nim |
20:29:35 | FromDiscord | <Gumber> or I guess - windbg preview? the GUI version of windbg? |
20:31:50 | FromDiscord | <Elegantbeef> Wish i could say yes i've only ever briefly used gdb |
20:32:01 | * | NeoCron joined #nim |
20:33:41 | FromDiscord | <Gumber> actually - it's okay... I didn't realize the output was in another command prompt window |
20:33:46 | FromDiscord | <Gumber> although I still have questions, but I'm not stuck 🙂 |
20:33:55 | FromDiscord | <Gumber> thank you for the support though beef! |
20:37:34 | FromDiscord | <dom96> Can you guys see this? https://github.com/dom96/choosenim/releases/tag/untagged-3f629b1656b4d8c3eac7 |
20:37:45 | FromDiscord | <dom96> no you can't |
20:38:28 | FromDiscord | <dom96> https://github.com/dom96/choosenim/releases/tag/v0.8.0 |
20:39:17 | FromDiscord | <Jakes1403> had this weird issue the other day where nimble disappeared and had to reinstall Nim |
20:39:29 | FromDiscord | <dom96> likely due to your antivirus |
20:40:45 | FromDiscord | <Jakes1403> probably so. Windows defender would complain about it a lot |
20:41:10 | FromDiscord | <dom96> 1.4.8 is just completely unusable because of it :/ |
20:45:45 | FromDiscord | <Jakes1403> sent a code paste, see https://play.nim-lang.org/#ix=3ACY |
20:54:32 | * | Gustavo6046 quit (Quit: ZNC 1.8.2 - https://znc.in) |
20:54:56 | * | Gustavo6046 joined #nim |
20:58:25 | FromDiscord | <Jakes1403> How do you pass an array to something expecting a ``pointer`` type? |
21:05:21 | Mister_Magister | hi, i'm trying to use intellij plugin for nim, but while building its using --usenimcache and my nim says no such option :< |
21:07:04 | Mister_Magister | keep calm and update nim, got it |
21:15:56 | NimEventer | New thread by Nya: Nim's types related questions, see https://forum.nim-lang.org/t/8473 |
21:23:46 | FromDiscord | <Recruit_main707> @Jakes1403 `addr arr` |
21:24:53 | Mister_Magister | tbh i'm using nim just because i hate python |
21:24:55 | Mister_Magister | is that okay? xd |
21:32:36 | nrds | <Prestige99> Sure |
21:32:40 | nrds | <Prestige99> I hate python too :P |
21:32:53 | nrds | <sorcerer99> :O |
21:35:05 | Mister_Magister | https://nim-lang.org/docs/uri.html#Uri |
21:35:19 | Mister_Magister | Uri has parameter query which is of string |
21:35:35 | Mister_Magister | and it returns arg1=something&arg2=something |
21:35:50 | Mister_Magister | is there some function to get table of args and values or do i have to parse it manually? |
21:37:24 | Mister_Magister | https://github.com/treeform/urlly look what i found! |
21:37:26 | nrds | <R2D299> itHub: 7"Uri and Url parsing for Nim for C and JS backend. Similar api to Window.location." |
21:46:23 | * | greyrat quit (Quit: Bye) |
21:46:46 | * | greyrat joined #nim |
22:29:01 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
22:29:08 | * | max22- joined #nim |
23:16:25 | Mister_Magister | in asynchttpserver i'm getting request, which contains field hostname, but unfortunately this field contains ip address and not hostname. Can i resolve hostname somehow? |
23:22:24 | * | max22- quit (Remote host closed the connection) |
23:25:17 | FromDiscord | <Jakes1403> In reply to @dom96 "likely due to your": yup, defender "protected" just now |
23:25:24 | FromDiscord | <Jakes1403> (edit) "In reply to @dom96 "likely due to your": yup, defender "protected" ... just" added "me" |
23:33:30 | Mister_Magister | i workarounded it |
23:39:21 | * | stutonk joined #nim |
23:42:36 | stutonk | Anyone happen to know the right way to use a wrapped C function that uses a **type to return an array? Everything I try crashes with a nil reference. Specifically, I'm trying to use XQueryTree from nim-lang/x11 |
23:55:23 | FromDiscord | <treeform> In reply to @Mister_Magister "https://github.com/treeform/urlly look what i": Let me know if you have issues using it. |
23:55:25 | nrds | <R2D299> itHub: 7"Uri and Url parsing for Nim for C and JS backend. Similar api to Window.location." |
23:57:44 | FromDiscord | <treeform> In reply to @Mister_Magister "hello i want to": If you need timezones I have a library for that too. |
23:58:53 | * | stutonk quit (Quit: Client closed) |