<< 01-05-2024 >>

00:00:46FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#pasty=EISVsVHzFNLR
00:06:04FromDiscord<Elegantbeef> Overloads
00:06:22FromDiscord<Robyn [She/Her]> ~~Converters 👀~~
00:06:47FromDiscord<Robyn [She/Her]> (edit) "~~Converters 👀~~ ... " added "(jk, converters are bad ideas)"
00:07:01FromDiscord<Robyn [She/Her]> (edit) "~~Converters 👀~~ (jk, converters are ... badidea)" added "a" | "ideas)" => "idea)"
00:07:05FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=nXEFKvjLbYbP
00:07:36FromDiscord<Elegantbeef> Using a converter for `some` is the most cancerous converter ever, I love it!
00:07:56FromDiscord<Elegantbeef> `10.get()` completely valid and not unhinged whatsoever
00:11:01FromDiscord<Robyn [She/Her]> Totally sane
00:18:30*KhazAkar quit (Ping timeout: 252 seconds)
00:18:55*KhazAkar joined #nim
00:54:10FromDiscord<polylokh_39446> sent a code paste, see https://play.nim-lang.org/#pasty=QVXhNemoIVcX
00:54:55FromDiscord<Elegantbeef> lame aint the word for it
00:55:55*def- quit (Quit: -)
00:57:39FromDiscord<polylokh_39446> sent a code paste, see https://play.nim-lang.org/#pasty=JSZACBSzfCdu
00:57:46FromDiscord<Robyn [She/Her]> Time to break out concepts lmao
00:58:07*def- joined #nim
00:59:31FromDiscord<polylokh_39446> sent a code paste, see https://play.nim-lang.org/#pasty=srIaXtqFTdEw
01:00:00FromDiscord<Elegantbeef> The issue is that any type that has `.get` will fire that
01:00:33FromDiscord<polylokh_39446> yep, I still don't know of a non-lame way to restrict this to `Option[T]`
01:01:03*def- quit (Client Quit)
01:01:11FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=YoriZylleRxb
01:01:37FromDiscord<Elegantbeef> Or `typ[0].eqIdent "Option"`
01:02:50FromDiscord<polylokh_39446> awesome, ty.
01:03:16FromDiscord<polylokh_39446> sent a code paste, see https://play.nim-lang.org/#pasty=bmQKUbSWFHMO
01:05:33FromDiscord<polylokh_39446> but to the original question, you probably want something like the builder pattern, and boring use of optionals
01:07:54FromDiscord<Elegantbeef> Or just use overloads if more applicable
01:13:33FromDiscord<amarevite> sent a code paste, see https://play.nim-lang.org/#pasty=DxIAnaDWjPkR
01:16:33FromDiscord<polylokh_39446> jumping to macros is the easiest way to do that.
01:17:58FromDiscord<amarevite> in that case can you give me a minimal example of iterating a proc's input variables from inside the proc
01:18:04FromDiscord<polylokh_39446> with the builder pattern - i.e., instead of having all these parameters, have them as fields of an object, and work with the object - you could use fieldPairs to iterate over them
01:18:05FromDiscord<amarevite> (edit) "in that case can you give me a minimal example of iterating ... a" added "over"
01:18:07FromDiscord<Elegantbeef> You don't need macros
01:18:25FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=NHneNvULPgDu
01:37:23*def- joined #nim
01:45:25FromDiscord<amarevite> if the proc has a return type, `locals().fields` includes that as the last item↵which means i get a segfault (i assume because im trying echo a variable that doesnt exist yet)↵i tried appending `[0..^2]` but thats not working
01:45:41FromDiscord<amarevite> (edit) "if the proc has a return type, `locals().fields` includes that as the last item↵which means i get a segfault (i assume because im trying ... echo" added "to"
01:46:05FromDiscord<Elegantbeef> `for name, field in locals().fieldPairs: when name != "result": ....`
01:47:56FromDiscord<Elegantbeef> Tuples cannot be sliced which is why `[0..^2]` did not work
01:49:15FromDiscord<new_librarian> where should i put the mingw64
01:49:15FromDiscord<polylokh_39446> sent a code paste, see https://play.nim-lang.org/#pasty=AFmPCiyNatUb
01:51:07FromDiscord<Elegantbeef> Why not `when field is Option`?
01:53:08FromDiscord<polylokh_39446> no reason except that I didn't know that worked
01:54:38*def- quit (Quit: -)
01:55:10*def- joined #nim
02:00:57*KhazAkar quit (Read error: Connection reset by peer)
02:02:24FromDiscord<polylokh_39446> sent a code paste, see https://play.nim-lang.org/#pasty=ArUKjToaTuIV
02:02:58*def- quit (Quit: -)
02:04:01*def- joined #nim
02:11:46FromDiscord<amarevite> sent a code paste, see https://play.nim-lang.org/#pasty=IedyEiXBrUGH
02:13:09FromDiscord<amarevite> im trying implement the BoolorNothing idea from (this forum comment)[<https://forum.nim-lang.org/t/3124#:~:text=And%20a%20more%20Nim%2Dspecific%20way%2C%20with%20generics%20and%20static%20branching%2C%20no%20run%2Dtime%20overhead%20exc.%20file%20size%3A>]
02:13:26FromDiscord<amarevite> oh i swapped the parenthese and brackets my bad
02:13:33FromDiscord<amarevite> (edit) "(this" => "[this" | "comment)[<https://forum.nim-lang.org/t/3124#:~:text=And%20a%20more%20Nim%2Dspecific%20way%2C%20with%20generics%20and%20static%20branching%2C%20no%20run%2Dtime%20overhead%20exc.%20file%20size%3A>]" => "comment](<https://forum.nim-lang.org/t/3124#:~:text=And%20a%20more%20Nim%2Dspecific%20way%2C%20with%20generics%20and%20static%20branching%2C%20no%20run%2Dtime%20overhead%20exc.%20file%20size%3A>)"
02:16:29FromDiscord<polylokh_39446> sent a code paste, see https://play.nim-lang.org/#pasty=UIOPZUMkRyMq
02:17:12FromDiscord<polylokh_39446> (edit) "https://play.nim-lang.org/#pasty=FsbccIJFAAYT" => "https://play.nim-lang.org/#pasty=ObPULyDqcaOq"
02:18:30FromDiscord<polylokh_39446> you need that workaround, if you want it to be possible for the 'or' to resolve differently for different arguments
02:19:20FromDiscord<polylokh_39446> sent a code paste, see https://play.nim-lang.org/#pasty=qjLrZInhCVcP
02:20:18FromDiscord<amarevite> i dont recognize the syntax youre using with that proc↵what are the backets before the parentheses doing?↵what is that even called so i can look at the docs and learn about it?
02:20:52FromDiscord<polylokh_39446> 'or' makes the proc implicitly generic. The brackets make it explciitly generic and name what it's generic over. With that syntax, it's generic over A and B, which are both BoolOrNothing
02:21:43FromDiscord<polylokh_39446> it's introduced early in <https://nim-lang.org/docs/manual.html#generics>
02:22:42FromDiscord<polylokh_39446> the implicit 'or' generics have the limitation that BoolOrNothing can't resolve to bool for one param and EmptyType for another
02:23:46FromDiscord<polylokh_39446> sent a code paste, see https://play.nim-lang.org/#pasty=NqHnkjyFgqfe
02:30:35FromDiscord<polylokh_39446> it's still a compiler bug that that fails the way it does
02:40:03*def- quit (Quit: -)
02:40:59*def- joined #nim
02:44:07FromDiscord<amarevite> sent a code paste, see https://play.nim-lang.org/#pasty=rNplOcEIlBqK
02:44:40*def- quit (Client Quit)
02:45:36FromDiscord<amarevite> i would like to be able to turn that `paramsBuilder` `locals().fieldPairs` thing into a proc I can call so I can reuse it more easily, but i struggled with getting that to work
02:47:11*def- joined #nim
02:50:11*def- quit (Client Quit)
02:50:54*def- joined #nim
02:57:21FromDiscord<Elegantbeef> Or you just do `distinct BoolOrNothing`
02:59:47FromDiscord<Elegantbeef> \Which is why distinct TypeClass\` exists
03:00:06FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=CQXgmRNfdSbv
03:02:09FromDiscord<Elegantbeef> `paramBuilder.buildShiz(locales())`
03:02:20FromDiscord<Elegantbeef> where `proc buildShiz(buffer: string, data: tuple)`
03:03:07FromDiscord<Elegantbeef> `var string`\
03:07:16FromDiscord<Elegantbeef> Can also just turn it into a template
03:45:50*SchweinDeBurg quit (Quit: WeeChat 4.3.0-dev)
03:46:16*SchweinDeBurg joined #nim
03:50:15*def- quit (Quit: -)
03:50:34*def- joined #nim
03:55:18FromDiscord<amarevite> sent a code paste, see https://play.nim-lang.org/#pasty=VhBwRsRSCNOQ
03:56:13FromDiscord<Elegantbeef> `result.add name & "=" & $field`
03:56:23FromDiscord<Elegantbeef> Using format for simple formatting is silliness
03:57:40FromDiscord<Elegantbeef> PS there is `?` inside `std/uri` that takes in `(string, string)` and appends it to your code
03:58:06FromDiscord<Elegantbeef> so it'd be like `parseUri(serverAddress & "/Users).query(locals().paramsBuilder())`
03:58:17FromDiscord<Elegantbeef> Whoops
03:58:29FromDiscord<Elegantbeef> `parseUri(serverAddress & "/Users) ? locals().paramsBuilder()`
03:58:34FromDiscord<Elegantbeef> My brain filled the gap
03:59:57FromDiscord<amarevite> using `fmt()` was more of a consistency/readability thing but that works, thank you↵and i didnt know about `?` ill give that a try
04:03:12FromDiscord<amarevite> it's not working and i dont care enough to figure out what syntax im getting wrong but i might end up using that in the future, thank you
04:03:30FromDiscord<Elegantbeef> you need to emit `seq[(string, string)]` and import `uri`
04:09:01FromDiscord<amarevite> alright if `paramsBuilder()` returns a `(string, string)` tuple, `let endpoint:string = $(serverAddress.parseUri / "Users" ? locals().paramsBuilder)` works
04:11:36FromDiscord<amarevite> i dont have a stray `?` at the end of the url when there are no optional parameters set, but i find it much harder to read
04:35:24*def- quit (Quit: -)
04:36:32*def- joined #nim
04:40:42*def- quit (Client Quit)
04:42:34*def- joined #nim
05:49:32*coldfeet joined #nim
05:51:16*ntat joined #nim
05:57:56*def- quit (Quit: -)
05:58:33*def- joined #nim
07:00:39*lucerne quit (Ping timeout: 260 seconds)
07:04:55FromDiscord<xkonti> sent a code paste, see https://play.nim-lang.org/#pasty=ibUZlDeWkYcS
07:06:35FromDiscord<xkonti> In other words I want all implementations of the abstractions (separate libraries) to execute those tests on themselves. Implementations could be OsFs, InMemoryFs, SftpFs, S3Fs, etc.
07:08:02FromDiscord<Elegantbeef> You want an external library to depend on your test architecture?
07:08:45FromDiscord<Elegantbeef> In the case of Nimble that means you want to have a `testAparatus` file then just have a template or proc that you call from an external library
07:11:22FromDiscord<xkonti> Yes. Think of it in a way of a set of tests that ensure that the implementation of the abstraction is correct. Library author doesn't need to write it themselves, they just use what's provided in the library they already depend on.
07:11:40FromDiscord<Elegantbeef> Make a proc or template that takes a `FileSystem`
07:11:55FromDiscord<Elegantbeef> Put it inside your `src` file
07:11:55FromDiscord<Elegantbeef> folder\
07:12:29FromDiscord<Elegantbeef> then someone can do `tests/tosfs.nim` in their project and do `import filesystems/testaparatus; test(newOsFs())`
07:16:41FromDiscord<xkonti> That's awesome! For some reason I thought that test suites won't be valid if I won't "include" but simply "import". Thank you again @ElegantBeef , you seem to never sleep!
07:17:00FromDiscord<Elegantbeef> No I just don't have a life
07:17:44*om3ga joined #nim
07:24:19*def- quit (Quit: -)
07:24:53*def- joined #nim
07:33:40FromDiscord<Phil> sent a long message, see https://pasty.ee/kBUJyESVzDpQ
07:34:14FromDiscord<Phil> (edit) "https://pasty.ee/iwxBwfWoiSNB" => "https://pasty.ee/IPNvNEKuHhxQ"
07:35:25FromDiscord<Phil> The problem is that Cold Observable shouldn't really contain a value. It should contain a callback function that gets executed for a given observer when it subscribes.
07:35:53FromDiscord<Phil> (edit) "subscribes." => "subscribes and emits values captured in the callback function to that observer."
07:37:08*lucerne joined #nim
07:41:34FromDiscord<Phil> sent a long message, see https://pasty.ee/saNFaiQriCUX
07:41:43FromDiscord<Phil> (edit) "https://pasty.ee/QkpLQkktvaRm" => "https://pasty.ee/wWmermoBVFqr"
07:42:22FromDiscord<Phil> (edit) "https://pasty.ee/ufSwsuDNuHfM" => "https://pasty.ee/hSexzEQKFYAE"
07:45:17*redj_ quit (Ping timeout: 240 seconds)
07:46:02*redj joined #nim
08:08:15FromDiscord<Elegantbeef> @Phil have you written out a small demo with what was working to showcase the issue?
08:08:35FromDiscord<Elegantbeef> I read your words but given my lack of knowledge with RX I just scratch my head and go balder
08:14:19FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#pasty=tkShdpIbFXtx
08:15:26FromDiscord<Elegantbeef> The expected output is what?
08:16:08*def- quit (Quit: -)
08:16:58*def- joined #nim
08:17:45FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#pasty=VYGGAcWfDUVK
08:19:03FromDiscord<Elegantbeef> Huh
08:19:32FromDiscord<Phil> And there are ways around that I think, but they seem ugly as hell
08:19:54FromDiscord<Phil> Like implementing 2 "forward" procs or some shit and storing weird amounts of observers left and right
08:20:20FromDiscord<Elegantbeef> I'm so lost at how this works 😄
08:21:07FromDiscord<Phil> Its "push" mechanisms as opposed to "pull".↵That's why reactive programming is a fairly different paradigm and breaks your brain a bit when you wrap your head around it.
08:21:16FromDiscord<Phil> (edit) "Its "push" mechanisms as opposed to "pull".↵That's why reactive programming is a fairly different paradigm and breaks your brain a bit when you ... wrap" added "first"
08:21:21*def- quit (Client Quit)
08:21:59FromDiscord<Elegantbeef> Well afaict it's just a stack of procedures
08:22:04FromDiscord<Phil> Its not "I need X, so I fetch from data", it is "data changes, so it informs everybody that it is and calls their callbacks that they registered with the individual piece of data, keeping them automatically in sync"
08:22:34FromDiscord<Elegantbeef> You add a procedure in the stack then all children get an event when a value changes
08:22:36FromDiscord<Phil> Yes but also more than that.↵Because you sometimes want to call the entire stack of procedures and sometimes you don't.
08:23:03*def- joined #nim
08:23:33FromDiscord<Phil> And there's 2 stacks: The stack of Observers and their callbacks (e.g. Observer1 and the observer that MapObservable will have registered with cold Observable), and the stack of procs that manipulate the piece of data (in this case that's just the map proc from MapObservable)
08:23:44FromDiscord<Phil> (edit) "and" => "with"
08:24:38*redj quit (Quit: No Ping reply in 180 seconds.)
08:25:11FromDiscord<Elegantbeef> So in the above example you push a value into cold or map?
08:25:25FromDiscord<Phil> In reply to @Elegantbeef "You add a procedure": Yes, that is true but only for Subjects where the value can actually change (Hot observable).↵In a cold observable the data that can be sent kind of already is known ahead of time.
08:25:46FromDiscord<Elegantbeef> Like in above the subscription causes a call to be made down the chain
08:26:02FromDiscord<Phil> In reply to @Elegantbeef "So in the above": The data exists in cold observable and it is the only source of data.↵Even when somebody subscribes to map observable, it itself does not hold data. It fetches data from the cold observable, transforms it and forwards that to the subscriber/observer
08:26:09FromDiscord<Elegantbeef> So it turns into `echo "Observable": map(map(map(5)))`
08:26:10*redj joined #nim
08:27:13FromDiscord<Phil> More: "Observer1: 5"↵"Observer2: anonymousMapProc(5)"↵"Observer3: anonymousMapProc(5)"
08:27:40FromDiscord<Phil> The "problem" with cold observables is just that they emit all their values on subscribes, which hot observables don't do because they don't contain data that way
08:27:59FromDiscord<Phil> But the subscribe should trigger only value emission to the one thing that subscribed and to nobody else
08:28:32FromDiscord<Phil> So if Observer3 subscribes, the process should be that only it receives transformed values from cold observable, nobody else does because they already subscribed and got their values
08:28:46*def- quit (Quit: -)
08:29:22*def- joined #nim
08:30:31FromDiscord<Elegantbeef> So in the case the of `next` it pushes `1` to what?
08:30:46FromDiscord<Elegantbeef> You omitted all of the plumbing
08:41:12FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#pasty=KFsujoxMusoc
08:41:48FromDiscord<Phil> The problem is that this behaviour for hot observables is undesired for cold observables.↵Where I want the same behaviour but only for one single observer
08:43:58FromDiscord<Phil> sent a long message, see https://pasty.ee/WbmsCxpXkXvu
08:44:32FromDiscord<Phil> (edit) "sent" => "Meanwhile the above (which is the Observer for the mapObservable onto the cold observable) will trigger everything always for all observers:↵- `onSourceCompletion` triggers the complete callback on all observers of the map observable↵- `onSourceError` already makes it visible that it forwards errors from source to all observers on the map-observable↵- `mapSubscription` uses the `forward` proc which forwards the value
08:46:45FromDiscord<Phil> I guess the solution would be that on subscribe of an observer to mapObservable, mapObservable creates on-the-fly a new "mapObserver" that is only there to forward values to the first observer
08:47:00FromDiscord<Elegantbeef> I was more saying that you left out the how the first example related to the second 😛
08:47:05FromDiscord<Phil> The entire hot vs cold observable dichotomy is murdering me
08:52:37FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#pasty=wSJIpCLNmEEE
08:53:01FromDiscord<Phil> Or rather you need to tell your parent observable "give me the values"; which in turn needs to tell its parent "Give me the values" etc. until you hit the cold root observable
08:53:26FromDiscord<Phil> And then only emit the values back to that one specific child that asked for values
08:53:34FromDiscord<Elegantbeef> Lol you still missed my point
08:53:48FromDiscord<Elegantbeef> Write the desired code using example A and B
08:53:58FromDiscord<Phil> Not really, it's just really fucking hard to explain
08:54:03FromDiscord<Elegantbeef> Plumb A into B
08:54:08FromDiscord<Elegantbeef> I don't want you to explain
08:54:13FromDiscord<Elegantbeef> I want to see the desired code
08:55:13FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#pasty=lqgkewaXwDmT
08:55:34FromDiscord<Elegantbeef> Thank you 😄
08:57:39FromDiscord<Elegantbeef> Much clearer how it's working
08:58:01FromDiscord<Elegantbeef> Or rather how it's supposed to work
09:09:04*def- quit (Quit: -)
09:09:59*def- joined #nim
09:14:20FromDiscord<nocturn9x> In reply to @juancarlospaco "looks like a realloc": well yeah but
09:14:23FromDiscord<nocturn9x> it's internal nim stuff
09:14:28FromDiscord<nocturn9x> how am I supposed to fix that lol
09:15:34*def- quit (Quit: -)
09:15:55*def- joined #nim
09:17:42FromDiscord<nocturn9x> I've tried several options
09:17:54FromDiscord<nocturn9x> `--mm:atomicArc` as well as `-d:useMalloc`ù
09:17:56FromDiscord<nocturn9x> (edit) "`-d:useMalloc`ù" => "`-d:useMalloc`"
09:18:00FromDiscord<nocturn9x> nothing seems to fix it
09:18:10FromDiscord<nocturn9x> it seems like a bug related to passing refs to another thread
09:20:09FromDiscord<nocturn9x> I'm trying to see if `--mm:boehm` works better
09:27:48FromDiscord<nocturn9x> that seems to have fixed it
09:30:41FromDiscord<ieltan> In reply to @nocturn9x "it seems like a": I think you can't pass refs to another threads unless you use something like `isolate` iirc
09:32:35FromDiscord<ieltan> But I've heard it's a pretty limited mechanism. Gotta go C++ style and use raw pointers or `SmartPtr[T]`
09:33:49FromDiscord<Phil> Hmmmm constructing single-use observers on the fly for that one occurrence at the end of the observable might be the way to go
09:34:01FromDiscord<Phil> At least I can vaguely imagine that approach
09:35:31NimEventerNew thread by take1234: Unicode operators / Arrays, which size is know at run time, see https://forum.nim-lang.org/t/11526
09:36:30FromDiscord<nocturn9x> In reply to @ieltan "I think you can't": huh
09:41:08FromDiscord<ieltan> the issue with threading in Nim is that it has been finally "nailed down" just very recently and there isnt many uptodate ressources on what you can do and cannot do with them right now
09:41:19FromDiscord<nocturn9x> yeah anyway it crashed again
09:41:25FromDiscord<nocturn9x> this is _so_ annoying
09:41:43FromDiscord<nocturn9x> it makes me kinda regret I learned nim :P
09:42:37FromDiscord<ieltan> fwiw, those are the "official" libraries to use for threads ↵https://github.com/nim-lang/threading↵https://github.com/Araq/malebolgia
09:42:51FromDiscord<nocturn9x> malebolgia is borked lol
09:43:10FromDiscord<ieltan> rip lol
09:43:25FromDiscord<nocturn9x> and the documentation for threading is just the API reference
09:43:38FromDiscord<ieltan> In reply to @nocturn9x "it makes me kinda": well this certaintly doesn't bode well for me as i'll need to use thread soon in my library
09:44:09FromDiscord<nocturn9x> can someone provide a simple example of sending off a function to a worker thread with shared references
09:44:22FromDiscord<nocturn9x> an example that works and isn't outdated and doesn't randomly crash for no reason
09:44:50FromDiscord<nocturn9x> the whole damn point of threads is to have shared state, otherwise I'd be spawning a process. The very idea of a thread-local heap is so stupid
09:45:57FromDiscord<nocturn9x> also afaik malebolgia implements SC, but I don't _need_ SC
09:46:09FromDiscord<nocturn9x> I need a separate worker thread that does something, prints to stdout and then exits
09:46:30FromDiscord<nocturn9x> I don't even care about the result or if it crashes. If it crashes, it crashed, too bad
09:57:54FromDiscord<odexine> what have you tried so far
09:58:08FromDiscord<odexine> iirc you will have to use sharedptr (threading/smartptrs)
09:58:36FromDiscord<nocturn9x> how do I make one?
09:58:49FromDiscord<nocturn9x> I have tried several things
09:59:21FromDiscord<nocturn9x> sent a long message, see https://pasty.ee/XMgITnSHAhMT
10:02:14FromDiscord<odexine> when you create the shared data, you first `isolate` it (std/isolation), then directly pass that isolated data into `newSharedPtr` (std/threading/smartptrs), i think
10:02:59FromDiscord<odexine> this data would be the non-ref version of what you want to share, so the direct data and not a ref
10:03:24FromDiscord<odexine> i dont have threading experience so im not too sure
10:18:28*xet7 quit (Ping timeout: 246 seconds)
10:18:34FromDiscord<nocturn9x> I need both the main thread and the worker thread to access the reference though
10:19:00FromDiscord<nocturn9x> there is a boolean variable and an `Atomic[bool]` object that needs to be shared
10:24:10FromDiscord<odexine> In reply to @nocturn9x "I need both the": they would share this access via the same sharedptr
10:26:45FromDiscord<nocturn9x> so
10:27:25FromDiscord<odexine> i dont know the behaviour of this mechanism with atomics
10:28:06FromDiscord<nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=cqCEsSFLfoRB
10:28:14FromDiscord<nocturn9x> or should I initialize it as a shared ptr to begin with
10:29:40FromDiscord<odexine> i would say to begin with
10:30:20*deadmarshal_ quit (Ping timeout: 268 seconds)
10:34:19FromDiscord<nocturn9x> okay
10:34:33FromDiscord<nocturn9x> so I won't need to wrap the `SearchManager` in an `Atomic[T]`?
10:35:15FromDiscord<odexine> im sorry i really dont know the behaviour of this with atomics
10:35:53FromDiscord<nocturn9x> where do I import `SharedPtr` from?
10:35:59FromDiscord<nocturn9x> `std/threading` doesn't seem to exist
10:36:03FromDiscord<nocturn9x> In reply to @odexine "im sorry i really": no problem
10:36:54FromDiscord<nocturn9x> https://github.com/henryas/nptr?
10:41:22FromDiscord<odexine> In reply to @nocturn9x "`std/threading` doesn't seem to": hm i think this is something to be installed first
10:41:30FromDiscord<odexine> so not std/threading but just threading/
10:41:42FromDiscord<odexine> my bad i forgot
10:41:58FromDiscord<odexine> basically install this as a package in nimble https://github.com/nim-lang/threading
10:42:59FromDiscord<nocturn9x> so I should turn my entire `UCISession` into a shared ptr
10:43:09FromDiscord<nocturn9x> should `UCISession` be a value type instead of a ref then?
10:43:50FromDiscord<nocturn9x> I don't undertand how `Isolated` fits into this
10:43:52FromDiscord<odexine> if youre making it a shared ptr, i guess it should? maybe smth like UCISessionObj = object... then UCISession = SharedPtr[UCISessionObj[
10:43:54FromDiscord<odexine> (edit) "SharedPtr[UCISessionObj[" => "SharedPtr[UCISessionObj]"
10:43:56FromDiscord<nocturn9x> how do I get the value out?
10:44:23FromDiscord<odexine> deref the ptr `[]`
10:44:40FromDiscord<odexine> you can get a mut/immut version
10:44:51FromDiscord<odexine> mutable VIEW
10:45:09FromDiscord<nocturn9x> so `session: SharedPtr[Isolated[UCISession]]`?
10:45:13FromDiscord<odexine> no
10:45:16FromDiscord<odexine> remove the isolated
10:45:22FromDiscord<nocturn9x> oke
10:45:23FromDiscord<odexine> the isolated part is only needed to construct the sharedptr
10:45:29FromDiscord<odexine> its not part of the type
10:45:49*FromDiscord quit (Remote host closed the connection)
10:46:03*FromDiscord joined #nim
10:46:17FromDiscord<nocturn9x> gotcha
10:48:13FromDiscord<nocturn9x> how do I initialize it tho
10:48:34FromDiscord<nocturn9x> do I just construct the value type, then isolate it and pass it to newSharedPtr?
10:48:56*def- quit (Quit: -)
10:49:21FromDiscord<odexine> yes
10:49:28FromDiscord<odexine> i believe so yes
10:49:31*def- joined #nim
10:50:00FromDiscord<nocturn9x> but `isolate` wants a `sink T`
10:50:02FromDiscord<nocturn9x> whatever that means
10:50:30FromDiscord<odexine> means you should not use that value type again after isolating
10:51:27FromDiscord<nocturn9x> okay, how do I make something into a `sink T` then
10:51:50FromDiscord<ieltan> it's supposed to be automatic
10:51:52FromDiscord<odexine> simply dont use it again after
10:51:53FromDiscord<odexine> yes
10:52:05FromDiscord<nocturn9x> `expression cannot be isolated`
10:52:29FromDiscord<odexine> does your data type have references
10:52:34FromDiscord<nocturn9x> yes, many
10:52:40FromDiscord<nocturn9x> that's kind of the point
10:53:14FromDiscord<ieltan> Remember what I said about isolated being limited lol
10:53:24FromDiscord<odexine> you cannot have references when youre isolating data
10:53:29FromDiscord<odexine> at all
10:53:33FromDiscord<odexine> anywhere
10:53:40FromDiscord<nocturn9x> it would be nice if the language implemented something that works instead of something that is only theoretical
10:53:54FromDiscord<odexine> "works" depends on the person
10:54:02FromDiscord<nocturn9x> no, "works" is a universal definition
10:54:11FromDiscord<odexine> i dont think so
10:54:16FromDiscord<nocturn9x> you do what all the other sane languages do and it works
10:54:24FromDiscord<nocturn9x> if it doesn't, your solution _does not work_
10:54:31FromDiscord<odexine> sane is again dependent on the person
10:55:00FromDiscord<nocturn9x> we can talk about type safety and data race prevention all day
10:55:04FromDiscord<nocturn9x> but people don't write code in a lab
10:55:07FromDiscord<nocturn9x> they do so in the real world
10:55:11FromDiscord<nocturn9x> and the real world is sometimes dirty
10:55:17FromDiscord<nocturn9x> so not supporting that means being broken
10:55:19FromDiscord<nocturn9x> by definition
10:55:30FromDiscord<nocturn9x> languages are tools that are supposed to adapt to the users, not the other way around.
10:55:34FromDiscord<odexine> please provide such definition's source
10:55:47FromDiscord<nocturn9x> check out this thing called common sense
10:55:50FromDiscord<nocturn9x> it might amaze you
10:55:50FromDiscord<nocturn9x> lol
10:55:52FromDiscord<solitudesf> In reply to @nocturn9x "languages are tools that": adapt it then
10:55:57FromDiscord<odexine> In reply to @nocturn9x "check out this thing": common sense is clearly not found where you are
10:56:04FromDiscord<nocturn9x> In reply to @solitudesf "adapt it then": why do you think I'm working on my own language rofl
10:56:23FromDiscord<odexine> please tell us when you solve your threading problem in such language
10:56:57FromDiscord<nocturn9x> will do lol
10:56:59FromDiscord<ieltan> sent a code paste, see https://play.nim-lang.org/#pasty=YTqQpdKwCMre
10:57:11FromDiscord<nocturn9x> that isn't the problem
10:57:20FromDiscord<nocturn9x> the problem is that `YourDataType` has refs
10:57:23FromDiscord<nocturn9x> inside
10:57:28FromDiscord<nocturn9x> so it cannot be isolated, apparently
10:58:05FromDiscord<ieltan> welp rip pepperoni
10:58:06FromDiscord<nocturn9x> I tried that and it still fails to compile
10:58:12FromDiscord<nocturn9x> so 🤷
10:58:33FromDiscord<odexine> nim supports message passing better versus the shared memory model
10:58:50FromDiscord<odexine> different languages have differing approaches to ideas
10:58:52FromDiscord<nocturn9x> I need shared ownership
10:59:21FromDiscord<nocturn9x> I don't make the rules, the UCI spec does, and to implement the `stop` command I need some way of telling my search to stop, which means it has to go in another thread
10:59:41FromDiscord<nocturn9x> the fact nim doesn't support the literal most basic use case of that is astonishing
10:59:57FromDiscord<odexine> ...i would say this can be easily implemented with message passing
11:01:32FromDiscord<nocturn9x> yes of course let me refactor my code because nim is opinionated about how threads should work (except they don't)
11:01:54FromDiscord<nocturn9x> building abstraction is one thing, but let me do "unsafe" things if I want to without breaking things
11:02:03FromDiscord<nocturn9x> but nope, apparently nim is too good for that, lol
11:02:05FromDiscord<odexine> if you want
11:02:13FromDiscord<odexine> i believe you can create a more raw shared pointer
11:02:25FromDiscord<nocturn9x> I've tried several things
11:02:27FromDiscord<odexine> https://nim-lang.org/docs/system.html#createShared%2Ctypedesc
11:02:34FromDiscord<nocturn9x> let's see if this works
11:03:05FromDiscord<odexine> chuck the type in, set the val with `varname[] = value`, deref is `[]` as is before
11:03:53FromDiscord<odexine> basically `var myptr = createShared(MyType); myptr[] = myvaluetype #[type == MyType]#`
11:04:03FromDiscord<odexine> this needs to be freed like in C
11:04:20FromDiscord<odexine> no isolated shit whatnot
11:05:24FromDiscord<nocturn9x> that looks like what I need
11:05:51FromDiscord<nocturn9x> can `MyType` hold `ref`s?
11:05:55FromDiscord<odexine> congrats, hope this is good enough, sorry about the common sense comment
11:05:58FromDiscord<odexine> In reply to @nocturn9x "can `MyType` hold `ref`s?": literally anything
11:06:02FromDiscord<nocturn9x> good
11:06:02FromDiscord<odexine> no restrictions at all
11:06:14FromDiscord<nocturn9x> In reply to @odexine "congrats, hope this is": it's okay, I'm a bit frustrated
11:06:34FromDiscord<nocturn9x> it's annoying enough to fight with a problem, but when the tooling you're using gets in the way it becomes extra annoying
11:06:43FromDiscord<odexine> any segfaults and null derefs at this point would prolly be your error since the compiler doesnt analyse anything
11:06:58FromDiscord<ieltan> I guess though accessing the refs from other thread will still subject you to some issues
11:07:10FromDiscord<odexine> In reply to @ieltan "I guess though accessing": i think this might be a problem too yes
11:07:20FromDiscord<odexine> the refs inside the type would still be local
11:07:31FromDiscord<nocturn9x> _pain_
11:07:33FromDiscord<odexine> so i think all refs need to be ptrised
11:07:36FromDiscord<ieltan> Yeh
11:07:58FromDiscord<odexine> in which case why not just use the isolated thing? SharedPtrs are isolated compatible
11:07:59FromDiscord<ieltan> I was gonna say you'll drop the ref altogether for ptr
11:08:10FromDiscord<ieltan> So you'll be refactoring anyways
11:08:17FromDiscord<odexine> i dont think this is too big of a refactor
11:08:22FromDiscord<odexine> compared to message passing anyways
11:08:30FromDiscord<ieltan> True
11:08:37FromDiscord<nocturn9x> I suppose if it's gonna be a refactoring either way
11:08:42FromDiscord<nocturn9x> might as well use the higher level abstraction
11:09:04FromDiscord<nocturn9x> so I should just use `SharedPtr` everywhere instead of `ref`?
11:09:22FromDiscord<odexine> i think so, yes
11:09:46FromDiscord<nocturn9x> I can probably do away with another thing actually
11:09:55FromDiscord<nocturn9x> if I keep all the refs local to one thread
11:10:00FromDiscord<nocturn9x> that could work
11:10:03FromDiscord<nocturn9x> the main thread doesn't need them anyway
11:10:35*def- quit (Quit: -)
11:12:09*def- joined #nim
11:28:08*beholders_eye joined #nim
11:29:39*def- quit (Quit: -)
11:29:58*def- joined #nim
11:37:21*deadmarshal_ joined #nim
11:49:01FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#pasty=KhfAsScPefaX
11:51:36FromDiscord<ezquerra> In reply to @mratsim "are you using the": @mratsim, I am looking at speeding up the convolve proc in arraymancer and I remember this old reply of yours. Can you share an example of how to enable `omp simd` when using `omp_parallel_blocks`? I couldn't find any examples on the arraymancer codebase. Probably I did not search for the right thing...
11:54:11*nyeaa49284230101 quit (Quit: The Lounge - https://thelounge.chat)
11:56:17*nyeaa49284230101 joined #nim
12:01:07FromDiscord<nocturn9x> In reply to @nocturn9x "the main thread doesn't": jk it does
12:01:14FromDiscord<nocturn9x> ugh this is so freaking annoying
12:51:15*def- quit (Quit: -)
13:10:11*def- joined #nim
13:43:58*beholders_eye quit (Ping timeout: 268 seconds)
14:03:02FromDiscord<Phil> @ElegantBeef I just did it. It screwed me up a little bit, but my entire test-suite still runs and the new tests do as well
14:03:31FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#pasty=pAmOdZzkpcKj
14:09:52*gst joined #nim
14:12:31FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#pasty=WPglZjsoQroC
14:15:24gstis there a way to unordered enum?
14:34:43FromDiscord<Phil> I am not familiar with the term I'll admit. You can do hole-y enums, you can define the number values explicitly
14:34:54FromDiscord<Phil> (edit) "I am not familiar with the term I'll admit. You can do hole-y enums, you can define the number values ... explicitly" added "for a given enum-value"
14:35:12*lucasta joined #nim
14:39:31FromDiscord<odexine> enums are always ordinal
14:39:49FromDiscord<odexine> not sure what you mean by unordered, i dont understand the benefits to having one be unordered
14:40:04gsthole enums are supported yes and I am using them, my problem is that currently nim requires that the values are ordered incrementally
14:40:22gstunordered I mean for example, x = 1, then y = 0
14:41:37gstmy usecase is protocol implementation, it is much nicer to keep the names in the order of the documentation regardless of the values
14:42:28FromDiscord<odexine> i dont think so
14:42:40FromDiscord<odexine> i think nim should allow it for when all values are specified but it doesnt so
14:43:40gsthttps://play.nim-lang.org/#pasty=NsXVDYjOvkjz
14:45:38gstodexine, I agree, I think it should be possible as, when all values are specified, the order requirement is useless and changes nothing to the result. but currently it fails.
14:46:08FromDiscord<odexine> should check if there is an issue filed, see any discussion
14:46:09gstI was wondering if there is a pragma or some trick around this.
14:47:03gstthis is the closest I found, https://github.com/nim-lang/Nim/issues/1043, it was not fixed.
14:50:37FromDiscord<odexine> same, when i searched
14:50:45FromDiscord<odexine> seems like no one has raised another issue
15:05:19*def- quit (Quit: -)
15:05:41*def- joined #nim
15:19:25FromDiscord<z3ntl3> abc
15:19:57FromDiscord<z3ntl3> 🫡
16:51:04*def- quit (Quit: -)
16:52:21*coldfeet quit (Remote host closed the connection)
16:53:40*def- joined #nim
16:56:42*def- quit (Client Quit)
16:58:43*def- joined #nim
17:16:36*krux02 joined #nim
17:20:58*progranner joined #nim
17:28:06*xet7 joined #nim
18:04:56*KhazAkar joined #nim
18:26:50*def- quit (Quit: -)
18:27:35*def- joined #nim
18:31:18*def- quit (Client Quit)
18:33:29FromDiscord<nocturn9x> are `Atomic`s references?
18:33:50FromDiscord<nocturn9x> still trying to debug the issue with ARC and threads
18:33:52FromDiscord<nocturn9x> to no avail
18:34:27*def- joined #nim
18:37:58FromDiscord<nocturn9x> the question I have is why is it segfaulting in danger/release mode and not in debug mode?
18:39:06FromDiscord<Phil> In reply to @nocturn9x "are `Atomic`s references?": I don't think they are, at least from my time staring at the threading package and making it free of data-races I don't recall that being a requirement
18:47:27*ntat quit (Quit: Leaving)
18:47:57FromDiscord<marioboi3112> wait is the entire nim site made in nim? (nim playground, the official website, the forum, and package index)
18:49:15FromDiscord<leorize> the official site is Jekyll iirc
18:49:22FromDiscord<leorize> but the rest are nim-bases
18:49:28FromDiscord<leorize> nim-based\
18:50:34FromDiscord<marioboi3112> so their html code was written in nim...
18:50:39FromDiscord<marioboi3112> interestin
18:50:42FromDiscord<marioboi3112> (edit) "nim..." => "nim...g"
18:50:46FromDiscord<marioboi3112> (edit) "nim...g" => "nim..."
18:57:27FromDiscord<nervecenter> @marioboi3112 There are multiple HTML templating libraries for Nim. I use Nimja, it's quite fleshed-out and performant.
18:58:26FromDiscord<nervecenter> (edit) "@marioboi3112 There are multiple HTML templating libraries for Nim. I use Nimja, it's quite fleshed-out and performant. ... " added "But it's for a CLI application that outputs the HTML to stdout (the pages are actually reports), our server scripts handle the web serving part."
19:02:19FromDiscord<marioboi3112> In reply to @nervecenter "<@947089775280660571> There are multiple": what uses do you get from the CLI spitting out html code?
19:13:49FromDiscord<nervecenter> Like I said, they're reports. They can be printed to PDF and sent to our clients
19:14:18FromDiscord<nervecenter> Or really any which way. We can deliver them in an iframe, print to PDF, deliver the HTML as a file, whatever
19:32:00FromDiscord<marioboi3112> i see
19:34:00*def- quit (Quit: -)
19:34:02*Batzy joined #nim
19:34:26*def- joined #nim
19:36:03FromDiscord<Phil> Hmmm the entire "reactivex but in nim" thing starts becoming problematic when you include async
19:36:16FromDiscord<Phil> Or rather, when you realize you somehow must include async
19:37:05FromDiscord<.lisuwu_> In reply to @isofruit "Or rather, when you": isn't it simpler ? afterall you got Future↵i might just be ignorant given i don't understand rx so...
19:38:17FromDiscord<Phil> Not quite, I mean specifically stuff like "emit a value every 3 seconds" or the like
19:38:41FromDiscord<Phil> Which means now a whole lot of procs need to become async procs to be able to deal with it, and I'll likely need to strategically place some waitFor's
19:39:03FromDiscord<Phil> And users need to be aware that they must be in an async-loop
19:39:08FromDiscord<Phil> (edit) "And users need to be aware that they must be in an async-loop ... " added "for this to work properly"
19:39:16FromDiscord<.lisuwu_> ahh, i see
19:39:49FromDiscord<.lisuwu_> bad idea but: couldn't you have separate thread doing all the waiting ?
19:40:08FromDiscord<Phil> I'm already fucked enough as is, I'm not introducing multithreading
19:40:20FromDiscord<Phil> Nothing ever got simpler or easier to understand by introducing multithreading
19:40:29FromDiscord<.lisuwu_> i know that there is data structure you can do to optimize the waits which just boils down to thread waiting, although whole thread for one thing isnt good lol
19:41:09*def- quit (Quit: -)
19:41:48FromDiscord<.lisuwu_> good luck though
19:41:52*def- joined #nim
19:44:53*def- quit (Client Quit)
19:45:58*def- joined #nim
19:50:15*def- quit (Client Quit)
19:50:57*def- joined #nim
19:54:22FromDiscord<nocturn9x> In reply to @isofruit "I don't *think* they": got it
19:54:30FromDiscord<nocturn9x> then I really don't know what's going on
19:54:37FromDiscord<nocturn9x> the GC is just segfaulting on me for no reason
19:54:49FromDiscord<nocturn9x> and I'm using `atomicArc` so that shouldn't even happen
19:55:12FromDiscord<nocturn9x> I even changed things around so that the reference is created in the worker thread and the only shared reference is the session object
19:56:36FromDiscord<Phil> Concurrency is just hard. Really hard. I can't much help there because I myself am barely knowledgeable on the subjectmatter
19:57:15FromDiscord<nocturn9x> I agree
19:57:25FromDiscord<nocturn9x> from all my time working on my asynchronous event loops in Python I can tell
19:57:33FromDiscord<nocturn9x> and the nice thing about those is that it was never parallel
19:58:02FromDiscord<nocturn9x> it was cooperative multitasking on a single thread, so you never have to worry about concurrent access, just leaving things in a consistent state before/after you `await`
19:58:37FromDiscord<nervecenter> Actor model definitely seems like the safest and easiest to wrap a human head around. Not that it's the end-all be-all but it sure is as good as we've got.
19:58:41FromDiscord<nocturn9x> here it's just, idk, it might happen immediately or it might happen in 2 hours or somewhere in between and it depends on how the scheduler is feeling
19:58:48FromDiscord<nocturn9x> (edit) "here it's just, idk, it might happen immediately or it might happen in 2 hours or somewhere in between and it depends on how the scheduler is feeling ... " added "and the current phase of the moon"
19:59:31FromDiscord<nocturn9x> I'm trying to get rid of the references in the session object
19:59:38FromDiscord<nocturn9x> I'll keep a `ptr SearchManager` around
20:25:55*lucasta quit (Quit: Leaving)
20:31:14FromDiscord<nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=FnFcjzEgniqY
20:31:24FromDiscord<nocturn9x> should I make it so the captured object is not `var`?
20:47:58*jkl quit (Quit: Gone.)
20:49:41*jkl joined #nim
20:56:47FromDiscord<Elegantbeef> Well are any of the types\
20:56:47FromDiscord<Elegantbeef> @nocturn9x is any of the code cyclic?
20:57:00FromDiscord<nocturn9x> I have fixed that issue
20:57:06FromDiscord<nocturn9x> but afaik no, it should not be cyclic
20:57:12FromDiscord<nocturn9x> none of the structures point to one another
20:57:32FromDiscord<nocturn9x> positions are in a `seq`
20:59:14FromDiscord<Elegantbeef> Is the code a small digestable file?
21:00:06FromDiscord<nocturn9x> unfortunately not
21:13:28FromDiscord<polylokh_39446> sent a code paste, see https://play.nim-lang.org/#pasty=EDxIfyisMOjF
21:13:53FromDiscord<nocturn9x> yeah that works that's not the problem
21:13:57FromDiscord<nocturn9x> I am now facing another issue
21:13:57FromDiscord<polylokh_39446> -d:bug to get the error above. the indices stuff is just for the capture.
21:14:17FromDiscord<nocturn9x> I have a `SharedPtr[UCISession]` variable
21:14:39FromDiscord<nocturn9x> which has a field `currentSearch: ptr SearchManager`
21:15:05FromDiscord<nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=FvyXRpvDnJpe
21:15:09FromDiscord<nocturn9x> and then in the main thread
21:15:25FromDiscord<nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=ZcjMrbmaBujQ
21:15:34FromDiscord<nocturn9x> however, the two echo statements print different addresses
21:15:36FromDiscord<nocturn9x> how come?
21:15:48FromDiscord<nocturn9x> isn't that the point of `SharedPtr`?
21:16:07FromDiscord<nocturn9x> should `currentSearch` also be a `SharedPtr`?
21:17:14FromDiscord<polylokh_39446> you're getting the addr of `search`, which is a SharedManager (not a ptr - you're dereferencing it)
21:17:22FromDiscord<nocturn9x> oh
21:17:58FromDiscord<nocturn9x> let me correct that
21:18:50FromDiscord<nocturn9x> they still print different addresses
21:19:20FromDiscord<nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=hYMJsYQsIUhw
21:19:43FromDiscord<nocturn9x> and I know it's a different object because when I call `stop()`, it's not setting the atomic, which means it's operating on a different object
21:19:55FromDiscord<nocturn9x> I've tried making the search manager a shared ptr but that doesn't change anything
21:20:11FromDiscord<polylokh_39446> if you don't dereference it, you're still getting the addr of `search`, which is still a stack-allocated variable with an address on the stack, even though it contains a pointer
21:20:43FromDiscord<nocturn9x> huh
21:20:50FromDiscord<nocturn9x> you said one thing and the opposite of a thing
21:21:03FromDiscord<nocturn9x> In reply to @nocturn9x "from within a worker": here I'm taking the address of `searcher`
21:21:12FromDiscord<nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=UDIBUPdXOrWc
21:21:13FromDiscord<nocturn9x> and it's not
21:21:37FromDiscord<nocturn9x> `search` here is not a reference at all, it's a value type
21:23:24FromDiscord<polylokh_39446> sent a code paste, see https://play.nim-lang.org/#pasty=EmGTKkVjOCxt
21:24:05FromDiscord<nocturn9x> so how do I get the actual memory address
21:24:21FromDiscord<polylokh_39446> if you have a pointer, you already have it. Don't use addr
21:24:27FromDiscord<nocturn9x> I don't have a pointer
21:24:30FromDiscord<polylokh_39446> the final echo there is printing the pointer
21:24:31FromDiscord<nocturn9x> that's kinda the point
21:24:42FromDiscord<nocturn9x> yes but I get it via `addr` in the other thread...
21:25:21FromDiscord<polylokh_39446> easiest way is probably to work with a ref to begin with, and pass that around
21:25:37FromDiscord<polylokh_39446> this came up the other day on the forums: <https://forum.nim-lang.org/t/11508>
21:25:43FromDiscord<nocturn9x> that is literally what I have done
21:25:47FromDiscord<nocturn9x> and it randomly segfault
21:25:53FromDiscord<nocturn9x> it's the whole reason I'm avoiding refs like the plague
21:26:19FromDiscord<nocturn9x> they don't work because _someone_ was too concerned for writing memory safe multithreaded programs and forgot to implement something that actually works
21:26:22FromDiscord<nocturn9x> (edit) "they don't work because _someone_ was too concerned for writing memory safe multithreaded programs and forgot to implement something that actually works ... " added "and isn't trash"
21:27:11FromDiscord<nocturn9x> sharing refs is the whole pain in the ass that brought me here
21:27:20FromDiscord<nocturn9x> (edit) "segfault" => "segfaults"
21:27:31FromDiscord<nocturn9x> (edit) "for" => "with"
21:28:06FromDiscord<polylokh_39446> well this is also a pain. You have to be very aware of what you're taking the address of with addr, and you have to make sure that that ptr is valid when you use it.
21:28:16FromDiscord<nocturn9x> that is not a problem
21:28:21FromDiscord<nocturn9x> the problem is how do I get the right address
21:28:36FromDiscord<nocturn9x> I know for a fact the pointer will be valid due to how the program's flow is structured
21:29:53FromDiscord<polylokh_39446> my thought's to use an uncopiable type to ensure that it's always taken as a 'var' in parameters, so that addr against its members will refer to the original location and not to a local copy
21:30:59FromDiscord<nocturn9x> Let me explain what I need to do
21:31:09FromDiscord<nocturn9x> I receive a `go` command from a chess GUI or other UCI compatible client
21:31:16FromDiscord<nocturn9x> I have to start a search for the best move in that position
21:31:21FromDiscord<nocturn9x> but I also cannot stop processing UCI commands
21:31:27FromDiscord<nocturn9x> hence the search needs to go to a separate thread
21:31:42FromDiscord<nocturn9x> I can't use var parameters because I can't return until I'm done, the command loop needs to do other things
21:31:50FromDiscord<nocturn9x> then when I receive `stop`, I set an atomic boolean flag
21:31:55FromDiscord<nocturn9x> and the search stops
21:32:42FromDiscord<nocturn9x> I guess I'd have to create the `SearchManager` in the main thread and pass it along instead of creating it in the thread?
21:32:43FromDiscord<polylokh_39446> sent a code paste, see https://play.nim-lang.org/#pasty=QrUjmnvBVDPQ
21:38:38FromDiscord<nocturn9x> I have fixed it by creating the searcher instance in the main thread
21:38:46FromDiscord<nocturn9x> now the worker thread merely accesses it
21:39:55FromDiscord<nocturn9x> still getting segfaults regardless
21:39:59*progranner quit (Ping timeout: 252 seconds)
21:40:05FromDiscord<nocturn9x> I am seriously starting to consider just dropping nim as a language outright
21:40:11FromDiscord<nocturn9x> it causes more pain in the ass than it's worth
21:40:47FromDiscord<michaelb.eth> depending on what you’re accessing (including reads) across threads, it can cause races in the reference counter and segfault
21:40:57FromDiscord<nocturn9x> yeah, I noticed.
21:41:04FromDiscord<nocturn9x> that's despite `--mm:atomicArc`
21:41:06FromDiscord<nocturn9x> atomic my ass
21:41:32FromDiscord<michaelb.eth> generally with Nim you want to use message passing across channels for multithreaded programs
21:41:58FromDiscord<nocturn9x> I _just_ need to share a reference
21:41:59FromDiscord<nocturn9x> it's not that hard
21:42:05FromDiscord<nocturn9x> plenty of languages do it race-free
21:42:10FromDiscord<nocturn9x> Nim can't because it's opinionated
21:42:14FromDiscord<nocturn9x> it's literally the only reason.
21:42:35FromDiscord<nocturn9x> message passing requires copies or moves, isn't that right
21:42:44FromDiscord<Elegantbeef> No it cannot due it cause ORC and ARC are not threadsafe 😄
21:42:53FromDiscord<nocturn9x> then wtf is `atomicArc` for
21:42:57FromDiscord<nocturn9x> is that just a lie?
21:42:58FromDiscord<Elegantbeef> ORC being threadsafe is a complex thing
21:43:06FromDiscord<nocturn9x> I'm not even using orc
21:43:09FromDiscord<Elegantbeef> atomic arc has the destructors being atomically called
21:43:20FromDiscord<nocturn9x> the crashing occurs even with boehm which has a shared heap
21:43:24FromDiscord<nocturn9x> nim is the problem here
21:43:29FromDiscord<michaelb.eth> In reply to @nocturn9x "Nim can't because it's": yeah, goes against grain of Nim’s design, at least to date, it’s a common thing people run into re: multithreading with Nim
21:43:47FromDiscord<nocturn9x> well nim's design is stupid then
21:43:56FromDiscord<nocturn9x> if it can't work with real world programs with real world needs then it's useless
21:44:10FromDiscord<nocturn9x> and sharing _one damn reference_ isn't too much to ask
21:44:15FromDiscord<Elegantbeef> It's not so much against Nim's design as much as Orc is not threadsafe so isolation exists
21:44:23FromDiscord<nocturn9x> _I'm not usinc ORC_
21:44:30FromDiscord<Elegantbeef> I know
21:44:32FromDiscord<Elegantbeef> I'm not talking to you
21:44:39FromDiscord<nocturn9x> it's not even just ORC or ARC
21:44:44FromDiscord<nocturn9x> refc and boehm fail just as bad
21:44:45FromDiscord<Elegantbeef> atomicarc supposed to work
21:44:51FromDiscord<nocturn9x> yeah, keyword supposed
21:45:17FromDiscord<Elegantbeef> Is this project public?
21:45:20FromDiscord<nocturn9x> it is
21:45:55FromDiscord<nocturn9x> https://git.nocturn9x.space/nocturn9x/CPG/
21:45:59FromDiscord<nocturn9x> `Chess` directory
21:46:05FromDiscord<michaelb.eth> In reply to @Elegantbeef "It's not so much": true, what I said is slightly overstated, but a lot of folks won’t know to delineate Nim from its ORC
21:46:05FromDiscord<nocturn9x> `nimble install` should do
21:46:19FromDiscord<nocturn9x> the offending code is in `nimfish/nimfishpkg/uci.nim`
21:46:25FromDiscord<Elegantbeef> `git clone` is easier 😄
21:46:32FromDiscord<nocturn9x> that too
21:46:48FromDiscord<nocturn9x> In reply to @nocturn9x "the offending code is": specifically it's `bestMove` and `commandLoop`
21:46:53FromDiscord<michaelb.eth> what version of Nim?
21:46:56FromDiscord<nocturn9x> 2.0.4
21:47:09FromDiscord<nocturn9x> the nimble file has all the info necessary to build it
21:47:28FromDiscord<nocturn9x> Appreciate the help, by the way
21:47:48FromDiscord<Elegantbeef> How to run?
21:47:48FromDiscord<nocturn9x> Just a little frustrated because I'm wasting time fighting with the tool rather than using it to solve my problem
21:48:14FromDiscord<nocturn9x> To run the offending benchmark you need `cutechess-cli`
21:48:23FromDiscord<nocturn9x> which runs many instances of the program in parallel
21:48:28FromDiscord<nocturn9x> I'll send you the appropriate command
21:48:36FromDiscord<nocturn9x> have you git cloned the repo?
21:48:43FromDiscord<Elegantbeef> of course
21:49:12FromDiscord<nocturn9x> first thing you need to do is `unzip Pohl.epd.zip` inside `nimfish/nimfishpkg/resources`
21:49:28FromDiscord<nocturn9x> then install cutechess-cli
21:49:56FromDiscord<Elegantbeef> This is where I'll joke about dependency hell
21:50:08FromDiscord<nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=zuAUzWeblFPr
21:50:16FromDiscord<nocturn9x> of course you have to run `nimble build` first
21:51:02FromDiscord<nocturn9x> In reply to @nocturn9x "and run the following:": then just wait a random amount of time until cutechess exits with `Loss: X disconnects: 1` and you'll notice that one of the logs files presents a segfault
21:51:20FromDiscord<nocturn9x> yesterday I managed to track down the segfault to basically a `realloc` call on nil
21:51:25FromDiscord<nocturn9x> deep down in the internals of ARC
21:51:41FromDiscord<nocturn9x> In reply to @nocturn9x "changing the load to": here
21:52:37FromDiscord<Elegantbeef> Is it?
21:52:50FromDiscord<nocturn9x> that's what it seems at least
21:53:13FromDiscord<Elegantbeef> As you said that I seen `r.move` and was scared that it was calling `move(r)` 😄
21:53:25FromDiscord<Elegantbeef> But nah expandArc says it's a field access
21:53:40FromDiscord<nocturn9x> In reply to @Elegantbeef "As you said that": oh haha yeah no
21:53:44FromDiscord<nocturn9x> it's not using move semantics
21:53:48FromDiscord<nocturn9x> at least I'm not doing so explicitly
21:54:11FromDiscord<Elegantbeef> Well naming a field `move` has got to be asking for a fuckup 😄
21:54:21FromDiscord<nocturn9x> _whoops_
21:55:46FromDiscord<nocturn9x> you might notice a bunch of `Atomic`s sprinkled somewhere
21:55:53FromDiscord<nocturn9x> those were my desperate attempts at fixing this
21:56:12FromDiscord<nocturn9x> except `stopFlag` in `search.nim`, that was purposely put there since the beginning
21:58:06FromDiscord<Elegantbeef> Is it expected to not compile with `-d:debug`?
21:58:54FromDiscord<michaelb.eth> beef, one thing that I'm wondering re: Matt's code, I recall in the past that Araq had mentioned that threads need to be global variables, is that still a thing do you know?
22:00:11FromDiscord<Elegantbeef> By global they need to be never moved
22:00:18FromDiscord<nocturn9x> In reply to @Elegantbeef "Is it expected to": it should compile
22:00:32FromDiscord<Elegantbeef> well with debug it complains about lacking `toFEN`
22:00:41FromDiscord<nocturn9x> oh yeah I forgot to fix that
22:01:02FromDiscord<nocturn9x> there is a forward declaration for `toFen` missing in `position.nim`
22:01:12FromDiscord<nocturn9x> just move it up and it should compile
22:01:19FromDiscord<Elegantbeef> But it only fails for debug....
22:01:21FromDiscord<michaelb.eth> In reply to @Elegantbeef "By global they need": e.g. https://forum.nim-lang.org/t/10772#71871
22:01:32FromDiscord<nocturn9x> because the check is inside a `when not defined(danger) `
22:01:34FromDiscord<Elegantbeef> Yea I know what he said
22:01:41FromDiscord<Elegantbeef> But notice he said `local variables`
22:01:49FromDiscord<Elegantbeef> If they're heap allocated on a seq or `ref` it's fine
22:02:20FromDiscord<Elegantbeef> > Not, it just cannot be copied, you have to go through the OS to create/destroy it.
22:02:48FromDiscord<nocturn9x> _Don't use threads directly, use Weave or Malebolgia._↵↵yeah, thanks Araq. I would if either of them worked properly
22:03:03FromDiscord<nocturn9x> Weave is a mess and Malebolgia straight up does not freaking compile
22:03:09FromDiscord<nocturn9x> I don't need structured concurrency
22:03:51FromDiscord<morgan> today i think i got the last bit of my clap abstraction layer done, tonight i'm going to port my existing basic effect plugin over to that and fix any issues that i find in the process. should be a lot simpler now
22:04:13FromDiscord<nocturn9x> This is hands down the single dumbest point of Nim's design
22:04:13FromDiscord<Elegantbeef> Oh michael they do have a stack thread
22:04:37FromDiscord<nocturn9x> In reply to @nocturn9x "This is hands down": up there with templates
22:04:53FromDiscord<morgan> what's the issue with templates?
22:05:35FromDiscord<nocturn9x> don't even get me started on those, I have a whole rant
22:05:36FromDiscord<threefour> Parallelism is definitely Nim's biggest pain point for me.
22:05:41FromDiscord<Elegantbeef> Yea you don't shit on templates
22:05:54FromDiscord<nocturn9x> but templates I can work around
22:06:06FromDiscord<nocturn9x> stupid decisions about how parallelism should work, I can not
22:06:37FromDiscord<nocturn9x> especially when the proposed standard solutions do not, in fact, work in the slightest beyond toy examples
22:06:58FromDiscord<morgan> i haven't ran it yet but i was unsure how to do the part of the library where it exposes the entry point, but figured out i could just stick all that related code in a template
22:07:09FromDiscord<nocturn9x> Before this I thought making my own language to fix my issues with nim was a low priority
22:07:16FromDiscord<nocturn9x> Now it's suddenly at the top of my bucket list
22:07:39FromDiscord<nocturn9x> I need to get my compiler up and running quickly so I can implement actual sane multithreaded parallelism without feeling like the language is treating me like an idiot
22:07:48FromDiscord<Elegantbeef> Yea why is there a `createThread`just floating inside a single scope?
22:08:07FromDiscord<Elegantbeef> Just hoping the program stays alive long enough that's not an issue
22:08:22FromDiscord<nocturn9x> I don't know, is that not how you create bare threads in nim? There's a bazillion examples and none of them look alike or work the same way
22:08:29FromDiscord<Elegantbeef> That is how you do it
22:08:43FromDiscord<Elegantbeef> But you do not `joinThread` or anything like that so it's not safe
22:08:43FromDiscord<nocturn9x> The program staying alive is not a problem
22:09:08FromDiscord<nocturn9x> In reply to @Elegantbeef "But you do not": That doesn't really matter, if the thread dies it died, too bad
22:09:18FromDiscord<nocturn9x> the UCI spec is surprisingly lax when it comes to handling errors
22:09:30FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=LdWyAKwSPgcR
22:09:37FromDiscord<Elegantbeef> This keeps the thread alive and does not have it on the stack
22:09:48FromDiscord<Elegantbeef> I'm assuming you're writing over the thread and causing issues down the road
22:09:52FromDiscord<Elegantbeef> Whether this fixes the segfault is another thing
22:10:02FromDiscord<nocturn9x> testing this will be quite easy
22:10:02FromDiscord<nocturn9x> let me see
22:10:05FromDiscord<Elegantbeef> Yes it leaks resources
22:10:12FromDiscord<Elegantbeef> But you need to keep the thread alive and in a single spot
22:10:28FromDiscord<Elegantbeef> So using a `seq[ref Thread]` or similar would be ideal
22:10:32FromDiscord<nocturn9x> the thread exists for the duration of the `go` command and then exits
22:10:43FromDiscord<nocturn9x> and there is only ever one search running
22:10:48FromDiscord<nocturn9x> because that's how UCI chess engines work
22:10:52FromDiscord<Elegantbeef> Right but it exists on the stack so if the program continues running and it pops the stack
22:11:17FromDiscord<nocturn9x> why would it pop the stack if `commandLoop` never exits
22:12:13FromDiscord<nocturn9x> `commandLoop` is the program's main loop
22:12:18FromDiscord<nocturn9x> it exits when everything is done and good
22:12:23FromDiscord<nocturn9x> not before, not after
22:13:43FromDiscord<Elegantbeef> Hey don't look at me I just followed what has been said
22:14:40FromDiscord<Elegantbeef> I have not looked at the C or expanded arc for `startUCISession` so I don't know exactly how Nim is behaving here
22:14:51FromDiscord<nocturn9x> testing your change right now
22:15:40FromDiscord<northnaut> 1000001489.gif https://media.discordapp.net/attachments/371759389889003532/1235353976418074694/1000001489.gif?ex=6634108b&is=6632bf0b&hm=41d6927761aa3aec04d1e9fcd58c75b17a82adba8971d6c63e2330bc9a423e93&
22:16:21FromDiscord<threefour> https://tenor.com/view/cat-huh-cat-huh-etr-gif-15332443943609734737
22:17:08FromDiscord<Elegantbeef> @nocturn9x it does probably do `=wasMoved` and `=destroy` inside that scope, which means it likely 0's the thread data
22:17:19FromDiscord<ElegantBeef> <@&371760044473319454>
22:17:28FromDiscord<nocturn9x> In reply to @Elegantbeef "<@523555920265871380> it does probably": huh
22:17:39FromDiscord<nocturn9x> I suppose that would fuck things up yeah
22:18:13FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=PxqSyhJPENZR
22:18:16FromDiscord<Elegantbeef> Is what yours did
22:19:27FromDiscord<northnaut> 1000001489.gif https://media.discordapp.net/attachments/371759389889003532/1235354928864825435/1000001489.gif?ex=6634116e&is=6632bfee&hm=a8669c3b98efc545e2d920c1ac470733b220f8bbae3247ad6a4fcf452d78abb9&
22:19:37FromDiscord<nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=euOmkyAmozYd
22:19:47FromDiscord<nocturn9x> that would do it...
22:20:29FromDiscord<northnaut> 1000001498.jpg https://media.discordapp.net/attachments/371759389889003532/1235355187447730226/1000001498.jpg?ex=663411ac&is=6632c02c&hm=e2508cafe7665faf66598aa4f2185a6231bc95c216023a19fa1648feada17132&
22:21:07FromDiscord<morgan> In reply to @northnaut "1000001489.gif": couldn’t even get the dog whistle number right smhing my head
22:22:05FromDiscord<nocturn9x> In reply to @northnaut "1000001498.jpg": can you like, not
22:23:27FromDiscord<morgan> idk if the <@&371760044473319454> s here are also mods on whatever chat app that’s synced from to discipline them there
22:23:49FromDiscord<morgan> but at least deleting the messages on discord’s end would be appreciated
22:24:14FromDiscord<polylokh_39446> they can handle it. Discussing it is just contributing to the disruption.
22:25:31FromDiscord<polylokh_39446> that the bridge prevents blocks does make it more annoying than normal spam, though.
22:26:17FromDiscord<morgan> In reply to @Elegantbeef "Morgan will want a": yea it would be nice to have an audio dev channel
22:27:05FromDiscord<morgan> In reply to @morganalyssa "could we get an": bumping this, in case any mods happen to look at general
22:32:01FromDiscord<northnaut> 1000001489.gif https://media.discordapp.net/attachments/371759389889003532/1235358090833170462/1000001489.gif?ex=66341460&is=6632c2e0&hm=f698ce9e9c2aa64fd6235fdccbd94723e1ae2a631aacd5916da2e44af21353ef&
22:32:20FromDiscord<northnaut> Morgan pedophile
22:32:20FromDiscord<northnaut> Pedophile morgan
22:46:16FromDiscord<morgan> i wonder if bots can be affected by automod, if not it would be worth setting up something similar that could at least ping mods on specific words
22:46:36FromDiscord<Elegantbeef> There are moderation tools for matrix
22:47:19FromDiscord<morgan> i was thinking on the discord, since discord has an automod feature
22:48:13FromDiscord<Elegantbeef> The biggest issue with discord is that no one can do what matrix does with the pseudo users
22:48:25FromDiscord<morgan> pseudo user?
22:48:26FromDiscord<Elegantbeef> Every discord user shows up as a unique person on matrix
22:48:38FromDiscord<morgan> ah
22:48:39FromDiscord<morgan> neat
22:48:50FromDiscord<anuke> Automod doesn't trigger for bots/webhook events unfortunately
22:49:01FromDiscord<morgan> yeah that was my guess
22:49:11FromDiscord<polylokh_39446> this one started with image posts, not words that a simple filter could catch. And it's not able to speak English enough to insult you. This isn't a sincere interaction. I'd guess it's just something like a researcher paying a group of people on fiverr to be offensive in different chats so he can produce a graph↵"In the Nim community, it took moderators TWO HOURS to silence our disruptor. Meanwhile, this other language community
22:49:40FromDiscord<northnaut> Morgan fsggot
22:49:47FromDiscord<morgan> lol
22:49:56FromDiscord<northnaut> 1000001489.gif https://media.discordapp.net/attachments/371759389889003532/1235362596756914311/1000001489.gif?ex=66341892&is=6632c712&hm=b3ef6c58eb4ee3fcf3412d7ea05b6360ef13f06f3abd0c8a883195d4eec5d1b1&
22:49:58*def- quit (Quit: -)
22:50:15FromDiscord<northnaut> I hope you get raped and have a painful abortion you whore
22:50:22FromDiscord<northnaut> 1000001498.jpg https://media.discordapp.net/attachments/371759389889003532/1235362706194960444/1000001498.jpg?ex=663418ad&is=6632c72d&hm=5f387b365c1cc6b63a7821fe498fc02f06dc174924c4b76f7244883743edd98b&
22:51:44FromDiscord<Elegantbeef> I don't think the matrix side has any anti spam bots setup
22:52:51FromDiscord<Elegantbeef> https://github.com/the-draupnir-project/Draupnir https://github.com/matrix-org/mjolnir both exist
22:53:50FromDiscord<morgan> nice, should be pretty easy to get something set up then
22:55:01FromDiscord<northnaut> Yeah set it up nigger
22:55:15FromDiscord<Elegantbeef> I'll never get the shear lack of anything productive to do
22:56:40FromDiscord<polylokh_39446> does it demonstrate more or less faith in humanity to think he's being paid?
22:56:54FromDiscord<Elegantbeef> Less
22:57:07FromDiscord<polylokh_39446> huh.
22:57:48FromDiscord<Elegantbeef> To think that someone would pay someone else to do such inane things as just using bigoted language for no reason other than to attempt to get a reaction is a deep dark tunnel
22:59:32FromDiscord<polylokh_39446> it makes sense to me, it's similar to hiring pentesters, just in a "community moderation" rather than an "application security" context.
22:59:45*lucasta joined #nim
23:01:28FromDiscord<Elegantbeef> Whether it makes sense is another thing
23:02:56FromDiscord<northnaut> sent a long message, see https://pasty.ee/VgZJSRBEArrW
23:02:57FromDiscord<northnaut> sent a long message, see https://pasty.ee/VkGYZCFVklXh
23:02:58FromDiscord<northnaut> sent a long message, see https://pasty.ee/ZWfAAUSVIqqx
23:02:59FromDiscord<northnaut> sent a long message, see https://pasty.ee/bAobdWkPHwuM
23:02:59FromDiscord<northnaut> sent a long message, see https://pasty.ee/snCylxoZFKUh
23:03:01FromDiscord<polylokh_39446> it's unethical, and irritating, but there are people who want more heavily moderated communities. It's in their interest for disruptions like this to happen, and I think people will easily rationalize what's in their interest.
23:03:08FromDiscord<Elegantbeef> Oh no we talked about them
23:03:08FromDiscord<northnaut> sent a long message, see https://pasty.ee/xCDVhVXlCWPJ
23:03:09FromDiscord<northnaut> sent a long message, see https://paste.rs/fIKeo
23:03:15FromDiscord<Elegantbeef> They now need to prove they're an adult
23:03:15FromDiscord<northnaut> sent a long message, see https://paste.rs/GLIBd
23:03:21FromDiscord<northnaut> sent a long message, see https://paste.rs/36QLS
23:03:27FromDiscord<northnaut> sent a long message, see https://paste.rs/LWFq0
23:03:33FromDiscord<northnaut> sent a long message, see https://paste.rs/f2Q51
23:03:39FromDiscord<northnaut> sent a long message, see https://paste.rs/1AbAw
23:03:45FromDiscord<northnaut> sent a long message, see https://paste.rs/WKGoG
23:03:51FromDiscord<northnaut> sent a long message, see https://paste.rs/ov3Jp
23:03:57FromDiscord<northnaut> sent a long message, see https://paste.rs/Llcle
23:08:57*def- joined #nim
23:09:00FromDiscord<michaelb.eth> I was reading the other day that smooth brained individuals such as northnaut may not be able to reach psychological adulthood
23:15:26FromDiscord<morgan> to use a word they may be familiar with to insult others with, retarded
23:15:45FromDiscord<northnaut> sent a long message, see https://pasty.ee/BPoDLcYLeAIO
23:15:45FromDiscord<northnaut> sent a long message, see https://pasty.ee/omhaAxcbIxVS
23:15:46FromDiscord<northnaut> sent a long message, see https://pasty.ee/yqPsSBTlfnvJ
23:15:49strogon14morgan: I'm currentyl working on making it nicer to write LV2 format plugins in Nim. I would definetly be interested in some Nim audio dev focused channel / community / whatever.
23:16:00FromDiscord<northnaut> sent a long message, see https://pasty.ee/PPDemjxiuKUu
23:16:03FromDiscord<northnaut> sent a long message, see https://pasty.ee/dUUCAQWStusk
23:16:03FromDiscord<northnaut> sent a long message, see https://pasty.ee/roRwYAKULzGC
23:16:40FromDiscord<morgan> In reply to @strogon14 "<@277133333773811712>: I'm currentyl working": yea it was a pleasant surprise to see when i searched for when i talked about getting an audio channel here
23:17:00FromDiscord<northnaut> sent a long message, see https://pasty.ee/TEVAEtewEKJT
23:17:00FromDiscord<northnaut> sent a long message, see https://pasty.ee/qRZNVyOQPbkR
23:17:00FromDiscord<northnaut> sent a long message, see https://pasty.ee/GSweKkvmfTll
23:17:05strogon14do you have a published repo for your clap stuff yet?
23:17:10FromDiscord<morgan> <@&371760044473319454> there’s a matrix user being incredibly disruptive
23:17:14FromDiscord<morgan> yea one sec
23:17:16FromDiscord<northnaut> sent a long message, see https://pasty.ee/QJWLDnRDMmyr
23:17:16FromDiscord<northnaut> sent a long message, see https://pasty.ee/fadkFKzsnRQh
23:17:17FromDiscord<northnaut> sent a long message, see https://pasty.ee/fWxEyplBHxTz
23:17:28FromDiscord<Elegantbeef> @morgan and it's not me for once 😛
23:17:41FromDiscord<morgan> lol
23:19:35FromDiscord<northnaut> morgan likes touching kids
23:19:48FromDiscord<morgan> In reply to @strogon14 "do you have a": https://github.com/morganholly/nim-clap i have a working clap audio effect using the raw api, i finally finished writing the abstraction layer over it that i’ve been working on and i’m going to test it tonight, and then once that’s working, custom ui (using sokol) is next on my list, and after that i’ll be looking into the c++ clap to au and vst3 wrappers
23:20:26strogon14morgan: sounds awesome
23:21:23strogon14I have two simple LV2 audio plugins so far, but no abstraction layer over the LV2 C API. So, I'l definitely check out how you approach things.
23:23:42FromDiscord<morgan> theoretically i think the abstraction layer could have a lv2 backend, but would require compiling against both it and the clap headers, im not sure what parts of clap api are used in what the user sees
23:23:55strogon14For UI I was thinking of either wrapping NanoGUI in Nim or just creating some basic widgets with windy and pixie. But it will probably be some weeks before I get to that.
23:24:12FromDiscord<Elegantbeef> https://github.com/johnnovak/koi is interesting if you want an IMGUI
23:24:22strogon14I'm not a fan of immediate UI libs, mainly because I think they all have terrible layouting.
23:25:05FromDiscord<morgan> the bulk of it is abstracting over the parameter api functions so that the user provides a seq of parameter objects and it handles automation, setting up the parameters, and saving/loading them
23:25:45FromDiscord<morgan> my plan for the ui is just expose sokol callbacks and let the user provide shaders, meshes, uniforms, etc
23:25:45FromDiscord<Robyn [She/Her]> In reply to @northnaut "STUPID NIGGER STUPID NIGGER": <@&371760044473319454>
23:26:01strogon14morgan: yeah, that's similar to my plan as well.
23:26:08FromDiscord<morgan> mostly because that’s what i need for my ui and i’m primarily making this for myself
23:26:44strogon14plus a 'Plugin' type for defining the plugin name, ID, whether it needs MIDI, etc.
23:27:24FromDiscord<Robyn [She/Her]> In reply to @Elegantbeef "They now need to": Lol
23:29:28FromDiscord<morgan> sent a long message, see https://pasty.ee/EocxwEBmEyvb
23:45:14*gst quit (Ping timeout: 250 seconds)
23:53:15FromDiscord<morgan> i might redo that to remove the blendable dual settings thing, but i first want to see how bad the performance is
23:54:08FromDiscord<morgan> because that would be recalculating coefficients for up to 85 filters
23:55:05FromDiscord<morgan> i might have to split up the calculations into N groups that are recalculated every N samples and interpolated
23:58:19FromDiscord<morgan> tho it would still have the per channel eq amount sliders which could all be modulated at the same time, so maybe not that much worse
23:58:53FromDiscord<morgan> anyways