<< 29-08-2023 >>

00:07:56*lumo_e quit (Ping timeout: 245 seconds)
00:10:16FromDiscord<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:31FromDiscord<Elegantbeef> You can use zigcc to compile Nim
00:12:38FromDiscord<Elegantbeef> Remember Nim just generates C/C++/JS
00:14:56FromDiscord<raynei486> oh true
00:16:21FromDiscord<.maverk> are ``run-time`` errors recoverable in nim language ?
00:24:58FromDiscord<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:42FromDiscord<shell8729> hello
00:26:30termerhello
00:26:38FromDiscord<Elegantbeef> exelotl telling people about a module pretty much no one should use 😄
00:27:32FromDiscord<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:03FromDiscord<srmordred> ptr
00:28:51FromDiscord<Chronos [She/Her]> Some people talked about a C compiler written in Nim however, would be interesting but hm, painful
00:28:54FromDiscord<Elegantbeef> Just import llvm and redo their work in `.nim` instead of `.zig` 😄
00:31:14FromDiscord<Chronos [She/Her]> Isn't that a giant project?
00:31:31FromDiscord<Chronos [She/Her]> Oh wait you mean for what Zig did to the compiler
00:31:38FromDiscord<Chronos [She/Her]> Just recreate that with Nim
00:32:04FromDiscord<Chronos [She/Her]> ~~Why not write a WASM runtime in Nim as well as a WASM backend for Nim~~
00:32:21FromDiscord<Elegantbeef> Why not just Nim
00:34:46FromDiscord<raynei486> In reply to @chronos.vitaqua "Oh wait you mean": iirc Andrew did write the zig compiler by refactoring clang
00:35:09FromDiscord<Chronos [She/Her]> Ah
00:35:19FromDiscord<Chronos [She/Her]> In reply to @Elegantbeef "Why not just Nim": Wdym?
00:35:35FromDiscord<raynei486> ngl a good C compiler in Nim would be nice
00:35:43FromDiscord<raynei486> especially if it provides a library for parsing C
00:35:57FromDiscord<Elegantbeef> Just use libclang
01:31:30NimEventerNew Nimble package! spread - macro for spreading blocks into call parameters/collections , see https://github.com/metagn/spread
02:38:09FromDiscord<.elcritch> In reply to @Elegantbeef "Why are you asking": But you sorta are aren't you?! 😉
03:30:53FromDiscord<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:49NimEventerNew Nimble package! saucenao-nim - Asynchronous Nim wrapper for SauceNAO's API, see https://github.com/filvyb/saucenao-nim
05:03:05FromDiscord<heysokam> In reply to @raynei486 "I wonder if something": its done, `confy` works literally like that:↵https://github.com/heysokam/confy
05:03:23FromDiscord<heysokam> it builds .nim files with zig cc seamlessly
05:12:55FromDiscord<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:59FromDiscord<Elegantbeef> `hasKeyOrPut` is your friend
05:16:01FromDiscord<heysokam> In reply to @Elegantbeef "`hasKeyOrPut` is your friend": how would it work?
05:17:04FromDiscord<Elegantbeef> `if excepts.hasKeyOrPut(folder, initHashSet[string](): excepts[folder].incl realFile`
05:17:34FromDiscord<heysokam> holy line. yeah i think im good 🙈
05:24:31FromDiscord<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:58FromDiscord<System64 ~ Flandre Scarlet> In reply to @exelotl "Exceptions yes, Defects (integer": So no segfault crash anymore?
07:56:12FromDiscord<System64 ~ Flandre Scarlet> In reply to @heysokam "its done, `confy` works": And is it better than gcc?
07:59:06FromDiscord<odexine> at what?
07:59:30FromDiscord<odexine> In reply to @sys64 "So no segfault crash": the segfaults module is not recommended for use
08:01:51FromDiscord<System64 ~ Flandre Scarlet> In reply to @odexine "the segfaults module is": Oh alright, why?
08:02:02FromDiscord<System64 ~ Flandre Scarlet> In reply to @odexine "at what?": Optimisations and performances
08:02:25FromDiscord<odexine> In reply to @sys64 "Optimisations and performances": that's still situational
08:02:28FromDiscord<odexine> In reply to @sys64 "Oh alright, why?": buggy iirc
08:02:46FromDiscord<System64 ~ Flandre Scarlet> Oh↵So we can't avoid segfault crashes yet
08:03:21FromDiscord<odexine> iirc you cant avoid crashes from segfaults, full stop
08:03:51FromDiscord<System64 ~ Flandre Scarlet> even with segfault modules? I think it turns segfaults into exceptions so you can try-except
08:04:15FromDiscord<System64 ~ Flandre Scarlet> (edit) "modules?" => "module?"
08:07:15FromDiscord<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:20FromDiscord<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:05FromDiscord<System64 ~ Flandre Scarlet> Oh alright↵And why do some people prefer to use the ZIG compiler?
08:10:22FromDiscord<odexine> it's Zig
08:10:27FromDiscord<odexine> simpler cross compilation IIRC
08:10:35FromDiscord<System64 ~ Flandre Scarlet> Oh
08:11:01FromDiscord<System64 ~ Flandre Scarlet> Isn't ZIG still in beta?
08:11:31FromDiscord<odexine> it's Zig
08:11:50FromDiscord<odexine> Zig is indeed not in stable yet
08:18:53FromDiscord<System64 ~ Flandre Scarlet> Oh you say I should say Zig instead of ZIG?
08:19:28FromDiscord<System64 ~ Flandre Scarlet> I didn't understood that, sorry
08:19:41FromDiscord<_gumbercules> I think you should keep saying ZIG
08:20:19FromDiscord<_gumbercules> Don't let Rika stifle your creativity
08:20:35FromDiscord<System64 ~ Flandre Scarlet> The logo↵It's written in caps
08:20:43FromDiscord<_gumbercules> Tis
08:21:38FromDiscord<_gumbercules> https://media.discordapp.net/attachments/371759389889003532/1145996666072223754/Screenshot_20230829-032128_GitHub.jpg
08:21:46FromDiscord<_gumbercules> Gotta look at the codez
08:22:49FromDiscord<.maverk> what is the difference between ``proc`` and ``func`` ?
08:23:45FromDiscord<_gumbercules> proc is a procedure which makes no guarantees re mutation of arguments
08:24:58FromDiscord<.maverk> In reply to @_gumbercules "proc is a procedure": no mutation of argument i don't understand this
08:25:48FromDiscord<_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:15FromDiscord<_gumbercules> In reply to @.maverk "no mutation of argument": That means it would mutate or change the arguments passes to it
08:27:50FromDiscord<.maverk> hmmm is not the difference that func doesn't print while proc can print
08:27:50FromDiscord<_gumbercules> So if I had proc foo that took a var char bar, I could change the value of bar
08:28:23FromDiscord<_gumbercules> No but using stdout is a side effect
08:28:55FromDiscord<_gumbercules> The point of strictFuncs is to prevent side effects
08:30:09FromDiscord<_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:28FromDiscord<_gumbercules> Play around even
08:31:44*enthus1ast joined #nim
08:32:28FromDiscord<odexine> In reply to @_gumbercules "func is a function": func does not prevent argument mutability
08:33:14FromDiscord<odexine> sent a code paste, see https://play.nim-lang.org/#ix=4EOc
08:33:56FromDiscord<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:03FromDiscord<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:12FromDiscord<odexine> is my point
08:41:54FromDiscord<Phil> sent a long message, see http://ix.io/4EOe
08:42:06FromDiscord<Phil> (edit) "http://ix.io/4EOe" => "http://ix.io/4EOf"
08:43:50*PMunch quit (Ping timeout: 245 seconds)
08:44:44FromDiscord<_gumbercules> In reply to @odexine "func is only about": Weird but I guess that's because pointers
08:45:34FromDiscord<_gumbercules> And Nim is really imperative at the end of the day
08:45:38FromDiscord<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:48FromDiscord<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:58FromDiscord<_gumbercules> Just has all these things bolted on
08:46:10FromDiscord<Phil> And making them mutable via var is deemed explicit enough
08:46:13FromDiscord<_gumbercules> In reply to @isofruit "Given a recent argument": Yeah so pointers edsent
08:46:21FromDiscord<Phil> "edsent"?
08:46:29FromDiscord<_gumbercules> Given var is just a runtime managed pre
08:46:36FromDiscord<_gumbercules> (edit) "pre" => "ptr"
08:46:45FromDiscord<_gumbercules> In reply to @isofruit ""edsent"?": Essentially
08:47:18FromDiscord<_gumbercules> Sorry on my phone and I'm not great with virtual keyboards and spelling accuracy
08:47:29FromDiscord<odexine> In reply to @_gumbercules "Sorry on my phone": who is lol
08:47:40FromDiscord<odexine> people who type fast on the phone rely super hard on autocorrect
08:47:41FromDiscord<odexine> i do
08:47:59FromDiscord<Phil> sent a long message, see http://ix.io/4EOi
08:48:34FromDiscord<odexine> out parameters, remember those? i barely do
08:48:39FromDiscord<odexine> wonder if theyre still relevant
08:49:11FromDiscord<Phil> sent a long message, see https://paste.rs/J3E4f
08:49:52FromDiscord<_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:46FromDiscord<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:52FromDiscord<Phil> (edit) "a" => "an explicit"
08:51:07FromDiscord<odexine> i dont remember (see "i barely do")
08:52:23FromDiscord<Phil> I can't even find docs on them
08:52:27FromDiscord<_gumbercules> https://nim-lang.github.io/Nim/manual_experimental.html#strict-definitions-and-nimout-parameters-nimout-parameters
08:52:49FromDiscord<Phil> Ohh experimentel
08:52:52FromDiscord<Phil> I never go there
09:19:52FromDiscord<enthus1ast> Never heard of those↵(@odexine)
09:24:21*xet7 quit (Read error: Connection reset by peer)
09:32:48FromDiscord<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:43FromDiscord<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:19FromDiscord<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:54FromDiscord<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:36FromDiscord<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:51FromDiscord<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:11FromDiscord<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:28FromDiscord<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:26FromDiscord<Phil> If that package ever surpasses nimja in terms of github stars I'll cackle so damn hard
10:05:04FromDiscord<Phil> It's already beating the nimDownloadGrist repo of his 😛
10:05:19FromDiscord<Phil> (edit) "It's already beating the nimDownloadGrist repo of his ... 😛" added "and is hot on the heels of illwillWidgets"
11:13:37FromDiscord<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:02FromDiscord<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:25FromDiscord<Phil> confy?
11:55:58FromDiscord<System64 ~ Flandre Scarlet> Is it normal I can't do that? https://media.discordapp.net/attachments/371759389889003532/1146050609011765278/image.png
11:55:59FromDiscord<Phil> In reply to @_gumbercules "Don't let Rika stifle": ziG is the only way
11:56:16FromDiscord<heysokam> In reply to @isofruit "confy?": https://github.com/heysokam/confy/blob/5ffc103632aea8178b2818edff0ef91e00ec7d5e/src/confy/builder/nim.nim#L32-L46
11:57:05FromDiscord<Phil> In reply to @sys64 "Is it normal I": I mean, is the seq assigned to a mutable variable via var?
11:57:14FromDiscord<System64 ~ Flandre Scarlet> Oh, will do that
11:57:31FromDiscord<System64 ~ Flandre Scarlet> it works, thanks
11:57:54FromDiscord<Phil> norm needs to mutate the values you have in that seq to add ids etc., so they must be var
11:57:58FromDiscord<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:49FromDiscord<Phil> All these people providing packages with the solution, preventing my SO question from getting even more fame and upvotes 😤
12:07:23FromDiscord<odexine> In reply to @isofruit "All these people providing": Lol
12:45:30*azimut quit (Ping timeout: 246 seconds)
12:57:34FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4EPh
13:05:02FromDiscord<heysokam> is it because `assert false` triggers the assertion exception?↵if so... i think I've been confused by that before 😔
13:12:48FromDiscord<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:37FromDiscord<heysokam> damn double negatives
13:38:36*yellow-man joined #nim
13:38:50yellow-manp
13:38:56*yellow-man quit (Client Quit)
13:40:12FromDiscord<odexine> q
13:48:41FromDiscord<nnsee> In reply to @heysokam "does someone have an": please assert that zero does not, in fact, equal zero
13:54:14FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4EPB
13:54:48FromDiscord<odexine> good luck have fun. let's call it undefined behaviour
13:54:58FromDiscord<heysokam> kk
13:54:58FromDiscord<odexine> use the regular function versions `any`
14:01:06FromDiscord<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:01FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4EPE
14:03:04FromDiscord<frobnicate> Return the function? It returns whatever is in the statement
14:03:12FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4EPF
14:03:26FromDiscord<heysokam> In reply to @isofruit "That is a macro.": kk ty ✍️
14:04:04FromDiscord<frobnicate> Return takes you out of the function. I think you're looking for break
14:04:12FromDiscord<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:21FromDiscord<heysokam> In reply to @frobnicate "Return takes you out": yeah but break does not assign a valued, does it?
14:04:31FromDiscord<heysokam> and break also breaks the loop, not the block
14:04:40FromDiscord<frobnicate> Assign a value before you break
14:04:49FromDiscord<frobnicate> I'm confused what you want
14:04:49FromDiscord<heysokam> how?
14:04:58FromDiscord<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:00FromDiscord<heysokam> the exit value of the block is the asignment
14:05:20FromDiscord<frobnicate> You want a block that does an assignment?
14:05:42FromDiscord<heysokam> that was the idea
14:05:54FromDiscord<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:56FromDiscord<frobnicate> I don't think that's the intended use of a block
14:06:02FromDiscord<frobnicate> Use a proc
14:06:07FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4EPI
14:07:34FromDiscord<frobnicate> I'm confused as to what you're even trying to do
14:08:04FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4EPJ
14:08:49FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4EPK
14:09:27FromDiscord<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:47FromDiscord<Phil> My version is even faster as it only starts doing the loops if they actually have a chance of mattering
14:09:58FromDiscord<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:02FromDiscord<Phil> Because if your trg.deps.len condition is false, all the loops don't matter, it's always false
14:10:43FromDiscord<heysokam> In reply to @isofruit "Because if your trg.deps.len": the loops matter, because its not an `or` its an `and`
14:10:48FromDiscord<heysokam> or am i missing your point 🤔
14:11:14FromDiscord<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:30FromDiscord<Phil> (edit) "false.↵SO" => "false.↵So"
14:12:26FromDiscord<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:41FromDiscord<heysokam> i see
14:12:55FromDiscord<heysokam> might be thinking incorrectly about it
14:14:01*PMunch_ quit (Quit: Leaving)
14:14:41FromDiscord<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:02FromDiscord<heysokam> the loop is probably irrelevant to begin with for this
14:15:28FromDiscord<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:38FromDiscord<heysokam> (edit) "it" => "the loop"
14:18:28FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4EPM
14:19:45FromDiscord<Phil> Lul
14:30:19FromDiscord<odexine> blocks dont use the return keyword btw, but they can return, i didnt see this mentioned so
14:31:59FromDiscord<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:36FromDiscord<odexine> they can be used to ensure immutability without creating a new function with temp vars etc etc
14:32:49FromDiscord<Phil> Yeah, really nice
14:33:22FromDiscord<odexine> sent a code paste, see https://play.nim-lang.org/#ix=4EPS
14:38:55FromDiscord<heysokam> whats `mutate b` doing there?
14:39:50FromDiscord<_nenc> But block can't break from loops though, however assigning to a var is a workaround
14:40:11FromDiscord<_nenc> (edit) "But block can't break ... from" added "and return"
14:53:50FromDiscord<Phil> Then don't use a loop directly and write either a find proc or use any, map or filter
14:54:29FromDiscord<Phil> That should cover all usecase where you want to return something
14:58:26*kenran quit (Remote host closed the connection)
15:08:33FromDiscord<_nenc> In reply to @isofruit "Then don't use a": reasonable
15:12:44*enthus1ast quit (Ping timeout: 248 seconds)
15:13:55FromDiscord<Chronos [She/Her]> In reply to @odexine "blocks dont use the": Aren't you forced to use a label now with them?
15:14:12FromDiscord<odexine> In reply to @heysokam "whats `mutate b` doing": ... it's just some function that mutates b
15:14:18FromDiscord<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:22FromDiscord<odexine> In reply to @chronos.vitaqua "Aren't you forced to": not that i know of
15:14:28FromDiscord<Chronos [She/Her]> Bc blocks aren't supposed to be used like that
15:14:30FromDiscord<Chronos [She/Her]> Ah hm
15:14:35FromDiscord<Chronos [She/Her]> Probably misremembering then
15:15:25FromDiscord<odexine> its only deprecated if using break w/o a name as well
15:34:20FromDiscord<ravinder387> In reply to @chronos.vitaqua "Bc blocks aren't supposed": hi where are you from?
15:36:56*krux02 joined #nim
15:37:29FromDiscord<Chronos [She/Her]> In reply to @odexine "its only deprecated if": Aah alright
15:37:39FromDiscord<Chronos [She/Her]> In reply to @ravinder387 "hi where are you": I'm from England, why?
15:39:55FromDiscord<ravinder387> In reply to @chronos.vitaqua "I'm from England, why?": So, what u developing recently in nim?
15:41:49FromDiscord<ravinder387> I can do single page application with only javascript or nim. why karax developed then?
15:43:47FromDiscord<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:56FromDiscord<Chronos [She/Her]> As for web development, that's not really my area aha
15:44:08FromDiscord<Chronos [She/Her]> @Phil definitely knows more than me
16:00:41FromDiscord<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:58FromDiscord<odexine> it does literally anything that mutates the variable
16:01:01FromDiscord<odexine> whatever you want it to
16:01:03FromDiscord<odexine> its a placeholder
16:01:18FromDiscord<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:47FromDiscord<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:34FromDiscord<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:53FromDiscord<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:55FromDiscord<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:02FromDiscord<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:20FromDiscord<Phil> So similar mechanism could work for sockets
16:41:04FromDiscord<Chronos [She/Her]> Hey Beef, wondering how would I decide how much RAM to allocate to a WASM plugin
16:41:12FromDiscord<Chronos [She/Her]> And how would I not go over the memory limit
16:50:14FromDiscord<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:19FromDiscord<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:28FromDiscord<Phil> (edit) "alive" => "alive?"
17:13:38FromDiscord<Phil> (edit) "really" => "all rely"
17:14:09FromDiscord<odexine> In reply to @isofruit "So do so sockets": it's the backbone of making something unreliable more reliable, id say
17:15:44FromDiscord<Phil> Just seems so common that it's weird that sockets don't come with that by default
17:22:42FromDiscord<Phil> Then again I guess that makes them more universal in the few cases where ping pong overhead is unneeded
17:22:46FromDiscord<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:55FromDiscord<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:16FromDiscord<Phil> Waaaait a second... Is there an equivalent to http for request response style communication between threads not over sockets?
17:24:18FromDiscord<jaar23> In reply to @isofruit "So do so sockets": Yes
17:25:17FromDiscord<enthus1ast> you can also acknowlege every message you sent, this way you switch between send and receive
17:25:22FromDiscord<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:26FromDiscord<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:58FromDiscord<jaar23> In reply to @isofruit "Waaaait a second... Is": hmm, i think you mean channel?
17:27:22FromDiscord<Phil> In reply to @jaar23 "yes, i think this": Based on that you can also have message retry buffers etc., sounds good
17:27:22FromDiscord<enthus1ast> @Phil\: Appdev == Webdev these days \:)
17:27:47FromDiscord<jaar23> everything is web nowadays...
17:27:54FromDiscord<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:22FromDiscord<enthus1ast> http is good enough and nearly everything can speak it so yeah
17:28:35FromDiscord<enthus1ast> http + mime
17:29:04FromDiscord<Phil> Also no, appdev means you need to put on boxing glove and fight with apple QA folks
17:29:17FromDiscord<Phil> It's far more violent
17:30:23FromDiscord<Phil> In reply to @jaar23 "hmm, i think you": I mean, maybe? Do channels work between an unrelated Daemon and your program?
17:41:29FromDiscord<jaar23> i using channel as a queue currently.
17:42:17FromDiscord<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:10FromDiscord<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:08FromDiscord<Chronos [She/Her]> In reply to @isofruit "So do so sockets": Ik Discord does, iirc Minecraft does too
17:51:52FromDiscord<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:33FromDiscord<Phil> I'm basically wondering if there are scenarios with normal sockets where extra considerations may make ping pong pointless
17:54:09FromDiscord<jaar23> In reply to @enthus1ast "<@614403538172379156>\: you can't ,": it works now, thanks! @Phil @enthus1ast
17:54:41FromDiscord<Chronos [She/Her]> Ah
17:56:28FromDiscord<odexine> In reply to @isofruit "Waaaait a second... Is": RPC?
17:57:49FromDiscord<Phil> Do those respond even if the response is just "RPC call finished execution, returning void" ?
17:58:40FromDiscord<odexine> implementation dependent
17:58:40FromDiscord<odexine> https://en.wikipedia.org/wiki/Remote_procedure_call
17:59:34FromDiscord<odexine> iirc usually it does, and otherwise it prolly wont be called RPC
18:00:11FromDiscord<odexine> ~~to note that erlang/elixir is in the list, and hence i must shill it again~~
18:00:19FromDiscord<Phil> Then that's more socket style then, was more looking for a fixed request response model like http has
18:00:48FromDiscord<odexine> please read the wikipage
18:16:37FromDiscord<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:17FromDiscord<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:45FromDiscord<Phil> That seems wild, though I guess that can make sense (?)
18:17:52FromDiscord<Phil> (edit) "That seems wild, though I guess that can make sense ... (?)" added "on a local machine"
18:18:29FromDiscord<odexine> i'd say theyre not necessarily sync and an async impl would prolly still satisfy the "what RPC is"
18:20:08FromDiscord<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:36FromDiscord<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:13FromDiscord<odexine> :baqua:
18:23:43FromDiscord<Phil> baqua? Is that some recolored version of aqua from konosuba?
18:25:00FromDiscord<odexine> no
18:25:02FromDiscord<odexine> other aqua
18:25:07termerwhat're you talking about
18:25:48FromDiscord<odexine> an emoji i sent
18:26:09termerCan't see it
18:27:02termeralso an update for you guys: I'm currently eating chocolate chip pancakes
18:28:07FromDiscord<ravinder387> In reply to @termer "also an update for": I never eat pancakes in my life
18:29:09termerYou should change that
18:29:23termerDo you live in Houston? I'll make you some kickass pancakes if you are
18:29:42termer*if you do
18:30:04FromDiscord<odexine> just doxxed you, i know where you live
18:30:11termerwhere do I live
18:40:55FromDiscord<␀ Array> termer u better add strawberries to that
18:41:33termerI wanted to, but I didn't have any
18:43:07FromDiscord<heysokam> 🫐 pancakes 🤤
18:43:42termerthe blueperry flavor goes away too quickly
18:43:44termerbut they are good
18:43:46termer*blueberry
18:43:54FromDiscord<␀ 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:05FromDiscord<.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:03qwruse 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:17FromDiscord<Elegantbeef> OOMhooks↵(@Chronos [She/Her])
20:12:50FromDiscord<Chronos [She/Her]> How would I decide how much RAM to allocate tho-
20:14:15termerget more RAM and allocate all you want
20:20:26FromDiscord<Elegantbeef> I mean how much ram does a program liikely need? 😄
20:26:20*krux02 quit (Remote host closed the connection)
20:52:16FromDiscord<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:48FromDiscord<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:31FromDiscord<odexine> Calling convention? I have no other ideas lol
20:54:48FromDiscord<jviega> It shouldn't be? It's just cdecl
20:55:12FromDiscord<Chronos [She/Her]> In reply to @Elegantbeef "I mean how much": Shrug
20:55:25FromDiscord<odexine> Your computer might just be cursed
20:55:51FromDiscord<Chronos [She/Her]> 4 MB per plugin?-
20:55:53FromDiscord<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:14FromDiscord<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:31FromDiscord<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:25FromDiscord<.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:51FromDiscord<mratsim> In reply to @chronos.vitaqua "I grew up in": Found the electron programmer
21:29:24FromDiscord<Chronos [She/Her]> In reply to @mratsim "Found the electron programmer": Ew JS, no thanks lmao
21:29:32FromDiscord<Chronos [She/Her]> I'm used to Python lol
21:37:30FromDiscord<djazz> I'm a JS dev who now codes embedded in Nim for fun, precious memory!
21:42:43FromDiscord<Chronos [She/Her]> In reply to @djazz "I'm a JS dev": What amount of memory are you used to, then? 👀
21:56:31termerplenty
21:56:39termerMost JS devs don't know what memory is
21:56:46termerdjazz isn't a normal JS dev
21:57:07FromDiscord<djazz> Hehe
21:57:34FromDiscord<djazz> I remember coding on my netbook… 1.5 GB memory
21:58:30FromDiscord<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:52FromDiscord<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:46FromDiscord<Chronos [She/Her]> In reply to @djazz "Now, I can’t have": I can do it with 24 GB on Linux tho-
23:02:19termerI had 1GB of memory on an old device I had, managed to run Eclipse AND Minecraft on it at the same time
23:02:24termerit was definitely raping the swap
23:03:20FromDiscord<Elegantbeef> Damn chronos has a 24gb phone and plays games through termux
23:03:37termerMy phone has 8GiB RAM
23:03:41termermaybe more, not sure
23:03:53FromDiscord<Elegantbeef> I don't know, mine has maybe 1GB
23:04:05termerMy previous one had 2GiB
23:04:18termerthe one before that had about 100MiB lol
23:04:26FromDiscord<Elegantbeef> But I need my phone like I need a venereal disease
23:04:34termerI hate phones and avoid using htem
23:05:00FromDiscord<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:08termerwould love one of those to ACTUALLY be usable
23:06:43FromDiscord<Elegantbeef> Be the change you want to see in the world
23:06:56termerI don't know MMS protocol
23:06:59termerthat's the issue here
23:07:16FromDiscord<Elegantbeef> That's always the first step of learning anything
23:07:28termerOpen source MMS is almost nonexistent, surprisingly
23:12:20FromDiscord<Elegantbeef> hey MMS is slowly getting phased out anyway
23:12:35termerfor something with even less OSS support lol
23:13:10FromDiscord<Elegantbeef> Are the not just leaning on internet chat?
23:13:30FromDiscord<Elegantbeef> they\
23:16:34termerNo idea
23:23:41*azimut joined #nim
23:28:51FromDiscord<Chronos [She/Her]> In reply to @Elegantbeef "Damn chronos has a": No, on my PC lmao
23:29:29FromDiscord<Chronos [She/Her]> MC taking up 12 GB, 10+ chromium tabs open and VSC open too
23:29:40FromDiscord<Chronos [She/Her]> While my system updates in the background