00:03:01 | FromDiscord | <tfp> i actually found that `var beginFrame = proc()...` works too |
00:03:05 | FromDiscord | <tfp> but i'm not sure if that will have other issues |
00:03:14 | FromDiscord | <tfp> that's how i'd normally make a closure in other langs |
00:03:21 | FromDiscord | <tfp> but idk how it works in nim |
00:03:36 | FromDiscord | <tfp> will it like.. go out of scope and die |
00:06:37 | FromDiscord | <Elegantbeef> Probably you'd need to do `GcRef` on the environment, but idk |
00:08:14 | FromDiscord | <BobBBob> sent a code paste, see https://play.nim-lang.org/#ix=4pk3 |
00:09:41 | FromDiscord | <BobBBob> oh wait I think Im reading the wrong thing |
00:11:34 | FromDiscord | <BobBBob> sent a code paste, see https://play.nim-lang.org/#ix=4pk5 |
00:25:39 | FromDiscord | <ajusa> In reply to @Elegantbeef "Nimscripter makes it easier,": Does nimscripter support importing other files? Or just standalone Nim code? |
00:32:41 | FromDiscord | <Elegantbeef> You can make your own stdlib and friends |
00:41:00 | NimEventer | New thread by elcritch: Ants: YAML inspired configuration using Nimscript / Nim, see https://forum.nim-lang.org/t/9944 |
00:59:58 | FromDiscord | <Haze System (they/them)> sent a code paste, see https://play.nim-lang.org/#ix=4pkf |
01:00:23 | * | luis_ joined #nim |
01:03:26 | FromDiscord | <huantian> sent a code paste, see https://paste.rs/V2h |
01:04:32 | FromDiscord | <Haze System (they/them)> :o |
01:05:19 | FromDiscord | <Haze System (they/them)> dope ty :) |
01:06:01 | FromDiscord | <Haze System (they/them)> didnt know you could just use `isUpperASCII` like that, thats handy |
01:06:14 | FromDiscord | <Elegantbeef> All procedures in Nim are pointer procedures |
01:06:57 | FromDiscord | <Elegantbeef> Worth noting there is also `filterIt` |
01:07:26 | FromDiscord | <Haze System (they/them)> ive been spoiled by pointerless langs recently haha |
01:09:05 | FromDiscord | <Elegantbeef> spoiled |
01:09:58 | FromDiscord | <Haze System (they/them)> x'D |
01:11:34 | FromDiscord | <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:16 | FromDiscord | <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:57 | FromDiscord | <Saint> How do I import a npm library into nim? |
01:36:02 | FromDiscord | <Saint> JS library |
01:36:58 | FromDiscord | <Saint> Is there an easy way to do |
01:43:26 | FromDiscord | <Elegantbeef> https://github.com/juancarlospaco/nodejs refer to this |
02:40:14 | * | arkurious quit (Quit: Leaving) |
03:11:43 | FromDiscord | <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:11 | FromDiscord | <ranok (Jacob Torrey)> I see that parseInt and parseBiggestInt is defined in both of those, but with a different signature |
03:13:19 | FromDiscord | <Elegantbeef> What version of Nim? |
03:13:33 | FromDiscord | <ranok (Jacob Torrey)> 1.6.10 |
03:13:51 | FromDiscord | <Elegantbeef> Wait you said `include` |
03:13:54 | FromDiscord | <ranok (Jacob Torrey)> ok, if I import the std it works, if I include it I get the issues |
03:13:57 | FromDiscord | <Elegantbeef> You best not be using `include` |
03:14:02 | FromDiscord | <Elegantbeef> Yea you do not include modules |
03:14:27 | FromDiscord | <Elegantbeef> Including copies them in place and since they're runtime library procedures that duplicates symbols in the C compiler |
03:14:56 | FromDiscord | <ranok (Jacob Torrey)> ok, that was a quick fix to a dumb mistake |
03:14:57 | FromDiscord | <ranok (Jacob Torrey)> thanks |
03:15:46 | FromDiscord | <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:11 | FromDiscord | <ranok (Jacob Torrey)> 👍️ |
03:16:19 | FromDiscord | <ranok (Jacob Torrey)> I am new to Nim, but loving it |
03:17:31 | FromDiscord | <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:04 | FromDiscord | <Elegantbeef> So if you ever ask for help do post it to nim playground or just use a proper matrix client 😛 |
03:21:46 | FromDiscord | <ranok (Jacob Torrey)> will do! |
03:33:12 | FromDiscord | <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:15 | FromDiscord | <Elegantbeef> Nim2.0 or something |
03:38:04 | FromDiscord | <ringabout> https://github.com/nim-lang/Nim/pull/21433 |
03:38:23 | FromDiscord | <Elegantbeef> No i was responding to the switch |
03:38:26 | FromDiscord | <ringabout> Yeah, this issue https://github.com/nim-lang/Nim/issues/7375 |
03:38:32 | FromDiscord | <Elegantbeef> This is nim2.0, it breaks stuff |
03:39:23 | FromDiscord | <ringabout> Yeah, I can add `laxMacrosTypes` or `nimPreviewStritcQuote` for this case. |
03:39:39 | FromDiscord | <Elegantbeef> My point is why... |
03:40:13 | FromDiscord | <Elegantbeef> Yes code is broken due to this change, that code should be fixed, especially when it's stupid wrong |
03:40:41 | FromDiscord | <Elegantbeef> Especially when you can have two competing macros with two different views of `quote` |
03:41:11 | FromDiscord | <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:49 | FromDiscord | <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:00 | FromDiscord | <Elegantbeef> No clue |
03:43:09 | FromDiscord | <Elegantbeef> This is a breaking change that cannot have a flag afaict |
03:43:34 | FromDiscord | <Elegantbeef> I guess unless people then fork their code with the flag |
03:43:52 | FromDiscord | <ringabout> (edit) "agrere." => "agree." |
03:44:00 | FromDiscord | <ringabout> I see |
03:44:50 | FromDiscord | <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:39 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4pkF |
03:46:21 | FromDiscord | <Elegantbeef> It's a macro error |
03:46:40 | FromDiscord | <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:07 | NimEventer | New thread by noah: Asyncfutures: addCallback not calling callback , see https://forum.nim-lang.org/t/9946 |
03:47:14 | FromDiscord | <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:31 | FromDiscord | <Elegantbeef> It's attempting to index a symbol |
03:47:58 | FromDiscord | <Elegantbeef> https://github.com/treeform/shady/blob/master/src/shady.nim#L618 |
03:48:19 | FromDiscord | <ringabout> It can be aweful for macros-heavy code. https://media.discordapp.net/attachments/371759389889003532/1079610907694469182/image.png |
03:48:46 | FromDiscord | <sOkam!> https://github.com/treeform/shady/blob/42cf4589eb9861f013477245c529ddf39455f767/src/shady/demo.nim#L109-L119 |
03:48:53 | FromDiscord | <Elegantbeef> Yea I do not know what to say ringabout |
03:48:59 | FromDiscord | <Elegantbeef> It's a shitty spot to be |
03:49:12 | FromDiscord | <ringabout> And the classic arrays of int16 type https://media.discordapp.net/attachments/371759389889003532/1079611126846861455/image.png |
03:49:37 | FromDiscord | <ringabout> I have fixes for these packages fortunately, the cause is simple. |
03:49:43 | FromDiscord | <Elegantbeef> I'd say this is the issue with not having a spec |
03:50:08 | FromDiscord | <Elegantbeef> All this code is incorrect, but it's also works.... just a bad spot to be in |
03:50:35 | FromDiscord | <ringabout> Yeah |
03:51:26 | FromDiscord | <Elegantbeef> Does it work sokam if you move basicVert to toplevel? |
03:51:40 | FromDiscord | <sOkam!> its toplevel |
03:51:46 | FromDiscord | <Elegantbeef> No it's not |
03:51:51 | FromDiscord | <sOkam!> in my file i mean |
03:52:03 | FromDiscord | <Elegantbeef> Oh wait that's not your code 😄 |
03:52:26 | FromDiscord | <Elegantbeef> The only thing i can really suggest is to put a `echo param.repr` before the index |
03:52:32 | FromDiscord | <sOkam!> i assume im missing something and its crashing it, but just cant figure out what |
03:52:34 | FromDiscord | <Elegantbeef> To see which field it's indexing at |
03:52:54 | FromDiscord | <sOkam!> because im moving the code around to understand it |
03:52:59 | FromDiscord | <Elegantbeef> Well even if you're missing something macros shouldnt error like this |
03:53:20 | FromDiscord | <sOkam!> im trying to compile the demo, in case the issue is with the demo or something |
03:54:02 | FromDiscord | <Elegantbeef> Double check the version of shady you have installed aswell |
03:54:10 | FromDiscord | <sOkam!> 0.1.3 |
03:54:33 | FromDiscord | <sOkam!> is there a way to update all installed packages? |
03:54:45 | FromDiscord | <Elegantbeef> He's got commits recently, that might not be updated 😄 |
03:54:49 | FromDiscord | <Elegantbeef> Nope |
03:55:22 | FromDiscord | <Elegantbeef> I do not recall how nimble works, but I think it correctly finds the first commit with a version |
03:56:52 | FromDiscord | <Elegantbeef> you can try `nimble install shady@#head` |
03:59:43 | FromDiscord | <sOkam!> i think its just missing something, but crashing the macro instead for whatever reason |
04:00:22 | FromDiscord | <Elegantbeef> That doesnt make any sense |
04:00:37 | FromDiscord | <Elegantbeef> It's indexing a symbol node, attempting to get a strvalue from it |
04:02:22 | FromDiscord | <ranok (Jacob Torrey)> Another dumb Q, how do you set the output filename for a task in a .nimble file? |
04:02:36 | FromDiscord | <ranok (Jacob Torrey)> I tried adding \`--out\:"filename" |
04:02:39 | FromDiscord | <Elegantbeef> You do not inside a nimble |
04:02:46 | FromDiscord | <Elegantbeef> you make a `config.nims` |
04:02:55 | FromDiscord | <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:16 | FromDiscord | <Elegantbeef> That means the macro is getting caught on something |
04:06:08 | FromDiscord | <Elegantbeef> Checking the ast before it errors would do well in finding the cause |
04:06:35 | FromDiscord | <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:44 | FromDiscord | <sOkam!> so its definitely getting stuck in something |
04:07:14 | FromDiscord | <Elegantbeef> Hey it's your time to learn macros! |
04:07:49 | FromDiscord | <sOkam!> found it |
04:09:06 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4pkJ |
04:09:20 | FromDiscord | <Elegantbeef> Lol |
04:09:24 | FromDiscord | <Elegantbeef> Told you the macro is the fault |
04:09:26 | FromDiscord | <sOkam!> seems like treeform doesn't like my non-standard formatting |
04:09:36 | FromDiscord | <Elegantbeef> No the AST doesnt care |
04:09:40 | FromDiscord | <Elegantbeef> It's the `: void` |
04:09:46 | FromDiscord | <sOkam!> oh |
04:10:05 | FromDiscord | <Elegantbeef> It needs to either ensure the result is void or skip the first node |
04:10:13 | FromDiscord | <Elegantbeef> there is no `[0]` for the return value |
04:10:38 | FromDiscord | <sOkam!> ic |
04:10:59 | FromDiscord | <sOkam!> yep, if i add void it breaks |
04:11:10 | FromDiscord | <sOkam!> well, good to know 🤷♂️ |
04:11:20 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4pkK |
04:11:35 | FromDiscord | <Elegantbeef> Or just `for param in n[1..^1]` |
04:16:06 | FromDiscord | <Elegantbeef> Really the macro should error if you have any return type other than void or an empty node |
04:17:48 | FromDiscord | <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:01 | FromDiscord | <ringabout> Seems so. I would disallow void as well, which might be removed in 2.x according to the Roadmap. |
04:18:42 | FromDiscord | <Elegantbeef> Well for this specific case yea, there is no main procedure in glsl that returns a type |
04:18:43 | FromDiscord | <sOkam!> void will be removed? |
04:19:04 | FromDiscord | <Elegantbeef> Well internally |
04:19:07 | FromDiscord | <Elegantbeef> Not externally afaik |
04:19:22 | FromDiscord | <ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4pkL |
04:19:30 | FromDiscord | <Elegantbeef> Void is still needed for "no type" though that can be done in otherways |
04:19:30 | FromDiscord | <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:57 | FromDiscord | <Elegantbeef> I mean there is no alternative to having some `void` |
04:20:06 | FromDiscord | <Elegantbeef> `type NotVoid = distinct void` should always work |
04:21:11 | FromDiscord | <sOkam!> is it considered incorrect code to type the void return explicitely? |
04:21:43 | FromDiscord | <Rika> i dont think it should ever be incorrect to do so |
04:22:26 | FromDiscord | <Elegantbeef> It's not idiomatic 😄 |
04:24:31 | FromDiscord | <ringabout> I remembered I saw it is useful for generics, like Thread[void], but I forgot where I saw that. |
04:24:36 | FromDiscord | <ringabout> (edit) "remembered" => "remember" |
04:25:04 | FromDiscord | <Elegantbeef> Yea think that was in an RFC or issue about it |
04:25:55 | FromDiscord | <Elegantbeef> Might've been a PR |
04:26:17 | FromDiscord | <ringabout> 2.0 RFC => https://github.com/nim-lang/RFCs/issues/437 |
04:26:33 | FromDiscord | <ringabout> this↵> No, for the return type and discard-checking there would still be a void. |
04:26:54 | FromDiscord | <Elegantbeef> Yea the void comment in the milestone is wrong |
04:27:03 | FromDiscord | <Elegantbeef> It just wants to optimise and remove the issue with void |
04:30:28 | FromDiscord | <sOkam!> ✍️ |
04:47:17 | FromDiscord | <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:51 | FromDiscord | <Elegantbeef> Of course only if you use nimscript |
04:47:56 | FromDiscord | <Elegantbeef> Macros do not run at runtime |
04:48:38 | FromDiscord | <sOkam!> what i meant is if the lib has support for passing text and converting without macro, or if its macro mandatory |
04:49:20 | FromDiscord | <Elegantbeef> It operates on the AST so of course it cannot convert without a macro |
04:49:20 | FromDiscord | <Elegantbeef> Treeform obviously didnt implement a new compiler for shaders 😄 |
04:49:39 | FromDiscord | <sOkam!> ic |
04:51:01 | FromDiscord | <sOkam!> how would this be done with nimscripter? |
04:52:07 | FromDiscord | <Elegantbeef> https://github.com/beef331/nimscripter/blob/master/examples/macrorepl/macrorepl.nim best reference |
04:52:55 | FromDiscord | <sOkam!> all of it, or is any part of the 200lines more remarkable? |
04:53:23 | FromDiscord | <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:34 | FromDiscord | <Elegantbeef> I mean this side isnt macro related |
04:54:43 | FromDiscord | <sOkam!> probl is i don't understand 1% of these modules |
04:54:58 | FromDiscord | <sOkam!> so i'm having a hard time knowing what the file is even doing |
04:56:06 | FromDiscord | <Elegantbeef> All i can say is it powers this https://streamable.com/c6farb |
04:56:11 | FromDiscord | <Elegantbeef> I'm not going to go line by line to explain what it's' doing |
04:57:10 | FromDiscord | <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:16 | FromDiscord | <ringabout> (edit) "Pretty," => "Pretty cool," |
04:57:19 | FromDiscord | <sOkam!> i don't mean line by line, but something like `go to line blablabla, this is impossible to do without nimscripter` |
04:57:34 | FromDiscord | <Elegantbeef> Nothing is impossible without nimscripter |
04:57:40 | FromDiscord | <sOkam!> that way i can backtrack at least from somewhere |
04:57:44 | FromDiscord | <Elegantbeef> Nimscripter only wraps the compieler API |
04:57:49 | FromDiscord | <Elegantbeef> compiler\ |
04:57:57 | FromDiscord | <sOkam!> please don't miss the point, that's not what i meant |
04:58:22 | FromDiscord | <Elegantbeef> Ask real questions and i'll happily answer |
04:59:49 | FromDiscord | <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:07 | FromDiscord | <Elegantbeef> I do not follow |
05:00:13 | FromDiscord | <sOkam!> because right now its 200 lines of code i have no reference at all. like at all |
05:00:25 | FromDiscord | <Elegantbeef> You want to run Nim code in a VM so you can get your shaders |
05:00:32 | FromDiscord | <Elegantbeef> That's not possible without the NimVm |
05:00:36 | FromDiscord | <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:54 | FromDiscord | <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:56 | FromDiscord | <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:21 | FromDiscord | <Elegantbeef> It's 200loc a vast majority is unrelated to the actual interop |
05:02:28 | FromDiscord | <Elegantbeef> Line 162 onwards is all that is nimscript related |
05:02:33 | FromDiscord | <sOkam!> kk ty |
05:02:36 | FromDiscord | <sOkam!> 🙏 |
05:05:30 | FromDiscord | <sOkam!> whats `macrosport`? |
05:06:08 | FromDiscord | <Elegantbeef> The name of the nimscript 'module' we're adding declarations to |
05:06:23 | FromDiscord | <sOkam!> module as in a file? |
05:06:29 | FromDiscord | <Elegantbeef> No |
05:06:47 | FromDiscord | <sOkam!> oh you create a module with code? 🤔 |
05:06:54 | FromDiscord | <sOkam!> i didn't know that was even poss |
05:06:59 | FromDiscord | <Elegantbeef> As in a collection of procedures/types/templates that we're accruing to add with `implNimscriptModule` |
05:07:07 | FromDiscord | <sOkam!> i see |
05:07:11 | FromDiscord | <Elegantbeef> I mean this is nimscript interop it loads a file |
05:07:20 | FromDiscord | <Elegantbeef> The file it loads is created by us |
05:08:48 | FromDiscord | <sOkam!> right, but is this not creating the file from existing code? |
05:09:14 | FromDiscord | <sOkam!> if im following correctly, the ast already exists, but this is exporting it into the vm |
05:09:25 | FromDiscord | <Elegantbeef> No |
05:09:41 | FromDiscord | <Elegantbeef> Exporto exposes Nim code to the VM |
05:09:57 | FromDiscord | <Elegantbeef> That is just creating a string that is appended to the file before our actual file |
05:10:49 | FromDiscord | <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:12 | FromDiscord | <Elegantbeef> Likely |
05:11:31 | FromDiscord | <Elegantbeef> Though you still need to pass the string to Nim |
05:12:34 | FromDiscord | <sOkam!> whats the function that takes the `readfile` string and passes it to the vm? |
05:12:58 | FromDiscord | <Elegantbeef> There isnt one you'd need to write it |
05:13:44 | FromDiscord | <sOkam!> but weren't you saying that this code is passing a string to the vm? |
05:13:49 | FromDiscord | <sOkam!> that's what i understood |
05:14:10 | FromDiscord | <Elegantbeef> Nope |
05:14:25 | FromDiscord | <Elegantbeef> This code appends all the exported symbols to a file that is then loaded from loadScript |
05:14:53 | FromDiscord | <Gumbercules> sent a code paste, see https://play.nim-lang.org/#ix=4pkP |
05:15:19 | FromDiscord | <Gumbercules> `if ((x = +x, x != x) || (y = +y, y != y)) return false;` |
05:15:31 | FromDiscord | <sOkam!> In reply to @Elegantbeef "This code appends all": this sentence is confusing |
05:15:32 | FromDiscord | <Gumbercules> is confusing me - isn't `x = +x` an assignment? |
05:16:14 | FromDiscord | <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:38 | FromDiscord | <Elegantbeef> You need to write code that gets the string back from the vm |
05:16:44 | FromDiscord | <Elegantbeef> You want to call `toGlsl` on a procedure |
05:16:54 | FromDiscord | <Elegantbeef> That means you need to have some procedure exposed to the VM to pass it back to Nim |
05:17:28 | FromDiscord | <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:44 | FromDiscord | <Elegantbeef> You do not need to get the data there |
05:17:52 | FromDiscord | <Elegantbeef> If it's a proper nim file you can just load that string |
05:18:30 | FromDiscord | <sOkam!> i thought you said that the string cannot be managed and needs to be created 😭 man i hate english |
05:18:50 | FromDiscord | <sOkam!> (edit) "cannot be managed" => "function doesn't exist," |
05:18:51 | FromDiscord | <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:43 | FromDiscord | <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:50 | FromDiscord | <sOkam!> that's when i started getting confused af |
05:19:59 | FromDiscord | <Elegantbeef> There isnt one |
05:20:15 | FromDiscord | <Elegantbeef> You can call the VM procedure and pass a string to it |
05:20:16 | FromDiscord | <Elegantbeef> But that's not required here |
05:20:32 | FromDiscord | <Elegantbeef> Ostensibly you just open an interpreter per shader |
05:20:35 | FromDiscord | <sOkam!> how does the file exist, if its not a string then? |
05:20:57 | FromDiscord | <Elegantbeef> On your drive |
05:21:06 | FromDiscord | <sOkam!> `var shader = readfile(myvert.nim)` |
05:21:13 | FromDiscord | <sOkam!> i was just thinking of that |
05:21:33 | FromDiscord | <sOkam!> if there is another way that nimscripter expects... i'm not quite getting it, and that's the confusion probably |
05:22:58 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/UsC |
05:28:11 | FromDiscord | <sOkam!> is the explanation of how to run the vm itself in the readme? |
05:28:41 | FromDiscord | <Elegantbeef> It is |
05:28:50 | FromDiscord | <Elegantbeef> First example shows it |
05:29:06 | FromDiscord | <Elegantbeef> Whoops in your case it'd be `NimScriptPath` |
05:29:33 | FromDiscord | <ringabout> > In Swift, Void is an typealias for an empty tuple, ().↵Sounds like a easy task. |
05:30:41 | FromDiscord | <sOkam!> sent a code paste, see https://paste.rs/zew |
05:30:54 | FromDiscord | <Elegantbeef> One loads from string, one loads from file |
05:31:19 | FromDiscord | <Elegantbeef> That parses the code and runs all top level statements |
05:31:23 | FromDiscord | <Elegantbeef> So... that's how you run a VM |
05:31:55 | FromDiscord | <sOkam!> so i actually don't run the shader file, i read it and parse the data with some string-code? |
05:32:09 | FromDiscord | <Elegantbeef> Yes you run the shader file |
05:32:16 | FromDiscord | <Elegantbeef> you need the ast and to return the generated code |
05:32:34 | FromDiscord | <Elegantbeef> `loadScript` is akin to `nim e` |
05:33:03 | FromDiscord | <sOkam!> but i don't want to run the shader file, just read it and parse it into glsl |
05:33:16 | FromDiscord | <Elegantbeef> You need to compile it |
05:34:06 | FromDiscord | <sOkam!> so the output of loadscript is what is then passed to the toglsl macro? |
05:34:12 | FromDiscord | <Elegantbeef> No |
05:34:17 | FromDiscord | <Elegantbeef> The file you load calls `toGlsl` |
05:34:34 | FromDiscord | <sOkam!> why? |
05:34:42 | FromDiscord | <sOkam!> its just meant to be a shader |
05:34:47 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4pkU |
05:34:58 | FromDiscord | <Elegantbeef> Cause you need to get that string back to Nim somehow |
05:35:13 | FromDiscord | <sOkam!> that's what I thought you were explaining how to do with the importing |
05:37:01 | FromDiscord | <sOkam!> so the file would also need to import shady and everything? |
05:37:20 | FromDiscord | <Elegantbeef> You could use the `modules` optional parameter to make it not |
05:47:41 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4pkV |
05:48:02 | FromDiscord | <Elegantbeef> `NimScriptPath` though |
05:48:32 | FromDiscord | <sOkam!> where do you add the optional modules? |
05:48:52 | FromDiscord | <Elegantbeef> and also you can do `modules = ["shady", "vmath"]` assuming you do `searchPaths = [vmathPathHere, shadyPathHere, ...]` |
05:48:56 | FromDiscord | <Elegantbeef> https://github.com/beef331/nimscripter/blob/master/src/nimscripter.nim#L55 |
05:50:02 | FromDiscord | <sOkam!> why the searchpaths? |
05:50:13 | FromDiscord | <sOkam!> are those not resolved to `pkg/`where needed? |
05:50:37 | FromDiscord | <Elegantbeef> Nope this is meant to be portable |
05:50:40 | FromDiscord | <Elegantbeef> There is no concept of pkg |
05:51:15 | FromDiscord | <sOkam!> pkg is not portable? why? |
05:51:20 | FromDiscord | <sOkam!> i've been using it everywhere |
05:51:27 | FromDiscord | <sOkam!> as in everywhere in my code |
05:51:30 | FromDiscord | <Elegantbeef> Not portable for nimscript |
05:51:35 | FromDiscord | <Elegantbeef> Since there is not nimble |
05:51:39 | FromDiscord | <sOkam!> if Its nor portable, i would need to change my whole codebase |
05:52:33 | FromDiscord | <sOkam!> how do you find the vmath/shady paths at runtime then |
05:53:53 | FromDiscord | <Elegantbeef> Include them in your custom stdlib |
05:54:46 | FromDiscord | <Elegantbeef> Shipping a nimscript project requires having your own stdlib and including your custom modules |
05:56:03 | FromDiscord | <sOkam!> i think im leaving nim shaders for compile time, and rutime literal glsl. honestly |
05:58:23 | * | advesperacit joined #nim |
05:59:01 | FromDiscord | <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:57 | FromDiscord | <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:53 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4plI |
09:56:13 | FromDiscord | <4zv4l> I don't have access to the `str_decode` unfortunately |
10:45:31 | FromDiscord | <luteva> Hi! Is there an excel (xlsx) library that is able to read (and maybe write) the formulars in an excel file? |
10:46:17 | NimEventer | New thread by matkuki: Mixed C / Cpp project structure?, see https://forum.nim-lang.org/t/9948 |
10:58:10 | * | junaid_ joined #nim |
11:00:01 | FromDiscord | <4zv4l> is there a widechar to string in Nim ? |
11:01:01 | FromDiscord | <4zv4l> https://nim-lang.org/docs/widestrs.html#%24%2CWideCString |
11:01:02 | FromDiscord | <4zv4l> found it |
11:29:00 | * | junaid_ quit (Remote host closed the connection) |
12:07:09 | NimEventer | New question by Joshua Fenner: Sign up for the Nim forum, see https://stackoverflow.com/questions/75580298/sign-up-for-the-nim-forum |
13:01:12 | FromDiscord | <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:35 | FromDiscord | <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:12 | FromDiscord | <virdisn> Now I am puzzled nimlsp is sunig nimsuggest which is said to be part of the core. |
13:15:37 | FromDiscord | <luteva> sent a long message, see http://ix.io/4pmB |
13:16:02 | FromDiscord | <virdisn> Evaluate ? Then you need to redo all the VBA work. |
13:16:05 | FromDiscord | <virdisn> Maybe simple formulars. |
13:17:08 | FromDiscord | <luteva> yes that yould be possible: calculate the SUM, etc, =WHEN .... etc. |
14:40:56 | FromDiscord | <4zv4l> anyway I can handle an action to do if my program is killed in anyway ? |
14:41:23 | FromDiscord | <4zv4l> like I my program must kill another process if it is stopped or killed |
14:41:39 | FromDiscord | <4zv4l> since my program end with an infinite loop↵can only be stopped with a signal I guess |
14:41:46 | FromDiscord | <4zv4l> it's on Windows |
14:41:54 | FromDiscord | <4zv4l> (edit) removed "I" |
14:54:22 | NimEventer | New 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:25 | FromDiscord | <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:03 | FromDiscord | <auxym> https://nim-lang.org/docs/system.html#setControlCHook%2Cproc%29 |
15:45:25 | FromDiscord | <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:32 | FromDiscord | <enthus1ast> for windows service you can simply use NSSM https://nssm.cc/ |
15:49:15 | FromDiscord | <4zv4l> it's a windows console program 🥺 |
15:49:30 | FromDiscord | <enthus1ast> does not matter |
15:50:01 | FromDiscord | <enthus1ast> i mean if it is some kind of service |
15:50:08 | FromDiscord | <enthus1ast> and not something the user must interact with |
15:50:51 | FromDiscord | <4zv4l> the thing is my program start another program that protect the clipboard |
15:51:02 | FromDiscord | <4zv4l> but if my program is killed using ctrl-c or the taskmanager |
15:51:04 | FromDiscord | <4zv4l> the protection is gone |
15:51:09 | FromDiscord | <4zv4l> and users can copy paste anything |
15:51:11 | FromDiscord | <4zv4l> which is terrible |
15:51:25 | FromDiscord | <enthus1ast> this sounds .... weird |
15:51:26 | * | arkurious joined #nim |
15:51:27 | FromDiscord | <enthus1ast> \:) |
15:51:43 | FromDiscord | <enthus1ast> i would hate you if you block my copy paste \:P |
15:51:46 | FromDiscord | <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:00 | FromDiscord | <4zv4l> In reply to @enthus1ast "i would hate you": thats to prevent them copy paste sensitive data from a server |
15:52:15 | FromDiscord | <4zv4l> and also copy malware to the server |
15:53:35 | FromDiscord | <enthus1ast> to be honest, this does not sound like a good idea |
15:53:50 | FromDiscord | <enthus1ast> so if i see it, i can make screenshots, if i can type, i can autotype |
15:54:16 | FromDiscord | <enthus1ast> screenshots -\> ocr -\> secret as text↵autotype -\> malware as base64 -\> infected |
15:54:50 | FromDiscord | <enthus1ast> how do you connect to the server? |
15:54:53 | FromDiscord | <enthus1ast> via rdp? |
15:55:21 | FromDiscord | <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:32 | FromDiscord | <4zv4l> yeah but the users still need to copy some stuff |
15:55:45 | FromDiscord | <4zv4l> so we use regex |
15:55:55 | FromDiscord | <4zv4l> In reply to @enthus1ast "so if i see": you cannot retrieve the screenshot |
15:56:10 | FromDiscord | <enthus1ast> but i can screenshot the remote session |
15:56:20 | FromDiscord | <4zv4l> indeed, then ? |
15:56:35 | FromDiscord | <enthus1ast> then i do ocr on it and have the secrets |
15:56:39 | FromDiscord | <enthus1ast> as text |
15:57:04 | FromDiscord | <enthus1ast> or i can print it |
15:57:13 | FromDiscord | <enthus1ast> or 10\_000 other options really \:) |
15:57:15 | FromDiscord | <4zv4l> I think the screenshot is blocked, that's a restricted computer to connect via rdp |
15:57:26 | FromDiscord | <4zv4l> In reply to @enthus1ast "or 10\_000 other options": well you could type it manually |
15:57:50 | FromDiscord | <4zv4l> but still↵the purpose is to make them loose time if they wanna do that↵it's really well monitored |
15:57:56 | FromDiscord | <enthus1ast> i think the proper way of doing this, is to write a view, where the user does not see the secrets |
15:58:09 | FromDiscord | <enthus1ast> ok |
15:58:12 | FromDiscord | <4zv4l> they interact with Excel on a rdp session |
15:58:17 | FromDiscord | <4zv4l> they have to see it |
15:58:45 | * | arkurious quit (Ping timeout: 268 seconds) |
15:58:48 | FromDiscord | <4zv4l> I mean obviously at some point anything is possible↵he could type anything by hand yeah |
15:59:02 | FromDiscord | <enthus1ast> or make a photo with the mobile phone |
15:59:07 | FromDiscord | <4zv4l> not allowed |
15:59:36 | FromDiscord | <enthus1ast> its a strange company where you work \:P |
16:00:04 | FromDiscord | <enthus1ast> so they MUST see the secrets? |
16:00:36 | FromDiscord | <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:43 | FromDiscord | <4zv4l> I just texted my manager about that |
16:02:07 | FromDiscord | <enthus1ast> can they not just see a representation of the secret? |
16:02:08 | FromDiscord | <enthus1ast> or they can autotype a malware as base64 (or excel macro, or powershell, or vbscript) |
16:02:08 | FromDiscord | <enthus1ast> or visit a webpage (if allowed) ↵or do dns exfiltration |
16:02:09 | FromDiscord | <enthus1ast> or do ping exfiltration |
16:02:11 | FromDiscord | <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:22 | FromDiscord | <4zv4l> In reply to @enthus1ast "or they can autotype": would be long no ? |
16:02:27 | FromDiscord | <4zv4l> In reply to @enthus1ast "or visit a webpage": no internet access |
16:02:40 | FromDiscord | <4zv4l> the server is |
16:02:42 | FromDiscord | <4zv4l> how to say |
16:02:48 | FromDiscord | <4zv4l> isolé |
16:02:51 | FromDiscord | <4zv4l> isolated ? |
16:03:11 | FromDiscord | <4zv4l> they access to it using those private cable on the ground |
16:03:16 | FromDiscord | <4zv4l> to not go through the internet |
16:03:32 | FromDiscord | <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:55 | FromDiscord | <enthus1ast> on the server, can you do a nslookup of a server? |
16:04:04 | FromDiscord | <enthus1ast> or can you ping a server (no answer needet) |
16:04:18 | FromDiscord | <enthus1ast> in dns, and also in icmp you can put data |
16:04:27 | FromDiscord | <4zv4l> I never touched those server |
16:04:30 | NimEventer | New thread by moigagoo: Nimble package submission process broken?, see https://forum.nim-lang.org/t/9950 |
16:04:31 | FromDiscord | <4zv4l> it's really restricted again |
16:04:32 | FromDiscord | <enthus1ast> and i think for both there are living of the land techniques |
16:04:54 | FromDiscord | <enthus1ast> also for rdp, there is printer forwarding |
16:05:19 | FromDiscord | <enthus1ast> so you'r local printer is forwarded to the rdp session (with default settings though) |
16:05:28 | FromDiscord | <enthus1ast> so they might can just print something on their local printer |
16:05:36 | FromDiscord | <4zv4l> I think they putted lot of gpo to block as much as possible what could go wrong |
16:06:16 | FromDiscord | <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:30 | FromDiscord | <4zv4l> but indeed I'll tell those to my manager |
16:06:35 | FromDiscord | <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:16 | FromDiscord | <enthus1ast> big hoops i mean, (my english....) |
16:08:00 | FromDiscord | <4zv4l> well, I'll talk about it to my manager |
16:08:04 | * | lain quit (Ping timeout: 246 seconds) |
16:08:16 | FromDiscord | <4zv4l> I still have to finish that program as useless as it is |
16:08:31 | FromDiscord | <enthus1ast> nah, its not useless, you learned a lot i hope \:) |
16:08:33 | FromDiscord | <4zv4l> (edit) "is" => "could be" |
16:08:38 | FromDiscord | <4zv4l> yeah I did |
16:08:44 | FromDiscord | <4zv4l> made me enjoy Nim more and more |
16:08:49 | * | lain joined #nim |
16:08:57 | FromDiscord | <4zv4l> still have to figure out how to kill that damn program when mine get killed |
16:09:12 | FromDiscord | <4zv4l> why doesn't windows follow the signals |
16:09:33 | FromDiscord | <4zv4l> I tried `addExitProc` also |
16:09:41 | FromDiscord | <enthus1ast> you could, let the other proc monitor its parent |
16:09:50 | FromDiscord | <enthus1ast> the other process i mean |
16:09:56 | FromDiscord | <enthus1ast> and when its gone, quit |
16:10:08 | FromDiscord | <4zv4l> add a loop that check for its parent ? |
16:10:31 | FromDiscord | <4zv4l> isn't there a way to create a child that automatically die when the parent dies ? |
16:10:37 | FromDiscord | <enthus1ast> no idea |
16:11:47 | * | arkurious joined #nim |
16:16:09 | FromDiscord | <4zv4l> lmao what https://media.discordapp.net/attachments/371759389889003532/1079799104445616258/image.png |
16:17:00 | FromDiscord | <Phil> Free programming support! Quick, call them! |
16:17:38 | FromDiscord | <Nerve> rofl yeah, calling and describing your problem might lead to gold, but I don't actually recommend it |
16:19:39 | FromDiscord | <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:54 | FromDiscord | <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:55 | FromDiscord | <enthus1ast> https://stackoverflow.com/questions/872364/win32-get-message-notification-of-other-applications-close-exit |
16:20:37 | FromDiscord | <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:56 | FromDiscord | <Phil> God I love when I look for a more beautiful way to express something and nim just flipping has it |
17:00:00 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4pnZ |
17:00:06 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=4pnZ" => "https://play.nim-lang.org/#ix=4po0" |
17:01:42 | FromDiscord | <Rika> lol |
17:15:41 | FromDiscord | <4zv4l> In reply to @enthus1ast "one thing that might": I found a way |
17:15:49 | FromDiscord | <4zv4l> making a Job Object and attaching the child process to it |
17:16:04 | FromDiscord | <4zv4l> when there is no handler attached to the Job↵it gets killed |
17:21:23 | FromDiscord | <ezquerra> I'm surprised there is no version of isLowerAscii / isUpperAscii for strings in _strutils_. There are only versions for chars |
17:23:20 | FromDiscord | <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:29 | FromDiscord | <pruno> sent a code paste, see https://play.nim-lang.org/#ix=4pob |
17:41:18 | * | rockcavera joined #nim |
17:47:09 | FromDiscord | <4zv4l> is there a way to export the Nim doc to a `Git Wiki` format ? so markdown I would say ? |
17:50:46 | FromDiscord | <sOkam!> Is there something like staticRead but for writing? |
17:52:13 | FromDiscord | <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:23 | FromDiscord | <pruno> In reply to @sOkam! "if applicable to your": Could be applicable, how do you do that ? |
17:56:53 | FromDiscord | <Phil> Norm is nim 2.0 ready folks, you heard it here first |
17:56:57 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4poj |
17:57:24 | FromDiscord | <Phil> PR is merged, now only a new norm version needs to come out |
17:57:46 | FromDiscord | <sOkam!> (edit) "https://play.nim-lang.org/#ix=4poj" => "https://play.nim-lang.org/#ix=4pok" |
17:58:28 | FromDiscord | <sOkam!> (edit) "https://play.nim-lang.org/#ix=4pok" => "https://play.nim-lang.org/#ix=4pol" |
17:59:57 | FromDiscord | <pruno> In reply to @sOkam! "<@85058614229729280> This is the": Will try that, thanks |
18:26:53 | FromDiscord | <sigmasd> j-james\: Hello I tried your nim queires in nvim, and for some reason they fails with invalid node type |
18:27:28 | FromDiscord | <sigmasd> even just `[ "mixin" ] @keyword` fails |
18:27:55 | FromDiscord | <j-james> likely because they're entirely untested |
18:28:34 | FromDiscord | <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:03 | FromDiscord | <sigmasd> its cool thanks for your work, hopefully the parser gets some love too xD |
18:29:10 | FromDiscord | <j-james> haha, thanks |
18:29:30 | FromDiscord | <j-james> if you do figure out why they're not working, let me know! |
18:29:42 | FromDiscord | <sigmasd> sure |
18:30:22 | FromDiscord | <sigmasd> is this valid tree sitter query [ "mixin" ] @keyword |
18:30:55 | FromDiscord | <j-james> i think it should be |
18:30:55 | FromDiscord | <sigmasd> the nvim pr uses the parser kew variable so (kew) @keyword |
18:31:09 | FromDiscord | <j-james> hmm interesting |
18:31:11 | FromDiscord | <sigmasd> weird maybe nvim has an issue then |
18:31:39 | FromDiscord | <j-james> all i know about queries comes from the working queries for other languages |
18:31:45 | FromDiscord | <j-james> it's probably an issue in my query |
18:32:54 | FromDiscord | <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:00 | FromDiscord | <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:24 | FromDiscord | <Phil> But that is on a server that consists of a potato cpu so eh |
18:34:48 | FromDiscord | <Phil> (edit) "But that is on a server that consists of a potato cpu ... so" added "with a single thread" |
18:35:42 | FromDiscord | <Hourglass [She/Her]> Nvm it's fine, just defines stuff in the thread locally? |
18:35:45 | FromDiscord | <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:46 | FromDiscord | <Hourglass [She/Her]> I think that's the correct term |
18:36:06 | FromDiscord | <Hourglass [She/Her]> In reply to @Isofruit "But that is on": Fair |
18:36:11 | * | arkurious quit (Ping timeout: 264 seconds) |
18:36:18 | FromDiscord | <Hourglass [She/Her]> In reply to @Isofruit "Personally I'd just have": Honestly I think that part may be fine? |
18:36:50 | FromDiscord | <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:13 | FromDiscord | <Phil> And it runs startup actions per thread it spins up |
18:38:09 | FromDiscord | <Hourglass [She/Her]> Aah fair |
18:40:00 | FromDiscord | <Hourglass [She/Her]> I may write my own anyway |
18:40:07 | FromDiscord | <Hourglass [She/Her]> Purely so I can customise it to be how I want |
18:40:32 | FromDiscord | <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:00 | FromDiscord | <Phil> Huh, for that one I set up prologue to write to a different file per thread |
18:42:24 | FromDiscord | <jtv> That works too |
18:43:01 | FromDiscord | <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:04 | FromDiscord | <sigmasd> sent a code paste, see https://paste.rs/KHl |
18:44:52 | FromDiscord | <Elegantbeef> `Option[T]` is a generic invocation and `Option(T)` would be wrong but is a type conversion |
18:45:01 | FromDiscord | <Elegantbeef> Also inside typedefs it's `a: Type` not `a = Type` |
18:45:31 | FromDiscord | <Phil> Also writing your own seems like a fair bit of pain to write |
18:47:54 | FromDiscord | <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:20 | FromDiscord | <sigmasd> so that should become a compiler error ? or it have its usecases |
18:50:33 | FromDiscord | <Elegantbeef> Nim devel it actually does something |
18:53:45 | * | jmdaemon joined #nim |
18:54:49 | FromDiscord | <sigmasd> sent a code paste, see https://play.nim-lang.org/#ix=4poy |
18:55:22 | FromDiscord | <sigmasd> sent a code paste, see https://paste.rs/Jpc |
18:55:55 | FromDiscord | <sigmasd> sent a code paste, see https://play.nim-lang.org/#ix=4poz |
18:56:59 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4poA |
18:57:24 | FromDiscord | <sigmasd> ah wait it fixed itself |
19:05:06 | FromDiscord | <sigmasd> Is there a recommend way to generate javascript import statements ? (import {a} from url) |
19:06:38 | NimEventer | New Nimble package! kraut - Router for Karax frontend framework., see https://github.com/moigagoo/kraut |
19:07:58 | FromDiscord | <Hourglass [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4poE |
19:09:48 | FromDiscord | <jtv> Well, are you providing a concrete type when instantiating it?? |
19:11:07 | FromDiscord | <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:32 | FromDiscord | <Hourglass [She/Her]> So I'll need to use `when R is int32`, as an example? |
19:12:25 | FromDiscord | <Hourglass [She/Her]> That got rid of the error so I think so |
19:13:30 | FromDiscord | <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:33 | FromDiscord | <Hourglass [She/Her]> Alright thanks! |
19:17:26 | FromDiscord | <sigmasd> I just used emit pragma, seems good enough |
19:20:08 | FromDiscord | <sigmasd> In this import pragam, I want to reference the same argument more then once , so #1 #1 |
19:20:25 | FromDiscord | <sigmasd> whats the correct syntax ? |
19:20:43 | FromDiscord | <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:54 | FromDiscord | <Phil> Here we go, norm 2.7.0 version just dropped! |
19:25:46 | FromDiscord | <sigmasd> sent a code paste, see https://play.nim-lang.org/#ix=4poJ |
19:26:04 | FromDiscord | <sigmasd> sent a code paste, see https://play.nim-lang.org/#ix=4poK |
19:27:18 | FromDiscord | <sigmasd> sent a code paste, see https://play.nim-lang.org/#ix=4poK |
19:29:42 | FromDiscord | <sigmasd> it transalte to this ! |
19:30:04 | FromDiscord | <sigmasd> but that nimCopy is not needed |
19:30:15 | FromDiscord | <sigmasd> and it doesn't even work anyway |
19:30:30 | FromDiscord | <sigmasd> can I just unsafe cast in the compiler or something to tell it to consider one type as another |
19:30:48 | FromDiscord | <sigmasd> cause thats all I need in this case |
19:32:23 | FromDiscord | <sigmasd> sent a code paste, see https://play.nim-lang.org/#ix=4poO |
19:34:52 | FromDiscord | <sigmasd> using cast[T] also creates a nimcopy |
19:51:59 | FromDiscord | <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:17 | FromDiscord | <Diogenes of Toronto> In reply to @NimEventer "New Nimble package! kraut": Very cool |
20:09:57 | FromDiscord | <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:28 | FromDiscord | <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:39 | FromDiscord | <Nerve> (edit) "am" => "Am" |
20:22:48 | * | junaid_ joined #nim |
20:23:56 | FromDiscord | <Hourglass [She/Her]> Uhoh, illegal storage access- |
20:24:18 | FromDiscord | <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:13 | FromDiscord | <Hourglass [She/Her]> I'm passing an `NbPlugin` (ref type), `AsyncSocket` (also a ref type), `int32`, `string`, `uint8` and an `int32` |
20:25:28 | FromDiscord | <Hourglass [She/Her]> It returns a `Future[bool]` and is an async method used via dynlib |
20:25:47 | FromDiscord | <Phil> Smells like nil-spirit |
20:27:07 | FromDiscord | <jmgomez> Are you passing (and treating as) refs around dll boundaries? |
20:27:30 | FromDiscord | <jmgomez> I will be surprise if that doesnt cause issues. You can try to use them as ptr though |
20:28:28 | FromDiscord | <Hourglass [She/Her]> In reply to @jmgomez "Are you passing (and": Yep I'm using refs |
20:28:45 | FromDiscord | <Hourglass [She/Her]> I'm using the `arc` memory management too if it has any impact |
20:29:59 | * | junaid___ joined #nim |
20:30:06 | FromDiscord | <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:38 | FromDiscord | <Hourglass [She/Her]> Aha wait I got a different error now |
20:31:46 | FromDiscord | <Hourglass [She/Her]> Before the function signatures didn't match |
20:31:51 | * | junaid__2 joined #nim |
20:32:25 | FromDiscord | <Hourglass [She/Her]> Now I'm getting a large chunk of error lol |
20:33:32 | FromDiscord | <Hourglass [She/Her]> https://hastebin.com/share/hitahuseve.go |
20:34:08 | FromDiscord | <Hourglass [She/Her]> https://hastebin.com/share/liquzoneno.bash error |
20:35:13 | FromDiscord | <Hourglass [She/Her]> Why am I getting a value error hm... |
20:36:19 | FromDiscord | <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:16 | FromDiscord | <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:21 | FromDiscord | <Hourglass [She/Her]> Time for more echo statements lmao |
20:40:19 | FromDiscord | <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:36 | NimEventer | New thread by alexgustafson: Error: VM does not support 'cast' from tyOpenArray to tyPtr, see https://forum.nim-lang.org/t/9951 |
21:11:56 | FromDiscord | <Hourglass [She/Her]> In reply to @jmgomez "I will be surprise": Pointers also aren't working rip |
21:12:02 | FromDiscord | <Hourglass [She/Her]> I don't know what to do now lol |
21:12:47 | FromDiscord | <Hourglass [She/Her]> Still getting the 'attempt to read from nil' error when trying to use the socket |
21:13:05 | FromDiscord | <jtv> That only happens... when you're trying to read nil |
21:13:36 | FromDiscord | <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:42 | FromDiscord | <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:10 | FromDiscord | <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:49 | FromDiscord | <Hourglass [She/Her]> Okay on the plugin side, `s == nil` returns false, so it's definitely there |
21:18:57 | FromDiscord | <Hourglass [She/Her]> It's just that accessing anything wants to make it die |
21:19:29 | FromDiscord | <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:32 | FromDiscord | <Hourglass [She/Her]> But still no dife |
21:19:34 | FromDiscord | <Hourglass [She/Her]> Dice |
21:20:16 | FromDiscord | <Hourglass [She/Her]> Not so sure where to go from here... |
21:21:42 | FromDiscord | <Elegantbeef> You need to gcref before sending to the plugin |
21:21:57 | FromDiscord | <Elegantbeef> I do not know if you can gcunref from the plugin, you likely need to deallocate inside the program |
21:24:04 | FromDiscord | <AmjadHD> @Varriount comment on <https://github.com/nim-lang/NimLime/pull/165> please. |
21:24:08 | FromDiscord | <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:50 | FromDiscord | <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:07 | FromDiscord | <Yepoleb> it's a distinct int so you can't fuck it up |
21:28:11 | FromDiscord | <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:18 | FromDiscord | <Hourglass [She/Her]> In reply to @Yepoleb "i sent an AsyncFD": Oh? I'll try that |
21:28:43 | FromDiscord | <Yepoleb> you need to use the recv and send from asyncdispatch then instead of asyncnet |
21:33:42 | FromDiscord | <Hourglass [She/Her]> So `newAsyncSocket` with the file descriptor doesn't work? |
21:37:46 | FromDiscord | <Hourglass [She/Her]> That doesn't lol |
21:38:06 | FromDiscord | <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:44 | FromDiscord | <Dudugz> 🤔 what are u trying to do? |
21:39:25 | FromDiscord | <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:59 | FromDiscord | <Elegantbeef> They're wanting to pass an async socket across the dll barrier and use it |
21:40:00 | FromDiscord | <Hourglass [She/Her]> In reply to @Dudugz "🤔 what are u": I'm using an async TCP socket from a shared library lol |
21:40:08 | FromDiscord | <Hourglass [She/Her]> In reply to @Elegantbeef "They're wanting to pass": Yep |
21:40:10 | FromDiscord | <Yepoleb> In reply to @Hourglass, When the Hour Strikes "That doesn't lol": maybe asyncdispatch is impossible to use in a thread |
21:40:24 | FromDiscord | <Elegantbeef> Nah asyncdispatch works in a thread |
21:40:29 | FromDiscord | <Elegantbeef> I'm assuming their logic is wrong |
21:41:07 | FromDiscord | <Hourglass [She/Her]> I haven't even introduced threading yet aha |
21:41:25 | FromDiscord | <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:39 | FromDiscord | <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:55 | FromDiscord | <Elegantbeef> nice naming totally helpful in explaining what the module is for |
21:45:03 | FromDiscord | <Elegantbeef> n1\_19\_3 isnt that a football play? |
21:45:09 | FromDiscord | <Hourglass [She/Her]> No? |
21:45:22 | FromDiscord | <Dudugz> lol, no |
21:45:25 | FromDiscord | <Hourglass [She/Her]> `n`: `networking`↵Then it's just the MC version |
21:45:47 | FromDiscord | <Dudugz> recap, what current problem are you having? |
21:46:03 | FromDiscord | <Hourglass [She/Her]> Also, seems like AsyncFD also gives me an illegal storage access error |
21:48:15 | FromDiscord | <Elegantbeef> Where do you call the plugin? |
21:48:19 | FromDiscord | <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:40 | FromDiscord | <Hourglass [She/Her]> In reply to @Elegantbeef "Where do you call": Line 99 in `core.nim` |
21:48:42 | FromDiscord | <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:25 | FromDiscord | <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:26 | FromDiscord | <4zv4l> how can I read from stdin asynchronously ? |
21:50:00 | FromDiscord | <Elegantbeef> I'm going to say using async procedures across the dll barrier is a problem |
21:50:12 | FromDiscord | <Elegantbeef> The way you're using plugins almost completely ruins the purpose of system libraries 😄 |
21:52:01 | * | fallback joined #nim |
21:52:09 | FromDiscord | <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:30 | FromDiscord | <Yepoleb> i did not test this btw, but that's the basic concept |
21:55:32 | FromDiscord | <Hourglass [She/Her]> In reply to @Elegantbeef "The way you're using": How so? :P |
21:55:47 | FromDiscord | <Elegantbeef> You've tied it to the Nim implementation of a lot of data types |
21:56:01 | FromDiscord | <Elegantbeef> Which means you now have a plugin system that is purely Nim centric |
21:56:21 | FromDiscord | <Elegantbeef> A big benefit of system libraries is that they're language agnostic |
21:56:38 | FromDiscord | <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:50 | FromDiscord | <Elegantbeef> Not really |
21:56:56 | FromDiscord | <Elegantbeef> A system library is fine for a plugin system |
21:57:03 | FromDiscord | <Hourglass [She/Her]> This is made for Nim, anything else isn't exactly considered supported for me |
21:57:13 | FromDiscord | <Dudugz> It is but you deal with more boilerplate |
21:57:13 | FromDiscord | <Elegantbeef> I'd rather use wasm if i was expecting people to share the modules, but they're fine |
21:57:26 | FromDiscord | <Elegantbeef> Sure but they want hot code reload for Nim |
21:57:34 | FromDiscord | <Elegantbeef> You do not get Nim hot code reload using lua 😄 |
21:57:58 | FromDiscord | <Dudugz> True |
21:58:04 | FromDiscord | <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:01 | FromDiscord | <Dudugz> Also, can't you just pass AsyncSocket instead of AsyncFD? |
21:59:57 | FromDiscord | <Elegantbeef> You do not annotate your DLL procedures as stdcall |
22:00:48 | FromDiscord | <Hourglass [She/Her]> In reply to @Dudugz "Also, can't you just": Explained it here |
22:01:59 | FromDiscord | <Elegantbeef> Why do you even use `stdcall`? |
22:02:00 | FromDiscord | <Elegantbeef> Like you're writing both sides of the API |
22:05:37 | FromDiscord | <Hourglass [She/Her]> I also tried using nimcall but that didn't work either |
22:05:56 | FromDiscord | <Hourglass [She/Her]> Is there any actual difference between nimcall and stdcall? |
22:05:59 | FromDiscord | <Elegantbeef> I mean right now both sides do not share the same conventiob |
22:06:08 | FromDiscord | <Elegantbeef> yes Nimcall on linux is cdecl |
22:06:18 | FromDiscord | <Elegantbeef> on windows it's fastcall if available |
22:07:43 | FromDiscord | <Hourglass [She/Her]> Ah |
22:08:39 | FromDiscord | <Hourglass [She/Her]> Procs use `nimcall` by default right? |
22:09:37 | FromDiscord | <Hourglass [She/Her]> Yeah it is |
22:09:42 | FromDiscord | <Hourglass [She/Her]> Manual says so |
22:10:36 | FromDiscord | <Hourglass [She/Her]> But yeah don't think this has any impact currently considering the code segfaults |
22:26:49 | FromDiscord | <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:12 | FromDiscord | <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:10 | FromDiscord | <Yepoleb> recv won't work on stdin because it is not a socket |
23:07:25 | FromDiscord | <4zv4l> I meant↵read from stdin on the server to reply to the client |