<< 03-03-2023 >>

00:03:41FromDiscord<Elegantbeef> You did load the script as a module?
00:03:45*cfa left #nim (#nim)
00:04:13FromDiscord<Elegantbeef> like `createInterpeter("exposed"`
00:08:28FromDiscord<jmgomez> hmm no, Im just pointing to a file
00:09:21FromDiscord<Elegantbeef> https://github.com/beef331/nimscripter/blob/master/src/nimscripter.nim#L81-L90
00:09:21FromDiscord<Elegantbeef> might help
00:11:18FromDiscord<jmgomez> ok, I was doing it wrong what gets override is the whole module I thought it was per proc basis
00:11:33FromDiscord<jmgomez> Nice, will definitely take a look
00:15:29FromDiscord<jmgomez> hmm got a `Error: deref unsupported ptr type: ("ptr TestType", tyPtr)` is deref not supported?
00:16:16FromDiscord<Elegantbeef> The VM doesnt support the entire Nim language so yea likely
00:17:20FromDiscord<jmgomez> hmm, ok
00:17:46FromDiscord<Elegantbeef> If you think you're going to be capable of sending a Nim pointer to the VM and dereferencing it you're dead wrong
00:17:58FromDiscord<Elegantbeef> NimVM objects are PNodes
00:18:39FromDiscord<Elegantbeef> So to the NimVm a `ptr object` is an address to a `Pnode`
00:19:52FromDiscord<Elegantbeef> If curious the way that Nimscripter does interop is to deep copy all types
00:20:31FromDiscord<Elegantbeef> And for slightly obvious reasons it does not support `ptr T` by default
00:21:00FromDiscord<Elegantbeef> Insert your crying here 😛
00:22:16arkanoidhow can I read a larger list of "trending packages" in https://nimble.directory/ ? I'm tend to come and go to nim, and often I find myself out of the loop when I come back. A refresh of whats new, and what is old but now is much stronger and relevant, would be good
00:22:54FromDiscord<jmgomez> xD
00:23:26FromDiscord<Elegantbeef> write your own code that queries the Nim package registry and gets the growth rate, preferably in Nim
00:24:46FromDiscord<hotdog> In reply to @arkanoid "how can I read": GitHub advanced search can probably get you something vaguely similar. It won’t get you packages that aren’t on GitHub though
00:25:16FromDiscord<Elegantbeef> It is just using the package registry, sort by most recently update, then store in a list
00:25:18FromDiscord<hotdog> Search for nim lang repos that have updates in the last month, ordered by stars. Something like that
00:27:04FromDiscord<jmgomez> Im just poking around to see where the limitations are. Was able to pseudo pass the type by deref it to a primitive one. I know that's not taking me too far anyways, let's see if I end up using that or something else if I want scripting.. comp times are quite fast though < 4/5 for minor changes so this is mostly driven by curiosity
00:27:49FromDiscord<Elegantbeef> Yea the limitations will mostly be that it's a nigh impossible to do 0 cost interop
00:28:23FromDiscord<Elegantbeef> Nim VM is quite a limited VM, but also it stores objects in a specific way, so to do this interop you need to do something like Nimscripter
00:28:33FromDiscord<jmgomez> I dont really care much about the cost though, not planing to ship anything in NimScript
00:28:56FromDiscord<Elegantbeef> On the plus side my interop is written in a way that is purely modularized and generic
00:28:56FromDiscord<Elegantbeef> https://github.com/beef331/nimscripter/blob/master/src/nimscripter/vmconversion.nim
00:29:09FromDiscord<Elegantbeef> This means you can relatively easily do interop even if you do not use nimscripter's frontend
00:30:53FromDiscord<jmgomez> Nice, I may end up using it anyways, I just want to understand the "raw" vm before using something on top of it
00:31:25FromDiscord<Elegantbeef> Yea there are limitations though with nimscripter, presently i do not allow implementing more than one module
00:31:52FromDiscord<Elegantbeef> Also my `parseObject` macro is awful 😄
00:34:12FromDiscord<Elegantbeef> Speaking of issues @elcritch still waiting for a min repro on std/pegs
00:36:08FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=4pJR
00:36:31FromDiscord<Elegantbeef> It's impossible to
00:36:46FromDiscord<Elegantbeef> I say impossible, but i mean it's night impossible 😄
00:36:54FromDiscord<Elegantbeef> The VM does not operate on actual binary data
00:38:17FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4pJU
00:39:18FromDiscord<Elegantbeef> A `ptr TestType` is actually a `nkNodeAddr` which is the address of a `PNode`
00:39:28FromDiscord<Elegantbeef> I guess it's a `rkNodeAddr`
00:39:57FromDiscord<Elegantbeef> The NimVm is not written in a way for this stuff, I know the nimskull VM has been changed, but do not know if it addresses this either
00:40:00FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=4pJV
00:40:59arkanoidelegantbeef, surely, but it's not sufficient to get something like https://lib.rs/std
00:41:03FromDiscord<Elegantbeef> What type is `c`?
00:41:11FromDiscord<jmgomez> (edit) "https://play.nim-lang.org/#ix=4pJV" => "https://play.nim-lang.org/#ix=4pJW"
00:41:21FromDiscord<jmgomez> just update the snippet, `ptr int `
00:42:21FromDiscord<jmgomez> Im just passing the direction of A to the VM and resolving it inside and the values are ok
00:44:04FromDiscord<hotdog> In reply to @arkanoid "<@145405730571288577>, surely, but it's": They track downloads, nimble doesn’t
01:10:07*azimut_ joined #nim
01:10:41*azimut quit (Ping timeout: 255 seconds)
01:18:28FromDiscord<Elegantbeef> I mean isnt that just like awesome nim or whatever
01:18:31FromDiscord<Elegantbeef> I believe pointers to primitives are actually just pointers to primitives
01:18:31FromDiscord<Elegantbeef> Pointers to objects are pointers to Pnodes
01:25:50FromDiscord<jmgomez> haha I know, I know, just trying to understand what can be done and actually it can be enough like that
01:28:08FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=4pK0
01:28:59FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=4pK1
01:31:08FromDiscord<ringabout> on the devel branch, is not supported fro better performance.
01:31:21FromDiscord<ringabout> (edit) "fro" => "for"
01:31:45FromDiscord<ringabout> You should add a nimble file and specify its package name.
01:32:23FromDiscord<ringabout> In reply to @ringabout "on the devel branch,": From O(n) to O(1) for per registered rountine,
01:35:02FromDiscord<jmgomez> ok, like one file for all? that should be fine
01:36:57FromDiscord<ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4pK3
01:38:47FromDiscord<Elegantbeef> wait does this mean I now need to emit a nimble file for nimscripter?!
01:40:41FromDiscord<ringabout> probably, it requires a package name.
01:41:37FromDiscord<Elegantbeef> Well that's a bitch
02:02:22*User11 joined #nim
02:40:09*User11 quit (Quit: WeeChat 3.8)
02:41:45*onetwo quit (Read error: Connection reset by peer)
02:44:27*onetwo joined #nim
03:50:16*derpydoo joined #nim
04:53:14*rockcavera quit (Remote host closed the connection)
04:56:26*arkurious quit (Quit: Leaving)
06:47:45*nyeaa492842301 joined #nim
06:48:10*attah_ joined #nim
06:49:04*ltriant_ joined #nim
06:50:10*ltriant quit (Ping timeout: 260 seconds)
06:53:33FromDiscord<ringabout> Hey beef, My PR keeps the passes for backward compatibility => https://github.com/nim-lang/Nim/pull/21444?notification_referrer_id=NT_kwDOApCZSbM1NzIyNTU5NDM2OjQzMDMwODU3&notifications_query=is%3Aunread#discussion_r1123918235
06:54:10FromDiscord<Elegantbeef> Yea i was just curious if it completely ruined tooling or if one can still use the compiler as a library
06:54:34FromDiscord<Elegantbeef> So I guess I await what nimsuggest and friends do
06:55:07FromDiscord<ringabout> nimsuggest can reuse the new API because it only needs semantic checking.
06:55:17*derpydoo quit (*.net *.split)
06:55:17*jmdaemon quit (*.net *.split)
06:55:18*nyeaa49284230 quit (*.net *.split)
06:55:18*cornfeedhobo quit (*.net *.split)
06:55:18*attah quit (*.net *.split)
06:55:18*madprops quit (*.net *.split)
06:55:18*Ekho quit (*.net *.split)
06:55:18*krydos quit (*.net *.split)
06:55:18FromDiscord<ringabout> Since I haven't figured out how to interface with the new API from external libraries. Until then, I keep them.
06:55:23*attah_ is now known as attah
06:55:37FromDiscord<Elegantbeef> Well that's what my silly C header generator will need
06:55:37FromDiscord<ringabout> Probably I need to store the final node somehwere like what ic does.
06:55:52FromDiscord<Elegantbeef> Perhaps it needs the transformed code
06:55:57FromDiscord<Elegantbeef> Hmmm doesnt really matter though
06:56:43FromDiscord<ringabout> That's glad to hear.
06:56:53*derpydoo joined #nim
06:56:53*jmdaemon joined #nim
06:56:53*cornfeedhobo joined #nim
06:56:53*Ekho joined #nim
06:56:53*madprops joined #nim
06:56:53*krydos joined #nim
06:57:56FromDiscord<ringabout> I'm working on community building these few days. It works pretty well. The workflow of packages will be improved since the mod team has grown.
07:14:10*Notxor joined #nim
07:20:42FromDiscord<Phil> I just realized I'm now affected as one of the guys using the compiler as a library
07:21:18FromDiscord<Phil> Damn, stuff just happens when you use nimble as a lib
07:21:59FromDiscord<ringabout> In reply to @Isofruit "I just realized I'm": Which parts are you using?
07:22:02*Notxor quit (Quit: Leaving)
07:22:34FromDiscord<Phil> only really what interacts with nimble
07:22:50FromDiscord<Phil> I'd need to check for specifics later (can't atm, I'm at work)
07:22:53FromDiscord<ringabout> nimble is not a part of the compiler api.
07:23:06FromDiscord<Phil> Nimble for some reason requires the compiler as lib though
07:23:35FromDiscord<Phil> Not in its nimble file, but at least when I tried working with it and importing stuff from it I suddenly needed to also import the compiler.↵I'll check that again later
07:25:04FromDiscord<ringabout> Yeah, confirmed. But I would say that nimble pollutes the compiler 😜
07:25:34FromDiscord<Phil> I haven't worked in the nimble codebase, I wouldn't kow xP
07:26:12*advesperacit joined #nim
07:39:11*kenran joined #nim
07:39:12*derpydoo quit (Ping timeout: 248 seconds)
07:40:18*Notxor joined #nim
07:41:36*Notxor quit (Client Quit)
07:42:40*kenran quit (Remote host closed the connection)
08:07:10FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4pL8
08:16:24*xet7 quit (Quit: Leaving)
08:23:35*azimut_ quit (Ping timeout: 255 seconds)
08:34:29FromDiscord<Phil> Best I can say that it appears to not be finding the header file of your imgui lib
08:34:37FromDiscord<Phil> (edit) "Best I can say ... that" added "is"
08:34:55FromDiscord<Phil> (edit) "the" => "the/a"
08:35:08FromDiscord<System64 ~ Flandre Scarlet> In reply to @Isofruit "Best I can say": I indicated the path https://media.discordapp.net/attachments/371759389889003532/1081132637822918656/image.png
08:35:41FromDiscord<ShalokShalom> In reply to @jtv "That's certainly more intuitive.": The whole Internet thinks, opposed to you, that Javascript is a weakly typed language↵↵And also by the standard that you agree on, that strongly typed means "to be able to enforce real constrains on the type level" is JavaScript not strongly typed
08:35:46FromDiscord<ShalokShalom> https://www.bing.com/search?q=javascript%20weakly%20typed&pc=MOZB&form=MOZMBA
08:35:54FromDiscord<Phil> And you're a thousand percent sure that this relative path is correct and also relative to the place that you think it is relative to?
08:36:23FromDiscord<System64 ~ Flandre Scarlet> It's relative to the file
08:43:30*filcuc joined #nim
08:43:54filcucwhat GC_ref /unref are supposed to do with nim gc orc/arc ?
08:44:11FromDiscord<Elegantbeef> The same they do in refc, increment/decrement the ref count
08:44:32FromDiscord<ringabout> except it doesn't sypport strings/seqs
08:44:36filcucthanks
08:44:37FromDiscord<ringabout> (edit) "sypport" => "support"
08:46:56filcucin some of the NimQml base classes i've marked methods with LockLevel unknown...since i don't know the final client implementation. However if a client implement some of them without any lock level i still get Warning: method has lock level 0, but another method has <unknown> [LockLevel]
08:53:44*NimBot joined #nim
08:54:27filcucok i'm spamming but what's the best way for turning off unused hints from a block...basically i would like to leave some procs in a module because i could need that code but i don't want to warn users about them
08:54:42filcucsomething like maybe_unused of C++
08:56:24FromDiscord<ringabout> `push` might work.
08:59:51FromDiscord<System64 ~ Flandre Scarlet> In reply to @ringabout "except it doesn't support": So it can't be GC'ed?
09:07:11*filcuc_ joined #nim
09:09:44*filcuc quit (Ping timeout: 252 seconds)
09:09:44*filcuc_ is now known as filcuc
09:36:54*ixmpp joined #nim
10:02:57*filcuc_ joined #nim
10:05:56*filcuc quit (Ping timeout: 260 seconds)
10:05:56*filcuc_ is now known as filcuc
10:07:45*kenran joined #nim
10:23:19FromDiscord<System64 ~ Flandre Scarlet> In reply to @Isofruit "And you're a thousand": path is relative to the file I compile or relative to the file?
10:23:27FromDiscord<System64 ~ Flandre Scarlet> (edit) "file?" => "file that includes the header??"
10:27:24FromDiscord<Phil> In reply to @System64 "path is relative to": I am not sure, could be that, could be that it is relative to the root-file you're compiling
10:28:06FromDiscord<Phil> I'm not insanely knowledgeable, but in terms of path's I'd start playing around or seeing if you can somehow get any kind of guarantee how path-fetching works, write minimal examples or the like
10:28:18FromDiscord<Phil> And once you know, write a self answered SO question to share this knowledge with the world!
10:28:35FromDiscord<Phil> @demotomohiro May also know though, he is pretty knowledgeable about C-interop
10:28:59FromDiscord<System64 ~ Flandre Scarlet> Good to know↵My code only imports the module
10:37:05*filcuc quit (Ping timeout: 260 seconds)
10:48:22FromDiscord<firasuke> sent a code paste, see https://play.nim-lang.org/#ix=4pMq
10:54:33FromDiscord<Rika> Hard to tell what kind of data structure is best fitting without knowing how you use it
10:54:41FromDiscord<Rika> Other than appending, what else is needed
10:56:32*jmdaemon quit (Ping timeout: 248 seconds)
10:57:04FromDiscord<firasuke> it's for dependency resolving
10:57:34FromDiscord<firasuke> values on the left are names, values on the right are an array of dependencies as strings
10:59:13FromDiscord<Rika> So a graph
11:00:45NimEventerNew thread by pp: Help with a simple gstreamer application, see https://forum.nim-lang.org/t/9966
11:02:20FromDiscord<firasuke> In reply to @Rika "So a graph": oh it's called a graph, ok, yeah that's what it is
11:03:57FromDiscord<firasuke> so how do you append to a graph?
11:07:50FromDiscord<demotomohiro> In reply to @System64 "path is relative to": If I remember correctly, path is relative to the file that includes the header.
11:10:30FromDiscord<System64 ~ Flandre Scarlet> In reply to @demotomohiro "If I remember correctly,": Ah alright, so why it isn't working in my case?
11:11:01FromDiscord<Rika> In reply to @firasuke "oh it's called a": It’s more of that you want to represent a graph into a data structure; there are many ways to do so↵Appending to your current structure is essentially adding an edge between nodes for a graph (to aid in your searching)
11:11:44FromDiscord<demotomohiro> In reply to @System64 "Ah alright, so why": Are you sure these header files actually exists?
11:15:41FromDiscord<System64 ~ Flandre Scarlet> In reply to @demotomohiro "Are you sure these": yes
11:16:05FromDiscord<System64 ~ Flandre Scarlet> https://github.com/system64MC/SysNimgl↵This is what I try to use
11:25:55FromDiscord<firasuke> In reply to @Rika "It’s more of that": oh ok thanks, any pseudocode I can refer to that is relevant to my example above?
11:27:09FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4pME
11:27:53FromDiscord<demotomohiro> In reply to @System64 "yes": I tried to compile your code but got error. It seems this path is wrong https://github.com/system64MC/SysNimgl/blob/61ebe90d3df8d580ed000f4d7d187ad545d22f51/src/nimgl/imnodes.nim#L22
11:28:22FromDiscord<System64 ~ Flandre Scarlet> In reply to @demotomohiro "I tried to compile": Did you cloned with --recursive?
11:28:27FromDiscord<demotomohiro> yes
11:29:26FromDiscord<System64 ~ Flandre Scarlet> Wait a second
11:31:19FromDiscord<System64 ~ Flandre Scarlet> In reply to @demotomohiro "yes": Just commited, does it work now?
11:34:42FromDiscord<demotomohiro> I got same compile error you posted.
11:35:04FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4pMG
11:35:48FromDiscord<demotomohiro> yes
11:36:29FromDiscord<System64 ~ Flandre Scarlet> In reply to @demotomohiro "yes": I have no idea how to solve this↵I tried relative paths and so on, nothing work
11:49:24*filcuc joined #nim
11:52:08FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4pMJ
11:52:53FromDiscord<System64 ~ Flandre Scarlet> In reply to @demotomohiro "Adding include dir to": So I need to put this code?
11:55:14FromDiscord<demotomohiro> yes
11:55:54FromDiscord<System64 ~ Flandre Scarlet> seems it removed one fatal error
11:58:06FromDiscord<demotomohiro> These .cpp files include files in imgui and imnodes repo has a copy of imgui source code.↵These -I compile flags adds include directory `private/cimnodes/imnodes/dependencies/imgui-1.84.2` so that .cpp files can find header files in imgui.
11:58:48FromDiscord<System64 ~ Flandre Scarlet> Oh alright↵But why do I still have 2 errors?
12:02:56FromDiscord<demotomohiro> In reply to @System64 "Oh alright But why": `nimgl/private/ncimnodes.h` includes header files in other directory.
12:03:56FromDiscord<System64 ~ Flandre Scarlet> In reply to @demotomohiro "`nimgl/private/ncimnodes.h` includes header files": And this is what causes the errors?
12:04:15FromDiscord<demotomohiro> I think so
12:06:33*ltriant_ quit (Ping timeout: 268 seconds)
12:06:43NimEventerNew post on r/nim by thindil: [Nim Blog] This Month with Nim: February 2023, see https://reddit.com/r/nim/comments/11gz246/nim_blog_this_month_with_nim_february_2023/
12:07:53FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4pMT
12:13:43FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4pMW
12:15:05FromDiscord<System64 ~ Flandre Scarlet> So I need to add this in the Nim file ?
12:17:19FromDiscord<System64 ~ Flandre Scarlet> In reply to @demotomohiro "It seems `./private/cimnodes/imnodes/dependencies/i": This is weird, because it's already added in the Nim file
12:18:42FromDiscord<demotomohiro> sent a code paste, see https://paste.rs/wyJ
12:20:03FromDiscord<System64 ~ Flandre Scarlet> This is what I did
12:20:07FromDiscord<demotomohiro> Second parameter of compile pragma is only used to compiling .cpp file in first parameter.
12:20:30FromDiscord<System64 ~ Flandre Scarlet> I did it, but still have the errors
12:21:21*filcuc quit (Ping timeout: 268 seconds)
12:22:23FromDiscord<demotomohiro> According to your compile error message, `private/cimnodes/imnodes/dependencies/imgui-1.84.2` is not in compile options.
12:24:46FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4pN2
12:28:17FromDiscord<demotomohiro> Please read source source code that generate that compile error
12:31:03FromDiscord<demotomohiro> Did you read readme in https://github.com/cimgui/cimnodes/tree/bf28b4d00878a9d81a9b9dc8c2d2a8412482f9de↵?
12:32:07FromDiscord<demotomohiro> It seems `-DIMNODES_NAMESPACE=imnodes` need to be added to `{.compile("private/cimnodes/cimnodes.cpp"`
12:32:33FromDiscord<System64 ~ Flandre Scarlet> Oooh alright, will try it
12:33:23FromDiscord<System64 ~ Flandre Scarlet> In reply to @demotomohiro "It seems `-DIMNODES_NAMESPACE=imnodes` need": So I just need to add this as string in the arguments?
12:33:33FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=4pN9
12:34:15FromDiscord<Rika> there are better representations for directed graphs than this though, but it takes a while to write the abstraction yourself
12:34:17FromDiscord<demotomohiro> In reply to @System64 "So I just need": yes
12:34:19FromDiscord<Rika> this one is simple
12:35:02FromDiscord<firasuke> In reply to @Rika "it's likely better to": thanks!
12:39:34*ltriant joined #nim
12:47:14FromDiscord<jtv> sent a long message, see http://ix.io/4pNa
12:49:34FromDiscord<jtv> sent a long message, see http://ix.io/4pNb
13:01:07FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4pNi
13:02:23FromDiscord<System64 ~ Flandre Scarlet> Oh nice... https://media.discordapp.net/attachments/371759389889003532/1081199893747609610/message.txt
13:07:48*xet7 joined #nim
13:12:30*azimut joined #nim
13:13:42*azimut quit (Remote host closed the connection)
13:14:16*azimut joined #nim
13:18:22*xet7 quit (Remote host closed the connection)
13:19:49FromDiscord<System64 ~ Flandre Scarlet> @demotomohiro Do you know how I can solve this please?
13:22:20FromDiscord<demotomohiro> In reply to @System64 "<@288750616510201856> Do you know": You need to find .cpp/.c files that define these functions and add them with compile pragma.
13:24:09FromDiscord<System64 ~ Flandre Scarlet> This file I think https://media.discordapp.net/attachments/371759389889003532/1081205370841743440/image.png
13:24:26FromDiscord<demotomohiro> Probably `-DIMNODES_NAMESPACE=imnodes` is also need to be added to `private/cimnodes/imnodes/imnodes.cpp`.
13:25:18FromDiscord<demotomohiro> https://github.com/Nelarius/imnodes/blob/e563371cee49eb42da08cca1e0209d30d452c665/imnodes.h#L10
13:25:21FromDiscord<System64 ~ Flandre Scarlet> It compiled!!
13:25:34FromDiscord<demotomohiro> congrats!
13:26:16FromDiscord<System64 ~ Flandre Scarlet> In reply to @demotomohiro "congrats!": But I Have that, should I be worried? https://media.discordapp.net/attachments/371759389889003532/1081205902335549460/message.txt
13:28:34FromDiscord<demotomohiro> If your program use OpenGL, these libraries need to be linked.
13:28:54FromDiscord<demotomohiro> But I don't know why you get these errors.
13:29:10FromDiscord<System64 ~ Flandre Scarlet> The program runs without problems↵And there is no errors since it compiles... And run
13:29:50FromDiscord<demotomohiro> Then, probably you dont need to care.
13:30:09FromDiscord<System64 ~ Flandre Scarlet> Who care about warning anyways
13:30:13FromDiscord<System64 ~ Flandre Scarlet> (edit) "warning" => "warnings"
13:42:36*rockcavera joined #nim
13:50:02*filcuc joined #nim
14:14:26FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4pNF
14:15:26*filcuc quit (Ping timeout: 268 seconds)
14:37:31*kenran quit (Remote host closed the connection)
14:47:54*junaid_ joined #nim
14:52:18*kenran joined #nim
14:58:53*junaid_ quit (Remote host closed the connection)
15:12:21FromDiscord<auxym> yeah, Nim's DCE probably removed the header includes if you weren't calling the functions
15:12:42FromDiscord<auxym> Now you'll need to find that header and make sure it's in gcc's search path
15:19:58FromDiscord<Nerve> How much of a rabbit hole is it to switch over to musl for static compilation and cross-compilation?
15:20:07*jmdaemon joined #nim
15:20:29FromDiscord<Nerve> I need to build an executable for Linux and Windows, and I need compatibility with libzip and libbrotli
15:20:46FromDiscord<Nerve> (edit) "compatibility with" => "to statically link"
15:29:00FromDiscord<jtv> It's a PITA
15:29:49FromDiscord<jtv> A pretty hard, long slog. We started, decided it wasn't worth it
15:29:55FromDiscord<System64 ~ Flandre Scarlet> In reply to @auxym "Now you'll need to": I found the header, but I think it's in search path
15:33:19*jmdaemon quit (Ping timeout: 252 seconds)
15:57:37*arkurious joined #nim
15:58:39*kenran quit (Remote host closed the connection)
16:04:21FromDiscord<Phil> ? What's hard about it ?↵Is static linking singificantly harder than dynamic linking to musl?
16:04:43FromDiscord<jtv> There are all sorts of places where musl is not actually compatible with glibc
16:04:45FromDiscord<Phil> I'm mostly asking from the perspective of webdev running the application in an alpine container which contains musl
16:05:14FromDiscord<Phil> Ah, so the issues likely arise from low level direct interactions with glibc?
16:05:19FromDiscord<jtv> Yes
16:06:15FromDiscord<Phil> Check, that's why I encountered little difficulty, at least 2 abstraction levels away from the places that could cause problems
16:10:25FromDiscord<0xRar> sent a code paste, see https://play.nim-lang.org/#ix=4pOo
16:16:00FromDiscord<Yepoleb> either set the headers variable of your client instance or use request with headers=
16:16:44FromDiscord<Yepoleb> you can create a headers object with httpcore's newHttpHeaders
16:18:07*derpydoo joined #nim
16:18:49FromDiscord<0xRar> can i get an example ?
16:37:51FromDiscord<0xRar> this compiled fine but, it seems to have a problem with Bearer .... https://media.discordapp.net/attachments/371759389889003532/1081254117625843852/image.png
16:41:15FromDiscord<exelotl> try `"Bearer " & client_secret` ?
16:42:28FromDiscord<0xRar> In reply to @exelotl "try `"Bearer " &": ! ty https://media.discordapp.net/attachments/371759389889003532/1081255280676966420/image.png
16:42:39FromDiscord<exelotl> 🎉
16:44:22*filcuc joined #nim
16:45:17FromDiscord<auxym> In reply to @System64 "I found the header,": you think? you can use `--verbosity:2` to see which include dir (`-I...`) nim is passing to gcc. If needed you can add extra include dirs via `--cincludes:DIR`
16:57:50FromDiscord<Ecorous> In the nimble build file, how can I insert the `version` value into another string?
16:59:59FromDiscord<Ecorous> For example, I'm using a task to build it with other options, and I want to customise the `--out` to include the version
17:00:19FromDiscord<Ecorous> (edit) "it" => "my project"
17:19:22FromDiscord<Phil> In reply to @Ecorous "In the nimble build": In the nimble build file and in tasks you're using nimscript and get access to all corresponding utilities
17:19:24FromDiscord<Phil> Including: https://nim-lang.org/docs/nimscript.html#version
17:20:02FromDiscord<Phil> inserting version then works like in normal nim, use string concat, or fmt or whatever you want
17:20:20*derpydoo quit (Ping timeout: 252 seconds)
17:21:21FromDiscord<Ecorous> I worked it out
17:21:24FromDiscord<Ecorous> `switch("out", "build/mpcreater_" & version & "_windows_release.exe")`
17:21:42FromDiscord<Ecorous> I just saw that type
17:21:49FromDiscord<Ecorous> (edit) "type" => "typo"
17:22:12FromDiscord<Ecorous> ``--out:"build/mpcreator_" & version & "_windows_release.exe"` didn't work
17:23:19FromDiscord<Ecorous> ignore the `​`` at the start
17:23:23FromDiscord<Ecorous> huh
17:23:28FromDiscord<Ecorous> ``​`
17:23:30FromDiscord<Ecorous> that
17:45:35FromDiscord<iffy (Matt Haggard)> What `--dynlibOverride` value would I pass to statically link this\: `{.dynlib: "libsodium.so(.18|.23)".}`? I've tried "libsodium", and "sodium", but `objdump` still reports the executable is dynamically linked to `libsodium.so.23`
17:48:21*filcuc quit (Ping timeout: 255 seconds)
17:51:02FromDiscord<iffy (Matt Haggard)> derp... I guess I need to actually `passL:libsodium.a`
18:04:56FromDiscord<Hourglass [She/Her]> I should make that bug report
18:21:01FromDiscord<Hourglass [She/Her]> #github-events and #community-events are the same what
18:21:16*cm quit (Quit: Bye.)
18:27:06*cm joined #nim
18:34:10FromDiscord<System64 ~ Flandre Scarlet> In reply to @auxym "you think? you can": This is in the nim compile arguments right?
18:41:19FromDiscord<firasuke> is it possible to pass tables as parameters? I have a recursive function that needs to access a table and update its contents accordingly,
18:44:34FromDiscord<Rika> Yes it is, you have to mark it as var to change the contents
18:48:21FromDiscord<firasuke> oh ok thanks
18:55:03*jmdaemon joined #nim
18:58:46FromDiscord<Nerve> If I were to make module-level globals using `let`, are those allocated on the heap?
18:59:02FromDiscord<Nerve> These are `JsonNode` values which can't be compile-time `const`
19:00:04FromDiscord<ShalokShalom> In reply to @jtv "No, as was discussed": I would simply see strong and weak on a spectrum
19:12:23FromDiscord<System64 ~ Flandre Scarlet> In reply to @auxym "you think? you can": It says that https://media.discordapp.net/attachments/371759389889003532/1081293008131084378/message.txt
19:32:56*filcuc joined #nim
19:35:57FromDiscord<guttural666> sent a code paste, see https://play.nim-lang.org/#ix=4pP7
19:36:21FromDiscord<guttural666> (edit) "https://play.nim-lang.org/#ix=4pP7" => "https://play.nim-lang.org/#ix=4pP8"
19:40:01FromDiscord<Rika> That’s not how you make a reference
19:40:17FromDiscord<Rika> And that’s not really possible even if it was
19:40:56FromDiscord<guttural666> my goal is to give the caller a pointer to an array element really
19:40:58FromDiscord<guttural666> to read it
19:41:09FromDiscord<Rika> Can’t be a reference in that case
19:41:11FromDiscord<guttural666> and I don't want to make a copy, which a return value would I guess
19:41:22FromDiscord<Rika> Either your array has to store references as elements or you use pointers
19:42:28FromDiscord<guttural666> changing ref to ptr / addr doesn't work either, at least as a return value
19:42:45FromDiscord<guttural666> expression has no address, maybe use unsafeAddr^^
19:43:22FromDiscord<Rika> Use that then, since you’re using a non var parameter
19:44:08FromDiscord<guttural666> yep, just realized it has to be var
19:44:12FromDiscord<guttural666> var works, thanks!
19:44:32FromDiscord<guttural666> (edit) "var ... works," added "+ ptr/addr"
19:58:55*filcuc quit (Ping timeout: 268 seconds)
20:36:22FromDiscord<guttural666> has any of you tried chatGPT, absolutely insane to help learn stuff
20:38:50*uics joined #nim
20:41:46FromDiscord<Yepoleb> wtf is a chatgpt
20:42:32om3gaIt generates wrong code lol
20:44:11FromDiscord<Yepoleb> i can just go on github for that
20:47:53FromDiscord<auxym> sent a code paste, see https://play.nim-lang.org/#ix=4pPq
20:48:17FromDiscord<Yepoleb> g++.exe looks funny
20:49:36*jmdaemon quit (Ping timeout: 248 seconds)
20:53:35*Notxor joined #nim
20:57:14FromDiscord<sOkam!> In rough terms, how does the process of compiling a nim app on windows look like?↵Is the user expected to install mingw on its own, or does nimc know how to handle that?
21:02:49FromDiscord<⚶ Zeno> In reply to @sOkam! "In rough terms, how": can you reword your question ?
21:03:05FromDiscord<sOkam!> in which way?
21:03:33FromDiscord<⚶ Zeno> how do you want me to answer the "how does process of compiling a nim app look like in windows" ?
21:03:39FromDiscord<⚶ Zeno> like in general or ?
21:04:27FromDiscord<sOkam!> sent a long message, see http://ix.io/4pPx
21:04:37FromDiscord<sOkam!> afaik nim needs gcc installed, but i don't remember
21:04:42FromDiscord<sOkam!> i had it installed before
21:04:58FromDiscord<sOkam!> but i don't know how its usually done in windows, hence the Q
21:05:08FromDiscord<⚶ Zeno> us as windows user just download mingw then download nim (same stuff as mingw, if u downloaded x64 mingw you download nim x64) from website↵↵and then we just add to path for both and then nim c blabla
21:05:30FromDiscord<sOkam!> so you build from mingw console?
21:05:34FromDiscord<⚶ Zeno> atleast thats how i downloaded it
21:05:51FromDiscord<⚶ Zeno> myself i didnt build, i just got prebuilt binaries
21:06:21FromDiscord<sOkam!> you build your project from mingw console, or on windows console directly?
21:06:29FromDiscord<⚶ Zeno> ahi
21:06:35FromDiscord<⚶ Zeno> windows console
21:06:44FromDiscord<sOkam!> k so then nimc knows how to resolve mingw
21:06:48FromDiscord<⚶ Zeno> (edit) "ahi" => "ah"
21:06:58FromDiscord<⚶ Zeno> ye
21:07:01FromDiscord<sOkam!> thats not the case in every buildsystem, so that's why i asked
21:07:08FromDiscord<sOkam!> ty that explains it ✍️
21:07:14FromDiscord<⚶ Zeno> np
21:10:40FromDiscord<guttural666> In reply to @om3ga "It generates wrong code": not really about that, it's about throwing ideas around and getting answers that help you solve your problem
21:12:26om3gaguttural666 it's still not the AI, but yeah, I agree, huge step forward
21:13:17om3gaI mean not AI since in my opinion Intelligence means Intellect, that's what such complicated neural networks lacking
21:13:32om3gawe don't know what the Intellect is
21:14:59FromDiscord<sOkam!> In reply to @guttural666 "not really about that,": for learning general purpose things that you know literally nothing about, chatgpt is absurdly insane
21:15:16FromDiscord<sOkam!> because you can guide it to teach you what you lack and dont know how to answer
21:15:29FromDiscord<guttural666> In reply to @sOkam! "for learning general purpose": yeah, using it for programming ideas, how would you do xy in Nim or any other language
21:15:34FromDiscord<guttural666> really mind blowing
21:15:35FromDiscord<sOkam!> people get nitpicky in the details... but that's just the early nature of it. its gonna be huge
21:15:37om3gait's good tool for finding information
21:15:44om3gaand for explanation
21:15:54FromDiscord<sOkam!> yep, exactly
21:16:09FromDiscord<guttural666> In reply to @sOkam! "people get nitpicky in": totally agree, my mind was blown today, it's just helping me write my program it's super crazy
21:16:22om3gaImagine who will be automated and replaced in future?
21:16:24FromDiscord<sOkam!> for generating implementation specific, efficient, or overall good code... its definitely lacking. but the overall idea is there, and then you start working from there
21:16:26FromDiscord<sOkam!> its just insane
21:16:55FromDiscord<guttural666> In reply to @om3ga "Imagine who will be": gonna take some time for that, sure writing super generic stuff will be automated
21:17:16FromDiscord<guttural666> look at Squarespace, same trend
21:17:34FromDiscord<sOkam!> its like a boosted mindmap generator, where it guides you in finding ideas that you might be missing↵it won't develop the ideas for you good enough.... but it can create the branches of the mindmap tree for you to start working on them
21:17:57om3gaguttural666 , no, teachers will be automated
21:18:21om3gasoftware development requires intellect, that tool cant replace good programmer
21:18:25FromDiscord<guttural666> In reply to @om3ga "<@375727321958580228> , no, teachers": yeah, maybe
21:18:39FromDiscord<sOkam!> teaching requires intellect
21:18:42FromDiscord<sOkam!> same thing
21:18:49FromDiscord<sOkam!> but... for the basics, sure
21:18:55om3ganot really, I mean not in all cases
21:19:07FromDiscord<sOkam!> dude, you know nothing about teaching with such a statement
21:19:16om3gathey have program, and teachers follow that program
21:19:19FromDiscord<sOkam!> its just as complex as programming
21:19:28FromDiscord<sOkam!> In reply to @om3ga "they have program, and": that's not good teaching
21:19:34om3gawho don't want to study will not learn anything
21:19:41FromDiscord<sOkam!> thats mindless teaching. mindless programming is already achieved by the ai
21:19:41FromDiscord<guttural666> explaining basics really bogs down efficiency, this is gonna boost that immediately, I see how people are annoyed at my stupid questions about Nim haha
21:19:50om3gasOkam! yes, but this is our reality
21:20:10FromDiscord<guttural666> allows us to focus on the more interesting and complex stuff
21:20:11om3gaI think in future we will have more non educated consumers
21:20:26FromDiscord<sOkam!> In reply to @guttural666 "explaining basics really bogs": yeah thats the biggest strength of the ai. spamming it with stupid dumb questions
21:20:39FromDiscord<sOkam!> nobody can stand that flow of rapid questions
21:20:43FromDiscord<sOkam!> but an ai can no biggie
21:20:57FromDiscord<guttural666> In reply to @sOkam! "yeah thats the biggest": and it's so happy to help and apologizes if its knowledge about a Nim lib is out of date and I kindly tell it hahahaha
21:21:00om3gasOkam! impossible to teach person how to have analytic thinking
21:21:00FromDiscord<sOkam!> not because its not doable by a human, but because human time is expensive
21:21:22om3gathe person should already have motivation to develop it
21:21:43FromDiscord<sOkam!> In reply to @guttural666 "and it's so happy": that part acually annoys me a lot. cant wait until you can teach them. its literally the very first thing I will remove from my conversations 🙈
21:22:06FromDiscord<guttural666> yeah, same haha
21:22:07FromDiscord<sOkam!> In reply to @om3ga "sOkam! impossible to teach": hard disagree
21:22:28FromDiscord<sOkam!> give the person the right tools, and they will develop analytical thinking without issues
21:23:31FromDiscord<guttural666> hahaha, this is just insane https://media.discordapp.net/attachments/371759389889003532/1081326008382271631/image.png
21:23:53FromDiscord<guttural666> this is just sooo cool
21:24:08om3gasOkam! I mean if person don't want to study, teacher will not help him
21:24:27om3gaor in case if he is unable to study for other different reasons
21:24:35FromDiscord<Elegantbeef> This is where i mock 'no, teachers will be automated' by saying "Look we already have chatgpt and it's confidently incorrect aswell!"
21:25:44om3gasOkam! what I think, our progress (I mean whole our civilization), brings degradation too into masses
21:26:22om3gascientists should study better that moments to gave more balanced ability for development into the masses
21:26:52om3ga*to give
21:26:55FromDiscord<guttural666> difference between humans and AIs is that humans will be cunts about being proven wrong, the AI will say "thank you for your kind words good sir, I will learn from my mistakes" 😄
21:27:09om3galol
21:27:24FromDiscord<Elegantbeef> Humans can be cunts about being wrong, AI will say you're wrong and it's 2022 when you asked a question 10 minutes ago
21:27:37om3gaalso what I found, it says "yes it is possible" almost on anything
21:27:52FromDiscord<Elegantbeef> I do not think you can replace a teacher with AI, you can replace a lecturer with AI
21:28:04FromDiscord<Elegantbeef> Teachers do more than just read a script explaining concepts
21:28:04FromDiscord<guttural666> deep
21:28:49om3gaElegantbeef all teachers what I had even not tried to explain properly the stuff
21:28:49FromDiscord<auxym> sent a long message, see http://ix.io/4pPH
21:29:03FromDiscord<guttural666> reading Dan Simmons Hyperion rn and it's funny how chatGPT reminds me of the ship AI in the last book
21:29:10FromDiscord<Elegantbeef> Cool but that's not all teachers
21:29:17om3gaElegantbeef except two or three really good teachers
21:29:39FromDiscord<Elegantbeef> That's my point, a good teacher is not replaceable by an AI
21:29:44om3gabut you know, when you're child, after you loose the trust
21:29:53FromDiscord<Elegantbeef> A bad teacher is cause, purely cause they do the bare minimum
21:30:09FromDiscord<sOkam!> In reply to @auxym "FYI, nimc uses the": helpful, ty ✍️
21:30:10om3gaElegantbeef of course, such tools will not replace anybody
21:30:25om3gaat least in near future
21:30:39FromDiscord<Elegantbeef> But i'm also a luddite and hate all this new "AI is taking over the world"
21:30:51om3gawhan I said teachers will be replaced, I mean after couple hundred years
21:31:05FromDiscord<Elegantbeef> Assuming we as a society last that long
21:31:25FromDiscord<sOkam!> lol that went negative fast 🙈
21:31:27FromDiscord<guttural666> yeah, nuclear holocaust seems a more likely outcome
21:31:41*jmdaemon joined #nim
21:31:46FromDiscord<guttural666> should ask chatGPT about that
21:31:51FromDiscord<Elegantbeef> Bleh not even nuclear
21:31:56om3gaElegantbeef in 1999 my neighbor told me, specialists already created program that writes code itself, why you studying the programming then?
21:31:58om3galol
21:32:13om3ganow is 2023, and I read similar textst online
21:32:27FromDiscord<guttural666> you mean the preprocessor? lwl
21:32:32om3ga"soon programmers will be replaced with new AI"
21:32:37FromDiscord<Elegantbeef> Jeez in 1999 I pooped and peed on myself
21:32:37FromDiscord<Elegantbeef> Now it rarely happens
21:32:54om3gaElegantbeef I'm not very old lol
21:33:08FromDiscord<⚶ Zeno> In reply to @sOkam! "lol that went negative": ✨ perfection ✨
21:33:13FromDiscord<Elegantbeef> Hey i love chatgpt being exclaimed as a programmer replacement, one day people will learn predictive models do not have general intelligence
21:33:56om3gaguttural666 the fun fact, that program was Linter and autocomplition tool for IDE
21:34:25FromDiscord<Elegantbeef> Sokam of course it's negative fast, have you seen the geopolitical situation?! 😛
21:34:31FromDiscord<guttural666> In reply to @om3ga "guttural666 the fun fact,": well it's all just automation in the end
21:34:49FromDiscord<guttural666> outsourcing of thinking that is boring and tedious
21:34:58om3gaguttural666 yes, and that's how journalists presented that
21:35:08om3ga"new program that will replace coders"
21:35:46om3gait was borland compiler era
21:35:49FromDiscord<guttural666> well programs are replacing programmers all the time arent they, what is metaprogramming other than letting our silicone friends do tedious things ^^
21:36:02om3gaonly I cannot remeber what the program was exactly
21:36:11FromDiscord<Elegantbeef> To be fair adding good tooling could replace compiler developer
21:36:19FromDiscord<Elegantbeef> 😛
21:36:42om3ganot when new architecture will arrive
21:37:12om3gaI want to have custom arch cpu
21:37:26om3gawith signed zero
21:38:16FromDiscord<Hourglass [She/Her]> People forget that ChatGPT can be confidently wrong
21:38:28FromDiscord<Hourglass [She/Her]> But because it sounds smart, people think it is
21:38:38FromDiscord<Elegantbeef> Hey people listen to me and I cannot prove i'm not a predictive model
21:39:06FromDiscord<Hourglass [She/Her]> Lol
21:39:28FromDiscord<Hourglass [She/Her]> I should work on Nimberite but the fact my plugin system idea fell flat because of a bug has discouraged me
21:39:38FromDiscord<Hourglass [She/Her]> I still need to upload the bug report
21:40:25FromDiscord<Hourglass [She/Her]> Hey Beef, you're a pro at macros, right? Is it possible to get all defined functions in a module?
21:40:36FromDiscord<Elegantbeef> No it's not
21:40:57om3gaHourglass that's what I said, it generates wrong answers frequently
21:41:37FromDiscord<Elegantbeef> Hey do not call me "it"
21:41:39om3gaI used it to check if it can optimize my code
21:41:48om3galol
21:41:53om3gaI mean chatGPT
21:41:53FromDiscord<Elegantbeef> Can you share that minimisation again?
21:42:42om3gaElegantbeef I should check if it was saved in history
21:42:56om3gawhat it did, inserted inline calculations
21:43:07om3gaswapped types to open arrays
21:43:21om3ganame[start..] <--why?!
21:43:37FromDiscord<Elegantbeef> Oooh chatgpt knows openarray is cooler
21:43:43om3gathe frequent error was using let for vars
21:43:52om3gaElegantbeef it knows nim pretty well
21:44:27FromDiscord<Hourglass [She/Her]> In reply to @Elegantbeef "No it's not": Rip...
21:44:48om3gaI don't like to use heavy lib stuff, I prefer to write my own functions
21:46:02om3gabut it started to suggesting to use algorithm, bitswap (or how it called), and all the code chatgpt printed consisted with such errors
21:46:22*filcuc joined #nim
21:46:41FromDiscord<etra> what's the best way to handle bitflags in nim? plain enums?
21:46:57om3gaalso fun example. : if a < b.smth: for a in someObj
21:47:10om3gawas something similar in Nim?
21:47:48om3gaor seems it literally translates from some other language to Nim's equivalents
21:48:13FromDiscord<Elegantbeef> Yes etra `set[MyEnum]`
21:48:35FromDiscord<Elegantbeef> Omega seems it thinks Nim is python
21:48:59om3gaElegantbeef yes, that's also what I thought
21:50:36FromDiscord<guttural666> In reply to @Hourglass, When the Hour Strikes "People forget that ChatGPT": you will learn that as soon as you compile or look at the docs, but that's not the point, what you are getting out of that is throwing ideas around and getting inspired
21:51:17FromDiscord<etra> sent a code paste, see https://play.nim-lang.org/#ix=4pPK
21:51:49FromDiscord<etra> if I use int, it's 6
21:51:53FromDiscord<etra> which should be raw | br?
21:52:22FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4pPL
21:52:52*Notxor quit (Quit: Leaving)
21:53:14FromDiscord<Elegantbeef> Also you probably should do `camera_mode: var CameraModeFlags`
21:53:37*filcuc quit (Ping timeout: 268 seconds)
21:53:47FromDiscord<etra> brrrp, works now! `Opening camera... Complete features: {Raw, Br}` thanks :p
21:54:10FromDiscord<etra> In reply to @Elegantbeef "Also you probably should": can I do that if I'm interacting with non nim code (i.e. dll?)
21:54:48FromDiscord<Elegantbeef> Of course
21:55:09FromDiscord<Elegantbeef> `var` in Nim is just a `ptr T` hididen
21:55:11FromDiscord<Elegantbeef> hidden\
21:55:17FromDiscord<Elegantbeef> The benefit is it does not require silly `addr` and friends
21:57:18FromDiscord<etra> cool
21:57:26FromDiscord<Elegantbeef> https://www.jasonbeetham.com/pointerexplanation.html might explain some things
21:57:38FromDiscord<Elegantbeef> It explains some basic concepts and also some Nim things
22:03:09*uics left #nim (#nim)
22:04:43FromDiscord<Hourglass [She/Her]> https://github.com/nim-lang/Nim/issues/21464 bug report done
22:05:36FromDiscord<Elegantbeef> Did you test just calling an async proc across the dynlib barrier?
22:08:03FromDiscord<Hourglass [She/Her]> I did, methods like `sleepAsync` work, even `AsyncScket.recv` works
22:08:22FromDiscord<Hourglass [She/Her]> Only issue I found (with our fairly limited testing) was sending data to the socket
22:08:36FromDiscord<Hourglass [She/Her]> This issue might exist with sync sockets... I'll try that now actually
22:11:44FromDiscord<etra> is there a quick way to print a struct full of char arrays on a more readable format? without needing to handroll my own `$`?
22:12:29FromDiscord<Elegantbeef> Nope
22:13:31FromDiscord<etra> sadge
22:20:12FromDiscord<guttural666> In reply to @etra "sadge": this is what chatGPT says (could be wrong) 😄 https://media.discordapp.net/attachments/371759389889003532/1081340272115466371/image.png
22:20:52FromDiscord<guttural666> sent a code paste, see https://play.nim-lang.org/#ix=4pPQ
22:23:54FromDiscord<etra> sent a code paste, see https://play.nim-lang.org/#ix=4pPR
22:24:51FromDiscord<guttural666> np, just cost our AI friend some 10s of Watts
22:26:12FromDiscord<etra> sent a code paste, see https://play.nim-lang.org/#ix=4pPU
22:26:40FromDiscord<etra> (edit) "https://play.nim-lang.org/#ix=4pPU" => "https://play.nim-lang.org/#ix=4pPV"
22:27:47FromDiscord<etra> sent a code paste, see https://play.nim-lang.org/#ix=4pPW
22:27:58FromDiscord<etra> they're null terminated so I'm assuming I'm good (?
22:36:38*advesperacit quit ()
22:37:56om3gastring and csting if I'm not mistaken are not the same thing
22:38:07om3gaI clearly remember the warning
22:39:15om3gaif this can be the problem in future, I think better to create new string in that proc, copy content of the cstring in it, and return the string
22:40:14om3gayes it can slowdown, but will be safe
22:40:44FromDiscord<etra> yes, that's what I'm doing, `di.Vendor` is a char array (null terminated), so I'm getting the address of that and casting it to `cstring`, which is compatible with `char`, then `$` converts the cstring to string
22:41:08om3gacstring is array of chars
22:41:28FromDiscord<guttural666> what are you working on @etra , I'm curious
22:42:01FromDiscord<etra> In reply to @guttural666 "what are you working": I found an SDK for fujifilm cameras, I'm writing the necessary bindings to create a tool to sideload custom profiles, because afaik there's no official tool to do that
22:42:40FromDiscord<guttural666> haha, the true beauty of open source
22:42:49FromDiscord<etra> I'd rather write nim bindings than using C and write my own debug functions to just print stuff
22:43:01FromDiscord<guttural666> word
22:43:21FromDiscord<etra> In reply to @guttural666 "haha, the true beauty": I mean https://media.discordapp.net/attachments/371759389889003532/1081346095956897922/image.png
22:43:32FromDiscord<etra> but they're out in the open so I'm not comitting crimes
22:43:45FromDiscord<guttural666> hackerman is on it again
22:50:05FromDiscord<Elegantbeef> Cstring and string are not the same thing indeed but Nim strings are compatible to cstring
22:50:23FromDiscord<Elegantbeef> Hence the warning, that it's technically unsafe to pass a string as a cstring unless you know the lifetime the function has
22:50:58om3gaetra: https://play.nim-lang.org/#ix=4pQ1
22:51:27FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4pQ2
22:51:45om3ganot the best solution, I don't know what will be if the cstring will not be properly terminated, but worth trying
22:52:03FromDiscord<Elegantbeef> If a cstring is not terminated you have massive problems
22:52:15om3gait may lead to overflow. but we can check that
22:52:20FromDiscord<jmgomez> hey beef, FYI could test the approach that I told you yesterday about passing pointers as int around with the host and the VM and works just fine for NimForUE. I think it's gonna take me far.↵ One thing thouhg, is that when a script is not 100% correct I get a hard crash from evalScript, the error hook doesnt seem to do much there. Did you get around it with nimscripter?
22:52:43om3gaor etra, you should pass from your C stuff the exact length
22:52:53FromDiscord<Elegantbeef> What do you mean hardcrash?
22:53:05om3gaor you should know and be sure 100% the time that proc gets cstring of exact length
22:53:17om3gato not trigger the owerflow read
22:53:23om3ga*overflow
22:53:47FromDiscord<jmgomez> the host crashes, try doesnt capture it and the dll makes the whole UE editor to crash too
22:53:51om3gayes, read access to the not allowed address may lead to the problems
22:54:02FromDiscord<Elegantbeef> Yea but how does it crash
22:54:06FromDiscord<Elegantbeef> Is it an issue inside the VM or host?
22:54:37FromDiscord<jmgomez> VM, lke if yo call a func thats not defined or you have errors on the actual code
22:54:49FromDiscord<jmgomez> (edit) "lke" => "like" | "yo" => "you"
22:55:00FromDiscord<Elegantbeef> The errorhook should work
22:55:35FromDiscord<Elegantbeef> https://github.com/beef331/nimscripter/blob/master/src/nimscripter.nim#L30-L37 mixed with https://github.com/beef331/nimscripter/blob/master/src/nimscripter.nim#L97-L104
22:59:10*derpydoo joined #nim
23:00:26FromDiscord<jmgomez> I dont see anything fundamentally different of what I was doign which is basically try/except around evalScript and hook into the error
23:01:39FromDiscord<Elegantbeef> Are you sure the error resides in the VM and not in host code?
23:02:04FromDiscord<jmgomez> 100% like a I see it working and then I introduce a type
23:02:06FromDiscord<jmgomez> typo
23:02:25FromDiscord<Elegantbeef> Well I can only say something seems setup wrong
23:02:48FromDiscord<etra> In reply to @om3ga "<@329819426000076801>: https://play.nim-lang.org/#i": The problem was more something like this: https://play.nim-lang.org/#ix=4pQa
23:02:57FromDiscord<Elegantbeef> you do use `registerErrorHook` riiiiight? 😄
23:03:07FromDiscord<jmgomez> Will try to reproduce outside UE
23:03:10FromDiscord<jmgomez> yeah xD
23:03:22FromDiscord<jmgomez> (edit) "Will try to reproduce ... outside" added "it"
23:03:27FromDiscord<etra> In reply to @om3ga "or etra, you should": I don't control the other side of the api, but I do know they're null terminated by docs so I'm ok with using unsafeAddr.
23:03:30FromDiscord<etra> (edit) "unsafeAddr." => "unsafeAddr, I think"
23:05:20FromDiscord<jmgomez> aghh it's what I was afraid out, something related with ue.. outside it works just fine
23:06:01FromDiscord<jmgomez> well outside it and in an exe which I dont think will make a diff
23:06:23FromDiscord<etra> sent a code paste, see https://play.nim-lang.org/#ix=4pQf
23:06:47FromDiscord<Elegantbeef> We can do better, but would require more code
23:07:20*zgasma joined #nim
23:07:28FromDiscord<jmgomez> Do you know if goto exceptions should work with cpp?
23:07:38*zgasma quit (Client Quit)
23:07:44FromDiscord<Elegantbeef> They probably should
23:08:03FromDiscord<etra> In reply to @Elegantbeef "We can do better,": it's ok, beef, you can be disappointed
23:08:41FromDiscord<etra> I'm surprised this works, at all, my camera is not even listed in the support :p, can't wait to break it, lol
23:10:40om3gaetra: https://play.nim-lang.org/#ix=4pQh
23:11:55FromDiscord<etra> In reply to @om3ga "<@329819426000076801>: https://play.nim-lang.org/#i": I am not sure what's the point of this if by api spec I know they're null terminated, the string convertion detects the length with that
23:12:17*zgasma joined #nim
23:12:35om3gabut I had many times problems, so I don't rely on stlen, or similar even in C. I always try to work with known length of arrays, and initialize their first index at least with zero
23:12:47om3gaetra, overflow happens....
23:13:21FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=4pQk
23:13:22om3gaand underflow is worse, leads to unpredicted behavior
23:14:20FromDiscord<jmgomez> I think it may be a compiler option, let me see if Im in luck and it's one of those no pch dependant
23:14:29FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=4pQl etra if you want to see funky code
23:15:17FromDiscord<Elegantbeef> Do you have `--panics:on` jm?
23:16:01FromDiscord<jmgomez> no
23:16:41FromDiscord<Elegantbeef> Hmph
23:16:47FromDiscord<jmgomez> I mostly do the actual compiler options directly because they are specific to the platform and need to match for the most part the ue ones and or play nice with it
23:17:15FromDiscord<auxym> sent a code paste, see https://play.nim-lang.org/#ix=4pQm
23:17:36FromDiscord<etra> sent a code paste, see https://play.nim-lang.org/#ix=4pQn
23:17:44FromDiscord<Elegantbeef> It's a generic
23:17:53FromDiscord<jmgomez> it seems there is a `\za` enabled that causes it but Im not enabling it explicitly not sure if its pulled from somewhere else
23:17:59FromDiscord<Elegantbeef> Not that it really matters it's likely to get inlined
23:18:09FromDiscord<etra> true :p
23:19:01FromDiscord<etra> sent a code paste, see https://play.nim-lang.org/#ix=
23:19:12FromDiscord<Elegantbeef> It's not needed
23:19:16FromDiscord<Elegantbeef> I was dumbly fighting a different bug
23:19:23FromDiscord<Elegantbeef> `fStr.distinctBas()[slice] = val` will work
23:20:24FromDiscord<Elegantbeef> I guess technically one should do `fStr.distinctBase[slice.b + 1] = '\0'`
23:20:27FromDiscord<Elegantbeef> And a check should be implemented inside the `$`
23:20:29FromDiscord<Elegantbeef> In the case it fills the buffer
23:21:12om3gaElegantbeef +1 can't cause overflow?
23:21:36om3gain case if the string not terminated
23:21:50FromDiscord<Elegantbeef> I mean you obviously should check this stuff
23:22:24FromDiscord<etra> is `type Foo = object` a zero sized type?
23:22:30om3gathe problem with cstrings is that we not always know their length
23:22:30FromDiscord<etra> I'd just like to hook it a destructor to something
23:22:36FromDiscord<Elegantbeef> Nope
23:22:37FromDiscord<Elegantbeef> It's sized of `1` cause Nim isnt dumb 😄
23:22:59*jmdaemon quit (Ping timeout: 260 seconds)
23:23:26FromDiscord<Hourglass [She/Her]> I should really work on Nim JVM again
23:23:44om3ganim jvM?
23:24:09om3gaown implementaton of java virtual machine written in nim?
23:25:07FromDiscord<jmgomez> aghh I think to get around need to actually enable it but it conflicts with another. What other exception mechanism would you recommend next? (other than cpp and goto?) I think I saw some issues in quirky in the past
23:27:00FromDiscord<Hourglass [She/Her]> In reply to @om3ga "nim jvM?": Nope, Nim compiling to JVM bytecode
23:27:14FromDiscord<Hourglass [She/Her]> I was working on that ages ago but did too much too fast and got burnt out aha
23:28:15FromDiscord<Elegantbeef> Omega this should resolve all your issues https://play.nim-lang.org/#ix=4pQq
23:29:32FromDiscord<jmgomez> In reply to @jmgomez "aghh I think to": setjmp produces other errors.. on losing qualifiersd (volatible wtf is that now😅 )
23:31:31FromDiscord<Hourglass [She/Her]> Is the csources just the generated C code from compiling the Nim compiler?
23:32:23om3gaHourglass, not easy task sure
23:33:35om3gaElegantbeef, good, but it was not my problems :)
23:35:13om3gaI think this example can be optimized also
23:39:21FromDiscord<Hourglass [She/Her]> In reply to @om3ga "Hourglass, not easy task": Definitely not aha, I was so confused on how to even begin
23:41:55om3gaElegantbeef the problem of that stuff is in the source, some cstrings returned by using dll can be shorter than expected. But this is different story
23:42:12om3gaand not terminated also
23:42:13om3galol
23:42:17om3gabugs are everywhere
23:42:25FromDiscord<Elegantbeef> Yea but we're looking at a subset of cstrings
23:42:43FromDiscord<Elegantbeef> This subset of cstrings uses a stack allocated array, and is always null terminated unless it fills the buffer
23:43:50*azimut quit (Ping timeout: 255 seconds)
23:44:02om3gasure, I just discuss general problems
23:44:17om3gadunno what is the real use case
23:44:48FromDiscord<Elegantbeef> The present use case is a struct that has a bunch of fixed length arrays
23:45:09FromDiscord<Elegantbeef> They want to easily print out their struct with nice strings per field
23:45:13*azimut joined #nim
23:45:15om3gathat should be initialized allways?
23:45:20FromDiscord<Elegantbeef> Hence the custom array type
23:45:43om3gaaah, ok
23:46:15om3gaI hate formatting the text
23:46:18FromDiscord<Elegantbeef> Since this is a fixed array cstring we know that there are only two states, the array is full or the array is not full and has a \\0
23:46:40FromDiscord<Elegantbeef> If it has a \\0 we can treat it like a cstring, if it doesnt have a \\0 we need to treat it like an array and copy it to the string
23:46:45om3gasure
23:47:30FromDiscord<Elegantbeef> An optimisation is to just iterate over the array adding it to the result and breaking on a `\0`
23:47:31om3gaso if sting is not empty we can only check values of each index that not equal to '\0'
23:47:37om3garight
23:47:38FromDiscord<Elegantbeef> But i'm also daft and just was writing the code
23:48:07FromDiscord<Elegantbeef> Hey do not agree with me being daft!
23:48:22om3gaif the speed mattersm numbers of vars can be reduced
23:48:45om3gaElegantbeef sometimes I write very non optimal code, it's ok
23:48:58FromDiscord<Elegantbeef> Something tells me etra is in another castle now
23:48:59om3gaespecially when the work should be done very fast
23:49:38om3gamany others will disagree, but the cost of the function matters
23:50:29om3gawhy spent resources of the computer with non needed operations
23:50:57om3gapython folks like the argument "who cares will it be faster on 1ms or not " :)
23:52:02FromDiscord<System64 ~ Flandre Scarlet> In reply to @auxym "can you just pass": does it need extra arguments?
23:55:36FromDiscord<jmgomez> the root of the issue with default cpp exceptions seems to be that UE is compiled with `/EHsc` the c means no extern exceptions
23:55:44om3gaIs here anybody who had deep experience with x11 programming?
23:58:44om3gawhat you think, is it possible to create very basic UI for linux? or such project is overkill for the small group of programmers?
23:59:41FromDiscord<auxym> In reply to @System64 "does it need extra": just the path you want to add to the include search paths, eg https://github.com/mratsim/Arraymancer/blob/master/nim.cfg#L14