00:07:56 | * | lumo_e quit (Ping timeout: 245 seconds) |
00:10:16 | FromDiscord | <raynei486> I wonder if something like this would be possible for Nim: https://andrewkelley.me/post/zig-cc-powerful-drop-in-replacement-gcc-clang.html |
00:12:31 | FromDiscord | <Elegantbeef> You can use zigcc to compile Nim |
00:12:38 | FromDiscord | <Elegantbeef> Remember Nim just generates C/C++/JS |
00:14:56 | FromDiscord | <raynei486> oh true |
00:16:21 | FromDiscord | <.maverk> are ``run-time`` errors recoverable in nim language ? |
00:24:58 | FromDiscord | <exelotl> Exceptions yes, Defects (integer overflow, array out of bounds, etc.) maybe depending on compiler options. Segfaults only if you import the `segfaults` module |
00:25:42 | FromDiscord | <shell8729> hello |
00:26:30 | termer | hello |
00:26:38 | FromDiscord | <Elegantbeef> exelotl telling people about a module pretty much no one should use 😄 |
00:27:32 | FromDiscord | <Chronos [She/Her]> In reply to @raynei486 "I wonder if something": That would require so much work for Nim as a project to do, there's no point to it when you can already output C which can be compiled |
00:28:03 | FromDiscord | <srmordred> ptr |
00:28:51 | FromDiscord | <Chronos [She/Her]> Some people talked about a C compiler written in Nim however, would be interesting but hm, painful |
00:28:54 | FromDiscord | <Elegantbeef> Just import llvm and redo their work in `.nim` instead of `.zig` 😄 |
00:31:14 | FromDiscord | <Chronos [She/Her]> Isn't that a giant project? |
00:31:31 | FromDiscord | <Chronos [She/Her]> Oh wait you mean for what Zig did to the compiler |
00:31:38 | FromDiscord | <Chronos [She/Her]> Just recreate that with Nim |
00:32:04 | FromDiscord | <Chronos [She/Her]> ~~Why not write a WASM runtime in Nim as well as a WASM backend for Nim~~ |
00:32:21 | FromDiscord | <Elegantbeef> Why not just Nim |
00:34:46 | FromDiscord | <raynei486> In reply to @chronos.vitaqua "Oh wait you mean": iirc Andrew did write the zig compiler by refactoring clang |
00:35:09 | FromDiscord | <Chronos [She/Her]> Ah |
00:35:19 | FromDiscord | <Chronos [She/Her]> In reply to @Elegantbeef "Why not just Nim": Wdym? |
00:35:35 | FromDiscord | <raynei486> ngl a good C compiler in Nim would be nice |
00:35:43 | FromDiscord | <raynei486> especially if it provides a library for parsing C |
00:35:57 | FromDiscord | <Elegantbeef> Just use libclang |
01:31:30 | NimEventer | New Nimble package! spread - macro for spreading blocks into call parameters/collections , see https://github.com/metagn/spread |
02:38:09 | FromDiscord | <.elcritch> In reply to @Elegantbeef "Why are you asking": But you sorta are aren't you?! 😉 |
03:30:53 | FromDiscord | <Elegantbeef> @.elcritch\: we don't talk about that |
03:39:56 | * | azimut quit (Remote host closed the connection) |
03:40:27 | * | azimut joined #nim |
04:05:59 | * | tiorock joined #nim |
04:05:59 | * | tiorock quit (Changing host) |
04:05:59 | * | tiorock joined #nim |
04:05:59 | * | rockcavera quit (Killed (tantalum.libera.chat (Nickname regained by services))) |
04:05:59 | * | tiorock is now known as rockcavera |
04:49:56 | * | advesperacit joined #nim |
05:01:49 | NimEventer | New Nimble package! saucenao-nim - Asynchronous Nim wrapper for SauceNAO's API, see https://github.com/filvyb/saucenao-nim |
05:03:05 | FromDiscord | <heysokam> In reply to @raynei486 "I wonder if something": its done, `confy` works literally like that:↵https://github.com/heysokam/confy |
05:03:23 | FromDiscord | <heysokam> it builds .nim files with zig cc seamlessly |
05:12:55 | FromDiscord | <heysokam> @odexine @Phil this monster manifested in my code after all the make shell parsing was done with those tips you gave me 🙈↵jeez, what a function! https://media.discordapp.net/attachments/371759389889003532/1145949177197625395/final.nim |
05:14:59 | FromDiscord | <Elegantbeef> `hasKeyOrPut` is your friend |
05:16:01 | FromDiscord | <heysokam> In reply to @Elegantbeef "`hasKeyOrPut` is your friend": how would it work? |
05:17:04 | FromDiscord | <Elegantbeef> `if excepts.hasKeyOrPut(folder, initHashSet[string](): excepts[folder].incl realFile` |
05:17:34 | FromDiscord | <heysokam> holy line. yeah i think im good 🙈 |
05:24:31 | FromDiscord | <heysokam> tried it anyway, by using two lines instead, but it feels super confusing to have an if block opened↵doesn't make it clear that its either add the key or fall through and add the item, and there is no other case |
06:10:16 | * | xet7 joined #nim |
06:42:32 | * | ntat joined #nim |
06:56:03 | * | PMunch joined #nim |
06:56:19 | * | enthus1ast joined #nim |
07:00:03 | * | rockcavera quit (Remote host closed the connection) |
07:11:07 | * | enthus1ast quit (Ping timeout: 258 seconds) |
07:52:58 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @exelotl "Exceptions yes, Defects (integer": So no segfault crash anymore? |
07:56:12 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @heysokam "its done, `confy` works": And is it better than gcc? |
07:59:06 | FromDiscord | <odexine> at what? |
07:59:30 | FromDiscord | <odexine> In reply to @sys64 "So no segfault crash": the segfaults module is not recommended for use |
08:01:51 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @odexine "the segfaults module is": Oh alright, why? |
08:02:02 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @odexine "at what?": Optimisations and performances |
08:02:25 | FromDiscord | <odexine> In reply to @sys64 "Optimisations and performances": that's still situational |
08:02:28 | FromDiscord | <odexine> In reply to @sys64 "Oh alright, why?": buggy iirc |
08:02:46 | FromDiscord | <System64 ~ Flandre Scarlet> Oh↵So we can't avoid segfault crashes yet |
08:03:21 | FromDiscord | <odexine> iirc you cant avoid crashes from segfaults, full stop |
08:03:51 | FromDiscord | <System64 ~ Flandre Scarlet> even with segfault modules? I think it turns segfaults into exceptions so you can try-except |
08:04:15 | FromDiscord | <System64 ~ Flandre Scarlet> (edit) "modules?" => "module?" |
08:07:15 | FromDiscord | <odexine> i'm not too sure about this but it works only because the operating systems allow you to hook a proc to the segfault signal; if for some reason the os changes this behaviour (not out of the question for macos) then the ability is lost |
08:09:20 | FromDiscord | <odexine> though i heavily doubt the remark i made about macos, it's really unlikely but iirc theyve changed things like this before so eh |
08:10:05 | FromDiscord | <System64 ~ Flandre Scarlet> Oh alright↵And why do some people prefer to use the ZIG compiler? |
08:10:22 | FromDiscord | <odexine> it's Zig |
08:10:27 | FromDiscord | <odexine> simpler cross compilation IIRC |
08:10:35 | FromDiscord | <System64 ~ Flandre Scarlet> Oh |
08:11:01 | FromDiscord | <System64 ~ Flandre Scarlet> Isn't ZIG still in beta? |
08:11:31 | FromDiscord | <odexine> it's Zig |
08:11:50 | FromDiscord | <odexine> Zig is indeed not in stable yet |
08:18:53 | FromDiscord | <System64 ~ Flandre Scarlet> Oh you say I should say Zig instead of ZIG? |
08:19:28 | FromDiscord | <System64 ~ Flandre Scarlet> I didn't understood that, sorry |
08:19:41 | FromDiscord | <_gumbercules> I think you should keep saying ZIG |
08:20:19 | FromDiscord | <_gumbercules> Don't let Rika stifle your creativity |
08:20:35 | FromDiscord | <System64 ~ Flandre Scarlet> The logo↵It's written in caps |
08:20:43 | FromDiscord | <_gumbercules> Tis |
08:21:38 | FromDiscord | <_gumbercules> https://media.discordapp.net/attachments/371759389889003532/1145996666072223754/Screenshot_20230829-032128_GitHub.jpg |
08:21:46 | FromDiscord | <_gumbercules> Gotta look at the codez |
08:22:49 | FromDiscord | <.maverk> what is the difference between ``proc`` and ``func`` ? |
08:23:45 | FromDiscord | <_gumbercules> proc is a procedure which makes no guarantees re mutation of arguments |
08:24:58 | FromDiscord | <.maverk> In reply to @_gumbercules "proc is a procedure": no mutation of argument i don't understand this |
08:25:48 | FromDiscord | <_gumbercules> func is a function and the compiler can be set to a mode via the strictFuncs option to ensure functional purity aka no args are mutated nor is out of scope state. Second statement regarding out of scope state I'm not sure about 100% |
08:26:15 | FromDiscord | <_gumbercules> In reply to @.maverk "no mutation of argument": That means it would mutate or change the arguments passes to it |
08:27:50 | FromDiscord | <.maverk> hmmm is not the difference that func doesn't print while proc can print |
08:27:50 | FromDiscord | <_gumbercules> So if I had proc foo that took a var char bar, I could change the value of bar |
08:28:23 | FromDiscord | <_gumbercules> No but using stdout is a side effect |
08:28:55 | FromDiscord | <_gumbercules> The point of strictFuncs is to prevent side effects |
08:30:09 | FromDiscord | <_gumbercules> If you're not familiar with functional programming you may want to do some reading and maybe playing around in a functional language in order to understand why you'd want these things |
08:30:28 | FromDiscord | <_gumbercules> Play around even |
08:31:44 | * | enthus1ast joined #nim |
08:32:28 | FromDiscord | <odexine> In reply to @_gumbercules "func is a function": func does not prevent argument mutability |
08:33:14 | FromDiscord | <odexine> sent a code paste, see https://play.nim-lang.org/#ix=4EOc |
08:33:56 | FromDiscord | <odexine> func is only about side effects and nim considers a mutable argument as not a side effect |
08:40:28 | * | PMunch_ joined #nim |
08:41:03 | FromDiscord | <odexine> addendum: of course you can just remove the var but it doesnt do anything special in that regard compared to a proc |
08:41:12 | FromDiscord | <odexine> is my point |
08:41:54 | FromDiscord | <Phil> sent a long message, see http://ix.io/4EOe |
08:42:06 | FromDiscord | <Phil> (edit) "http://ix.io/4EOe" => "http://ix.io/4EOf" |
08:43:50 | * | PMunch quit (Ping timeout: 245 seconds) |
08:44:44 | FromDiscord | <_gumbercules> In reply to @odexine "func is only about": Weird but I guess that's because pointers |
08:45:34 | FromDiscord | <_gumbercules> And Nim is really imperative at the end of the day |
08:45:38 | FromDiscord | <Phil> In reply to @_gumbercules "Weird but I guess": Given a recent argument araq had with one of the functionally inclined folks that want the strictFunc flag to be a default:↵That appears to be intentional as mutable inputs are more useful in various scenarios.↵At least if I understand that debate right. |
08:45:48 | FromDiscord | <Phil> (edit) "In reply to @_gumbercules "Weird but I guess": Given a recent argument araq had with one of the functionally inclined folks ... that" added "in the forum" |
08:45:58 | FromDiscord | <_gumbercules> Just has all these things bolted on |
08:46:10 | FromDiscord | <Phil> And making them mutable via var is deemed explicit enough |
08:46:13 | FromDiscord | <_gumbercules> In reply to @isofruit "Given a recent argument": Yeah so pointers edsent |
08:46:21 | FromDiscord | <Phil> "edsent"? |
08:46:29 | FromDiscord | <_gumbercules> Given var is just a runtime managed pre |
08:46:36 | FromDiscord | <_gumbercules> (edit) "pre" => "ptr" |
08:46:45 | FromDiscord | <_gumbercules> In reply to @isofruit ""edsent"?": Essentially |
08:47:18 | FromDiscord | <_gumbercules> Sorry on my phone and I'm not great with virtual keyboards and spelling accuracy |
08:47:29 | FromDiscord | <odexine> In reply to @_gumbercules "Sorry on my phone": who is lol |
08:47:40 | FromDiscord | <odexine> people who type fast on the phone rely super hard on autocorrect |
08:47:41 | FromDiscord | <odexine> i do |
08:47:59 | FromDiscord | <Phil> sent a long message, see http://ix.io/4EOi |
08:48:34 | FromDiscord | <odexine> out parameters, remember those? i barely do |
08:48:39 | FromDiscord | <odexine> wonder if theyre still relevant |
08:49:11 | FromDiscord | <Phil> sent a long message, see https://paste.rs/J3E4f |
08:49:52 | FromDiscord | <_gumbercules> Good context, I think I seeing this and my eyes glazing. Apparently conscious mind said no sir, not today to this information. |
08:50:46 | FromDiscord | <Phil> In reply to @odexine "out parameters, remember those?": Had you not mentioned it, I would've actually missed that one.↵Is that so you can have a parameter be the output for C interop or sth? |
08:50:52 | FromDiscord | <Phil> (edit) "a" => "an explicit" |
08:51:07 | FromDiscord | <odexine> i dont remember (see "i barely do") |
08:52:23 | FromDiscord | <Phil> I can't even find docs on them |
08:52:27 | FromDiscord | <_gumbercules> https://nim-lang.github.io/Nim/manual_experimental.html#strict-definitions-and-nimout-parameters-nimout-parameters |
08:52:49 | FromDiscord | <Phil> Ohh experimentel |
08:52:52 | FromDiscord | <Phil> I never go there |
09:19:52 | FromDiscord | <enthus1ast> Never heard of those↵(@odexine) |
09:24:21 | * | xet7 quit (Read error: Connection reset by peer) |
09:32:48 | FromDiscord | <heysokam> In reply to @sys64 "And is it better": Simply because of the fact that you don't need another compiler to build for any system....: significantly yes↵Is it better at optimization? well, you can search for `gcc vs clang` on google to answer that, because zigcc is basically a clang interface with modern standards of sane defaults |
09:34:43 | FromDiscord | <heysokam> wanna cross compile with gcc? get your mingw+gcc+osxcross chain ready, and expect every dev that builds your software to do the same in every system they use↵same with zigcc... well it just works out of the box, and you don't even need to manage your zig install at all if you use an automator like confy does 🤷♂️ |
09:35:19 | FromDiscord | <heysokam> basically zigcc is what gcc+clang would have been if they were made with modern standards in mind, without caring about breaking old 30y/o stuff |
09:35:54 | FromDiscord | <heysokam> (edit) "wanna cross compile with gcc? get your mingw+gcc+osxcross chain ready, and expect every dev that builds your software to do the same in every system they use↵same ... withzigcc?..." added "task" | "zigcc..." => "zigcc?..." |
09:46:36 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @heysokam "wanna cross compile with": I should move to zigcc then!! |
09:58:33 | * | PMunch joined #nim |
10:01:20 | * | PMunch_ quit (Ping timeout: 250 seconds) |
10:01:45 | * | kenran joined #nim |
10:02:51 | FromDiscord | <Phil> In reply to @sys64 "I should move to": It is pretty trivial to do that, I made an SO question, should be easily googleable |
10:03:11 | FromDiscord | <Phil> enthus1ast made the process so damn simple you can literally nimble install a nim package which in truth is just a bash script |
10:03:28 | FromDiscord | <Phil> (edit) "enthus1ast made the process so damn simple you can literally nimble install a nim package which in truth is just a bash script ... " added "and bam, you can use zigcc" |
10:04:26 | FromDiscord | <Phil> If that package ever surpasses nimja in terms of github stars I'll cackle so damn hard |
10:05:04 | FromDiscord | <Phil> It's already beating the nimDownloadGrist repo of his 😛 |
10:05:19 | FromDiscord | <Phil> (edit) "It's already beating the nimDownloadGrist repo of his ... 😛" added "and is hot on the heels of illwillWidgets" |
11:13:37 | FromDiscord | <System64 ~ Flandre Scarlet> Wow, will try that then |
11:30:46 | * | xet7 joined #nim |
11:48:40 | * | PMunch_ joined #nim |
11:51:32 | * | PMunch quit (Ping timeout: 240 seconds) |
11:54:02 | FromDiscord | <heysokam> the nim part of confy is basically that zigcc package, but its code moved to the new buildsystem↵I made it that way so you don't have to pass the arguments manually to the compiler so it knows how to crosscompile, the tool does the conversion when you define the build file automatically |
11:55:25 | FromDiscord | <Phil> confy? |
11:55:58 | FromDiscord | <System64 ~ Flandre Scarlet> Is it normal I can't do that? https://media.discordapp.net/attachments/371759389889003532/1146050609011765278/image.png |
11:55:59 | FromDiscord | <Phil> In reply to @_gumbercules "Don't let Rika stifle": ziG is the only way |
11:56:16 | FromDiscord | <heysokam> In reply to @isofruit "confy?": https://github.com/heysokam/confy/blob/5ffc103632aea8178b2818edff0ef91e00ec7d5e/src/confy/builder/nim.nim#L32-L46 |
11:57:05 | FromDiscord | <Phil> In reply to @sys64 "Is it normal I": I mean, is the seq assigned to a mutable variable via var? |
11:57:14 | FromDiscord | <System64 ~ Flandre Scarlet> Oh, will do that |
11:57:31 | FromDiscord | <System64 ~ Flandre Scarlet> it works, thanks |
11:57:54 | FromDiscord | <Phil> norm needs to mutate the values you have in that seq to add ids etc., so they must be var |
11:57:58 | FromDiscord | <heysokam> Basically does what the zigcc readme tells you to do, but automatically https://github.com/heysokam/confy/blob/5ffc103632aea8178b2818edff0ef91e00ec7d5e/src/confy/builder/nim.nim#L82-L89 |
11:58:49 | FromDiscord | <Phil> All these people providing packages with the solution, preventing my SO question from getting even more fame and upvotes 😤 |
12:07:23 | FromDiscord | <odexine> In reply to @isofruit "All these people providing": Lol |
12:45:30 | * | azimut quit (Ping timeout: 246 seconds) |
12:57:34 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4EPh |
13:05:02 | FromDiscord | <heysokam> is it because `assert false` triggers the assertion exception?↵if so... i think I've been confused by that before 😔 |
13:12:48 | FromDiscord | <ntzeno> In reply to @heysokam "is it because `assert": yeah, if asserted condition is false, it triggers exception |
13:14:21 | * | xet7 quit (Remote host closed the connection) |
13:30:37 | FromDiscord | <heysokam> damn double negatives |
13:38:36 | * | yellow-man joined #nim |
13:38:50 | yellow-man | p |
13:38:56 | * | yellow-man quit (Client Quit) |
13:40:12 | FromDiscord | <odexine> q |
13:48:41 | FromDiscord | <nnsee> In reply to @heysokam "does someone have an": please assert that zero does not, in fact, equal zero |
13:54:14 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4EPB |
13:54:48 | FromDiscord | <odexine> good luck have fun. let's call it undefined behaviour |
13:54:58 | FromDiscord | <heysokam> kk |
13:54:58 | FromDiscord | <odexine> use the regular function versions `any` |
14:01:06 | FromDiscord | <heysokam> does `return` work to return a value from a block when returning inside an asignment, or does it return the entire function? |
14:03:01 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4EPE |
14:03:04 | FromDiscord | <frobnicate> Return the function? It returns whatever is in the statement |
14:03:12 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4EPF |
14:03:26 | FromDiscord | <heysokam> In reply to @isofruit "That is a macro.": kk ty ✍️ |
14:04:04 | FromDiscord | <frobnicate> Return takes you out of the function. I think you're looking for break |
14:04:12 | FromDiscord | <Phil> The syntax may not be flawless and require some tinkering, but you get the gist.↵You just hand `any` an iterable and a proc that can be applied to every individual member of the iterable and that is asking the question "Does any member of the seq return true for the given proc?" |
14:04:21 | FromDiscord | <heysokam> In reply to @frobnicate "Return takes you out": yeah but break does not assign a valued, does it? |
14:04:31 | FromDiscord | <heysokam> and break also breaks the loop, not the block |
14:04:40 | FromDiscord | <frobnicate> Assign a value before you break |
14:04:49 | FromDiscord | <frobnicate> I'm confused what you want |
14:04:49 | FromDiscord | <heysokam> how? |
14:04:58 | FromDiscord | <Phil> Don't use break and instead immediately start outsourcing the for-loop into a proc that makes it easier to reason about |
14:05:00 | FromDiscord | <heysokam> the exit value of the block is the asignment |
14:05:20 | FromDiscord | <frobnicate> You want a block that does an assignment? |
14:05:42 | FromDiscord | <heysokam> that was the idea |
14:05:54 | FromDiscord | <Phil> The proc may return a bool and then you can go "if true return 3 else <whatever you want to return if nothing works>" |
14:05:56 | FromDiscord | <frobnicate> I don't think that's the intended use of a block |
14:06:02 | FromDiscord | <frobnicate> Use a proc |
14:06:07 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4EPI |
14:07:34 | FromDiscord | <frobnicate> I'm confused as to what you're even trying to do |
14:08:04 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4EPJ |
14:08:49 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4EPK |
14:09:27 | FromDiscord | <heysokam> given that the object `RootTarget` has the fields `src` and `deps` which contains the list of code and/or objects to build it |
14:09:47 | FromDiscord | <Phil> My version is even faster as it only starts doing the loops if they actually have a chance of mattering |
14:09:58 | FromDiscord | <heysokam> in the case of direct, there is no deps, only src, but src has `.c`files in it, which is never true for indirect cases |
14:10:02 | FromDiscord | <Phil> Because if your trg.deps.len condition is false, all the loops don't matter, it's always false |
14:10:43 | FromDiscord | <heysokam> In reply to @isofruit "Because if your trg.deps.len": the loops matter, because its not an `or` its an `and` |
14:10:48 | FromDiscord | <heysokam> or am i missing your point 🤔 |
14:11:14 | FromDiscord | <Phil> No, they don't.↵You're and-ing.↵Which means if one bool is false, the result is false.↵SO if trg.deps.len != 0 => false that means your proc can only return false |
14:11:30 | FromDiscord | <Phil> (edit) "false.↵SO" => "false.↵So" |
14:12:26 | FromDiscord | <Phil> The only scenario in which both the result of the loops matter and "trg.deps.len" is when they're "or"-combined.↵Then one or the other may turn the result of `isDirect` true.↵Currently they both must be true, so if the condition around trg.deps.len is false it's game over anyway |
14:12:41 | FromDiscord | <heysokam> i see |
14:12:55 | FromDiscord | <heysokam> might be thinking incorrectly about it |
14:14:01 | * | PMunch_ quit (Quit: Leaving) |
14:14:41 | FromDiscord | <heysokam> Oh I think I was trying to filter (without noticing) for the case when the input is not a root target↵but its a root, so your logic actually makes more sense |
14:15:02 | FromDiscord | <heysokam> the loop is probably irrelevant to begin with for this |
14:15:28 | FromDiscord | <heysokam> it would only matter if the files were manually converted to .o, but that's sent to the compiler to deal with |
14:15:38 | FromDiscord | <heysokam> (edit) "it" => "the loop" |
14:18:28 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4EPM |
14:19:45 | FromDiscord | <Phil> Lul |
14:30:19 | FromDiscord | <odexine> blocks dont use the return keyword btw, but they can return, i didnt see this mentioned so |
14:31:59 | FromDiscord | <Phil> The fact that they can is so cool tbh, should've used that a lot more when I had 3-5 lines that solely are there to compute 1 particular output variable |
14:32:36 | FromDiscord | <odexine> they can be used to ensure immutability without creating a new function with temp vars etc etc |
14:32:49 | FromDiscord | <Phil> Yeah, really nice |
14:33:22 | FromDiscord | <odexine> sent a code paste, see https://play.nim-lang.org/#ix=4EPS |
14:38:55 | FromDiscord | <heysokam> whats `mutate b` doing there? |
14:39:50 | FromDiscord | <_nenc> But block can't break from loops though, however assigning to a var is a workaround |
14:40:11 | FromDiscord | <_nenc> (edit) "But block can't break ... from" added "and return" |
14:53:50 | FromDiscord | <Phil> Then don't use a loop directly and write either a find proc or use any, map or filter |
14:54:29 | FromDiscord | <Phil> That should cover all usecase where you want to return something |
14:58:26 | * | kenran quit (Remote host closed the connection) |
15:08:33 | FromDiscord | <_nenc> In reply to @isofruit "Then don't use a": reasonable |
15:12:44 | * | enthus1ast quit (Ping timeout: 248 seconds) |
15:13:55 | FromDiscord | <Chronos [She/Her]> In reply to @odexine "blocks dont use the": Aren't you forced to use a label now with them? |
15:14:12 | FromDiscord | <odexine> In reply to @heysokam "whats `mutate b` doing": ... it's just some function that mutates b |
15:14:18 | FromDiscord | <Chronos [She/Her]> Someone said something along the lines of using a template for creating a new scope instead of a block now |
15:14:22 | FromDiscord | <odexine> In reply to @chronos.vitaqua "Aren't you forced to": not that i know of |
15:14:28 | FromDiscord | <Chronos [She/Her]> Bc blocks aren't supposed to be used like that |
15:14:30 | FromDiscord | <Chronos [She/Her]> Ah hm |
15:14:35 | FromDiscord | <Chronos [She/Her]> Probably misremembering then |
15:15:25 | FromDiscord | <odexine> its only deprecated if using break w/o a name as well |
15:34:20 | FromDiscord | <ravinder387> In reply to @chronos.vitaqua "Bc blocks aren't supposed": hi where are you from? |
15:36:56 | * | krux02 joined #nim |
15:37:29 | FromDiscord | <Chronos [She/Her]> In reply to @odexine "its only deprecated if": Aah alright |
15:37:39 | FromDiscord | <Chronos [She/Her]> In reply to @ravinder387 "hi where are you": I'm from England, why? |
15:39:55 | FromDiscord | <ravinder387> In reply to @chronos.vitaqua "I'm from England, why?": So, what u developing recently in nim? |
15:41:49 | FromDiscord | <ravinder387> I can do single page application with only javascript or nim. why karax developed then? |
15:43:47 | FromDiscord | <Chronos [She/Her]> In reply to @ravinder387 "So, what u developing": Nothing really tbh, just messing around with anything that catches my interest |
15:43:56 | FromDiscord | <Chronos [She/Her]> As for web development, that's not really my area aha |
15:44:08 | FromDiscord | <Chronos [She/Her]> @Phil definitely knows more than me |
16:00:41 | FromDiscord | <heysokam> In reply to @odexine "... it's just some": well duh, that's in the name 🙈↵i mean what does mutate -do- to the variable |
16:00:58 | FromDiscord | <odexine> it does literally anything that mutates the variable |
16:01:01 | FromDiscord | <odexine> whatever you want it to |
16:01:03 | FromDiscord | <odexine> its a placeholder |
16:01:18 | FromDiscord | <heysokam> ohhh i thought it was an internal function/keyword from system, kk |
16:20:33 | * | disso-peach joined #nim |
16:20:40 | * | disso-peach quit (Client Quit) |
16:22:47 | FromDiscord | <Phil> In reply to @ravinder387 "I can do single": It's much easier to develop an application with an spa if you can guarantee at compile-time that your frontend correctly uses your backend by using shared types |
16:24:34 | FromDiscord | <Phil> Can have 3 folders: frontend with karax, backend with whatever and an interface folder with the types that frontend sends to backend and vice versa.↵Just make sure whatever JSON your backend returns/receives is based on one of the interface types (same for frontend) and you're good. |
16:25:53 | FromDiscord | <jaar23> How can socket (net) detect client has disconnect from their end. I'm using socket.send(data) while client disconnected, the socket server just hang there. |
16:25:55 | FromDiscord | <Phil> Bam, you can now guarantee at build time that you aren't forgetting anything and the type your frontend uses is automatically in sync with the type your backend provides |
16:27:02 | FromDiscord | <Phil> In reply to @jaar23 "How can socket (net)": I don't know for sockets, for websockets you typically have ping messages with acknowledge (aka pong) messages sent back to check that the connection is still alive |
16:27:20 | FromDiscord | <Phil> So similar mechanism could work for sockets |
16:41:04 | FromDiscord | <Chronos [She/Her]> Hey Beef, wondering how would I decide how much RAM to allocate to a WASM plugin |
16:41:12 | FromDiscord | <Chronos [She/Her]> And how would I not go over the memory limit |
16:50:14 | FromDiscord | <enthus1ast> @jaar23\: you can't , it will eventually timeout though. You ca on only detect the disconnect attempt when you read from a socket.↵As Phil mentioned you can establish a ping pong mechanism, when you define your own protocol |
16:57:59 | * | rockcavera joined #nim |
16:58:25 | * | enthus1ast joined #nim |
17:12:08 | * | enthus1ast quit (Remote host closed the connection) |
17:13:19 | FromDiscord | <Phil> In reply to @enthus1ast "<@614403538172379156>\: you can't ,": So do so sockets just really on ping pong since you almost always want to be able to figure out if a socket is still alive |
17:13:28 | FromDiscord | <Phil> (edit) "alive" => "alive?" |
17:13:38 | FromDiscord | <Phil> (edit) "really" => "all rely" |
17:14:09 | FromDiscord | <odexine> In reply to @isofruit "So do so sockets": it's the backbone of making something unreliable more reliable, id say |
17:15:44 | FromDiscord | <Phil> Just seems so common that it's weird that sockets don't come with that by default |
17:22:42 | FromDiscord | <Phil> Then again I guess that makes them more universal in the few cases where ping pong overhead is unneeded |
17:22:46 | FromDiscord | <jaar23> In reply to @isofruit "I don't know for": Okay, I think this make sense, just going through asynnet to see how isClose method is implement, seems like it is just a variable. |
17:23:55 | FromDiscord | <jaar23> In reply to @enthus1ast "<@614403538172379156>\: you can't ,": I think I'm better off implement the ping pong mechanism Phil has mentioned |
17:24:16 | FromDiscord | <Phil> Waaaait a second... Is there an equivalent to http for request response style communication between threads not over sockets? |
17:24:18 | FromDiscord | <jaar23> In reply to @isofruit "So do so sockets": Yes |
17:25:17 | FromDiscord | <enthus1ast> you can also acknowlege every message you sent, this way you switch between send and receive |
17:25:22 | FromDiscord | <Phil> If webdev has websockets and http for communication and appdev has an equivalent to websockets I wonder now if there's also an http parralel |
17:26:26 | FromDiscord | <jaar23> In reply to @enthus1ast "you can also acknowlege": yes, i think this is easier, if message doesn't come back from client within x seconds, consider dropped. |
17:26:58 | FromDiscord | <jaar23> In reply to @isofruit "Waaaait a second... Is": hmm, i think you mean channel? |
17:27:22 | FromDiscord | <Phil> In reply to @jaar23 "yes, i think this": Based on that you can also have message retry buffers etc., sounds good |
17:27:22 | FromDiscord | <enthus1ast> @Phil\: Appdev == Webdev these days \:) |
17:27:47 | FromDiscord | <jaar23> everything is web nowadays... |
17:27:54 | FromDiscord | <Phil> In reply to @enthus1ast "<@180601887916163073>\: Appdev == Webdev": I swear over time I get the impression that it's like the same couple mechanisms everywhere |
17:28:22 | FromDiscord | <enthus1ast> http is good enough and nearly everything can speak it so yeah |
17:28:35 | FromDiscord | <enthus1ast> http + mime |
17:29:04 | FromDiscord | <Phil> Also no, appdev means you need to put on boxing glove and fight with apple QA folks |
17:29:17 | FromDiscord | <Phil> It's far more violent |
17:30:23 | FromDiscord | <Phil> In reply to @jaar23 "hmm, i think you": I mean, maybe? Do channels work between an unrelated Daemon and your program? |
17:41:29 | FromDiscord | <jaar23> i using channel as a queue currently. |
17:42:17 | FromDiscord | <jaar23> trying to implement a linked-list like queue, but all the invalid memory access error happened, so i changed to use channel as of now. |
17:43:10 | FromDiscord | <jaar23> also using channel for passing socket connection across different thread for processing, you may notice, i'm trying to implement a pubsub connection now... |
17:45:08 | FromDiscord | <Chronos [She/Her]> In reply to @isofruit "So do so sockets": Ik Discord does, iirc Minecraft does too |
17:51:52 | FromDiscord | <Phil> In reply to @chronos.vitaqua "Ik Discord does, *iirc*": Well those are websockets over the network, my question was more aimed at separate processes talking to one another on one machine via a socket (I assume that's a usecase) |
17:52:33 | FromDiscord | <Phil> I'm basically wondering if there are scenarios with normal sockets where extra considerations may make ping pong pointless |
17:54:09 | FromDiscord | <jaar23> In reply to @enthus1ast "<@614403538172379156>\: you can't ,": it works now, thanks! @Phil @enthus1ast |
17:54:41 | FromDiscord | <Chronos [She/Her]> Ah |
17:56:28 | FromDiscord | <odexine> In reply to @isofruit "Waaaait a second... Is": RPC? |
17:57:49 | FromDiscord | <Phil> Do those respond even if the response is just "RPC call finished execution, returning void" ? |
17:58:40 | FromDiscord | <odexine> implementation dependent |
17:58:40 | FromDiscord | <odexine> https://en.wikipedia.org/wiki/Remote_procedure_call |
17:59:34 | FromDiscord | <odexine> iirc usually it does, and otherwise it prolly wont be called RPC |
18:00:11 | FromDiscord | <odexine> ~~to note that erlang/elixir is in the list, and hence i must shill it again~~ |
18:00:19 | FromDiscord | <Phil> Then that's more socket style then, was more looking for a fixed request response model like http has |
18:00:48 | FromDiscord | <odexine> please read the wikipage |
18:16:37 | FromDiscord | <Phil> > This is a form of client–server interaction (caller is client, executor is server), typically implemented via a request–response message-passing system.↵↵Hmmmmmmmmmm so kinda |
18:17:17 | FromDiscord | <Phil> > RPC is a request–response protocol. An RPC is initiated by the client, which sends a request message to a known remote server to execute a specified procedure with supplied parameters. The remote server sends a response to the client, and the application continues its process. While the server is processing the call, the client is blocked↵↵Wait a sec, RPCs are sync ? |
18:17:45 | FromDiscord | <Phil> That seems wild, though I guess that can make sense (?) |
18:17:52 | FromDiscord | <Phil> (edit) "That seems wild, though I guess that can make sense ... (?)" added "on a local machine" |
18:18:29 | FromDiscord | <odexine> i'd say theyre not necessarily sync and an async impl would prolly still satisfy the "what RPC is" |
18:20:08 | FromDiscord | <Phil> > Elixir builds on top of the Erlang VM and allows process communication (Elixir/Erlang processes, not OS processes) of the same network out-of-the-box via Agents and message passing.↵I see now why you recommended the wiki article 🧐 |
18:20:36 | FromDiscord | <Phil> (edit) "> Elixir builds on top of the Erlang VM and allows process communication (Elixir/Erlang processes, not OS processes) of the same network out-of-the-box via Agents and message passing.↵I see now why you recommended the wiki article 🧐 ... " added ".↵Always an agenda, I see I see" |
18:22:13 | FromDiscord | <odexine> :baqua: |
18:23:43 | FromDiscord | <Phil> baqua? Is that some recolored version of aqua from konosuba? |
18:25:00 | FromDiscord | <odexine> no |
18:25:02 | FromDiscord | <odexine> other aqua |
18:25:07 | termer | what're you talking about |
18:25:48 | FromDiscord | <odexine> an emoji i sent |
18:26:09 | termer | Can't see it |
18:27:02 | termer | also an update for you guys: I'm currently eating chocolate chip pancakes |
18:28:07 | FromDiscord | <ravinder387> In reply to @termer "also an update for": I never eat pancakes in my life |
18:29:09 | termer | You should change that |
18:29:23 | termer | Do you live in Houston? I'll make you some kickass pancakes if you are |
18:29:42 | termer | *if you do |
18:30:04 | FromDiscord | <odexine> just doxxed you, i know where you live |
18:30:11 | termer | where do I live |
18:40:55 | FromDiscord | <␀ Array> termer u better add strawberries to that |
18:41:33 | termer | I wanted to, but I didn't have any |
18:43:07 | FromDiscord | <heysokam> 🫐 pancakes 🤤 |
18:43:42 | termer | the blueperry flavor goes away too quickly |
18:43:44 | termer | but they are good |
18:43:46 | termer | *blueberry |
18:43:54 | FromDiscord | <␀ Array> sad↵(<@709044657232936960_termer=5b=49=52=43=5d>) |
19:27:02 | * | rockcavera quit (Read error: Connection reset by peer) |
19:30:23 | * | rockcavera joined #nim |
19:30:24 | * | rockcavera quit (Changing host) |
19:30:24 | * | rockcavera joined #nim |
19:34:05 | FromDiscord | <.lemagicien> Hi, I'm having trouble finding the appropriate module to create SYN packets on Nim. What is the best practice to follow? |
19:40:03 | qwr | use C library or write it yourself (it seems to me that creating syn packet from scratch should be quite easy) |
19:52:06 | * | ntat quit (Quit: leaving) |
20:09:17 | FromDiscord | <Elegantbeef> OOMhooks↵(@Chronos [She/Her]) |
20:12:50 | FromDiscord | <Chronos [She/Her]> How would I decide how much RAM to allocate tho- |
20:14:15 | termer | get more RAM and allocate all you want |
20:20:26 | FromDiscord | <Elegantbeef> I mean how much ram does a program liikely need? 😄 |
20:26:20 | * | krux02 quit (Remote host closed the connection) |
20:52:16 | FromDiscord | <jviega> Hey do I have to do something special in the FFI after 4 arguments? I keep getting weird crap where my 5th arg is a cstring, but nim keeps giving me conflicting type errors, saying that cstring and NCSTRING aren't compat. |
20:53:48 | FromDiscord | <jviega> Everything I try to weasel around it, like declaring it as a pointer, or another type and casting, etc, I still get a type error on that parameter, which is making me wonder if there's something magical after 4? |
20:54:31 | FromDiscord | <odexine> Calling convention? I have no other ideas lol |
20:54:48 | FromDiscord | <jviega> It shouldn't be? It's just cdecl |
20:55:12 | FromDiscord | <Chronos [She/Her]> In reply to @Elegantbeef "I mean how much": Shrug |
20:55:25 | FromDiscord | <odexine> Your computer might just be cursed |
20:55:51 | FromDiscord | <Chronos [She/Her]> 4 MB per plugin?- |
20:55:53 | FromDiscord | <jviega> No, this has happened before, and I just passed everything in a big struct instead to work around it. But this time, that's a bad idea. |
20:56:14 | FromDiscord | <Chronos [She/Her]> I grew up in the age of not worrying about RAM capacity, I never had to think about this stuff lol |
20:57:31 | FromDiscord | <jviega> Actually, maybe it's not the worst idea. Still, I even have cstring params earlier in the same proc that don't type error. It's odd. |
21:10:25 | FromDiscord | <.lemagicien> In reply to @qwr "use C library or": Alright, thank you. Will try to use the C library. Writing it by myself is also valid but I will take the time to study how to craft a syn packet |
21:12:12 | * | advesperacit quit () |
21:12:12 | * | rockcavera quit (Ping timeout: 248 seconds) |
21:27:51 | FromDiscord | <mratsim> In reply to @chronos.vitaqua "I grew up in": Found the electron programmer |
21:29:24 | FromDiscord | <Chronos [She/Her]> In reply to @mratsim "Found the electron programmer": Ew JS, no thanks lmao |
21:29:32 | FromDiscord | <Chronos [She/Her]> I'm used to Python lol |
21:37:30 | FromDiscord | <djazz> I'm a JS dev who now codes embedded in Nim for fun, precious memory! |
21:42:43 | FromDiscord | <Chronos [She/Her]> In reply to @djazz "I'm a JS dev": What amount of memory are you used to, then? 👀 |
21:56:31 | termer | plenty |
21:56:39 | termer | Most JS devs don't know what memory is |
21:56:46 | termer | djazz isn't a normal JS dev |
21:57:07 | FromDiscord | <djazz> Hehe |
21:57:34 | FromDiscord | <djazz> I remember coding on my netbook… 1.5 GB memory |
21:58:30 | FromDiscord | <djazz> Now, I can’t have VScode open while gaming on my PC with 16 GB, as it will use too much memory and hang the computer |
22:02:52 | FromDiscord | <djazz> I did toy with electron back in the day |
22:06:08 | * | mahlon quit (Quit: PotatoTech) |
22:06:53 | * | mahlon joined #nim |
22:11:46 | FromDiscord | <Chronos [She/Her]> In reply to @djazz "Now, I can’t have": I can do it with 24 GB on Linux tho- |
23:02:19 | termer | I had 1GB of memory on an old device I had, managed to run Eclipse AND Minecraft on it at the same time |
23:02:24 | termer | it was definitely raping the swap |
23:03:20 | FromDiscord | <Elegantbeef> Damn chronos has a 24gb phone and plays games through termux |
23:03:37 | termer | My phone has 8GiB RAM |
23:03:41 | termer | maybe more, not sure |
23:03:53 | FromDiscord | <Elegantbeef> I don't know, mine has maybe 1GB |
23:04:05 | termer | My previous one had 2GiB |
23:04:18 | termer | the one before that had about 100MiB lol |
23:04:26 | FromDiscord | <Elegantbeef> But I need my phone like I need a venereal disease |
23:04:34 | termer | I hate phones and avoid using htem |
23:05:00 | FromDiscord | <Elegantbeef> Same, the only chance I'll ever upgrade is if a pinephone or a phone that supports linux well enough falls on my lap |
23:06:08 | termer | would love one of those to ACTUALLY be usable |
23:06:43 | FromDiscord | <Elegantbeef> Be the change you want to see in the world |
23:06:56 | termer | I don't know MMS protocol |
23:06:59 | termer | that's the issue here |
23:07:16 | FromDiscord | <Elegantbeef> That's always the first step of learning anything |
23:07:28 | termer | Open source MMS is almost nonexistent, surprisingly |
23:12:20 | FromDiscord | <Elegantbeef> hey MMS is slowly getting phased out anyway |
23:12:35 | termer | for something with even less OSS support lol |
23:13:10 | FromDiscord | <Elegantbeef> Are the not just leaning on internet chat? |
23:13:30 | FromDiscord | <Elegantbeef> they\ |
23:16:34 | termer | No idea |
23:23:41 | * | azimut joined #nim |
23:28:51 | FromDiscord | <Chronos [She/Her]> In reply to @Elegantbeef "Damn chronos has a": No, on my PC lmao |
23:29:29 | FromDiscord | <Chronos [She/Her]> MC taking up 12 GB, 10+ chromium tabs open and VSC open too |
23:29:40 | FromDiscord | <Chronos [She/Her]> While my system updates in the background |