<< 13-10-2021 >>

01:26:21*neurocyte0132889 quit (Ping timeout: 245 seconds)
01:57:17Mister_Magisterc…can you
01:57:21Mister_Magisterprogram for android using nim?
01:57:27FromDiscord<Rika> yes
01:57:46Mister_Magisteri'm struggling with getting qtcreator to work so i might just go that route
01:58:09FromDiscord<Rika> ah you still need to go through kotlin afaikl
01:58:10FromDiscord<Rika> (edit) "afaikl" => "afaik"
01:58:13Mister_Magister@Rika any link, guide?
01:58:26FromDiscord<Rika> not off the top of my head, i dont program for android
02:03:24*arkurious quit (Quit: Leaving)
02:04:07FromDiscord<impbox [ftsf]> you can create android ndk stuff using nim
02:04:25FromDiscord<impbox [ftsf]> but you still need something that sets up the JRE side
02:04:37FromDiscord<impbox [ftsf]> (edit) "JRE" => "JRE/dalvik/art/whatever"
02:10:47FromDiscord<reilly> I am still exactly no closer to figuring out why I can't get this to compile. It's not obvious to me whether it's the case that `imgui.h` is failing to be imported, or it just can't find definitions for those types for whatever other reason (even though they're in `imgui.h`!!!)
02:11:46FromDiscord<impbox [ftsf]> check the nimcache
02:11:53FromDiscord<impbox [ftsf]> see what the C code it's outputting is doing
02:20:30FromDiscord<impbox [ftsf]> reilly, you're using imgui which is a c++ library right? and you're compiling with `nim c` rather than `nim cpp`
02:20:56FromDiscord<impbox [ftsf]> unless you're using cimgui
02:22:16FromDiscord<reilly> I can't use `nim cpp` because it won't compile on MacOS (supposedly due to trying to link Obj-C code)
02:22:49FromDiscord<impbox [ftsf]> well if you can't use nim cpp, you probably shouldn't use a cpp library, use cimgui instead
02:28:31FromDiscord<reilly> Well, you can compile C code as C code and C++ code as C++ code, then link them together after the fact. Is this not something I can do?
02:31:55FromDiscord<impbox [ftsf]> You can, but the header is a cpp header
02:32:15FromDiscord<impbox [ftsf]> Unless it only exposes a c api
02:33:20FromDiscord<reilly> Well, the ImGui extension I'm trying to use (ImGuiFileDialog) says it has a C api.
02:52:18FromDiscord<reilly> sent a long message, see http://ix.io/3BAo
02:55:22FromDiscord<impbox [ftsf]> Where are ImGuiWindowFlags defined?
02:55:34FromDiscord<reilly> The same error still happens if I edit `#include <imgui.h>` to `cimgui.h` in `ImGuiFileDialog.h/.cpp`.
02:55:35FromDiscord<impbox [ftsf]> And is nim complaining that it can't find them or C?
02:56:02FromDiscord<impbox [ftsf]> Does your generated wrapper define them?
02:57:56FromDiscord<reilly> `ImGuiWindowFlags` is defined in `imgui.h` and `cimgui.h`. It's the C compiler (gcc) that is complaining. My wrapper does not define them, but they are already defined in NimGL ImGui, so I just `import nimgl/imgui` at the beginning of my wrapper.
02:59:21FromDiscord<reilly> Although, now that you mention it, removing `import nimgl/imgui` from my wrapper makes it complain about undeclared identifiers for `ImGuiWindowFlags`, `ImVec2`, and `ImVec4`... the same three types that GCC is giving me grief over. That's probably not a coincidence.
03:01:34FromDiscord<Yardanico> Isn't ImguiFileDialog C++ ? It probably used ImGui by itself, right?
03:01:40FromDiscord<Yardanico> Then it won't work with cimgui
03:01:49FromDiscord<reilly> It says it has a C api, though.
03:02:07FromDiscord<reilly> The README says, and I quote: "C Api (succesfully tested with CimGui)"
03:02:13FromDiscord<Yardanico> Hmm
03:06:01FromDiscord<impbox [ftsf]> It may be that the library doesn't work as advertised
03:06:28FromDiscord<impbox [ftsf]> I've had success with nim and cimgui but i haven't tried any imgui extensions
03:08:50FromDiscord<reilly> Well, the hope was that ImGui extensions would give me some future-proofing for free, and that all I'd have to do is figure out how to use them once and then it would be easy going forward. That's no good if I can't figure out how to make it work the first time around...
03:10:26FromDiscord<reilly> This is especially annoying because I've spent, quite literally, all day making a build script to try to automate managing these non-nimble dependencies, but if I can't use them, then I've just wasted a whole day doing what I could just do with `nimble build`.
03:12:43FromDiscord<reilly> I can't even continue working on the problem anyway... I need to be well-rested for my PSAT tomorrow. I'm gonna lose sleep thinking about how annoying this is, though.
03:13:57FromDiscord<Yardanico> i can try checking if it works on linux with cimgui
03:14:46FromDiscord<Yardanico> ah well, obviously it won't work for you if you can't compile C++ code together with C code in your project since imguifiledialog written in C++
03:14:48FromDiscord<Yardanico> (edit) "ah well, obviously it won't work for you if you can't compile C++ code together with C code in your project since imguifiledialog ... written" added "is"
03:15:19FromDiscord<Yardanico> or maybe i'm wrong, but ".cpp" file extension strongly suggests it's C++ code :)
03:18:22FromDiscord<Yardanico> @reilly have you seen https://github.com/aiekick/cimgui ?
03:18:24nrds<R2D299> itHub: 7"c-api for imgui (https://github.com/ocornut/imgui) lookat: https://github.com/cimgui for other widgets"
03:19:38FromDiscord<Yardanico> So basically since you can't compile C++ and C in the same project you need to build cimgui with imguifiledialog embedded into it, and this work seems to be exactly that
03:19:59FromDiscord<Yardanico> but of course then you'll also have to add the imguifiledialog definitions in nimgl (or importc yourself)
04:06:02*supakeen quit (Quit: WeeChat 3.3)
04:06:31*supakeen joined #nim
04:21:04NimEventerNew thread by Guzba: Show Nim: Boxy, 2D GPU rendering with a tiling atlas and Pixie, see https://forum.nim-lang.org/t/8496
04:28:09*rockcavera quit (Remote host closed the connection)
05:00:40FromDiscord<geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3BAN
05:02:33FromDiscord<Elegantbeef> 1.6 cannot come soon enough uhhh looks possibly like the lock is the issue?
05:02:49FromDiscord<geekrelief> yeah lock is the difference
05:02:52FromDiscord<Elegantbeef> Make a typedef for the proc then do `YourProcType(yourProc)`
05:04:22FromDiscord<geekrelief> In reply to @Elegantbeef "Make a typedef for": Hmm not sure I follow, the lock pragma is on the Nim side. Are you saying I should make a typedef on the C side?
05:04:31FromDiscord<Elegantbeef> Nope on the Nim side
05:04:51FromDiscord<geekrelief> oh ok
05:07:17FromDiscord<geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3BAO
05:07:18FromDiscord<geekrelief> `Error: type mismatch: got 'StartFunc' for 'StartFunc(start)' but expected 'proc (args: ptr tm_simulation_start_args_t): ptr tm_simulation_state_o{.cdecl.}'`
05:07:55FromDiscord<geekrelief> maybe StartFunc in the wrapper too?
05:08:00FromDiscord<Elegantbeef> Yea
05:08:20FromDiscord<geekrelief> that's gonna suck.. since I'm trying to automate that
05:09:30FromDiscord<Elegantbeef> Well you can alwys do `(proc(args: ptr tm_simulation_start_args_t): ptr tm_simulation_state_o {.cdecl.})(yourProc)` or i guess annotate the proc with `locks: 0`
05:09:44FromDiscord<Elegantbeef> Atleast assuming it's the lock
05:11:27FromDiscord<geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3BAP
05:11:37FromDiscord<geekrelief> oh
05:11:41FromDiscord<geekrelief> maybe I need to cast πŸ˜„
05:11:53FromDiscord<Elegantbeef> No you do not `cast` here
05:12:18FromDiscord<geekrelief> huh, nope that gave me the same locks unknown error
05:12:53FromDiscord<Rika> ~~go to devel and try compiling there~~
05:14:53FromDiscord<Elegantbeef> Well devel wont change the behaviour but will give more concise proc mismatch messages
05:14:58FromDiscord<Elegantbeef> That's to a certain someone
05:15:08FromDiscord<Elegantbeef> thanks to \
05:15:22FromDiscord<geekrelief> thanks beef πŸ™‚
05:15:37FromDiscord<geekrelief> I am running devel.. I'll try pulling the latest
05:16:01FromDiscord<Elegantbeef> It probably wont help this case since it seems to be the lock mismatch alone
05:18:15FromDiscord<geekrelief> alright, I guess I'll take a look at this with fresh eyes in the morning
05:18:38FromDiscord<Elegantbeef> Well if you cannot resolve it get me a way to compile it and i'll look at it when i can
05:20:59FromDiscord<geekrelief> Oh the cast does seem to work!
05:21:15FromDiscord<Elegantbeef> A cast cast or a type conversion?
05:22:59FromDiscord<geekrelief> I did `cast[StartFunc](start)`
05:23:14FromDiscord<Elegantbeef> Odd that works but `StartFunc(start)` didnt
05:23:33FromDiscord<geekrelief> yeah
05:23:51FromDiscord<geekrelief> I'm going to try it with the other callbacks
05:24:40FromDiscord<Elegantbeef> I really want to see this source now cause this is just super weird
05:28:14FromDiscord<geekrelief> I don't have a small sample, but my type looks like this:
05:28:26FromDiscord<geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3BAR
05:28:55FromDiscord<geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3BAS
05:30:12FromDiscord<geekrelief> With that I'm able to get past the callback errors.
05:32:06FromDiscord<geekrelief> Do you know how to "complete" a struct? I'm importing a struct from C with `{.incompleteStruct.}`, but I need to define it in Nim and pass it to C. But I'm getting a redefinition error.
05:33:16FromDiscord<geekrelief> Maybe I should just call it something else and cast it to the C type..
05:33:22FromDiscord<Elegantbeef> `nodecl`?
05:33:40FromDiscord<Elegantbeef> https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-nodecl-pragma
05:39:41FromDiscord<geekrelief> In reply to @Elegantbeef "`nodecl`?": unfortunately that didn't work. I need to use `tm_simulation_state_o` as the return type for start, but I need to create a type for it. I think the way the C lib is using it is as an opaque pointer. So I can probably cast it safely.
05:40:59*Doraemon joined #nim
05:43:17*NeoCron quit (Ping timeout: 250 seconds)
05:54:01FromDiscord<geekrelief> Is there a way to forward declare a type in nim? In the C header there's `typedef struct tm_simulation_state_o tm_simulation_state_o` which is used by the callbacks. The user of the API is expected to define the type.
05:56:24FromDiscord<Elegantbeef> https://nim-lang.org/docs/manual_experimental.html#package-level-objects experimentally yes
05:58:52FromDiscord<geekrelief> ahh thanks! I though there was something like that. I'll have to try it tomorrow. FYI, I tried `nodecl` on the type in the wrapper, but I get a redefinition error.
05:59:01FromDiscord<geekrelief> (edit) "though" => "thought"
06:02:39FromDiscord<geekrelief> weird why does this give an indentation error? ` Pack.tm_simulation_state_o = object`
06:04:45FromDiscord<Elegantbeef> Uncertain `Pack` needs to be this package's name
06:05:58FromDiscord<geekrelief> What's a `package` in nim?
06:06:45FromDiscord<geekrelief> so it's the same nimble "package"?
06:06:59FromDiscord<Elegantbeef> Yea
06:07:44FromDiscord<geekrelief> hmm that means I can't complete the type from outside the package?
06:08:10FromDiscord<Elegantbeef> I'd imagine not considering these are `package level objects`
06:08:20FromDiscord<Elegantbeef> Not to be condescending i just havent used them
06:09:24FromDiscord<geekrelief> no worries, you've been helping, and I appreciate it
06:10:07FromDiscord<geekrelief> I guess I'll try again in the morning...
06:16:23*pch joined #nim
06:18:40FromDiscord<retkid> how can i import a module i wrote into nimpy
06:18:46FromDiscord<retkid> as you would in python
06:18:54FromDiscord<retkid> i tried just doing filename but it didn't work?
06:22:31FromDiscord<Yardanico> you need to compile your nim python module to a shared library and then you'll be able to use it as-is
06:22:36FromDiscord<Yardanico> also check https://github.com/Pebaz/nimporter which automates some stuff
06:22:38nrds<R2D299> itHub: 7"Compile Nim Extensions for Python On Import!"
06:39:44FromDiscord<KimJongUnstoppable> Is there a way to reference None or Null in nim? In C or Python I think I could just pass "None" to do what I want to do but I can't figure this out. I need to update a registry key that's set to the default key, but the winregistry package requires a key name. I can't find a way to reference it by index or anything either (eg pass 0 for the first key).
06:40:24FromDiscord<KimJongUnstoppable> In C (I think) it would be SetValueEx with key=None, but I can't figure out how to do that in nim
06:40:43FromDiscord<enthus1ast> maybe key = nil ß
06:40:58FromDiscord<KimJongUnstoppable> I didn't know nil was an option - I'll give that a try, thank you
06:41:09*Gustavo6046_ joined #nim
06:41:14FromDiscord<Elegantbeef> nil will only work if the type is nilable
06:41:34FromDiscord<KimJongUnstoppable> it compiled without an error, here's to hoping lol
06:41:35FromDiscord<Elegantbeef> Otherwise look at a default vaue `-1` or `""` or `std/options` for an optional
06:41:46FromDiscord<enthus1ast> when its winapi it should be 0 or NULL
06:42:10FromDiscord<Elegantbeef> Ah winregistry πŸ˜€
06:42:11*Gustavo6046 quit (Ping timeout: 245 seconds)
06:42:17FromDiscord<Elegantbeef> I didnt read that part πŸ˜€
06:42:27FromDiscord<KimJongUnstoppable> nil worked, it wrote to the (Default) key
06:42:54FromDiscord<KimJongUnstoppable> I don't want to admit how much time I've spent tonight trying to figure that out on my own. Thanks again
06:43:32*PMunch joined #nim
06:43:38FromDiscord<enthus1ast> yeah sometimes the moment comes to ask
06:43:51FromDiscord<geekrelief> @ElegantBeef I got my stuff to compile by doing a typedef for the proc types. I reordered some declarations and switched my compiler from tcc to vcc.
06:44:15FromDiscord<Elegantbeef> Still using cast? πŸ˜›
06:44:26FromDiscord<impbox [ftsf]> like a wizard
06:44:29FromDiscord<geekrelief> no more cast πŸ˜„ but I do get warnings
06:44:48FromDiscord<geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3BB6
06:45:14FromDiscord<Elegantbeef> The fuck does vcc know anyway?!
06:45:26FromDiscord<geekrelief> yeah I usually ignore them πŸ˜„
06:45:31*Gustavo6046_ is now known as Gustavo6046
07:04:37FromDiscord<Gumber> is there any way to create a dispatcher and call poll yourself without having to call `waitFor` or `runForever` if your program already has a loop in it? like a game loop?
07:05:20FromDiscord<Gumber> ah nevermind I think I found the answer
07:06:34FromDiscord<impbox [ftsf]> there is... `poll`?
07:06:48FromDiscord<Gumber> yeah but I was unaware of `newDispatcher`
07:07:37FromDiscord<impbox [ftsf]> I am also unaware of it, do you need it?
07:08:07FromDiscord<Gumber> well my program is already running in an endless loop
07:08:20FromDiscord<Gumber> so I don't know why I would want to use `runForever` or `waitFor`
07:08:21FromDiscord<impbox [ftsf]> yeah, any reason to not just call poll(0) ?
07:08:29FromDiscord<impbox [ftsf]> you wouldn't use runForever or waitFor
07:08:29FromDiscord<Gumber> you need to have some dispatcher registered somewhere apparently
07:08:57FromDiscord<Gumber> I tried just importing `asyncdispatch` and `asyncnet` as well as `nativesockets` the other day and I couldn't just call `poll` inside my game loop afaict
07:09:01*max22- joined #nim
07:09:07FromDiscord<impbox [ftsf]> i see
07:09:16FromDiscord<Gumber> going to make a quick test real quick
07:10:12FromDiscord<Gumber> https://play.nim-lang.org/#ix=3BBd
07:13:07FromDiscord<impbox [ftsf]> poll `" Waits for completion events and processes them. Raises ValueError if there are no pending operations. This runs the underlying OS epoll or kqueue primitive only once. Source Edit "`
07:13:18FromDiscord<impbox [ftsf]> (edit) "`" Waits" => "`Waits" | "once. Source Edit "`" => "once.`"
07:13:21FromDiscord<Gumber> yeah I think I know what the deal is
07:13:21FromDiscord<Gumber> one sec
07:13:36FromDiscord<Gumber> I don't even know why this threadvar crap is in this example
07:13:38FromDiscord<impbox [ftsf]> seems odd to raise and error in that case
07:13:44FromDiscord<Gumber> it looks wrong to me but whatever
07:15:06FromDiscord<impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=3BBe
07:31:33*NimBot joined #nim
07:31:55*GreaseMonkey quit (*.net *.split)
07:31:55*joast quit (*.net *.split)
07:31:55*flynn quit (*.net *.split)
07:31:55*jkl quit (*.net *.split)
07:31:55*ehmry quit (*.net *.split)
07:31:55*ecs quit (*.net *.split)
07:31:55*tinytoast quit (*.net *.split)
07:31:55*Ekho quit (*.net *.split)
07:31:56*flynn3 is now known as flynn
07:37:22*Ekho- is now known as Ekho
07:41:28*mst joined #nim
07:42:05*Theodore[m] quit (Ping timeout: 264 seconds)
07:50:57*Doraemon quit (Quit: Leaving)
07:57:13FromDiscord<Gumber> well this errors out on my machine, but it's as close as I can come to what I think should work: https://play.nim-lang.org/#ix=3BBm
07:58:06FromDiscord<Gumber> oh I see why...
07:58:06*Theodore[m] joined #nim
08:01:34PMunchYou know that poll will automatically create a global dispatcher for you if one doesn't exist, right?
08:04:40FromDiscord<Gumber> nope didn't
08:06:41FromDiscord<Gumber> I didn't
08:06:48FromDiscord<Gumber> but I still can't get it working: https://play.nim-lang.org/#ix=3BBt - is my latest shot
08:06:50FromDiscord<Gumber> need sleep though
08:06:53FromDiscord<Gumber> night!
08:09:36PMunchYou're overthinking this
08:10:06PMunchThis works just fine: http://ix.io/3BBv/nim
08:10:38FromDiscord<Gumber> wtf - I guess `hasPendingOperations` as @impbox [ftsf] suggested was the trick
08:10:48FromDiscord<Gumber> I thought it had to do with file descriptors not being registered
08:10:49PMunchWell, not really
08:11:13FromDiscord<Gumber> well I have no idea why I was getting that error before when I just called `poll` by itself
08:11:15PMunchYou could do while true: poll() as well, that is exactly what runForever does
08:11:26PMunchBut that would crash if you somehow ran out of work
08:11:36FromDiscord<Gumber> ah okay maybe that was my issue
08:11:40PMunchNot that this example would ever do that
08:11:53PMunchWhat error did you get?
08:12:53PMunchAll the `newAsyncSocket` and such does the file descriptor registering, that's what they are for
08:13:57FromDiscord<Gumber> gotcha
08:14:14FromDiscord<Gumber> I must have been doing something screwy... I got something about no dispatcher callbacks / handled being registered
08:14:59FromDiscord<enthus1ast> @Gumber\: never discard a future
08:15:04FromDiscord<enthus1ast> use asyncCheck for this
08:15:10FromDiscord<Gumber> yeah yeah I know
08:15:32FromDiscord<Gumber> I was just trying to get s to work πŸ™‚
08:15:42FromDiscord<Gumber> anywho - thanks for the help all, going to sleep now πŸ™‚
08:15:51FromDiscord<enthus1ast> no dispatcher callbacks registers could be the issue already
08:15:58FromDiscord<enthus1ast> good8!
08:18:07FromDiscord<enthus1ast> if my async procs could go away any time, and i like to keep it rolling, i normally add a dummy where i just ↡while true\: await sleepAsync(1\_000)
08:18:42FromDiscord<enthus1ast> but i guess hasPendingOperations is the cleaner option, but then one needs an outer while to still keep it going
08:19:09*robertmeta quit (Read error: Connection reset by peer)
08:19:10*notchris quit (Read error: Connection reset by peer)
08:19:18*notchris joined #nim
08:19:42*djanatyn joined #nim
08:20:30*ox joined #nim
08:21:26FromDiscord<enthus1ast> i think the example is a little misleading, since to handle disconnects gracefully (and to clean the clients list from disconnected clients) i think its better to just put them in a table
08:22:01*mst quit (Remote host closed the connection)
08:22:08*mst joined #nim
08:22:22FromDiscord<enthus1ast> the key could be a hash of the asyncFd or the sourceIp\:sourcePort or an artificial number
08:23:51*greyrat joined #nim
08:24:46*lucerne joined #nim
08:25:09FromDiscord<retkid> In reply to @Yardanico "you need to compile": i meant the other way
08:25:17FromDiscord<retkid> i have a python module into nim
08:25:35FromDiscord<retkid> (edit) "i have a python module ... into" added "i want"
08:27:41FromDiscord<retkid> https://media.discordapp.net/attachments/371759389889003532/897762504070029362/unknown.png
08:28:29FromDiscord<retkid> https://media.discordapp.net/attachments/371759389889003532/897762702301224980/unknown.png
08:29:53FromDiscord<retkid> https://media.discordapp.net/attachments/371759389889003532/897763054828290048/unknown.png
08:33:41*robertmeta_ joined #nim
08:33:45*tinytoas1 is now known as tinytoast
08:34:49*tinytoast is now known as tinytoes
08:35:33FromDiscord<retkid> https://media.discordapp.net/attachments/371759389889003532/897764482632273920/unknown.png
08:50:04*ecs joined #nim
08:50:28*greaser|q joined #nim
08:50:48*ehmry joined #nim
08:55:26FromDiscord<retkid> https://media.discordapp.net/attachments/371759389889003532/897769484113301544/unknown.png
08:55:34FromDiscord<retkid> nimpy failed its own test?
08:55:40FromDiscord<retkid> is it my system?
08:55:45FromDiscord<retkid> can anyone else verify
09:59:17*nixfreak_nim[m] quit (Quit: Bridge terminating on SIGTERM)
09:59:17*happycorsair[m] quit (Quit: Bridge terminating on SIGTERM)
09:59:22*Theodore[m] quit (Quit: Bridge terminating on SIGTERM)
10:03:09*nixfreak_nim[m] joined #nim
10:11:38FromDiscord<tandy> is it possible to change a table to a seq?
10:11:39*happycorsair[m] joined #nim
10:11:51*Theodore[m] joined #nim
10:12:24FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=3BC0
10:13:34FromDiscord<tandy> what about `TableRef[string, seq[string]]` to `seq[(string, string)]`
10:13:46FromDiscord<tandy> would i need a seq comprehension
10:14:31FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3BC1
10:14:38FromDiscord<haxscramper> `import std/sugar` for collect
10:17:16FromDiscord<tandy> hmm
10:17:29FromDiscord<tandy> not workin im gna try fix
10:20:36FromDiscord<Rika> We have β€œconcat”?
10:20:39FromDiscord<Rika> Isn’t it join
10:23:13FromDiscord<haxscramper> https://nim-lang.github.io/Nim/sequtils.html#concat%2Cvarargs%5Bseq%5BT%5D%5D
10:23:19FromDiscord<haxscramper> well, concat/join
10:23:26*Zevv quit (Ping timeout: 245 seconds)
10:25:32*Zevv joined #nim
10:30:43*Mister_Magister quit (Remote host closed the connection)
10:31:04*Mister_Magister joined #nim
10:38:19FromDiscord<tandy> sent a code paste, see https://play.nim-lang.org/#ix=3BC6
10:39:44FromDiscord<enthus1ast> your return SyncListenBrainz
10:39:57FromDiscord<tandy> F
10:40:25FromDiscord<tandy> gues im Sleepy
11:55:04*max22- quit (Ping timeout: 265 seconds)
12:06:01*supakeen quit (Quit: WeeChat 3.3)
12:06:31*supakeen joined #nim
12:20:25NimEventerNew thread by V3ss0n: Nim : Style insensitivity , snake_case , camelCase, see https://forum.nim-lang.org/t/8497
12:22:20FromDiscord<Rika> What the heck is this forum post
12:22:38FromDiscord<Yardanico> Nim should be a compiled clone of Python
12:25:41FromDiscord<xflywind> we should rewrite a compiled clone of Python using Nim, because it can get thousands of stars
12:26:58FromDiscord<Yardanico> And name it Vpy
12:27:13FromDiscord<xflywind> see https://github.com/peregrine-lang/Peregrine/tree/rewrite
12:27:48FromDiscord<xflywind> see "Vpy" https://github.com/peregrine-lang/Peregrine/tree/main
12:28:48FromDiscord<xflywind> https://dev.to/ethanolchik/peregrine-rewrite-the-python-like-language-that-s-as-fast-as-c-1bfp
12:30:02FromDiscord<xflywind> glad to see they switch from V to Python
12:30:28FromDiscord<Yardanico> In reply to @flywind "see "Vpy" https://github.com/peregrine-lang/Peregri": Seems like they're rewriting it in Python??
12:30:34FromDiscord<Yardanico> https://github.com/peregrine-lang/Peregrine/tree/rewrite
12:30:39FromDiscord<Yardanico> In reply to @flywind "glad to see they": yeah lol
12:30:42FromDiscord<xflywind> yeah
12:33:32FromDiscord<haxscramper> In reply to @NimEventer "New thread by V3ss0n:": Need to make default "yeah, sure, now fuck off" copypasta for style insensetivity
12:33:47FromDiscord<haxscramper> and just reply it to every comment/thread/etc on this topic
12:34:39FromDiscord<haxscramper> In reply to @flywind "see "Vpy" https://github.com/peregrine-lang/Peregri": > compiled programming language currently under development. Documentation is coming soon.
12:34:44FromDiscord<haxscramper> > Documentation is coming soon.
12:34:52FromDiscord<haxscramper> Probably a curse of everything written in V
12:35:22FromDiscord<xflywind> Mr. soon language families
12:35:38FromDiscord<haxscramper> Nice rainbows in readme though, looks better than default `-------`
12:35:51*arkurious joined #nim
12:49:57*mst quit (Changing host)
12:49:57*mst joined #nim
12:50:28FromDiscord<reilly> In reply to @Yardanico "<@!237452759975067650> have you seen": I've been using the version of cImGui that comes bundled with NimGL. The version aiekick provides is for ImGui 1.79, while the NimGL version is for ImGui 1.82.
12:51:07FromDiscord<Yardanico> well then you have to do what he did yourself to integrate it in cimgui or fix your problems when compiling with C++ backend
12:58:03*rockcavera joined #nim
12:58:03*rockcavera quit (Changing host)
12:58:03*rockcavera joined #nim
13:00:20FromDiscord<reilly> Take a look at this thread on Gitter from a few months ago: https://gitter.im/nim-lang/Nim/archives/2021/03/15↡(Ctrl-F `error: invalid argument '-std=gnu++14' not allowed with 'Objective-C'`
13:14:46*nrds joined #nim
13:35:50FromDiscord<Yardanico> Yes, I know, you've showed already
13:36:08FromDiscord<Yardanico> I didn't say I know how to fix, I said you have to fix it somehow or update nimgl's cimgui :P
13:44:03*Vladar joined #nim
13:54:31FromDiscord<Gumber> Why is the version aiekick provides better than the offical cimgui bindings?
13:55:51FromDiscord<qb> I feel honored https://media.discordapp.net/attachments/371759389889003532/897845088401621073/unknown.png
14:04:35*PMunch quit (Quit: Leaving)
14:08:41NimEventerNew thread by Gcao: Strange compilation error with Nim 1.4.6 on Mac, see https://forum.nim-lang.org/t/8498
14:14:53*ox is now known as oz
14:18:19*Gustavo6046 quit (Read error: Connection reset by peer)
14:21:32*Gustavo6046 joined #nim
14:53:01*Gustavo6046 quit (Ping timeout: 252 seconds)
14:56:29FromDiscord<no name fits> Is my config.nims supposed to be automatically picked up as long as there's a .nimble in the root? I made a config.nims with a switch path in my tests folder, but it doesn't seem to recognize switch
15:04:55FromDiscord<no name fits> nvm I'm just dumb. I had the wrong project structure, my bad
15:15:59*max22- joined #nim
15:16:32*Gustavo6046 joined #nim
15:17:16*averell joined #nim
15:20:19FromDiscord<no name fits> also this has probably been asked before, but what's the difference between parsexml module and the xmlparser module?
15:24:17FromDiscord<juan_carlos> One is more like a tree, another is more like a parser.
15:24:43FromDiscord<juan_carlos> with verbose compiler run, it says which .nims and .cfg is reading when compiling.
15:35:58FromDiscord<no name fits> I see, thanks
16:31:52*rockcavera quit (Remote host closed the connection)
16:45:49NimEventerNew question by Netsu: How to list items in directory in Nim, see https://stackoverflow.com/questions/69559275/how-to-list-items-in-directory-in-nim
16:50:27*rockcavera joined #nim
16:50:27*rockcavera quit (Changing host)
16:50:27*rockcavera joined #nim
16:57:34*tiorock joined #nim
16:57:35*tiorock quit (Changing host)
16:57:35*tiorock joined #nim
16:57:35*rockcavera quit (Killed (copper.libera.chat (Nickname regained by services)))
16:57:35*tiorock is now known as rockcavera
17:13:28*adam2 joined #nim
17:13:54*adam2 is now known as adg
17:24:41*adg quit (Ping timeout: 245 seconds)
17:25:03*adg joined #nim
17:36:22FromDiscord<reilly> In reply to @Yardanico "Yes, I know, you've": I've actually never brought this thread up before πŸ€”
18:09:36FromDiscord<wholesomedonut> I've debated learning Nim. I'm gonna ask the stupid new-guy questions, and yes I've RTFM at least a little bit. I like talking to people more than reading pages.I see that Nim can compile down to C/++ and web code. What kind of code is more prevalent so far in your experience writing Nim? Do more people use it as a systems language a la C/++ or Rust, or do they use it as a mother language for building web app frontends?
18:10:34FromDiscord<Rika> C
18:10:39FromDiscord<wholesomedonut> And also.. aside from the newish book that's shown on the website, which I'm thinking of getting, are there any other tutorials, proofs of concept or examples of Nim based projects you lot would recommend a newbie to look at?
18:11:04FromDiscord<Rika> im gonna assume here, but im pretty sure its roughly a 90% 10% split between C(++) and (explicitly) js code
18:11:14FromDiscord<Rika> at least thats what it feels to me
18:14:57FromDiscord<wholesomedonut> Duly noted.
18:16:04FromDiscord<treeform> I also think C.
18:16:27FromDiscord<treeform> Compiling to C++ or JS is more rare. JS might even win over the C++ code.
18:16:47FromDiscord<haxscramper> C++ code is only needed when you interface with C++ libraries
18:17:05FromDiscord<haxscramper> Which is possible, but harder to do than C
18:17:17FromDiscord<haxscramper> Mainly because there are not so many tools for automatically wrapping C++ libraries
18:17:33FromDiscord<treeform> Araq talked about making the C++ mode be the default mode.
18:17:47FromDiscord<treeform> Then it would change.
18:18:03FromDiscord<haxscramper> Why/
18:18:09FromDiscord<haxscramper> I don't think it adds anything new
18:23:31FromDiscord<treeform> Araq talks about advantages of cpp backend here: https://youtu.be/E1J3OL4Jz8w?t=467
18:23:33nrds<R2D299> outube: 7"Nim release 0.20 Part 1"
18:23:53FromDiscord<treeform> The exception handling might not be true any more with arc.
18:24:43FromDiscord<treeform> https://discord.com/channels/371759389889003530/371759389889003532/590451953524277248
18:25:20*max22- quit (Ping timeout: 260 seconds)
18:26:12FromDiscord<treeform> https://discord.com/channels/371759389889003530/371759389889003532/546084073366487040
18:27:25FromDiscord<treeform> https://github.com/nim-lang/RFCs/issues/152
18:27:30FromDiscord<reilly> Is it possible to tell the Nim compiler to not pass a particular flag to the C compiler?
18:27:58FromDiscord<treeform> sounds strange, you might be able to pass an anti-flag to the flag nim passes
18:28:19FromDiscord<treeform> it if happens to be later int he command line it might override it.
18:29:40FromDiscord<reilly> Well, the flag in question is `-std=gnu++14`, and to me it looks like something that can't just be negated.
18:30:52FromDiscord<treeform> You might be able to disable that flag with some thing like `--os:any`
18:31:12FromDiscord<treeform> There are probably flags that tell nim to not use a std library.
18:32:30FromDiscord<treeform> You might be able to define "cppXsupport" in a config.nims file in the folder or some thing like that...
18:32:34FromDiscord<treeform> https://github.com/nim-lang/Nim/blob/854006575498704c42b5ac465fdc74c3efdb5b97/compiler/extccomp.nim
18:32:45FromDiscord<treeform> (edit) "https://github.com/nim-lang/Nim/blob/854006575498704c42b5ac465fdc74c3efdb5b97/compiler/extccomp.nim" => "https://github.com/nim-lang/Nim/blob/854006575498704c42b5ac465fdc74c3efdb5b97/compiler/extccomp.nim#L89"
18:38:02*xet7 quit (Remote host closed the connection)
18:38:05FromDiscord<treeform> if you compile your own compiler you could just change that line
18:38:25FromDiscord<treeform> why do you not want the -std=gnu++14
18:40:17FromDiscord<wholesomedonut> how... Gentoo of you.↡(@treeform)
18:40:27FromDiscord<treeform> πŸ™‚
18:40:34FromDiscord<treeform> I was able to pass the anti flag 'nim cpp -rf --passC:-std=gnu++17 --verbosity:2 test.nim'
18:40:39FromDiscord<treeform> and get:
18:40:57FromDiscord<reilly> So, the problem I'm having is that that flags for C (i.e. c99, c11) aren't allowed when compiling C++, and flags for C++ (i.e. c++98, c++17) aren't allowed when compiling C or Obj-C. gnu++14 is unique in that it only says it's disallowed when compiling Obj-C. I somehow need a flag that works with all three, or maybe no flag at all.
18:40:58FromDiscord<Recruit_main707> cant you override it with something like `-std=none` or something?
18:41:16FromDiscord<treeform> sent a code paste, see https://play.nim-lang.org/#ix=
18:41:48*Gustavo6046 quit (Remote host closed the connection)
18:42:14*Gustavo6046 joined #nim
18:42:30FromDiscord<treeform> In reply to @reilly "So, the problem I'm": do you are compiling both C and C++ from nim? Maybe at this point you need like a make file to compile stuff with different flags and link them?
18:44:01FromDiscord<treeform> When compiling for iOS or Android you can't do it all form nim and it requires stupid different compile and link steps.
18:44:02*Gustavo6046 quit (Remote host closed the connection)
18:44:20FromDiscord<treeform> (in my experience)
18:44:30*Gustavo6046 joined #nim
18:44:32FromDiscord<reilly> So, I've tried compiling with the C backend. This doesn't work seemingly because a library I'm wrapping is written in C++, even though the readme says it has a C api... Compiling with the C++ backend fails because the default gnu++14 option isn't compatible with Objective-C.
18:45:23FromDiscord<reilly> It's trying to compile ObjC because the MacOS Cocoa headers or whatever are ObjC, and it needs those to put pixels on the screen.
18:45:26FromDiscord<treeform> That sounds like you want separate compile and link steps like like a make or a bash file.
18:45:43FromDiscord<reilly> I don't even know where the C is coming from.
18:45:45FromDiscord<treeform> (edit) removed "like"
18:46:11FromDiscord<treeform> You need to compile everything in like objc++ mode.
18:46:49FromDiscord<treeform> Have you tried naming your .m files with .mm extention?
18:51:12FromDiscord<reilly> Clang tries to find cocoa_init.m, but fails since it's been changed to .mm.
18:55:43FromDiscord<reilly> So, I can make Nim transpile to C++, and that should all get dumped in the nimcache folder... then what?
18:55:56*PMunch joined #nim
18:57:03FromDiscord<reilly> I've already been trying to use a nake file for this stuff, so I'm just going to keep working with that.
18:57:59FromDiscord<Qaz> How would I elevate priviliges in Windows so I can run a command as admin?
18:58:23nrds<Prestige99> Like in a malware sense?
18:58:44nrds<Prestige99> Or do you mean like, right click -> run as admin
18:58:54FromDiscord<Qaz> Yes
18:59:26FromDiscord<Qaz> I'm guessing I could run the exe as admin itself and do it that way but I don't want to
19:00:21FromDiscord<Qaz> I would like for the … wants to … to system popup to appear.
19:00:41FromDiscord<Qaz> (edit) "…" => "[program]" | "…" => "[do x]"
19:00:59FromDiscord<Qaz> Is there a procedure for that?
19:01:16PMunchYou want to have the "Program X is requesting to run as admin" prompt?
19:01:18nrds<Prestige99> Ah I see what you mean. Not sure, I don't use windows
19:01:20PMunchOr whatever that is
19:01:20FromDiscord<Qaz> I found a forum thread but it was from 6 years ago seemingly without a solution
19:01:25FromDiscord<Qaz> In reply to @PMunch "You want to have": yes
19:02:38FromDiscord<reilly> In reply to @reilly "So, I can make": Should I be only transpiling, or should I assemble too? (`--compileOnly:on` vs `--noLinking:on`, no linking either way, but the latter transpiles and assembles)
19:02:44FromDiscord<reilly> (edit) "`--noLinking:on`," => "`--noLinking:on` -"
19:04:04PMunch@Qaz, probably something like this: https://github.com/microsoft/Windows-classic-samples/tree/main/Samples/Win7Samples/com/uac
19:05:14*luis_ joined #nim
19:07:46FromDiscord<MahanBi> hello πŸ™‚
19:08:14FromDiscord<Qaz> hello
19:08:14nrds<Prestige99> Hey Mahan
19:09:20FromDiscord<MahanBi> Well friends one question does Nim have a package manager?
19:09:33PMunchYup, it's called Nimble and ships with Nim
19:09:59*max22- joined #nim
19:18:24FromDiscord<qb> I'm trying to capture `xwininfo` 's output with nim-regex. That regex works here but somehow nim-regex match fails. https://play.nim-lang.org/#ix=3BEV
19:18:40FromDiscord<qb> https://regex101.com/r/Suf01E/1/
19:24:44PMunchHmm, is in not possible to have openArray as arguments to an async procedure?
19:32:21FromDiscord<juan_carlos> Use seq
19:34:34PMunchCan't create openArray slices into an array with a seq..
19:48:18FromDiscord<juan_carlos> Gotta copy
19:50:47nrds<Prestige99> πŸ€”
19:56:08PMunchThat's what I was trying to avoid..
20:02:24*xet7 joined #nim
20:04:31FromDiscord<enthus1ast> Maybe with ref or pointer
20:05:07FromDiscord<juan_carlos> ye
20:10:52*adg quit (Ping timeout: 252 seconds)
20:12:59*luis_ quit (Ping timeout: 250 seconds)
20:28:08*adg joined #nim
20:52:13*PMunch quit (Quit: leaving)
21:08:16*adg quit (Quit: WeeChat 3.2)
21:27:41*greaser|q quit (Changing host)
21:27:41*greaser|q joined #nim
21:27:43*greaser|q is now known as GreaseMonkey
21:49:14nrds<Prestige99> Is there a safe way to access variables outside the scope of a {.cdecl.} callback? This is what I'm trying (but isn't safe) https://play.nim-lang.org/#ix=3BFC
21:49:45nrds<Prestige99> I want to pass "this" into the callback so I can affect the object during the callback. I'm not entirely sure how else I could interact with the data
21:52:35FromDiscord<impbox [ftsf]> globals?
21:53:04FromDiscord<impbox [ftsf]> Depends what you mean by _safe_
21:53:08nrds<Prestige99> Well they're instance objects so I'm not sure how that'd work
21:53:13nrds<Prestige99> uh well, compiling would be nic
21:53:15nrds<Prestige99> nice*
21:53:29nrds<Prestige99> `physicsbody.nim(102, 10) Error: illegal capture 'this' because ':anonymous' has the calling convention: <cdecl>`
21:53:42FromDiscord<impbox [ftsf]> Assign it to a global
21:53:49FromDiscord<impbox [ftsf]> Then access it via the global
21:53:56FromDiscord<impbox [ftsf]> It's ugly but it should work
21:54:10FromDiscord<impbox [ftsf]> Unless you're threading etc
21:54:21FromDiscord<impbox [ftsf]> Or calling the function again before it exits
21:54:32*arkurious quit (Quit: Leaving)
21:55:03FromDiscord<impbox [ftsf]> It doesn't take a userdata: pointer you can use?
21:55:30*arkurious joined #nim
21:55:39FromDiscord<impbox [ftsf]> A lot of c api stuff takes a second void argument for passing whatever you want in
21:55:46nrds<Prestige99> oh, it may. I could probably use that.. it's just an odd convention I haven't seen/used
21:56:03*rockcavera quit (Remote host closed the connection)
21:56:16nrds<Prestige99> ah it doesn't
21:56:36nrds<Prestige99> The global idea may work but it is scary lol
21:58:12FromDiscord<impbox [ftsf]> I'm not aware of another option other than changing the c side
21:58:35FromDiscord<impbox [ftsf]> Well you could write to disk and then read it back =)
21:58:41nrds<Prestige99> Well I've considered that too, if I can deploy a static binary it might not be a bad idea
21:58:46nrds<Prestige99> altering the c lib I mean
21:59:25FromDiscord<impbox [ftsf]> Or just include the library next to your app
21:59:45nrds<Prestige99> or rewrite it in Nim
21:59:55nrds<Prestige99> that'd be.. fun
22:04:36NimEventerNew thread by ErikWDev: Nanim: Inspired by 3b1b's manim, I created a GPU-accelerated framework for smooth animations in Nim!, see https://forum.nim-lang.org/t/8499
22:27:00*Vladar quit (Quit: Leaving)
22:28:53FromDiscord<satyrn> how do i replace the first occurance of something in a string
22:29:00FromDiscord<satyrn> (edit) "how do i replace ... the" added "only"
22:36:48FromDiscord<enthus1ast> replace from strutils
22:37:28FromDiscord<enthus1ast> It takes an additional int parameter how many replaces should be done
22:40:27FromDiscord<impbox [ftsf]> Docs are unclear about whether it replaces more than once, reading the code it looks like all occurrences
22:52:06*rockcavera joined #nim
22:52:07*rockcavera quit (Changing host)
22:52:07*rockcavera joined #nim
23:13:47*max22- quit (Remote host closed the connection)
23:29:36FromDiscord<konsumlamm> In reply to @impbox "Docs are unclear about": it replaces all occurences, the devel docs are clearer there: https://nim-lang.github.io/Nim/strutils.html#replace%2Cstring%2Cstring%2Cstring
23:29:44FromDiscord<Elegantbeef> It replaces all, there doesnt seem to be a replace once
23:29:49FromDiscord<Elegantbeef> old
23:29:51FromDiscord<gogolxdong (liuxiaodong)> Nim release 0.20 Part 1.mp4
23:29:52FromDiscord<gogolxdong (liuxiaodong)> What does Nim 0.20 mean?
23:30:03FromDiscord<konsumlamm> it means version 0.20
23:40:26FromDiscord<Yardanico> wow, it's 2021 and Windows still has the 256 char path limit by default which you can disable by either: enabling an option in the registry and opting in to long paths in your app's manifest file, or using the `\\?\` prefix before the path
23:57:02FromDiscord<gogolxdong (liuxiaodong)> so the news is cpp is going to be the default compile backend
23:59:17FromDiscord<Yardanico> no?
23:59:22FromDiscord<Yardanico> There's no such news
23:59:56FromDiscord<Yardanico> If you're watching that 0.20 video, it's quite outdated with latest Nim release being 1.4.8 and 1.6.0 coming soon