<< 02-10-2021 >>

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