<< 12-12-2023 >>

00:33:25FromDiscord<.bobbbob> another prologue question, is there no way to get the ip address of a request?
02:09:34FromDiscord<.bobbbob> nevermind, ctx.request.hostName has the ip, I just didnt have proxy_set_header Host $host; in nginx so it was blank
02:48:56*xet7 joined #nim
02:54:07*krux02_ quit (Remote host closed the connection)
03:13:26FromDiscord<zectbumo> Sequels are always the best, Terminator 2, Aliens, Python 2, Nim 2
03:14:46FromDiscord<Elegantbeef> C++21
03:17:34FromDiscord<zectbumo> are you a new dog every day? and what happened to your beef?
03:17:49FromDiscord<ElegantBeef> Matrix vs. discord
03:19:18FromDiscord<zectbumo> I'm always curious about your setup
03:19:49FromDiscord<zectbumo> dual computer? That's what I'm running now. I just started about 2 weeks ago
03:20:02FromDiscord<Elegantbeef> Nah just one PC
03:20:15FromDiscord<Elegantbeef> I just have a good feeling for when the bridge eats shite
03:20:15FromDiscord<zectbumo> what made you install discord?
03:21:17FromDiscord<Elegantbeef> I've been using it since it released pretty much cause I was hosting a teamspeak server and was dual booting
03:23:29FromDiscord<zectbumo> teamspeak always amazed me of their longevity. but I had a talk with an admin once and really no good alternatives if you want to roll your own.
03:24:16FromDiscord<Elegantbeef> mumble has existed for quite some time
03:27:09FromDiscord<Elegantbeef> Now we have matrix and we can be merry(especially with the voice rooms being added)
03:27:21FromDiscord<zectbumo> v1.1 in 2009
03:29:44FromDiscord<zectbumo> thunderbird is a matrix client??
03:30:20FromDiscord<odexine> It is?
03:30:34FromDiscord<Elegantbeef> Yea I think it got support a while back
03:31:07FromDiscord<Elegantbeef> Only as a text client really though
03:31:38FromDiscord<Elegantbeef> Lacks space and voip support
03:33:56FromDiscord<zectbumo> spaces is the new voice rooms?
03:34:10FromDiscord<Elegantbeef> No spaces is matrix's "server" equivlent
03:34:18FromDiscord<Elegantbeef> It lets you group rooms together for easy management/joining
03:34:56FromDiscord<Elegantbeef> Though it's not like discord servers cause rooms are still disconnected, it's really 'decentralised servers'
03:35:28FromDiscord<Elegantbeef> Yardanico is annoyed by rooms cause they do not propagate bans, they're a moderation nuisance 😄
03:35:29FromDiscord<zectbumo> is this using XMPP or did that die?
03:35:42FromDiscord<Elegantbeef> Matrix uses matrix
03:35:47FromDiscord<Elegantbeef> It's similar to XMPP but not it
03:35:54FromDiscord<zectbumo> sounds better
03:36:07FromDiscord<Elegantbeef> Depends if you ask a XMPP fan 😄
03:36:40FromDiscord<zectbumo> XMPP was supposed to be the end all of communication protocols. I guess they should have gone JMPP instead.
03:37:02FromDiscord<Elegantbeef> Yea matrix aims to do the same, but it has terribly low adoption outside FOSS places
03:37:10FromDiscord<Elegantbeef> It's picked up a bit in governments though
03:37:11*edr quit (Quit: Leaving)
03:37:18FromDiscord<Elegantbeef> Since the EU is moving towards open tech
03:37:46FromDiscord<Elegantbeef> Germany's Military and medical communication systems are using matrix iirc
03:37:57FromDiscord<zectbumo> that's cool to hear
06:24:35NimEventerNew thread by undefined: Can Nim interact with the hardware at a lower level than the C programming language?, see https://forum.nim-lang.org/t/10757
06:40:52*rockcavera quit (Remote host closed the connection)
07:18:04FromDiscord<.bobbbob> sent a code paste, see https://play.nim-lang.org/#ix=html>
07:18:38FromDiscord<.bobbbob> (edit)
07:19:13FromDiscord<.bobbbob> sent a code paste, see https://play.nim-lang.org/#ix=html>
07:29:20FromDiscord<nnsee> In reply to @.bobbbob "does anyone know why": how big is wtvr.opus?
07:29:38FromDiscord<nnsee> chances are it's larger than the pipe buffer limit
07:29:43*PMunch joined #nim
07:31:13FromDiscord<.bobbbob> 3.5mb, how can I check and/or change that limit?
07:32:52FromDiscord<.bobbbob> hm no I dont think it's that because Im doing another command that inputs an image file to an imagemagick command, and it works fine with image file upwards of 8mbs
07:33:52FromDiscord<nnsee> In reply to @.bobbbob "3.5mb, how can I": the pipe buffer limit is around 64k on most Linux systems
07:34:41FromDiscord<nnsee> as a test, try setting the ffprobe command to read the file `/dev/stdin` or `/proc/self/fd/0` instead of a pipe
07:35:55FromDiscord<.bobbbob> nope changing it to /dev/stdin gets the same error
07:36:20FromDiscord<nnsee> it might be complaining about stdout instead for some reason
07:36:49FromDiscord<nnsee> i'm not too familiar with the osproc module to be helpful here
07:39:08FromDiscord<.bobbbob> sent a code paste, see https://play.nim-lang.org/#ix=html>
07:39:28FromDiscord<.bobbbob> (edit)
07:41:11*advesperacit joined #nim
07:43:42FromDiscord<.bobbbob> gah if I cant get this to work im gonna have to write a temporary file
08:02:06FromDiscord<niontrix (Tobias Heinlein)> sent a long message, see <!doctype html>
08:13:32FromDiscord<Elegantbeef> use `func` instead of proc
08:18:41FromDiscord<nnsee> In reply to @.bobbbob "gah if I cant": out of curiosity does it break with the pipe error if you only serve eg the first 4K bytes of the file?
08:26:23*azimut quit (Remote host closed the connection)
08:26:51*azimut joined #nim
08:37:36FromDiscord<Phil> Trying to access channels stored in a pointer-table and not triggering a copy somewhere truly is difficulty level impossibru
08:38:27FromDiscord<zectbumo> @ElegantBeef in the generated nimib writeups the little house and the github cat contain broken links
08:38:41FromDiscord<odexine> In reply to @isofruit "Trying to access channels": whatcha especially have difficulty with
08:39:56FromDiscord<odexine> In reply to @isofruit "I mean, that works,": also i realise i never responded to this; you mean the user provides handleRequest and you want routeMessage to work with any declaration of?
08:46:40FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=html>
08:47:09FromDiscord<Phil> Not that making getChannel a proc makes things any better
08:48:12FromDiscord<zectbumo> it seems like all nimble examples are broken links
08:48:15FromDiscord<Phil> Maybe I should store ref Channels instead of straight up channels
08:48:29FromDiscord<odexine> i'd say so too
08:49:18FromDiscord<zectbumo> https://nimble.directory/pkg/pixie↵for example contains all broken images pointing to an examples folder. other projects same
08:49:31FromDiscord<Phil> Doesn't solve my problem as I still get wonky pointers though
08:49:42FromDiscord<Phil> Just that they're not nil anymore but refs to nil
08:53:59FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=html>
08:54:38FromDiscord<odexine> thats...
08:55:01FromDiscord<odexine> okay i think the problem is in using the global pragma in that sense, at least that would be my guess
08:56:08FromDiscord<Phil> The problem is without it I open myself up to use-after-frees
08:56:35FromDiscord<Phil> And get "IllegalOperation" runtime SIGILLs which I assume is a meaner variation of Segfault
08:57:29FromDiscord<odexine> yes and thats why you use a direct pointer w/ manual alloc instead of fucking around with global xd
08:57:55FromDiscord<odexine> i'm not too familiar with the semantics of a C local-static variable (which is what {.global.} produces)
08:58:49FromDiscord<Phil> So basically I now need to figure out which of the around 50 alloc named procs to call, back to research I gues
08:59:47FromDiscord<odexine> use createShared
09:00:13FromDiscord<odexine> one moment im looking at the cgen to see what it really actually generates
09:01:15NimEventerNew thread by aiac: Undeclared identifier error when using string format in template, see https://forum.nim-lang.org/t/10758
09:01:59FromDiscord<odexine> okay i see
09:02:09FromDiscord<odexine> since its a generic it "works"
09:02:13FromDiscord<odexine> or rather should
09:03:14FromDiscord<odexine> oh of course in add channel you dont actually make any damn channels @Phil
09:03:31FromDiscord<odexine> you dont open them
09:04:09FromDiscord<odexine> yeah
09:04:18FromDiscord<odexine> literally just `channel.open()` in addchannel fixes everything
09:04:35FromDiscord<odexine> funny
09:05:14FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=html>
09:05:22FromDiscord<odexine> no, i mean with the non-ref code
09:05:38FromDiscord<odexine> In reply to @isofruit "This doesn't reflect my": this + channel.open()
09:06:07FromDiscord<Phil> Now that just returns me nil pointers from the template there
09:06:12FromDiscord<odexine> i think the ref-in-a-pointer is a bit dangerous as i dont know if the GC would act well with it
09:06:31FromDiscord<Phil> Or at least the "got" echo's just echo out 0
09:06:39FromDiscord<odexine> yeah weird
09:07:15FromDiscord<odexine> dont return var Channel but ptr Channel
09:07:37FromDiscord<odexine> i'm yet again unfamiliar with the semantics of returning var xd
09:09:56FromDiscord<Phil> Hmm it works if I do a dedicated assignment to a var variable
09:10:01FromDiscord<Phil> So I'll save myself the ptr there
09:10:13FromDiscord<Phil> Well, it sends correctly at least, still not reading
09:10:39FromDiscord<odexine> In reply to @isofruit "Hmm it works if": what
09:12:06FromDiscord<Phil> Oh for the.... no its making a fucking copy again
09:12:20FromDiscord<Phil> it just doesn't segfault, but the addr of the channel is different
09:12:34FromDiscord<odexine> of course it is
09:14:08FromDiscord<odexine> since you assigned it to another variable thats where the copy happens so
09:14:12FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=html>
09:14:32FromDiscord<Phil> Just not in the setup I'm using it in somehow
09:18:29FromDiscord<Phil> Even works if getChannel is a proc so it lending out a ref here seems to work in this getup... but man I give up, new pointer approach then ugh
09:18:48FromDiscord<Phil> In reply to @odexine "dont return var Channel": Well I must have a var channel for trySend
09:18:50FromDiscord<odexine> ok stop here
09:19:03FromDiscord<odexine> its hard to start explaining when you're going way faster than i am
09:20:03FromDiscord<odexine> sent a code paste, see https://play.nim-lang.org/#ix=html>
09:21:04FromDiscord<odexine> sent a code paste, see https://play.nim-lang.org/#ix=html>
09:21:12FromDiscord<Phil> I was about to claim incorrectness but no, the address is different, they last 2 digits differ and I missed that >_>
09:22:06FromDiscord<odexine> sent a code paste, see https://play.nim-lang.org/#ix=html>
09:22:18FromDiscord<odexine> notable change is last line of getCh
09:22:41FromDiscord<odexine> otherwise the template signature is unchanged (returns var Channel)
09:23:34FromDiscord<Phil> So nim can just "reinterpret" `ptr Channel[Msg]` as `var Channel[Msg]`?
09:23:38FromDiscord<odexine> no
09:23:48FromDiscord<odexine> see end of that line, i dereference with `[]`
09:23:55FromDiscord<Elegantbeef> Why is `getChannel` a template? 😄
09:24:08FromDiscord<Elegantbeef> Ah nvm this is phils stuff
09:24:11FromDiscord<odexine> yes thats true, in this case you can go back to using `func`
09:24:24FromDiscord<Phil> this is like attempt number 50 and I was getting annoyed with proc approaches not working at all
09:24:57FromDiscord<odexine> ive been particularly slow with code recently xd i bet me from a few months ago would be quicker with realising this xd
09:41:23PMunchHmm, anyone know of a small multi-header C library meant to be compiled directly into your program
09:41:45PMunchThe kind of thing which would be wrapped with {.compile.} pragmas
09:42:17FromDiscord<Elegantbeef> wasm3 is pretty small and can be compiled easily
09:42:31PMunchOoh, that might work well
09:42:52FromDiscord<Elegantbeef> https://github.com/beef331/wasm3/blob/master/src/wasm3/wasm3c.nim refer to my Nim file 😄
09:58:02FromDiscord<Clonkk> With destructor based var T being moved out, howwould you implement a destructor for an object containing a socket seeing as the object cannot be modifed & close / disconnect operation would likely raise an exception (and exception in destructor is less than ideal) ?
09:58:07FromDiscord<Clonkk> I'm curious what people think
09:59:58FromDiscord<Phil> Is there a way to have a readLine() call in a while-loop and it not block? More like "feed it in a stream and if a value is there work with it"... I'm describing async or just a queue in a separate thread again aren't I...
10:01:26FromDiscord<Clonkk> You could open a Stream on stdin and use peek maybe ?↵(@Phil)
10:02:56FromDiscord<niontrix (Tobias Heinlein)> I tried that already, but unfortunately this produces the same error, because the compiler tells me that hash can have side effects.
10:04:32FromDiscord<niontrix (Tobias Heinlein)> Uh, ok. Strange. It compiles, but nimsuggest gives me the error message I wrote before
10:04:59FromDiscord<niontrix (Tobias Heinlein)> Maybe I need a newer version of nimsuggest?
10:08:22FromDiscord<nnsee> nimsuggest a shit sometimes
10:09:12FromDiscord<niontrix (Tobias Heinlein)> is there something better?
10:11:31FromDiscord<nnsee> well, nimlangserver exists, but under the hood it's still using the nimsuggest internals iirc
10:12:14FromDiscord<niontrix (Tobias Heinlein)> that's what i thought, too
10:13:18FromDiscord<niontrix (Tobias Heinlein)> but turning the procs into funcs worked. so, thanks for the help Elegantbeef !
10:20:35FromDiscord<odexine> In reply to @Clonkk "You could open a": I believe peek still blocks on lack of data as it’s essentially a read + set position
10:20:56FromDiscord<odexine> Plus I don’t think set position works on standard input
10:21:05FromDiscord<nnsee> it doesn't
10:21:42FromDiscord<odexine> Portable non blocking standard input is only possible using threading, otherwise if you don’t care about windows I believe it’s been done before
10:22:21FromDiscord<odexine> I mean that there’s code out there that achieves async io for Unixes, I don’t know where probably that one async tools repo
10:23:58FromDiscord<nnsee> https://web.archive.org/web/20170407122137/http://cc.byexamples.com/2007/04/08/non-blocking-user-input-in-loop-without-ncurses/
10:24:01FromDiscord<nnsee> C, though
10:24:07FromDiscord<nnsee> should be pretty easily portable
10:25:11FromDiscord<nnsee> oh wait, you probably aren't operating in a tty?
10:25:47FromDiscord<odexine> No clue, this is Phil’s problem
10:26:25FromDiscord<nnsee> yeah I meant Phil
10:27:09FromDiscord<Phil> In reply to @nnsee "oh wait, you probably": Just normal terminal, this is an example application.↵I'm just vexxed that I can't process messages on the side while waiting for user input, that makes me examples slightly less nice.
10:28:19FromDiscord<TӨMΛ ☠> sent a code paste, see https://play.nim-lang.org/#ix=html>
10:28:54FromDiscord<TӨMΛ ☠> (edit)
10:30:39FromDiscord<Phil> sent a long message, see <!doctype html>
10:31:27FromDiscord<Phil> Which is of course not good proper code, but makes the output printed to the terminal by the example more sensible
10:32:01FromDiscord<Phil> In an actual application I'd start to go hunting for some async input stuff but for an example to show-case threadButler I won't bother
10:35:41FromDiscord<Phil> The amount of unholy stuff in this package is sth I'm not sure how to feel about.↵Like, not sure if that's just the problem domain being oof or whether the approach was bad.↵Like, maybe one with inheritance and methods would've been easier.↵Give channel the root object for sending, then you inherit from that root object, implement a method as "handler"to execute on the other thread or sth
10:35:54FromDiscord<odexine> sent a code paste, see https://play.nim-lang.org/#ix=html>
10:36:06FromDiscord<Phil> (edit) "The amount of unholy stuff in this package" => "sent a long message, see <!doctype html> <html lang=en> <head> <meta charset=utf-8> <title>&nbsp;</title> </head> <style> body { font-family: monospace; margin: 2em; } </style> <body> <p>ix.io" | "sth I'm not sure how to feel about.↵Like, not sure if that's just the problem domain being oof or whether the approach was bad.↵Like, maybe one with inherita
10:37:41FromDiscord<odexine> In reply to @isofruit "The amount of unholy": What problems did you have with macro cache again?
10:38:54FromDiscord<Phil> That there's no CacheTable[CacheSeq].↵I solve that by storing an nnkStmtList in CacheTable and using that like a list
10:41:39FromDiscord<odexine> i mean the core issue; what reason did you need a table of seqs for?
10:43:56FromDiscord<Phil> I want users to be able to register types over various separate files and group them with a static string name.↵Once I have all of them I want to generate an enum and object variant per name provided, basically each name gets an object variant that can encompass all types that were registered for that name
10:45:05FromDiscord<odexine> so this is unrelated to why you think inheritance would be better okay
10:45:29FromDiscord<odexine> i dont know how inheritance would behave over multithreading
10:45:34FromDiscord<Phil> Not quite, the (not really thought out) idea was that maybe I could replace the object variant with an object via inheritance
10:46:05FromDiscord<Phil> The only reason I need the object variant so far is because channels need a concrete type for their instantiation
10:46:35FromDiscord<Phil> I could achieve the same by doing `Channel[RootMsg]` and all messages then subclass from `RootMsg` with RootMsg being some ref type
10:48:04FromDiscord<Phil> Once transported to the other channel the channel would then call its `handleEvent()` method, possibly with extra parameters added in by the thread itself (e.g. with AppState on a thread with owlkettle running on it, or a db connection in the backend thread, depends, that's flexible)
10:56:48FromDiscord<odexine> that would probably work but what's the issue with object variants?
10:56:51FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=html>
10:56:57FromDiscord<odexine> im not really familiar with what youre doing really
10:57:31FromDiscord<odexine> In reply to @isofruit "I may just need": yet again "why is this a template"
10:58:29FromDiscord<Phil> sent a long message, see <!doctype html>
10:59:13FromDiscord<Phil> In reply to @odexine "yet again "why is": Because there's no way in hell procs have even a chance of achieving this since this is code-generation stuff, so I won't even bother trying.↵This is trying to treat types like sth you could put into an iterable, which is just not possible.
10:59:39FromDiscord<Phil> And it was also just to communicate what I'm roughly after, chances are I'll need to express sth like this as a macro
10:59:51FromDiscord<odexine> would a compile time proc be unable to do this?
11:00:29FromDiscord<Phil> Yes because the fundamentals of it already don't work.↵Not unless you are in macro-land and acting on NimNode, in which case this would be just a helper-proc to be called by a macro
11:00:55FromDiscord<Phil> The very definition of the proc requires you to be able to have a `varargs[typedesc]`and that's just not happening
11:04:34FromDiscord<Phil> I mean, I'll have to first implement an equivalent with inheritance but I'm starting to appreciate where the ability to have dynamic dispatch comes in quite handy.↵Not having it means you need a whole lot of code generation facilities - the question just becomes then what's easier to deal with, the code generation that will not let you compile anything if its wrong, or the inheritance that may blow up in your face at runtime
11:05:36FromDiscord<odexine> `varargs[typedesc]` in explicit form is `varargs[typedesc[T]]` where T is the type the typedesc describes, so i cant imagine it ever working period regardless of proc, template, macro, no? at least to my understanding
11:06:58FromDiscord<Phil> The idea is more that I need a list of types. In macros I could have those in the shape of the user defining a list of NimNodes which are identNodes of the type
11:06:59FromDiscord<Phil> (edit) "type" => "types"
11:07:04FromDiscord<odexine> you would need a `varargs[untyped]` so yes indeed it is limited to macros/templates in such case, or a `varargs[NimNode]` where procs would work yes but then it would be a pain to use
11:07:57FromDiscord<odexine> okay so i took you literally okay
11:09:22FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=html>
12:41:44FromDiscord<Phil> Err... how do I kill a thread created via "createThread" ?↵I have the thread instance, but terminateThread is in a private package and that doesn't feel like I should be importing that
12:42:38FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=html>
12:42:49FromDiscord<Phil> (edit)
12:53:04FromDiscord<Phil> Hmm there appear to just straight up not be any utilities for killing threads that you should be using, just joinThread.↵Seems like I may have to provide a mechanism to kill the loop a thread is in myself
13:01:24advesperacitsending a value through a channel is a common way to stop threads, tryRecv in a the main loop for example
13:03:11FromDiscord<Phil> That one I already do to listen for messages in general.↵What I'll likely do is add a "Kill"-Variant to all my object variants that I send through channels.↵When a message is of the "Kill"-Variant it raises a "KillError" which breaks the main-loop↵Just need to add that to all the code-generation pieces
13:03:29FromDiscord<Phil> (edit) "breaks" => "is caught and triggers a break of"
13:03:40FromDiscord<Phil> (edit) "main-loop↵Just" => "thread's while-loop↵Just"
13:12:35*edr joined #nim
13:15:41FromDiscord<spotlightkid> The type you send through the channel could be a tuple `(should_exit: bool, value: T)` or an `Option` or `T` could have "sentinel" value, which signals exiting the loop.
13:17:25FromDiscord<Phil> In reply to @spotlightkid "The type you send": That implies that any message can kill the loop, when imo it makes more sense to just regard "killing the loop" as its own kind of message
13:20:26FromDiscord<odexine> it depens on how you look at it
13:20:50FromDiscord<odexine> are there scenarios where you want to kill the thread without also sending a "real" message to it beforehand?
13:21:33Amun-Rahmm, is there a way nimble/nim doc not to include "src/" in title?
13:23:34FromDiscord<Phil> In reply to @odexine "are there scenarios where": Yes, when the client gets killed all its servers also need to die
13:23:59FromDiscord<Phil> That is true for any scenario this would be used in because it's for applications, so you automatically always have a client and a server
13:24:00FromDiscord<Phil> at least one server
13:24:24FromDiscord<Phil> The client may be a CLI, or a GUI like owlkettle or whatnot, but it will exist and without it the threads are pointless
13:24:57FromDiscord<Phil> (edit) "The client may be a CLI, or a GUI like owlkettle or whatnot, but it will exist and without it the ... threadspointless," added "server" | "pointless" => "pointless, thus they need to die and trigger their shutdown events"
13:27:31FromDiscord<spotlightkid> > That implies that any message can kill the loop, when imo it makes more sense to just regard "killing the loop" as its own kind of message↵Like I said, use an `Option`. Then `some(msg)` meanss a "real" message and `empty(msg)` means "exit loop".
13:30:30FromDiscord<Phil> Note that `msg` is an object-variant that I generate on-the-fly that can be any of N kinds of messages.↵Might as well add a "killkind" to that
13:30:46FromDiscord<Phil> That's imo a more correct way to express that.
13:31:14FromDiscord<Phil> (edit) "that." => "that as it more accurately portrays what I want and how I view the shutdown process."
13:35:01FromDiscord<spotlightkid> If you have several different kinds of messages anyway, which are sent over one channel, yes, that seems a reasonable approach.
13:36:47FromDiscord<Phil> In reply to @spotlightkid "If you have several": That's pretty much what I'm building.↵You specify a bunch of types that should be sendable to a specific thread, I generate you the channel to send to that thread, the object variant necessary, a couple utility procs to convert your types into the object variant and send them and a routing proc for the thread to unpack the object variant
13:37:32FromDiscord<Phil> Given that I already generate craptons of code for type-safe, static-dispatch message sending, might as well
13:37:39FromDiscord<Phil> add kill messages
13:52:28FromDiscord<graveflo> yea that is pretty much the standard way of managing threads. Make a msg queue and when the main thread is shutting down ask each for a graceful exit and join them. There are fancier things you can put on top of that ofc but that's the idea
13:53:13FromDiscord<Phil> Now to figure out why my codegen shows me that the code gets generated, but somehow it's not available when I try to call it from a template
13:54:40FromDiscord<Phil> Oh FFS, the entire "you forgot to generate the proc in a mode that exports it" has caught me like 4 times today alone already
13:54:55FromDiscord<Phil> It's the silly little things 🤣
13:56:27FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=html>
13:56:52FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=html>
14:04:55*azimut quit (Ping timeout: 240 seconds)
14:07:13*azimut joined #nim
14:10:26FromDiscord<graveflo> that is really weird. Is `sendKillMessage` generated with a template or macro?
14:13:31FromDiscord<graveflo> try `Msg.T` ?
14:20:16FromDiscord<Phil> It is generated via macro indeed, but it should've been generated like 50 lines or so before this runs in global scope
14:21:51FromDiscord<Phil> But yeah, `Msg.type()` did it
14:21:57FromDiscord<graveflo> well it does appear to be there. It's just saying that the second input is not a `typedesc`
14:22:00FromDiscord<Phil> T was not doable because that's not a known identifier
14:22:32FromDiscord<graveflo> ah good to know. I think `T` works with generic type variable parameters
14:24:07FromDiscord<Phil> And yep that did it
14:24:19FromDiscord<Phil> HAH! It's kinda funny to see the data-race to print to the terminal
14:27:04FromDiscord<Phil> I kinda wish I could associate a thread name with a threadId, but threadName is a construct from myself that goes away at compiletime
14:27:20FromDiscord<Phil> And I can't think of a non-hacky way to do the association properly
15:11:18*PMunch quit (Quit: Leaving)
15:38:38FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=html>
15:40:03FromDiscord<Phil> (edit)
15:42:57FromDiscord<Phil> It's somewhat meh that you have 3 separate blocks (block to call `generateSetupCode()`, block to call `generateRouters()`, block to set-up a server and run it via `withServer`) but I think it's not in the cards to really make that simpler
16:31:50FromDiscord<crembo> sent a code paste, see https://play.nim-lang.org/#ix=html>
16:31:55FromDiscord<crembo> (edit)
16:33:16FromDiscord<crembo> (edit)
17:00:06FromDiscord<graveflo> is the "wrong" answer one of the right `answer`s from the loop?
17:21:36*rockcavera joined #nim
17:28:59FromDiscord<crembo> sorry I worded the confusingly, I expect `rez` to end up with a certain value (which I know now), but it doesn't. I haven't checked if every individual `answer` is is correct (I actually don't know that - it's like 100k answers I'd need to check 😅 )
17:35:07FromDiscord<graveflo> move the for loop out of `parallel` ?
17:35:26FromDiscord<graveflo> idk if nim automatically manages the threadpool size but that could be it
17:36:16FromDiscord<graveflo> nah that's not it
17:36:29FromDiscord<Phil> Hmm how do I link specifically to another module file in doc comments? Trying to read through the docs and I don't get it
17:39:05FromDiscord<alwaysoutofrange> sent a code paste, see https://play.nim-lang.org/#ix=html>
17:39:39FromDiscord<graveflo> sent a code paste, see https://play.nim-lang.org/#ix=html>
17:40:12FromDiscord<crembo> does it work if you it's 1_000_000 instead of 100? 😅
17:40:18FromDiscord<crembo> (edit) "if" => "for"
17:40:35FromDiscord<crembo> (edit) "does it work for you it's 1_000_000 instead of 100? 😅 ... " added "and I'm using nim 2"
17:42:35FromDiscord<nasuray> sent a code paste, see https://play.nim-lang.org/#ix=html>
17:42:38FromDiscord<graveflo> In reply to @crembo "does it work for": hmm no
17:43:55FromDiscord<crembo> In reply to @graveflo "hmm no": fair enough, well no worries! I guess it's a limitation of spawn and parallel!
17:47:36FromDiscord<Phil> In reply to @alwaysoutofrange "Hello everyone, Ive got": Wait, how are you calling this?↵I'd like to play around with this and your minimal example doesn't run the read_input proc.↵If I do run it, then should I just copy paste the echo text you provide here into the terminal?
17:48:10FromDiscord<alwaysoutofrange> sent a code paste, see https://play.nim-lang.org/#ix=html>
17:48:24FromDiscord<alwaysoutofrange> i can also make a little video if is helps
17:49:26FromDiscord<alwaysoutofrange> https://media.discordapp.net/attachments/371759389889003532/1184190290760843284/simplescreenrecorder-2023-12-12_18.48.59.mp4?ex=658b1226&is=65789d26&hm=8efaf6a4c3af5e0e71568d0d84a7173d349d51b6b5ce2257b0f7f22b92c243c6&
17:49:31FromDiscord<Phil> Now tell me how exactly you enter your string into the binary.↵Do you run a bash command and pipe it in?↵Do you copy paste the line with echo?
17:50:01FromDiscord<graveflo> In reply to @alwaysoutofrange "Hello everyone, Ive got": I'm not sure what you are talking about, but if you are trying to paste a multi line string as an argument to a program in a terminal that behavior is terminal specific
17:53:52FromDiscord<graveflo> In reply to @alwaysoutofrange "": looks like the new line character is being interpreted as enter and the rest of the text is probably getting flushed from the buffer?
17:54:15FromDiscord<alwaysoutofrange> thats a good point didnt think about it
17:54:22FromDiscord<Phil> Note: Have you considered that your line ` if not line.endsWith("\\"): break` will not assign `con` to buffer and thus you lose all that input?
17:55:16FromDiscord<Phil> That break statement breaks both loops it seems
17:56:00FromDiscord<Phil> At least during my playing around with it
18:00:43FromDiscord<alwaysoutofrange> there is definitely a text loss
18:02:05FromDiscord<Phil> ... hmm, adding module links seems kind of a mystery
18:11:52NimEventerNew thread by Isofruit: How to write a doc-comment-link to another module?, see https://forum.nim-lang.org/t/10760
18:13:24Amun-RaIsofruit: `some module name <https://mod.url/modfile.html#procname,args>`_
18:14:34FromDiscord<Phil> That's me - That's basically just HTML hard-linking, if ever anything changes then the link breaks
18:14:46Amun-Raright
18:14:54FromDiscord<Phil> That's why I'm not a too massive fan of that option, additionally the docgen tool can't warn me that the link is broken
18:15:04Amun-Rawell, I'd change https:// to //
18:15:38FromDiscord<Phil> Wouldn't that still try to call for the docs over a url even when local?
18:15:49Amun-RaI have a few doc patches
18:15:57Amun-Rayes
18:16:10Amun-Rabut he wants to link to external module
18:16:18Amun-Raergo - you have to know the path before
18:16:35FromDiscord<Phil> Nah I mean, I am isofruit, that's my account 😄
18:16:56Amun-Raoh :P
18:17:30Amun-RaI knew isofruit was here somewhere… :P
18:17:44Amun-Rathis is what I use to generate documentation: https://dpaste.com/4GKFSKEFN
18:17:50FromDiscord<Phil> sent a long message, see <!doctype html>
18:19:49Amun-Rathere's something wrong with discord gate, all I saw was: "Phil | sent a long message, see <!doctype html>"
18:20:20FromDiscord<Phil> https://media.discordapp.net/attachments/371759389889003532/1184198064685199561/image.png?ex=658b1963&is=6578a463&hm=3045083095a6590c56cd652bafad3667d89c36f563911b82c5bd3db31c3edd63&
18:20:54Amun-Rause </url/file.html>
18:21:32FromDiscord<Phil> so... </threadbutler/integrations/owlbutler.html> ?
18:21:38Amun-Rayes
18:24:05FromDiscord<Phil> iiiiiiii'm going to md links, old reliable: ` [owlCodegen](./threadButler/integrations/owlButler.html)`
18:26:22Amun-Raowlbutler? interesting name
18:27:24FromDiscord<alwaysoutofrange> In reply to @alwaysoutofrange "Hello everyone, Ive got": fixed my code more or less i mean i cant paste the entire thing at once but this is a problem for it self
18:27:36FromDiscord<Phil> The general package is ThreadButler, I just provide utilities for easier integration with other frameworks
18:27:46FromDiscord<Phil> By which I mean exactly owlkettle and nothing else, but adding more shouldn't be too hard
18:28:06Amun-Raah
18:28:09FromDiscord<Phil> The package is designed to be easily extensible for whatever stuff you need
18:28:39FromDiscord<graveflo> In reply to @alwaysoutofrange "there is definitely a": piping the data seems to work for me. That is a saner way of doing it anyway
18:28:50FromDiscord<Phil> And you can use it on its own as well as shown in one of the examples
18:31:41FromDiscord<alwaysoutofrange> In reply to @graveflo "piping the data seems": i dont know if you can call it piping what im doing i think its a direct read from the stdin
18:32:43FromDiscord<graveflo> like `echo "something" | nim r something.nim` or `cat something.txt | nim r something.nim`
18:33:23Amun-Ranim r something.nim < something.txt
18:34:01FromDiscord<graveflo> yea thats a redirect. should work too
18:35:28FromDiscord<alwaysoutofrange> In reply to @graveflo "like `echo "something" |": no im not doing something like this
18:36:16FromDiscord<alwaysoutofrange> but i think i found the problem im using readLineFromStdin i think i should use a filestream or something
18:36:59FromDiscord<graveflo> yea but what I'm saying is that you could. I'm not exactly sure why copy / paste isn't working for this but there is more at play when you do it that way. Going from the clipboard -> terminal program -> tty has more variables that are out of your control
18:37:53FromDiscord<graveflo> yea you can look at the stream closelier and find out what is actually going on in the buffer. I have a feeling that you can get it to work and if that's the case then maybe the std library could use a little patching
18:38:31*azimut quit (Ping timeout: 240 seconds)
18:40:11Amun-Rahmm, can I have multiple licenses in nimble?
18:44:12FromDiscord<alwaysoutofrange> In reply to @graveflo "yea you can look": the buffer is right its my fault i didnt read the docs it says that readLineFromStdin reads only 1 line
18:45:34FromDiscord<graveflo> but of course it does xD. The issue is that the other information that you are supposedly pasting in should still be in the stdin buffer. There's no reason for that to disappear
18:45:41*PMunch joined #nim
18:47:15PMunchAoC day 12 stream live now! https://twitch.tv/pmunche https://www.youtube.com/watch?v=uVUtlqxwWTs
18:48:11FromDiscord<systemonia> Amun-Ra: It depends on if both licenses should apply or if the user can choose one or the other. But try adding your license + "AND" + your second license if you want both licences to apply, or try adding your license + "OR" + and your second license.
18:48:44FromDiscord<systemonia> So if you wanted to license a software under MIT or BSD-3-Clause you'd use "MIT OR BSD-3-Clause"
18:49:01Amun-RaI was wondering whether nimble accepts SPDX-like syntax
18:49:06FromDiscord<systemonia> That is how the spdx standard specifies it, but im not sure if nimble actually detects multiple licenses.
18:50:03Amun-Ranimble check doesn't mind license = "MIT OR NCSA"
18:51:58FromDiscord<systemonia> nimble.directory does some checking at the very least, https://nimble.directory/pkg/gmp
18:53:00Amun-Rahmm, thanks
18:53:08FromDiscord<systemonia> no problem
18:57:00FromDiscord<nasuray> In reply to @pengwyns "nimble.directory does *some* checking": checking how? isn't it just displaying what's in the "license" field in the `packages.json`?
18:57:37FromDiscord<systemonia> If it did that only then the "or" would be capitalized.
18:57:48FromDiscord<systemonia> Wait no
18:57:49NimEventerNew question by Antoine Del&#232;gue: Nim program crashes when using recursivity and openarray, see https://stackoverflow.com/questions/77648448/nim-program-crashes-when-using-recursivity-and-openarray
18:58:37FromDiscord<systemonia> Never mind, the package itself has "or" lowercase.
18:58:51FromDiscord<systemonia> You were right
18:59:01FromDiscord<alwaysoutofrange> In reply to @graveflo "but of course it": i tested for a bit and it seems the stdin is only the first line of my sample input anything after that does not exists
19:26:38FromDiscord<piqueiras> Are iterators the only way of accessing set elements?
19:28:11*PMunch quit (Quit: leaving)
19:29:11FromDiscord<graveflo> typically sets are unordered so what other way would there be?
19:30:20FromDiscord<piqueiras> What if I knew a set had a single element
19:33:48FromDiscord<graveflo> good point, I don't think there is a way unless you want to couple to nims specific set implementation and access the private fields: https://github.com/nim-lang/Nim/blob/version-2-0/lib/pure/collections/sets.nim#L64↵otherwise you can `pop` but that will remove it
19:34:16FromDiscord<piqueiras> oh that exists?
19:34:58FromDiscord<piqueiras> which one does it return if it had more tho lmao
19:36:32FromDiscord<graveflo> an "arbitrary" one
19:36:58FromDiscord<piqueiras> where is pop defined..
19:37:11FromDiscord<graveflo> you could also hold on to the elements key and use `[]` maybe.. but that sounds really weird and prone to breakage
19:37:26FromDiscord<graveflo> https://nim-lang.org/docs/sets.html#pop%2CHashSet%5BA%5D
19:37:39FromDiscord<piqueiras> nah im using an iterator lmao
19:37:47FromDiscord<piqueiras> its a set for an enum with 5 elements
19:38:08FromDiscord<graveflo> oh so its a bitset?
19:38:33FromDiscord<piqueiras> yea
19:39:15FromDiscord<graveflo> well then if it only has one element you can math out which one it is without an iterator
19:39:19*ormiret quit (Ping timeout: 260 seconds)
19:40:28FromDiscord<piqueiras> some set to bits thing? no clue about those
19:42:13FromDiscord<graveflo> yea you can convert a singleton bitset to the right ordinal value for the enum. Don't bother. just use an iterator LOL
19:43:05*ormiret joined #nim
19:43:52FromDiscord<piqueiras> lmfao
19:44:49FromDiscord<Phil> One sec, I shall take this time to perform a small victory dance.↵Setting up a 3 thread scenario where all of them are doing their own thing and they're easily controllable, you can register routes on them effortlessly likey they were webservers and it just works.↵God damn!↵.... I feel like packages like that likely either are pointless or already exist but I'm just happy it works.
19:45:41FromDiscord<Phil> And you can literally send a message from any thread to any thread, all of it thread safe because you're using channels which take care of ownership appropriately and the code really isn't that complicated given what it does
20:09:10*nils` joined #nim
20:17:42FromDiscord<rakgew> congrats!! \:-D
20:33:32FromDiscord<zectbumo> does/did nim have an interactive mode or am I imagining things?
20:39:52FromDiscord<systemonia> there's nim secret which is somewhat close to an interactive mode but idk
20:40:24FromDiscord<jviega> Same with `inim`. There's also going to be an official repl before too long, to my understanding.
20:43:56FromDiscord<zectbumo> okay so not quite ready yet. I like secrets
20:57:46*rockcavera quit (Ping timeout: 276 seconds)
20:59:09FromDiscord<rakgew> I quite like inim for quick try-outs.↵but I am also spoilt by super-comfortable repls like ptpython (autocompletion, multiline-repeat/edits, docstrings, etc..)↵..would love something like that in nim.
20:59:13FromDiscord<Phil> In reply to @zectbumo "does/did nim have an": Look for nlvm!
20:59:22FromDiscord<Phil> nlvm e is an actual repl
20:59:36FromDiscord<Phil> https://github.com/arnetheduck/nlvm
20:59:53FromDiscord<Phil> Though it isn't entirely consistent with nim syntax my experience with it so far has been far better than just the nim vm or inim
21:00:13FromDiscord<Phil> By that I mean you can reassign `let x = 5`, likely because its interpreted line by line or sth
21:00:45FromDiscord<jviega> Eeew
21:10:17FromDiscord<rakgew> you were referring to the NIR discussion? ( https://forum.nim-lang.org/t/10594 )↵(@jviega)
21:19:12FromDiscord<jviega> Yes I remember Araq mentioning building a repl on top of it.
21:19:29*krux02_ joined #nim
21:30:21FromDiscord<Phil> In reply to @jviega "Eeew": Its close enough none the less imo and works for the minimal examples I typically write in them, I actually like it
21:53:38FromDiscord<piqueiras> if I have two positive integers but the biggest is unknown, which is the best way to define the range between them?
21:53:47FromDiscord<piqueiras> apart from min(a,b)..max(a,b) or sth
22:01:19FromDiscord<kcvinker5420> sent a code paste, see https://play.nim-lang.org/#ix=html>
22:02:13FromDiscord<kcvinker5420> I used --mm:boehm, that might be the reason
22:02:58FromDiscord<kcvinker5420> Yes, that's the reason.
22:14:05*rockcavera joined #nim
22:18:29FromDiscord<bostonboston> In reply to @piqueiras "if I have two": Abs(a-b)?
22:18:52FromDiscord<bostonboston> No that's not right
22:19:40*azimut joined #nim
22:19:49FromDiscord<bostonboston> No that is right
22:20:07FromDiscord<bostonboston> abs(a-b) is my final answer m
22:20:25FromDiscord<Elegantbeef> Nah it's `abs(b-a)` 😛
22:20:35FromDiscord<odexine> Lol
22:20:44*advesperacit quit ()
22:21:07FromDiscord<Elegantbeef> `min(a, b)..max(a, b)` is useful if you want to get the right index
22:21:26FromDiscord<nnsee> `max(a-b, b-a)`
22:21:33FromDiscord<Elegantbeef> Otherwise you can do `for _ in 0..abs(a - b))`
22:22:17FromDiscord<nnsee> oh wait, range
23:00:32*azimut quit (Remote host closed the connection)
23:00:51*azimut joined #nim
23:15:24FromDiscord<Phil> For architectural drawings, are there like specific symbols for objects vs. procs?
23:21:51FromDiscord<Phil> Obviously that can be heavily improved upon, just trying to figure out how to best arrange/visualize this https://media.discordapp.net/attachments/371759389889003532/1184273940600848470/architecture.png?ex=658b600e&is=6578eb0e&hm=06a3b74b7121c379739900dcb1b7a55e9b9512a05b341e06baabf5c89be00b7a&
23:57:14FromDiscord<michaelb.eth> In reply to @isofruit "Obviously that can be": A sequence diagram might be helpful, though what you've put together is nice
23:57:18FromDiscord<michaelb.eth> https://en.wikipedia.org/wiki/Sequence_diagram
23:58:33FromDiscord<michaelb.eth> I'm not sure about fitting instantiations into a sequence diagram...