<< 27-02-2023 >>

00:03:01FromDiscord<tfp> i actually found that `var beginFrame = proc()...` works too
00:03:05FromDiscord<tfp> but i'm not sure if that will have other issues
00:03:14FromDiscord<tfp> that's how i'd normally make a closure in other langs
00:03:21FromDiscord<tfp> but idk how it works in nim
00:03:36FromDiscord<tfp> will it like.. go out of scope and die
00:06:37FromDiscord<Elegantbeef> Probably you'd need to do `GcRef` on the environment, but idk
00:08:14FromDiscord<BobBBob> sent a code paste, see https://play.nim-lang.org/#ix=4pk3
00:09:41FromDiscord<BobBBob> oh wait I think Im reading the wrong thing
00:11:34FromDiscord<BobBBob> sent a code paste, see https://play.nim-lang.org/#ix=4pk5
00:25:39FromDiscord<ajusa> In reply to @Elegantbeef "Nimscripter makes it easier,": Does nimscripter support importing other files? Or just standalone Nim code?
00:32:41FromDiscord<Elegantbeef> You can make your own stdlib and friends
00:41:00NimEventerNew thread by elcritch: Ants: YAML inspired configuration using Nimscript / Nim, see https://forum.nim-lang.org/t/9944
00:59:58FromDiscord<Haze System (they/them)> sent a code paste, see https://play.nim-lang.org/#ix=4pkf
01:00:23*luis_ joined #nim
01:03:26FromDiscord<huantian> sent a code paste, see https://paste.rs/V2h
01:04:32FromDiscord<Haze System (they/them)> :o
01:05:19FromDiscord<Haze System (they/them)> dope ty :)
01:06:01FromDiscord<Haze System (they/them)> didnt know you could just use `isUpperASCII` like that, thats handy
01:06:14FromDiscord<Elegantbeef> All procedures in Nim are pointer procedures
01:06:57FromDiscord<Elegantbeef> Worth noting there is also `filterIt`
01:07:26FromDiscord<Haze System (they/them)> ive been spoiled by pointerless langs recently haha
01:09:05FromDiscord<Elegantbeef> spoiled
01:09:58FromDiscord<Haze System (they/them)> x'D
01:11:34FromDiscord<Elegantbeef> Y'know huan all i see in that code you posted is `let s = (for x in colChain sentence.filter(x.isUpperAscii): discard)` 😛
01:12:16FromDiscord<Elegantbeef> PeRfOrMaNcE
01:22:20*azimut_ joined #nim
01:22:50*azimut quit (Ping timeout: 255 seconds)
01:26:10*luis_ quit (Ping timeout: 252 seconds)
01:35:57FromDiscord<Saint> How do I import a npm library into nim?
01:36:02FromDiscord<Saint> JS library
01:36:58FromDiscord<Saint> Is there an easy way to do
01:43:26FromDiscord<Elegantbeef> https://github.com/juancarlospaco/nodejs refer to this
02:40:14*arkurious quit (Quit: Leaving)
03:11:43FromDiscord<ranok (Jacob Torrey)> Hi, I am having a strange issue, whenever I include strutils or parseutils I get a compilation error where ld reports that there are multiple definitions of 'nusParseInt'
03:12:11FromDiscord<ranok (Jacob Torrey)> I see that parseInt and parseBiggestInt is defined in both of those, but with a different signature
03:13:19FromDiscord<Elegantbeef> What version of Nim?
03:13:33FromDiscord<ranok (Jacob Torrey)> 1.6.10
03:13:51FromDiscord<Elegantbeef> Wait you said `include`
03:13:54FromDiscord<ranok (Jacob Torrey)> ok, if I import the std it works, if I include it I get the issues
03:13:57FromDiscord<Elegantbeef> You best not be using `include`
03:14:02FromDiscord<Elegantbeef> Yea you do not include modules
03:14:27FromDiscord<Elegantbeef> Including copies them in place and since they're runtime library procedures that duplicates symbols in the C compiler
03:14:56FromDiscord<ranok (Jacob Torrey)> ok, that was a quick fix to a dumb mistake
03:14:57FromDiscord<ranok (Jacob Torrey)> thanks
03:15:46FromDiscord<Elegantbeef> No problem, some modules can be included, but generally one only uses include if they want to split modules across multiple files but cannot due to cyclical references or similar
03:16:11FromDiscord<ranok (Jacob Torrey)> 👍️
03:16:19FromDiscord<ranok (Jacob Torrey)> I am new to Nim, but loving it
03:17:31FromDiscord<Elegantbeef> Well i'll warn you about something unrelated, using gitter makes it so only people with specific matrix clients can see your code blocks 😄
03:18:04FromDiscord<Elegantbeef> So if you ever ask for help do post it to nim playground or just use a proper matrix client 😛
03:21:46FromDiscord<ranok (Jacob Torrey)> will do!
03:33:12FromDiscord<ringabout> It seems that it is qute common to use bool and int compares in VM, I'm gonna add a legacy switch for `laxMacrosTypes`. https://media.discordapp.net/attachments/371759389889003532/1079607103536246784/image.png
03:37:15FromDiscord<Elegantbeef> Nim2.0 or something
03:38:04FromDiscord<ringabout> https://github.com/nim-lang/Nim/pull/21433
03:38:23FromDiscord<Elegantbeef> No i was responding to the switch
03:38:26FromDiscord<ringabout> Yeah, this issue https://github.com/nim-lang/Nim/issues/7375
03:38:32FromDiscord<Elegantbeef> This is nim2.0, it breaks stuff
03:39:23FromDiscord<ringabout> Yeah, I can add `laxMacrosTypes` or `nimPreviewStritcQuote` for this case.
03:39:39FromDiscord<Elegantbeef> My point is why...
03:40:13FromDiscord<Elegantbeef> Yes code is broken due to this change, that code should be fixed, especially when it's stupid wrong
03:40:41FromDiscord<Elegantbeef> Especially when you can have two competing macros with two different views of `quote`
03:41:11FromDiscord<Elegantbeef> If a library works with 2.0 but you need to use that above switch, it now doesnt work since it uses the old logic
03:42:49FromDiscord<ringabout> I agrere. Though I don't even know what is 2.0, since is the current devel the 2.0 or the 2.0 branch?
03:43:00FromDiscord<Elegantbeef> No clue
03:43:09FromDiscord<Elegantbeef> This is a breaking change that cannot have a flag afaict
03:43:34FromDiscord<Elegantbeef> I guess unless people then fork their code with the flag
03:43:52FromDiscord<ringabout> (edit) "agrere." => "agree."
03:44:00FromDiscord<ringabout> I see
03:44:50FromDiscord<Elegantbeef> Your example atleast shows they use `someBool == 1` which is now invalid, so that means if they want to support 2.0 and 1.x they need to have a branch in the other way 😄
03:45:39FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4pkF
03:46:21FromDiscord<Elegantbeef> It's a macro error
03:46:40FromDiscord<ringabout> In reply to @Elegantbeef "Your example atleast shows": Yeah, it is quite obvious for this example. But it is not the case about the question I asked yesterday about int16 as the len of an array.
03:47:07NimEventerNew thread by noah: Asyncfutures: addCallback not calling callback , see https://forum.nim-lang.org/t/9946
03:47:14FromDiscord<sOkam!> like, i can read. but the macro error makes no sense to me, because its copy/pasted from the shady demo code. so knowing its a macro error helps little, i just don't know how to intepret what is happening with the macro
03:47:31FromDiscord<Elegantbeef> It's attempting to index a symbol
03:47:58FromDiscord<Elegantbeef> https://github.com/treeform/shady/blob/master/src/shady.nim#L618
03:48:19FromDiscord<ringabout> It can be aweful for macros-heavy code. https://media.discordapp.net/attachments/371759389889003532/1079610907694469182/image.png
03:48:46FromDiscord<sOkam!> https://github.com/treeform/shady/blob/42cf4589eb9861f013477245c529ddf39455f767/src/shady/demo.nim#L109-L119
03:48:53FromDiscord<Elegantbeef> Yea I do not know what to say ringabout
03:48:59FromDiscord<Elegantbeef> It's a shitty spot to be
03:49:12FromDiscord<ringabout> And the classic arrays of int16 type https://media.discordapp.net/attachments/371759389889003532/1079611126846861455/image.png
03:49:37FromDiscord<ringabout> I have fixes for these packages fortunately, the cause is simple.
03:49:43FromDiscord<Elegantbeef> I'd say this is the issue with not having a spec
03:50:08FromDiscord<Elegantbeef> All this code is incorrect, but it's also works.... just a bad spot to be in
03:50:35FromDiscord<ringabout> Yeah
03:51:26FromDiscord<Elegantbeef> Does it work sokam if you move basicVert to toplevel?
03:51:40FromDiscord<sOkam!> its toplevel
03:51:46FromDiscord<Elegantbeef> No it's not
03:51:51FromDiscord<sOkam!> in my file i mean
03:52:03FromDiscord<Elegantbeef> Oh wait that's not your code 😄
03:52:26FromDiscord<Elegantbeef> The only thing i can really suggest is to put a `echo param.repr` before the index
03:52:32FromDiscord<sOkam!> i assume im missing something and its crashing it, but just cant figure out what
03:52:34FromDiscord<Elegantbeef> To see which field it's indexing at
03:52:54FromDiscord<sOkam!> because im moving the code around to understand it
03:52:59FromDiscord<Elegantbeef> Well even if you're missing something macros shouldnt error like this
03:53:20FromDiscord<sOkam!> im trying to compile the demo, in case the issue is with the demo or something
03:54:02FromDiscord<Elegantbeef> Double check the version of shady you have installed aswell
03:54:10FromDiscord<sOkam!> 0.1.3
03:54:33FromDiscord<sOkam!> is there a way to update all installed packages?
03:54:45FromDiscord<Elegantbeef> He's got commits recently, that might not be updated 😄
03:54:49FromDiscord<Elegantbeef> Nope
03:55:22FromDiscord<Elegantbeef> I do not recall how nimble works, but I think it correctly finds the first commit with a version
03:56:52FromDiscord<Elegantbeef> you can try `nimble install shady@#head`
03:59:43FromDiscord<sOkam!> i think its just missing something, but crashing the macro instead for whatever reason
04:00:22FromDiscord<Elegantbeef> That doesnt make any sense
04:00:37FromDiscord<Elegantbeef> It's indexing a symbol node, attempting to get a strvalue from it
04:02:22FromDiscord<ranok (Jacob Torrey)> Another dumb Q, how do you set the output filename for a task in a .nimble file?
04:02:36FromDiscord<ranok (Jacob Torrey)> I tried adding \`--out\:"filename"
04:02:39FromDiscord<Elegantbeef> You do not inside a nimble
04:02:46FromDiscord<Elegantbeef> you make a `config.nims`
04:02:55FromDiscord<sOkam!> In reply to @Elegantbeef "That doesnt make any": i know it doesn't. but its crashing just after me moving things around 🤷‍♂️
04:03:16FromDiscord<Elegantbeef> That means the macro is getting caught on something
04:06:08FromDiscord<Elegantbeef> Checking the ast before it errors would do well in finding the cause
04:06:35FromDiscord<sOkam!> yeah, if I copy/paste the code from the demo, and i build the same way with the same exact file, it runs
04:06:44FromDiscord<sOkam!> so its definitely getting stuck in something
04:07:14FromDiscord<Elegantbeef> Hey it's your time to learn macros!
04:07:49FromDiscord<sOkam!> found it
04:09:06FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4pkJ
04:09:20FromDiscord<Elegantbeef> Lol
04:09:24FromDiscord<Elegantbeef> Told you the macro is the fault
04:09:26FromDiscord<sOkam!> seems like treeform doesn't like my non-standard formatting
04:09:36FromDiscord<Elegantbeef> No the AST doesnt care
04:09:40FromDiscord<Elegantbeef> It's the `: void`
04:09:46FromDiscord<sOkam!> oh
04:10:05FromDiscord<Elegantbeef> It needs to either ensure the result is void or skip the first node
04:10:13FromDiscord<Elegantbeef> there is no `[0]` for the return value
04:10:38FromDiscord<sOkam!> ic
04:10:59FromDiscord<sOkam!> yep, if i add void it breaks
04:11:10FromDiscord<sOkam!> well, good to know 🤷‍♂️
04:11:20FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4pkK
04:11:35FromDiscord<Elegantbeef> Or just `for param in n[1..^1]`
04:16:06FromDiscord<Elegantbeef> Really the macro should error if you have any return type other than void or an empty node
04:17:48FromDiscord<Elegantbeef> I will say that if you just listened and put an echo where i said to you would've seen the error in all of 3 seconds
04:18:01FromDiscord<ringabout> Seems so. I would disallow void as well, which might be removed in 2.x according to the Roadmap.
04:18:42FromDiscord<Elegantbeef> Well for this specific case yea, there is no main procedure in glsl that returns a type
04:18:43FromDiscord<sOkam!> void will be removed?
04:19:04FromDiscord<Elegantbeef> Well internally
04:19:07FromDiscord<Elegantbeef> Not externally afaik
04:19:22FromDiscord<ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4pkL
04:19:30FromDiscord<Elegantbeef> Void is still needed for "no type" though that can be done in otherways
04:19:30FromDiscord<ringabout> (edit) "sent a code paste, see https://play.nim-lang.org/#ix=4pkL" => "`void type` is an experimental featrure.↵↵> "Void type" -- We should optimize away the "empty tuple" type in the backend and remove this feature."
04:19:57FromDiscord<Elegantbeef> I mean there is no alternative to having some `void`
04:20:06FromDiscord<Elegantbeef> `type NotVoid = distinct void` should always work
04:21:11FromDiscord<sOkam!> is it considered incorrect code to type the void return explicitely?
04:21:43FromDiscord<Rika> i dont think it should ever be incorrect to do so
04:22:26FromDiscord<Elegantbeef> It's not idiomatic 😄
04:24:31FromDiscord<ringabout> I remembered I saw it is useful for generics, like Thread[void], but I forgot where I saw that.
04:24:36FromDiscord<ringabout> (edit) "remembered" => "remember"
04:25:04FromDiscord<Elegantbeef> Yea think that was in an RFC or issue about it
04:25:55FromDiscord<Elegantbeef> Might've been a PR
04:26:17FromDiscord<ringabout> 2.0 RFC => https://github.com/nim-lang/RFCs/issues/437
04:26:33FromDiscord<ringabout> this↵> No, for the return type and discard-checking there would still be a void.
04:26:54FromDiscord<Elegantbeef> Yea the void comment in the milestone is wrong
04:27:03FromDiscord<Elegantbeef> It just wants to optimise and remove the issue with void
04:30:28FromDiscord<sOkam!> ✍️
04:47:17FromDiscord<sOkam!> Is it possible to use shady if I do `var shader = readFile(vert.nim)` at runtime, instead of passing the function to the macro?
04:47:51FromDiscord<Elegantbeef> Of course only if you use nimscript
04:47:56FromDiscord<Elegantbeef> Macros do not run at runtime
04:48:38FromDiscord<sOkam!> what i meant is if the lib has support for passing text and converting without macro, or if its macro mandatory
04:49:20FromDiscord<Elegantbeef> It operates on the AST so of course it cannot convert without a macro
04:49:20FromDiscord<Elegantbeef> Treeform obviously didnt implement a new compiler for shaders 😄
04:49:39FromDiscord<sOkam!> ic
04:51:01FromDiscord<sOkam!> how would this be done with nimscripter?
04:52:07FromDiscord<Elegantbeef> https://github.com/beef331/nimscripter/blob/master/examples/macrorepl/macrorepl.nim best reference
04:52:55FromDiscord<sOkam!> all of it, or is any part of the 200lines more remarkable?
04:53:23FromDiscord<sOkam!> considering its macro-related, it will take me a couple of hours to understand it, so any guidance will accelerate that time by a ton
04:53:34FromDiscord<Elegantbeef> I mean this side isnt macro related
04:54:43FromDiscord<sOkam!> probl is i don't understand 1% of these modules
04:54:58FromDiscord<sOkam!> so i'm having a hard time knowing what the file is even doing
04:56:06FromDiscord<Elegantbeef> All i can say is it powers this https://streamable.com/c6farb
04:56:11FromDiscord<Elegantbeef> I'm not going to go line by line to explain what it's' doing
04:57:10FromDiscord<ringabout> In reply to @Elegantbeef "All i can say": Pretty, now I don't need to use the lame nim secret to dump the ast trees.
04:57:16FromDiscord<ringabout> (edit) "Pretty," => "Pretty cool,"
04:57:19FromDiscord<sOkam!> i don't mean line by line, but something like `go to line blablabla, this is impossible to do without nimscripter`
04:57:34FromDiscord<Elegantbeef> Nothing is impossible without nimscripter
04:57:40FromDiscord<sOkam!> that way i can backtrack at least from somewhere
04:57:44FromDiscord<Elegantbeef> Nimscripter only wraps the compieler API
04:57:49FromDiscord<Elegantbeef> compiler\
04:57:57FromDiscord<sOkam!> please don't miss the point, that's not what i meant
04:58:22FromDiscord<Elegantbeef> Ask real questions and i'll happily answer
04:59:49FromDiscord<sOkam!> whats a line i can go to, and you can say `line blablabla, this is impossible to do without [insert your desired name for this functionality]`
05:00:07FromDiscord<Elegantbeef> I do not follow
05:00:13FromDiscord<sOkam!> because right now its 200 lines of code i have no reference at all. like at all
05:00:25FromDiscord<Elegantbeef> You want to run Nim code in a VM so you can get your shaders
05:00:32FromDiscord<Elegantbeef> That's not possible without the NimVm
05:00:36FromDiscord<sOkam!> so its chinese to me, and it would take me hours to even begin grasping it. so i was just asking for a specific pointer
05:00:54FromDiscord<sOkam!> In reply to @Elegantbeef "You want to run": but that's not a line in that example you sent, which was the point
05:01:56FromDiscord<sOkam!> if I have a line of reference, i can start backtracking from there. if i don't have it, i will need to invest hours to grasp this functionality. i would do it, but i think its faster and makes more sense to have some sensible reference
05:02:21FromDiscord<Elegantbeef> It's 200loc a vast majority is unrelated to the actual interop
05:02:28FromDiscord<Elegantbeef> Line 162 onwards is all that is nimscript related
05:02:33FromDiscord<sOkam!> kk ty
05:02:36FromDiscord<sOkam!> 🙏
05:05:30FromDiscord<sOkam!> whats `macrosport`?
05:06:08FromDiscord<Elegantbeef> The name of the nimscript 'module' we're adding declarations to
05:06:23FromDiscord<sOkam!> module as in a file?
05:06:29FromDiscord<Elegantbeef> No
05:06:47FromDiscord<sOkam!> oh you create a module with code? 🤔
05:06:54FromDiscord<sOkam!> i didn't know that was even poss
05:06:59FromDiscord<Elegantbeef> As in a collection of procedures/types/templates that we're accruing to add with `implNimscriptModule`
05:07:07FromDiscord<sOkam!> i see
05:07:11FromDiscord<Elegantbeef> I mean this is nimscript interop it loads a file
05:07:20FromDiscord<Elegantbeef> The file it loads is created by us
05:08:48FromDiscord<sOkam!> right, but is this not creating the file from existing code?
05:09:14FromDiscord<sOkam!> if im following correctly, the ast already exists, but this is exporting it into the vm
05:09:25FromDiscord<Elegantbeef> No
05:09:41FromDiscord<Elegantbeef> Exporto exposes Nim code to the VM
05:09:57FromDiscord<Elegantbeef> That is just creating a string that is appended to the file before our actual file
05:10:49FromDiscord<sOkam!> so if you do this same thing, but from a literal string instead of from code, you would remove all code from 162 and before?
05:11:12FromDiscord<Elegantbeef> Likely
05:11:31FromDiscord<Elegantbeef> Though you still need to pass the string to Nim
05:12:34FromDiscord<sOkam!> whats the function that takes the `readfile` string and passes it to the vm?
05:12:58FromDiscord<Elegantbeef> There isnt one you'd need to write it
05:13:44FromDiscord<sOkam!> but weren't you saying that this code is passing a string to the vm?
05:13:49FromDiscord<sOkam!> that's what i understood
05:14:10FromDiscord<Elegantbeef> Nope
05:14:25FromDiscord<Elegantbeef> This code appends all the exported symbols to a file that is then loaded from loadScript
05:14:53FromDiscord<Gumbercules> sent a code paste, see https://play.nim-lang.org/#ix=4pkP
05:15:19FromDiscord<Gumbercules> `if ((x = +x, x != x) || (y = +y, y != y)) return false;`
05:15:31FromDiscord<sOkam!> In reply to @Elegantbeef "This code appends all": this sentence is confusing
05:15:32FromDiscord<Gumbercules> is confusing me - isn't `x = +x` an assignment?
05:16:14FromDiscord<sOkam!> i'm reading a file, but you said i need to write a function to handle the data from the file, but then this is saying that you are loading the file from loadscript... do we have a file read or not?
05:16:38FromDiscord<Elegantbeef> You need to write code that gets the string back from the vm
05:16:44FromDiscord<Elegantbeef> You want to call `toGlsl` on a procedure
05:16:54FromDiscord<Elegantbeef> That means you need to have some procedure exposed to the VM to pass it back to Nim
05:17:28FromDiscord<sOkam!> right, makes sense. but i was just thinking about the first step, getting the data to the vm in the first place
05:17:44FromDiscord<Elegantbeef> You do not need to get the data there
05:17:52FromDiscord<Elegantbeef> If it's a proper nim file you can just load that string
05:18:30FromDiscord<sOkam!> i thought you said that the string cannot be managed and needs to be created 😭 man i hate english
05:18:50FromDiscord<sOkam!> (edit) "cannot be managed" => "function doesn't exist,"
05:18:51FromDiscord<Elegantbeef> All you need to do is implement a `proc setShaderString(s: string)` and expose that to the vm and ensure you do `setShaderString toGlsl(myProc)`
05:19:43FromDiscord<sOkam!> but i was asking about how to pass the data to the vm, and you said there is no function to pass a string to the vm
05:19:50FromDiscord<sOkam!> that's when i started getting confused af
05:19:59FromDiscord<Elegantbeef> There isnt one
05:20:15FromDiscord<Elegantbeef> You can call the VM procedure and pass a string to it
05:20:16FromDiscord<Elegantbeef> But that's not required here
05:20:32FromDiscord<Elegantbeef> Ostensibly you just open an interpreter per shader
05:20:35FromDiscord<sOkam!> how does the file exist, if its not a string then?
05:20:57FromDiscord<Elegantbeef> On your drive
05:21:06FromDiscord<sOkam!> `var shader = readfile(myvert.nim)`
05:21:13FromDiscord<sOkam!> i was just thinking of that
05:21:33FromDiscord<sOkam!> if there is another way that nimscripter expects... i'm not quite getting it, and that's the confusion probably
05:22:58FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/UsC
05:28:11FromDiscord<sOkam!> is the explanation of how to run the vm itself in the readme?
05:28:41FromDiscord<Elegantbeef> It is
05:28:50FromDiscord<Elegantbeef> First example shows it
05:29:06FromDiscord<Elegantbeef> Whoops in your case it'd be `NimScriptPath`
05:29:33FromDiscord<ringabout> > In Swift, Void is an typealias for an empty tuple, ().↵Sounds like a easy task.
05:30:41FromDiscord<sOkam!> sent a code paste, see https://paste.rs/zew
05:30:54FromDiscord<Elegantbeef> One loads from string, one loads from file
05:31:19FromDiscord<Elegantbeef> That parses the code and runs all top level statements
05:31:23FromDiscord<Elegantbeef> So... that's how you run a VM
05:31:55FromDiscord<sOkam!> so i actually don't run the shader file, i read it and parse the data with some string-code?
05:32:09FromDiscord<Elegantbeef> Yes you run the shader file
05:32:16FromDiscord<Elegantbeef> you need the ast and to return the generated code
05:32:34FromDiscord<Elegantbeef> `loadScript` is akin to `nim e`
05:33:03FromDiscord<sOkam!> but i don't want to run the shader file, just read it and parse it into glsl
05:33:16FromDiscord<Elegantbeef> You need to compile it
05:34:06FromDiscord<sOkam!> so the output of loadscript is what is then passed to the toglsl macro?
05:34:12FromDiscord<Elegantbeef> No
05:34:17FromDiscord<Elegantbeef> The file you load calls `toGlsl`
05:34:34FromDiscord<sOkam!> why?
05:34:42FromDiscord<sOkam!> its just meant to be a shader
05:34:47FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4pkU
05:34:58FromDiscord<Elegantbeef> Cause you need to get that string back to Nim somehow
05:35:13FromDiscord<sOkam!> that's what I thought you were explaining how to do with the importing
05:37:01FromDiscord<sOkam!> so the file would also need to import shady and everything?
05:37:20FromDiscord<Elegantbeef> You could use the `modules` optional parameter to make it not
05:47:41FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4pkV
05:48:02FromDiscord<Elegantbeef> `NimScriptPath` though
05:48:32FromDiscord<sOkam!> where do you add the optional modules?
05:48:52FromDiscord<Elegantbeef> and also you can do `modules = ["shady", "vmath"]` assuming you do `searchPaths = [vmathPathHere, shadyPathHere, ...]`
05:48:56FromDiscord<Elegantbeef> https://github.com/beef331/nimscripter/blob/master/src/nimscripter.nim#L55
05:50:02FromDiscord<sOkam!> why the searchpaths?
05:50:13FromDiscord<sOkam!> are those not resolved to `pkg/`where needed?
05:50:37FromDiscord<Elegantbeef> Nope this is meant to be portable
05:50:40FromDiscord<Elegantbeef> There is no concept of pkg
05:51:15FromDiscord<sOkam!> pkg is not portable? why?
05:51:20FromDiscord<sOkam!> i've been using it everywhere
05:51:27FromDiscord<sOkam!> as in everywhere in my code
05:51:30FromDiscord<Elegantbeef> Not portable for nimscript
05:51:35FromDiscord<Elegantbeef> Since there is not nimble
05:51:39FromDiscord<sOkam!> if Its nor portable, i would need to change my whole codebase
05:52:33FromDiscord<sOkam!> how do you find the vmath/shady paths at runtime then
05:53:53FromDiscord<Elegantbeef> Include them in your custom stdlib
05:54:46FromDiscord<Elegantbeef> Shipping a nimscript project requires having your own stdlib and including your custom modules
05:56:03FromDiscord<sOkam!> i think im leaving nim shaders for compile time, and rutime literal glsl. honestly
05:58:23*advesperacit joined #nim
05:59:01FromDiscord<ringabout> Found it https://github.com/nim-lang/Nim/issues/7370
06:14:53*azimut_ quit (Ping timeout: 255 seconds)
06:54:21*kenran joined #nim
07:03:55*kenran quit (Remote host closed the connection)
07:35:57FromDiscord<rb3.nim> hey guys, is there a way suppress logging like `@msrc@score@sengine@[email protected]` when compiling? I'm trying to make it so only errors and warnings are printed when I build
08:06:08*Notxor joined #nim
09:55:53FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4plI
09:56:13FromDiscord<4zv4l> I don't have access to the `str_decode` unfortunately
10:45:31FromDiscord<luteva> Hi! Is there an excel (xlsx) library that is able to read (and maybe write) the formulars in an excel file?
10:46:17NimEventerNew thread by matkuki: Mixed C / Cpp project structure?, see https://forum.nim-lang.org/t/9948
10:58:10*junaid_ joined #nim
11:00:01FromDiscord<4zv4l> is there a widechar to string in Nim ?
11:01:01FromDiscord<4zv4l> https://nim-lang.org/docs/widestrs.html#%24%2CWideCString
11:01:02FromDiscord<4zv4l> found it
11:29:00*junaid_ quit (Remote host closed the connection)
12:07:09NimEventerNew question by Joshua Fenner: Sign up for the Nim forum, see https://stackoverflow.com/questions/75580298/sign-up-for-the-nim-forum
13:01:12FromDiscord<virdisn> @luteva You can create XML and have that load in Excel. There are many PHP implementations you can look at. How to read? Don't know exactly maybe the same way. But there must be Java/Python libraries.
13:01:35FromDiscord<virdisn> ... /tmp/nimble_3559057/githubcom_PMunchnimlsp/src/nimlsppkg/suggestlib.nim:3:18 Error: cannot open file: nimsuggest/nimsuggest (Trynig to install nimlsp)
13:07:02*jmdaemon quit (Ping timeout: 246 seconds)
13:13:12FromDiscord<virdisn> Now I am puzzled nimlsp is sunig nimsuggest which is said to be part of the core.
13:15:37FromDiscord<luteva> sent a long message, see http://ix.io/4pmB
13:16:02FromDiscord<virdisn> Evaluate ? Then you need to redo all the VBA work.
13:16:05FromDiscord<virdisn> Maybe simple formulars.
13:17:08FromDiscord<luteva> yes that yould be possible: calculate the SUM, etc, =WHEN .... etc.
14:40:56FromDiscord<4zv4l> anyway I can handle an action to do if my program is killed in anyway ?
14:41:23FromDiscord<4zv4l> like I my program must kill another process if it is stopped or killed
14:41:39FromDiscord<4zv4l> since my program end with an infinite loop↵can only be stopped with a signal I guess
14:41:46FromDiscord<4zv4l> it's on Windows
14:41:54FromDiscord<4zv4l> (edit) removed "I"
14:54:22NimEventerNew thread by tanelso2: Debugging Memory Usage in Nim, see https://forum.nim-lang.org/t/9949
15:01:46*azimut joined #nim
15:07:59*luis_ joined #nim
15:21:25*luis_ quit (Remote host closed the connection)
15:43:25FromDiscord<auxym> In reply to @4zv4l "anyway I can handle": the best you can do, at least on linux, is to catch SIGINT (ctrl-c) events. you will never be able to respond to `kill -9`, the OS just kills the process instantly
15:44:03FromDiscord<auxym> https://nim-lang.org/docs/system.html#setControlCHook%2Cproc%29
15:45:25FromDiscord<auxym> if you need more, you'll have to do it at the OS level. Maybe a systemd unit would allow some sort of cleanup post-stop actions? Not sure, you'd have to dig into systemd (or windows services, have fun)
15:46:32FromDiscord<enthus1ast> for windows service you can simply use NSSM https://nssm.cc/
15:49:15FromDiscord<4zv4l> it's a windows console program 🥺
15:49:30FromDiscord<enthus1ast> does not matter
15:50:01FromDiscord<enthus1ast> i mean if it is some kind of service
15:50:08FromDiscord<enthus1ast> and not something the user must interact with
15:50:51FromDiscord<4zv4l> the thing is my program start another program that protect the clipboard
15:51:02FromDiscord<4zv4l> but if my program is killed using ctrl-c or the taskmanager
15:51:04FromDiscord<4zv4l> the protection is gone
15:51:09FromDiscord<4zv4l> and users can copy paste anything
15:51:11FromDiscord<4zv4l> which is terrible
15:51:25FromDiscord<enthus1ast> this sounds .... weird
15:51:26*arkurious joined #nim
15:51:27FromDiscord<enthus1ast> \:)
15:51:43FromDiscord<enthus1ast> i would hate you if you block my copy paste \:P
15:51:46FromDiscord<moigagoo> Is the package repository broken? I'm seeing 27 open PRs, some are really old: https://github.com/nim-lang/packages/pulls
15:52:00FromDiscord<4zv4l> In reply to @enthus1ast "i would hate you": thats to prevent them copy paste sensitive data from a server
15:52:15FromDiscord<4zv4l> and also copy malware to the server
15:53:35FromDiscord<enthus1ast> to be honest, this does not sound like a good idea
15:53:50FromDiscord<enthus1ast> so if i see it, i can make screenshots, if i can type, i can autotype
15:54:16FromDiscord<enthus1ast> screenshots -\> ocr -\> secret as text↵autotype -\> malware as base64 -\> infected
15:54:50FromDiscord<enthus1ast> how do you connect to the server?
15:54:53FromDiscord<enthus1ast> via rdp?
15:55:21FromDiscord<enthus1ast> for rdp you can disable copy and paste\: https://www.anyviewer.com/how-to/disable-copy-and-paste-remote-desktop-win10-0007.html
15:55:32FromDiscord<4zv4l> yeah but the users still need to copy some stuff
15:55:45FromDiscord<4zv4l> so we use regex
15:55:55FromDiscord<4zv4l> In reply to @enthus1ast "so if i see": you cannot retrieve the screenshot
15:56:10FromDiscord<enthus1ast> but i can screenshot the remote session
15:56:20FromDiscord<4zv4l> indeed, then ?
15:56:35FromDiscord<enthus1ast> then i do ocr on it and have the secrets
15:56:39FromDiscord<enthus1ast> as text
15:57:04FromDiscord<enthus1ast> or i can print it
15:57:13FromDiscord<enthus1ast> or 10\_000 other options really \:)
15:57:15FromDiscord<4zv4l> I think the screenshot is blocked, that's a restricted computer to connect via rdp
15:57:26FromDiscord<4zv4l> In reply to @enthus1ast "or 10\_000 other options": well you could type it manually
15:57:50FromDiscord<4zv4l> but still↵the purpose is to make them loose time if they wanna do that↵it's really well monitored
15:57:56FromDiscord<enthus1ast> i think the proper way of doing this, is to write a view, where the user does not see the secrets
15:58:09FromDiscord<enthus1ast> ok
15:58:12FromDiscord<4zv4l> they interact with Excel on a rdp session
15:58:17FromDiscord<4zv4l> they have to see it
15:58:45*arkurious quit (Ping timeout: 268 seconds)
15:58:48FromDiscord<4zv4l> I mean obviously at some point anything is possible↵he could type anything by hand yeah
15:59:02FromDiscord<enthus1ast> or make a photo with the mobile phone
15:59:07FromDiscord<4zv4l> not allowed
15:59:36FromDiscord<enthus1ast> its a strange company where you work \:P
16:00:04FromDiscord<enthus1ast> so they MUST see the secrets?
16:00:36FromDiscord<4zv4l> well it's an important company↵but indeed as silly as it sounds↵I didn't think about picture and screenshot↵just doing an internship there for now xD
16:00:43FromDiscord<4zv4l> I just texted my manager about that
16:02:07FromDiscord<enthus1ast> can they not just see a representation of the secret?
16:02:08FromDiscord<enthus1ast> or they can autotype a malware as base64 (or excel macro, or powershell, or vbscript)
16:02:08FromDiscord<enthus1ast> or visit a webpage (if allowed) ↵or do dns exfiltration
16:02:09FromDiscord<enthus1ast> or do ping exfiltration
16:02:11FromDiscord<4zv4l> but so for the program they asked me to do↵that's the only thing remaining for the check list↵that if it gets killed, it must kill `rdpclip` to be sure no copy paste is possible
16:02:22FromDiscord<4zv4l> In reply to @enthus1ast "or they can autotype": would be long no ?
16:02:27FromDiscord<4zv4l> In reply to @enthus1ast "or visit a webpage": no internet access
16:02:40FromDiscord<4zv4l> the server is
16:02:42FromDiscord<4zv4l> how to say
16:02:48FromDiscord<4zv4l> isolé
16:02:51FromDiscord<4zv4l> isolated ?
16:03:11FromDiscord<4zv4l> they access to it using those private cable on the ground
16:03:16FromDiscord<4zv4l> to not go through the internet
16:03:32FromDiscord<enthus1ast> does not matter, in fact i do this quite often with keypass, often copy paste breaks or is not possible because of reason, i just let it autotype↵(@4zv4l)
16:03:55FromDiscord<enthus1ast> on the server, can you do a nslookup of a server?
16:04:04FromDiscord<enthus1ast> or can you ping a server (no answer needet)
16:04:18FromDiscord<enthus1ast> in dns, and also in icmp you can put data
16:04:27FromDiscord<4zv4l> I never touched those server
16:04:30NimEventerNew thread by moigagoo: Nimble package submission process broken?, see https://forum.nim-lang.org/t/9950
16:04:31FromDiscord<4zv4l> it's really restricted again
16:04:32FromDiscord<enthus1ast> and i think for both there are living of the land techniques
16:04:54FromDiscord<enthus1ast> also for rdp, there is printer forwarding
16:05:19FromDiscord<enthus1ast> so you'r local printer is forwarded to the rdp session (with default settings though)
16:05:28FromDiscord<enthus1ast> so they might can just print something on their local printer
16:05:36FromDiscord<4zv4l> I think they putted lot of gpo to block as much as possible what could go wrong
16:06:16FromDiscord<4zv4l> I am not the sysadmin there↵so I have no info really↵they just asked for my internship to make a clipboard monitor for rdp session xD
16:06:30FromDiscord<4zv4l> but indeed I'll tell those to my manager
16:06:35FromDiscord<enthus1ast> yeah this might be true... ↵but on the one hand, your company jumps through big loops to make it "safe", on the other hand, they choose the wrong way in my opinion
16:07:16FromDiscord<enthus1ast> big hoops i mean, (my english....)
16:08:00FromDiscord<4zv4l> well, I'll talk about it to my manager
16:08:04*lain quit (Ping timeout: 246 seconds)
16:08:16FromDiscord<4zv4l> I still have to finish that program as useless as it is
16:08:31FromDiscord<enthus1ast> nah, its not useless, you learned a lot i hope \:)
16:08:33FromDiscord<4zv4l> (edit) "is" => "could be"
16:08:38FromDiscord<4zv4l> yeah I did
16:08:44FromDiscord<4zv4l> made me enjoy Nim more and more
16:08:49*lain joined #nim
16:08:57FromDiscord<4zv4l> still have to figure out how to kill that damn program when mine get killed
16:09:12FromDiscord<4zv4l> why doesn't windows follow the signals
16:09:33FromDiscord<4zv4l> I tried `addExitProc` also
16:09:41FromDiscord<enthus1ast> you could, let the other proc monitor its parent
16:09:50FromDiscord<enthus1ast> the other process i mean
16:09:56FromDiscord<enthus1ast> and when its gone, quit
16:10:08FromDiscord<4zv4l> add a loop that check for its parent ?
16:10:31FromDiscord<4zv4l> isn't there a way to create a child that automatically die when the parent dies ?
16:10:37FromDiscord<enthus1ast> no idea
16:11:47*arkurious joined #nim
16:16:09FromDiscord<4zv4l> lmao what https://media.discordapp.net/attachments/371759389889003532/1079799104445616258/image.png
16:17:00FromDiscord<Phil> Free programming support! Quick, call them!
16:17:38FromDiscord<Nerve> rofl yeah, calling and describing your problem might lead to gold, but I don't actually recommend it
16:19:39FromDiscord<Phil> Yeah for the record I said my statement in jest (just to be safe).↵It is pretty funny though that the page even can be read like Google is actually being sympathetic towards experiencing programming problems
16:19:54FromDiscord<enthus1ast> one thing that might work is when you put a RegisterWaitForSingleObject in the process that should quit, when its parent is gone
16:19:55FromDiscord<enthus1ast> https://stackoverflow.com/questions/872364/win32-get-message-notification-of-other-applications-close-exit
16:20:37FromDiscord<enthus1ast> haha
16:40:22*zgasma joined #nim
16:40:47*zgasma quit (Client Quit)
16:42:26*zgasma joined #nim
16:52:31*genpaku quit (Read error: Connection reset by peer)
16:56:44*genpaku joined #nim
16:58:37*rez joined #nim
16:58:56FromDiscord<Phil> God I love when I look for a more beautiful way to express something and nim just flipping has it
17:00:00FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4pnZ
17:00:06FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4pnZ" => "https://play.nim-lang.org/#ix=4po0"
17:01:42FromDiscord<Rika> lol
17:15:41FromDiscord<4zv4l> In reply to @enthus1ast "one thing that might": I found a way
17:15:49FromDiscord<4zv4l> making a Job Object and attaching the child process to it
17:16:04FromDiscord<4zv4l> when there is no handler attached to the Job↵it gets killed
17:21:23FromDiscord<ezquerra> I'm surprised there is no version of isLowerAscii / isUpperAscii for strings in _strutils_. There are only versions for chars
17:23:20FromDiscord<ezquerra> It is trivial to implement of course but it is a surprising omission
17:30:48*rockcavera joined #nim
17:38:57*rockcavera quit (Remote host closed the connection)
17:39:29FromDiscord<pruno> sent a code paste, see https://play.nim-lang.org/#ix=4pob
17:41:18*rockcavera joined #nim
17:47:09FromDiscord<4zv4l> is there a way to export the Nim doc to a `Git Wiki` format ? so markdown I would say ?
17:50:46FromDiscord<sOkam!> Is there something like staticRead but for writing?
17:52:13FromDiscord<sOkam!> In reply to @pruno "Is it possible in": if applicable to your usecase too, i had to use a specific attribute before, and what I did was create a custom pragma for it, so that the C output contains it
17:54:23FromDiscord<pruno> In reply to @sOkam! "if applicable to your": Could be applicable, how do you do that ?
17:56:53FromDiscord<Phil> Norm is nim 2.0 ready folks, you heard it here first
17:56:57FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4poj
17:57:24FromDiscord<Phil> PR is merged, now only a new norm version needs to come out
17:57:46FromDiscord<sOkam!> (edit) "https://play.nim-lang.org/#ix=4poj" => "https://play.nim-lang.org/#ix=4pok"
17:58:28FromDiscord<sOkam!> (edit) "https://play.nim-lang.org/#ix=4pok" => "https://play.nim-lang.org/#ix=4pol"
17:59:57FromDiscord<pruno> In reply to @sOkam! "<@85058614229729280> This is the": Will try that, thanks
18:26:53FromDiscord<sigmasd> j-james\: Hello I tried your nim queires in nvim, and for some reason they fails with invalid node type
18:27:28FromDiscord<sigmasd> even just `[ "mixin" ] @keyword` fails
18:27:55FromDiscord<j-james> likely because they're entirely untested
18:28:34FromDiscord<j-james> i haven't had the time to sit down and try to get them to work in an editor yet (and probably won't have time until wednesday \:-/ )
18:29:03FromDiscord<sigmasd> its cool thanks for your work, hopefully the parser gets some love too xD
18:29:10FromDiscord<j-james> haha, thanks
18:29:30FromDiscord<j-james> if you do figure out why they're not working, let me know!
18:29:42FromDiscord<sigmasd> sure
18:30:22FromDiscord<sigmasd> is this valid tree sitter query [ "mixin" ] @keyword
18:30:55FromDiscord<j-james> i think it should be
18:30:55FromDiscord<sigmasd> the nvim pr uses the parser kew variable so (kew) @keyword
18:31:09FromDiscord<j-james> hmm interesting
18:31:11FromDiscord<sigmasd> weird maybe nvim has an issue then
18:31:39FromDiscord<j-james> all i know about queries comes from the working queries for other languages
18:31:45FromDiscord<j-james> it's probably an issue in my query
18:32:54FromDiscord<Hourglass [She/Her]> What logging library would y'all recommend? I'm gonna be logging from multiple threads and async code and iirc std/logging dislikes threads (isn't threadsafe)
18:34:00FromDiscord<Phil> Personally I'd just have tried std/logging, I haven't yet encountered any issues with it, though it is mildly annoying that you need to instantiate appenders for every thread individually
18:34:24FromDiscord<Phil> But that is on a server that consists of a potato cpu so eh
18:34:48FromDiscord<Phil> (edit) "But that is on a server that consists of a potato cpu ... so" added "with a single thread"
18:35:42FromDiscord<Hourglass [She/Her]> Nvm it's fine, just defines stuff in the thread locally?
18:35:45FromDiscord<virdisn> @Hourglass [She/Her] https://stackoverflow.com/questions/2220525/is-fwrite-atomic fwrite no Windows might be atomic linux no clue. THe point is if you print all the string at once its likely to get printed that way (?)
18:35:46FromDiscord<Hourglass [She/Her]> I think that's the correct term
18:36:06FromDiscord<Hourglass [She/Her]> In reply to @Isofruit "But that is on": Fair
18:36:11*arkurious quit (Ping timeout: 264 seconds)
18:36:18FromDiscord<Hourglass [She/Her]> In reply to @Isofruit "Personally I'd just have": Honestly I think that part may be fine?
18:36:50FromDiscord<Phil> I'm solely speaking from the perspective of a prologue server, where you need to know ahead of time that you must define appenders in the startup-actions since prologue may spin up threads
18:37:13FromDiscord<Phil> And it runs startup actions per thread it spins up
18:38:09FromDiscord<Hourglass [She/Her]> Aah fair
18:40:00FromDiscord<Hourglass [She/Her]> I may write my own anyway
18:40:07FromDiscord<Hourglass [She/Her]> Purely so I can customise it to be how I want
18:40:32FromDiscord<jtv> Generally if two processes or threads have the same file open for writing at the same time, it's possible for writes to be interleaved, even if using buffered IO. Easiest thing to do is to use logging with your own wrapper and only allow one thread to write to any given file
18:42:00FromDiscord<Phil> Huh, for that one I set up prologue to write to a different file per thread
18:42:24FromDiscord<jtv> That works too
18:43:01FromDiscord<Phil> Somewhat inconvenient to deal with though.↵It honestly didn't occur to me to pass the same file-name to multiple file-appenders
18:43:04FromDiscord<sigmasd> sent a code paste, see https://paste.rs/KHl
18:44:52FromDiscord<Elegantbeef> `Option[T]` is a generic invocation and `Option(T)` would be wrong but is a type conversion
18:45:01FromDiscord<Elegantbeef> Also inside typedefs it's `a: Type` not `a = Type`
18:45:31FromDiscord<Phil> Also writing your own seems like a fair bit of pain to write
18:47:54FromDiscord<jtv> It's somewhat nice to not have to worry about reassembling log order after the fact, but in practice if you're logging really fast for debugging, etc, you're better off using an in-memory ring buffer so you don't end up with any synchronization issues.
18:49:02*arkurious joined #nim
18:50:20FromDiscord<sigmasd> so that should become a compiler error ? or it have its usecases
18:50:33FromDiscord<Elegantbeef> Nim devel it actually does something
18:53:45*jmdaemon joined #nim
18:54:49FromDiscord<sigmasd> sent a code paste, see https://play.nim-lang.org/#ix=4poy
18:55:22FromDiscord<sigmasd> sent a code paste, see https://paste.rs/Jpc
18:55:55FromDiscord<sigmasd> sent a code paste, see https://play.nim-lang.org/#ix=4poz
18:56:59FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4poA
18:57:24FromDiscord<sigmasd> ah wait it fixed itself
19:05:06FromDiscord<sigmasd> Is there a recommend way to generate javascript import statements ? (import {a} from url)
19:06:38NimEventerNew Nimble package! kraut - Router for Karax frontend framework., see https://github.com/moigagoo/kraut
19:07:58FromDiscord<Hourglass [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4poE
19:09:48FromDiscord<jtv> Well, are you providing a concrete type when instantiating it??
19:11:07FromDiscord<jtv> Generic functions aren't functions on their own, they're essentially a template for building a function based on a type. You need to provide a type at the call-site if it's ambiguous in any way
19:11:32FromDiscord<Hourglass [She/Her]> So I'll need to use `when R is int32`, as an example?
19:12:25FromDiscord<Hourglass [She/Her]> That got rid of the error so I think so
19:13:30FromDiscord<jtv> Yeah, decodeVarNum[int32](foo) if foo is ambiguous. If it's not, and there's always a concrete type you can skip it
19:15:33FromDiscord<Hourglass [She/Her]> Alright thanks!
19:17:26FromDiscord<sigmasd> I just used emit pragma, seems good enough
19:20:08FromDiscord<sigmasd> In this import pragam, I want to reference the same argument more then once , so #1 #1
19:20:25FromDiscord<sigmasd> whats the correct syntax ?
19:20:43FromDiscord<sigmasd> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1079845406701260820): In import pragam, I want to reference the same argument more then once , so #1 #1
19:24:54FromDiscord<Phil> Here we go, norm 2.7.0 version just dropped!
19:25:46FromDiscord<sigmasd> sent a code paste, see https://play.nim-lang.org/#ix=4poJ
19:26:04FromDiscord<sigmasd> sent a code paste, see https://play.nim-lang.org/#ix=4poK
19:27:18FromDiscord<sigmasd> sent a code paste, see https://play.nim-lang.org/#ix=4poK
19:29:42FromDiscord<sigmasd> it transalte to this !
19:30:04FromDiscord<sigmasd> but that nimCopy is not needed
19:30:15FromDiscord<sigmasd> and it doesn't even work anyway
19:30:30FromDiscord<sigmasd> can I just unsafe cast in the compiler or something to tell it to consider one type as another
19:30:48FromDiscord<sigmasd> cause thats all I need in this case
19:32:23FromDiscord<sigmasd> sent a code paste, see https://play.nim-lang.org/#ix=4poO
19:34:52FromDiscord<sigmasd> using cast[T] also creates a nimcopy
19:51:59FromDiscord<sigmasd> ah so it was not related to that, its just somewhere on the codebase I had a js ffi fn that took string instead of cstring
20:00:17FromDiscord<Diogenes of Toronto> In reply to @NimEventer "New Nimble package! kraut": Very cool
20:09:57FromDiscord<Nerve> I'm using `zip` to read from an archive, and when I use `extract_file()` to dump into a stream, reading from that stream with `read_all()` produces an empty string, am I doing anything wrong?
20:10:28FromDiscord<Nerve> (edit) "I'm using `zip` to read from an archive, and when I use `extract_file()` to dump into a stream, reading from that stream with `read_all()` produces an empty string, ... am" added "or throws an `IOError`."
20:10:39FromDiscord<Nerve> (edit) "am" => "Am"
20:22:48*junaid_ joined #nim
20:23:56FromDiscord<Hourglass [She/Her]> Uhoh, illegal storage access-
20:24:18FromDiscord<Hourglass [She/Her]> I don't think Nim likes how I'm interacting with the shared library lol
20:24:47*junaid__ joined #nim
20:25:13FromDiscord<Hourglass [She/Her]> I'm passing an `NbPlugin` (ref type), `AsyncSocket` (also a ref type), `int32`, `string`, `uint8` and an `int32`
20:25:28FromDiscord<Hourglass [She/Her]> It returns a `Future[bool]` and is an async method used via dynlib
20:25:47FromDiscord<Phil> Smells like nil-spirit
20:27:07FromDiscord<jmgomez> Are you passing (and treating as) refs around dll boundaries?
20:27:30FromDiscord<jmgomez> I will be surprise if that doesnt cause issues. You can try to use them as ptr though
20:28:28FromDiscord<Hourglass [She/Her]> In reply to @jmgomez "Are you passing (and": Yep I'm using refs
20:28:45FromDiscord<Hourglass [She/Her]> I'm using the `arc` memory management too if it has any impact
20:29:59*junaid___ joined #nim
20:30:06FromDiscord<jmgomez> I didnt test it myself but Im not sure that will work. In NimForUE I have a similar scenario though, I pass from the prev dll to the next that gets hot reloaded the type information which is a global ref as a ptr with no issues
20:30:46*junaid__1 joined #nim
20:31:38FromDiscord<Hourglass [She/Her]> Aha wait I got a different error now
20:31:46FromDiscord<Hourglass [She/Her]> Before the function signatures didn't match
20:31:51*junaid__2 joined #nim
20:32:25FromDiscord<Hourglass [She/Her]> Now I'm getting a large chunk of error lol
20:33:32FromDiscord<Hourglass [She/Her]> https://hastebin.com/share/hitahuseve.go
20:34:08FromDiscord<Hourglass [She/Her]> https://hastebin.com/share/liquzoneno.bash error
20:35:13FromDiscord<Hourglass [She/Her]> Why am I getting a value error hm...
20:36:19FromDiscord<Nerve> In reply to @Nerve "I'm using `zip` to": For anyone who'd like to know, `zip`'s `extract_file()` proc doesn't reset the stream pointer, so you need to call `set_position(0)` on it.
20:38:16FromDiscord<Hourglass [She/Her]> In reply to @Hourglass, When the Hour Strikes "https://hastebin.com/share/liquzoneno.bash error": Btw the code is now executed but crashes at some point
20:38:21FromDiscord<Hourglass [She/Her]> Time for more echo statements lmao
20:40:19FromDiscord<Hourglass [She/Her]> Ah crashes with the socket, time to use pointers!
20:54:04*junaid__3 joined #nim
20:55:31*kenran joined #nim
21:07:36NimEventerNew thread by alexgustafson: Error: VM does not support 'cast' from tyOpenArray to tyPtr, see https://forum.nim-lang.org/t/9951
21:11:56FromDiscord<Hourglass [She/Her]> In reply to @jmgomez "I will be surprise": Pointers also aren't working rip
21:12:02FromDiscord<Hourglass [She/Her]> I don't know what to do now lol
21:12:47FromDiscord<Hourglass [She/Her]> Still getting the 'attempt to read from nil' error when trying to use the socket
21:13:05FromDiscord<jtv> That only happens... when you're trying to read nil
21:13:36FromDiscord<jtv> So some value is nil. Tends to happen w/ file-descriptor based data structures if they don't open successfully, for instance
21:13:37*fallback quit (Ping timeout: 252 seconds)
21:13:42FromDiscord<jtv> Make sure you're checking return values
21:13:50*junaid__ quit (Remote host closed the connection)
21:13:50*junaid__1 quit (Remote host closed the connection)
21:13:50*junaid__2 quit (Remote host closed the connection)
21:13:50*junaid___ quit (Remote host closed the connection)
21:13:50*junaid_ quit (Remote host closed the connection)
21:13:50*junaid__3 quit (Remote host closed the connection)
21:18:10FromDiscord<Hourglass [She/Her]> But the socket was opened and can be read from successfully from the main app, my shared library just freaks out for some odd reason, I'll make a check to see if it's nil but I don't know what to do from there aha
21:18:49FromDiscord<Hourglass [She/Her]> Okay on the plugin side, `s == nil` returns false, so it's definitely there
21:18:57FromDiscord<Hourglass [She/Her]> It's just that accessing anything wants to make it die
21:19:29FromDiscord<Hourglass [She/Her]> I also tried using `GC_unref` on the core before passing the value to the plugin and then doing `GC_ref` in the plugin on that socket
21:19:32FromDiscord<Hourglass [She/Her]> But still no dife
21:19:34FromDiscord<Hourglass [She/Her]> Dice
21:20:16FromDiscord<Hourglass [She/Her]> Not so sure where to go from here...
21:21:42FromDiscord<Elegantbeef> You need to gcref before sending to the plugin
21:21:57FromDiscord<Elegantbeef> I do not know if you can gcunref from the plugin, you likely need to deallocate inside the program
21:24:04FromDiscord<AmjadHD> @Varriount comment on <https://github.com/nim-lang/NimLime/pull/165> please.
21:24:08FromDiscord<Hourglass [She/Her]> Still the same issue, I used `GC_ref` in the core before passing it, and `GC_unref` as soon as the proc in the plugin was ran
21:27:50FromDiscord<Yepoleb> In reply to @Hourglass, When the Hour Strikes "Not so sure where": i sent an AsyncFD to the thread instead of an asyncsocket
21:28:07FromDiscord<Yepoleb> it's a distinct int so you can't fuck it up
21:28:11FromDiscord<Hourglass [She/Her]> In reply to @Elegantbeef "I do not know": How do I deallocate before it kills itself because I access a field? Aha
21:28:18FromDiscord<Hourglass [She/Her]> In reply to @Yepoleb "i sent an AsyncFD": Oh? I'll try that
21:28:43FromDiscord<Yepoleb> you need to use the recv and send from asyncdispatch then instead of asyncnet
21:33:42FromDiscord<Hourglass [She/Her]> So `newAsyncSocket` with the file descriptor doesn't work?
21:37:46FromDiscord<Hourglass [She/Her]> That doesn't lol
21:38:06FromDiscord<Hourglass [She/Her]> In reply to @Yepoleb "you need to use": So how would I check if it's closed then? Since `isClosed` doesn't exist
21:38:44FromDiscord<Dudugz> 🤔 what are u trying to do?
21:39:25FromDiscord<Dudugz> I'm using asyncnet for a tcp server, didn't have any issues with it, tho using ``buffered=true`` made server and client don't receive/send data anymore
21:39:59FromDiscord<Elegantbeef> They're wanting to pass an async socket across the dll barrier and use it
21:40:00FromDiscord<Hourglass [She/Her]> In reply to @Dudugz "🤔 what are u": I'm using an async TCP socket from a shared library lol
21:40:08FromDiscord<Hourglass [She/Her]> In reply to @Elegantbeef "They're wanting to pass": Yep
21:40:10FromDiscord<Yepoleb> In reply to @Hourglass, When the Hour Strikes "That doesn't lol": maybe asyncdispatch is impossible to use in a thread
21:40:24FromDiscord<Elegantbeef> Nah asyncdispatch works in a thread
21:40:29FromDiscord<Elegantbeef> I'm assuming their logic is wrong
21:41:07FromDiscord<Hourglass [She/Her]> I haven't even introduced threading yet aha
21:41:25FromDiscord<Hourglass [She/Her]> I'm just trying to use the AsyncFD now but there's no `isClosed` which is a pain
21:41:28*kenran quit (Remote host closed the connection)
21:43:39FromDiscord<Hourglass [She/Her]> My code is here: https://github.com/Nimberite-Development/Nimberite/tree/develop↵↵It's `src/nimberite/core` and `src/nimberite/plugins/networking/n1_19_3.nim` giving me trouble (also possibly `tests/test1.nim`)
21:44:55FromDiscord<Elegantbeef> nice naming totally helpful in explaining what the module is for
21:45:03FromDiscord<Elegantbeef> n1\_19\_3 isnt that a football play?
21:45:09FromDiscord<Hourglass [She/Her]> No?
21:45:22FromDiscord<Dudugz> lol, no
21:45:25FromDiscord<Hourglass [She/Her]> `n`: `networking`↵Then it's just the MC version
21:45:47FromDiscord<Dudugz> recap, what current problem are you having?
21:46:03FromDiscord<Hourglass [She/Her]> Also, seems like AsyncFD also gives me an illegal storage access error
21:48:15FromDiscord<Elegantbeef> Where do you call the plugin?
21:48:19FromDiscord<Hourglass [She/Her]> In reply to @Dudugz "recap, what current problem": I'm passing my socket (via an AsyncFD object) to my shared library's function, that's supposed to be able to read from the socket but gives me `SIGSEGV: Illegal storage access. (Attempt to read from nil?)` even though `s` (line 62 in `src/nimberite/plugins/networking/n1_19_3.nim`) is not nil
21:48:40FromDiscord<Hourglass [She/Her]> In reply to @Elegantbeef "Where do you call": Line 99 in `core.nim`
21:48:42FromDiscord<Yepoleb> In reply to @Hourglass, When the Hour Strikes "So how would I": it's closed if recv or send immediately returns with no data
21:49:25FromDiscord<Hourglass [She/Her]> In reply to @Hourglass, When the Hour Strikes "I'm passing my socket": I also tried using an `AsyncSocket` instead of `AsyncFD` earlier which didn't work either
21:49:26FromDiscord<4zv4l> how can I read from stdin asynchronously ?
21:50:00FromDiscord<Elegantbeef> I'm going to say using async procedures across the dll barrier is a problem
21:50:12FromDiscord<Elegantbeef> The way you're using plugins almost completely ruins the purpose of system libraries 😄
21:52:01*fallback joined #nim
21:52:09FromDiscord<Yepoleb> In reply to @4zv4l "how can I read": create a file descriptor to stdin with `AsyncFD(0)` (0 is the file descriptor for stdin), register it and register a callback with `addRead` that completes a future
21:52:30FromDiscord<Yepoleb> i did not test this btw, but that's the basic concept
21:55:32FromDiscord<Hourglass [She/Her]> In reply to @Elegantbeef "The way you're using": How so? :P
21:55:47FromDiscord<Elegantbeef> You've tied it to the Nim implementation of a lot of data types
21:56:01FromDiscord<Elegantbeef> Which means you now have a plugin system that is purely Nim centric
21:56:21FromDiscord<Elegantbeef> A big benefit of system libraries is that they're language agnostic
21:56:38FromDiscord<Dudugz> I think that if you are going to make a plugin system it is much more feasible to use a scripting system or an embedded language like lua
21:56:50FromDiscord<Elegantbeef> Not really
21:56:56FromDiscord<Elegantbeef> A system library is fine for a plugin system
21:57:03FromDiscord<Hourglass [She/Her]> This is made for Nim, anything else isn't exactly considered supported for me
21:57:13FromDiscord<Dudugz> It is but you deal with more boilerplate
21:57:13FromDiscord<Elegantbeef> I'd rather use wasm if i was expecting people to share the modules, but they're fine
21:57:26FromDiscord<Elegantbeef> Sure but they want hot code reload for Nim
21:57:34FromDiscord<Elegantbeef> You do not get Nim hot code reload using lua 😄
21:57:58FromDiscord<Dudugz> True
21:58:04FromDiscord<Hourglass [She/Her]> In reply to @Elegantbeef "You do not get": Also would have to expose the Nim APIs I want to use manually aha
21:59:01FromDiscord<Dudugz> Also, can't you just pass AsyncSocket instead of AsyncFD?
21:59:57FromDiscord<Elegantbeef> You do not annotate your DLL procedures as stdcall
22:00:48FromDiscord<Hourglass [She/Her]> In reply to @Dudugz "Also, can't you just": Explained it here
22:01:59FromDiscord<Elegantbeef> Why do you even use `stdcall`?
22:02:00FromDiscord<Elegantbeef> Like you're writing both sides of the API
22:05:37FromDiscord<Hourglass [She/Her]> I also tried using nimcall but that didn't work either
22:05:56FromDiscord<Hourglass [She/Her]> Is there any actual difference between nimcall and stdcall?
22:05:59FromDiscord<Elegantbeef> I mean right now both sides do not share the same conventiob
22:06:08FromDiscord<Elegantbeef> yes Nimcall on linux is cdecl
22:06:18FromDiscord<Elegantbeef> on windows it's fastcall if available
22:07:43FromDiscord<Hourglass [She/Her]> Ah
22:08:39FromDiscord<Hourglass [She/Her]> Procs use `nimcall` by default right?
22:09:37FromDiscord<Hourglass [She/Her]> Yeah it is
22:09:42FromDiscord<Hourglass [She/Her]> Manual says so
22:10:36FromDiscord<Hourglass [She/Her]> But yeah don't think this has any impact currently considering the code segfaults
22:26:49FromDiscord<Hourglass [She/Her]> Yeah I'm stuck lol
22:28:02*Notxor quit (Remote host closed the connection)
22:34:23*advesperacit quit ()
22:38:12FromDiscord<4zv4l> In reply to @Yepoleb "create a file descriptor": thanks !↵I don't know what I had in mind↵wanted to handle recv and send data with asyncnet but↵the 'readline' from stdin is a trouble if there are many clients lol
22:39:10FromDiscord<Yepoleb> recv won't work on stdin because it is not a socket
23:07:25FromDiscord<4zv4l> I meant↵read from stdin on the server to reply to the client