00:00:46 | FromDiscord | <demotomohiro> sent a code paste, see https://play.nim-lang.org/#pasty=EISVsVHzFNLR |
00:06:04 | FromDiscord | <Elegantbeef> Overloads |
00:06:22 | FromDiscord | <Robyn [She/Her]> ~~Converters 👀~~ |
00:06:47 | FromDiscord | <Robyn [She/Her]> (edit) "~~Converters 👀~~ ... " added "(jk, converters are bad ideas)" |
00:07:01 | FromDiscord | <Robyn [She/Her]> (edit) "~~Converters 👀~~ (jk, converters are ... badidea)" added "a" | "ideas)" => "idea)" |
00:07:05 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=nXEFKvjLbYbP |
00:07:36 | FromDiscord | <Elegantbeef> Using a converter for `some` is the most cancerous converter ever, I love it! |
00:07:56 | FromDiscord | <Elegantbeef> `10.get()` completely valid and not unhinged whatsoever |
00:11:01 | FromDiscord | <Robyn [She/Her]> Totally sane |
00:18:30 | * | KhazAkar quit (Ping timeout: 252 seconds) |
00:18:55 | * | KhazAkar joined #nim |
00:54:10 | FromDiscord | <polylokh_39446> sent a code paste, see https://play.nim-lang.org/#pasty=QVXhNemoIVcX |
00:54:55 | FromDiscord | <Elegantbeef> lame aint the word for it |
00:55:55 | * | def- quit (Quit: -) |
00:57:39 | FromDiscord | <polylokh_39446> sent a code paste, see https://play.nim-lang.org/#pasty=JSZACBSzfCdu |
00:57:46 | FromDiscord | <Robyn [She/Her]> Time to break out concepts lmao |
00:58:07 | * | def- joined #nim |
00:59:31 | FromDiscord | <polylokh_39446> sent a code paste, see https://play.nim-lang.org/#pasty=srIaXtqFTdEw |
01:00:00 | FromDiscord | <Elegantbeef> The issue is that any type that has `.get` will fire that |
01:00:33 | FromDiscord | <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:11 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=YoriZylleRxb |
01:01:37 | FromDiscord | <Elegantbeef> Or `typ[0].eqIdent "Option"` |
01:02:50 | FromDiscord | <polylokh_39446> awesome, ty. |
01:03:16 | FromDiscord | <polylokh_39446> sent a code paste, see https://play.nim-lang.org/#pasty=bmQKUbSWFHMO |
01:05:33 | FromDiscord | <polylokh_39446> but to the original question, you probably want something like the builder pattern, and boring use of optionals |
01:07:54 | FromDiscord | <Elegantbeef> Or just use overloads if more applicable |
01:13:33 | FromDiscord | <amarevite> sent a code paste, see https://play.nim-lang.org/#pasty=DxIAnaDWjPkR |
01:16:33 | FromDiscord | <polylokh_39446> jumping to macros is the easiest way to do that. |
01:17:58 | FromDiscord | <amarevite> in that case can you give me a minimal example of iterating a proc's input variables from inside the proc |
01:18:04 | FromDiscord | <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:05 | FromDiscord | <amarevite> (edit) "in that case can you give me a minimal example of iterating ... a" added "over" |
01:18:07 | FromDiscord | <Elegantbeef> You don't need macros |
01:18:25 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=NHneNvULPgDu |
01:37:23 | * | def- joined #nim |
01:45:25 | FromDiscord | <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:41 | FromDiscord | <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:05 | FromDiscord | <Elegantbeef> `for name, field in locals().fieldPairs: when name != "result": ....` |
01:47:56 | FromDiscord | <Elegantbeef> Tuples cannot be sliced which is why `[0..^2]` did not work |
01:49:15 | FromDiscord | <new_librarian> where should i put the mingw64 |
01:49:15 | FromDiscord | <polylokh_39446> sent a code paste, see https://play.nim-lang.org/#pasty=AFmPCiyNatUb |
01:51:07 | FromDiscord | <Elegantbeef> Why not `when field is Option`? |
01:53:08 | FromDiscord | <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:24 | FromDiscord | <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:46 | FromDiscord | <amarevite> sent a code paste, see https://play.nim-lang.org/#pasty=IedyEiXBrUGH |
02:13:09 | FromDiscord | <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:26 | FromDiscord | <amarevite> oh i swapped the parenthese and brackets my bad |
02:13:33 | FromDiscord | <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:29 | FromDiscord | <polylokh_39446> sent a code paste, see https://play.nim-lang.org/#pasty=UIOPZUMkRyMq |
02:17:12 | FromDiscord | <polylokh_39446> (edit) "https://play.nim-lang.org/#pasty=FsbccIJFAAYT" => "https://play.nim-lang.org/#pasty=ObPULyDqcaOq" |
02:18:30 | FromDiscord | <polylokh_39446> you need that workaround, if you want it to be possible for the 'or' to resolve differently for different arguments |
02:19:20 | FromDiscord | <polylokh_39446> sent a code paste, see https://play.nim-lang.org/#pasty=qjLrZInhCVcP |
02:20:18 | FromDiscord | <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:52 | FromDiscord | <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:43 | FromDiscord | <polylokh_39446> it's introduced early in <https://nim-lang.org/docs/manual.html#generics> |
02:22:42 | FromDiscord | <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:46 | FromDiscord | <polylokh_39446> sent a code paste, see https://play.nim-lang.org/#pasty=NqHnkjyFgqfe |
02:30:35 | FromDiscord | <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:07 | FromDiscord | <amarevite> sent a code paste, see https://play.nim-lang.org/#pasty=rNplOcEIlBqK |
02:44:40 | * | def- quit (Client Quit) |
02:45:36 | FromDiscord | <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:21 | FromDiscord | <Elegantbeef> Or you just do `distinct BoolOrNothing` |
02:59:47 | FromDiscord | <Elegantbeef> \Which is why distinct TypeClass\` exists |
03:00:06 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=CQXgmRNfdSbv |
03:02:09 | FromDiscord | <Elegantbeef> `paramBuilder.buildShiz(locales())` |
03:02:20 | FromDiscord | <Elegantbeef> where `proc buildShiz(buffer: string, data: tuple)` |
03:03:07 | FromDiscord | <Elegantbeef> `var string`\ |
03:07:16 | FromDiscord | <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:18 | FromDiscord | <amarevite> sent a code paste, see https://play.nim-lang.org/#pasty=VhBwRsRSCNOQ |
03:56:13 | FromDiscord | <Elegantbeef> `result.add name & "=" & $field` |
03:56:23 | FromDiscord | <Elegantbeef> Using format for simple formatting is silliness |
03:57:40 | FromDiscord | <Elegantbeef> PS there is `?` inside `std/uri` that takes in `(string, string)` and appends it to your code |
03:58:06 | FromDiscord | <Elegantbeef> so it'd be like `parseUri(serverAddress & "/Users).query(locals().paramsBuilder())` |
03:58:17 | FromDiscord | <Elegantbeef> Whoops |
03:58:29 | FromDiscord | <Elegantbeef> `parseUri(serverAddress & "/Users) ? locals().paramsBuilder()` |
03:58:34 | FromDiscord | <Elegantbeef> My brain filled the gap |
03:59:57 | FromDiscord | <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:12 | FromDiscord | <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:30 | FromDiscord | <Elegantbeef> you need to emit `seq[(string, string)]` and import `uri` |
04:09:01 | FromDiscord | <amarevite> alright if `paramsBuilder()` returns a `(string, string)` tuple, `let endpoint:string = $(serverAddress.parseUri / "Users" ? locals().paramsBuilder)` works |
04:11:36 | FromDiscord | <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:55 | FromDiscord | <xkonti> sent a code paste, see https://play.nim-lang.org/#pasty=ibUZlDeWkYcS |
07:06:35 | FromDiscord | <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:02 | FromDiscord | <Elegantbeef> You want an external library to depend on your test architecture? |
07:08:45 | FromDiscord | <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:22 | FromDiscord | <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:40 | FromDiscord | <Elegantbeef> Make a proc or template that takes a `FileSystem` |
07:11:55 | FromDiscord | <Elegantbeef> Put it inside your `src` file |
07:11:55 | FromDiscord | <Elegantbeef> folder\ |
07:12:29 | FromDiscord | <Elegantbeef> then someone can do `tests/tosfs.nim` in their project and do `import filesystems/testaparatus; test(newOsFs())` |
07:16:41 | FromDiscord | <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:00 | FromDiscord | <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:40 | FromDiscord | <Phil> sent a long message, see https://pasty.ee/kBUJyESVzDpQ |
07:34:14 | FromDiscord | <Phil> (edit) "https://pasty.ee/iwxBwfWoiSNB" => "https://pasty.ee/IPNvNEKuHhxQ" |
07:35:25 | FromDiscord | <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:53 | FromDiscord | <Phil> (edit) "subscribes." => "subscribes and emits values captured in the callback function to that observer." |
07:37:08 | * | lucerne joined #nim |
07:41:34 | FromDiscord | <Phil> sent a long message, see https://pasty.ee/saNFaiQriCUX |
07:41:43 | FromDiscord | <Phil> (edit) "https://pasty.ee/QkpLQkktvaRm" => "https://pasty.ee/wWmermoBVFqr" |
07:42:22 | FromDiscord | <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:15 | FromDiscord | <Elegantbeef> @Phil have you written out a small demo with what was working to showcase the issue? |
08:08:35 | FromDiscord | <Elegantbeef> I read your words but given my lack of knowledge with RX I just scratch my head and go balder |
08:14:19 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#pasty=tkShdpIbFXtx |
08:15:26 | FromDiscord | <Elegantbeef> The expected output is what? |
08:16:08 | * | def- quit (Quit: -) |
08:16:58 | * | def- joined #nim |
08:17:45 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#pasty=VYGGAcWfDUVK |
08:19:03 | FromDiscord | <Elegantbeef> Huh |
08:19:32 | FromDiscord | <Phil> And there are ways around that I think, but they seem ugly as hell |
08:19:54 | FromDiscord | <Phil> Like implementing 2 "forward" procs or some shit and storing weird amounts of observers left and right |
08:20:20 | FromDiscord | <Elegantbeef> I'm so lost at how this works 😄 |
08:21:07 | FromDiscord | <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:16 | FromDiscord | <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:59 | FromDiscord | <Elegantbeef> Well afaict it's just a stack of procedures |
08:22:04 | FromDiscord | <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:34 | FromDiscord | <Elegantbeef> You add a procedure in the stack then all children get an event when a value changes |
08:22:36 | FromDiscord | <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:33 | FromDiscord | <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:44 | FromDiscord | <Phil> (edit) "and" => "with" |
08:24:38 | * | redj quit (Quit: No Ping reply in 180 seconds.) |
08:25:11 | FromDiscord | <Elegantbeef> So in the above example you push a value into cold or map? |
08:25:25 | FromDiscord | <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:46 | FromDiscord | <Elegantbeef> Like in above the subscription causes a call to be made down the chain |
08:26:02 | FromDiscord | <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:09 | FromDiscord | <Elegantbeef> So it turns into `echo "Observable": map(map(map(5)))` |
08:26:10 | * | redj joined #nim |
08:27:13 | FromDiscord | <Phil> More: "Observer1: 5"↵"Observer2: anonymousMapProc(5)"↵"Observer3: anonymousMapProc(5)" |
08:27:40 | FromDiscord | <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:59 | FromDiscord | <Phil> But the subscribe should trigger only value emission to the one thing that subscribed and to nobody else |
08:28:32 | FromDiscord | <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:31 | FromDiscord | <Elegantbeef> So in the case the of `next` it pushes `1` to what? |
08:30:46 | FromDiscord | <Elegantbeef> You omitted all of the plumbing |
08:41:12 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#pasty=KFsujoxMusoc |
08:41:48 | FromDiscord | <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:58 | FromDiscord | <Phil> sent a long message, see https://pasty.ee/WbmsCxpXkXvu |
08:44:32 | FromDiscord | <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:45 | FromDiscord | <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:00 | FromDiscord | <Elegantbeef> I was more saying that you left out the how the first example related to the second 😛 |
08:47:05 | FromDiscord | <Phil> The entire hot vs cold observable dichotomy is murdering me |
08:52:37 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#pasty=wSJIpCLNmEEE |
08:53:01 | FromDiscord | <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:26 | FromDiscord | <Phil> And then only emit the values back to that one specific child that asked for values |
08:53:34 | FromDiscord | <Elegantbeef> Lol you still missed my point |
08:53:48 | FromDiscord | <Elegantbeef> Write the desired code using example A and B |
08:53:58 | FromDiscord | <Phil> Not really, it's just really fucking hard to explain |
08:54:03 | FromDiscord | <Elegantbeef> Plumb A into B |
08:54:08 | FromDiscord | <Elegantbeef> I don't want you to explain |
08:54:13 | FromDiscord | <Elegantbeef> I want to see the desired code |
08:55:13 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#pasty=lqgkewaXwDmT |
08:55:34 | FromDiscord | <Elegantbeef> Thank you 😄 |
08:57:39 | FromDiscord | <Elegantbeef> Much clearer how it's working |
08:58:01 | FromDiscord | <Elegantbeef> Or rather how it's supposed to work |
09:09:04 | * | def- quit (Quit: -) |
09:09:59 | * | def- joined #nim |
09:14:20 | FromDiscord | <nocturn9x> In reply to @juancarlospaco "looks like a realloc": well yeah but |
09:14:23 | FromDiscord | <nocturn9x> it's internal nim stuff |
09:14:28 | FromDiscord | <nocturn9x> how am I supposed to fix that lol |
09:15:34 | * | def- quit (Quit: -) |
09:15:55 | * | def- joined #nim |
09:17:42 | FromDiscord | <nocturn9x> I've tried several options |
09:17:54 | FromDiscord | <nocturn9x> `--mm:atomicArc` as well as `-d:useMalloc`ù |
09:17:56 | FromDiscord | <nocturn9x> (edit) "`-d:useMalloc`ù" => "`-d:useMalloc`" |
09:18:00 | FromDiscord | <nocturn9x> nothing seems to fix it |
09:18:10 | FromDiscord | <nocturn9x> it seems like a bug related to passing refs to another thread |
09:20:09 | FromDiscord | <nocturn9x> I'm trying to see if `--mm:boehm` works better |
09:27:48 | FromDiscord | <nocturn9x> that seems to have fixed it |
09:30:41 | FromDiscord | <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:35 | FromDiscord | <ieltan> But I've heard it's a pretty limited mechanism. Gotta go C++ style and use raw pointers or `SmartPtr[T]` |
09:33:49 | FromDiscord | <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:01 | FromDiscord | <Phil> At least I can vaguely imagine that approach |
09:35:31 | NimEventer | New thread by take1234: Unicode operators / Arrays, which size is know at run time, see https://forum.nim-lang.org/t/11526 |
09:36:30 | FromDiscord | <nocturn9x> In reply to @ieltan "I think you can't": huh |
09:41:08 | FromDiscord | <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:19 | FromDiscord | <nocturn9x> yeah anyway it crashed again |
09:41:25 | FromDiscord | <nocturn9x> this is _so_ annoying |
09:41:43 | FromDiscord | <nocturn9x> it makes me kinda regret I learned nim :P |
09:42:37 | FromDiscord | <ieltan> fwiw, those are the "official" libraries to use for threads ↵https://github.com/nim-lang/threading↵https://github.com/Araq/malebolgia |
09:42:51 | FromDiscord | <nocturn9x> malebolgia is borked lol |
09:43:10 | FromDiscord | <ieltan> rip lol |
09:43:25 | FromDiscord | <nocturn9x> and the documentation for threading is just the API reference |
09:43:38 | FromDiscord | <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:09 | FromDiscord | <nocturn9x> can someone provide a simple example of sending off a function to a worker thread with shared references |
09:44:22 | FromDiscord | <nocturn9x> an example that works and isn't outdated and doesn't randomly crash for no reason |
09:44:50 | FromDiscord | <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:57 | FromDiscord | <nocturn9x> also afaik malebolgia implements SC, but I don't _need_ SC |
09:46:09 | FromDiscord | <nocturn9x> I need a separate worker thread that does something, prints to stdout and then exits |
09:46:30 | FromDiscord | <nocturn9x> I don't even care about the result or if it crashes. If it crashes, it crashed, too bad |
09:57:54 | FromDiscord | <odexine> what have you tried so far |
09:58:08 | FromDiscord | <odexine> iirc you will have to use sharedptr (threading/smartptrs) |
09:58:36 | FromDiscord | <nocturn9x> how do I make one? |
09:58:49 | FromDiscord | <nocturn9x> I have tried several things |
09:59:21 | FromDiscord | <nocturn9x> sent a long message, see https://pasty.ee/XMgITnSHAhMT |
10:02:14 | FromDiscord | <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:59 | FromDiscord | <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:24 | FromDiscord | <odexine> i dont have threading experience so im not too sure |
10:18:28 | * | xet7 quit (Ping timeout: 246 seconds) |
10:18:34 | FromDiscord | <nocturn9x> I need both the main thread and the worker thread to access the reference though |
10:19:00 | FromDiscord | <nocturn9x> there is a boolean variable and an `Atomic[bool]` object that needs to be shared |
10:24:10 | FromDiscord | <odexine> In reply to @nocturn9x "I need both the": they would share this access via the same sharedptr |
10:26:45 | FromDiscord | <nocturn9x> so |
10:27:25 | FromDiscord | <odexine> i dont know the behaviour of this mechanism with atomics |
10:28:06 | FromDiscord | <nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=cqCEsSFLfoRB |
10:28:14 | FromDiscord | <nocturn9x> or should I initialize it as a shared ptr to begin with |
10:29:40 | FromDiscord | <odexine> i would say to begin with |
10:30:20 | * | deadmarshal_ quit (Ping timeout: 268 seconds) |
10:34:19 | FromDiscord | <nocturn9x> okay |
10:34:33 | FromDiscord | <nocturn9x> so I won't need to wrap the `SearchManager` in an `Atomic[T]`? |
10:35:15 | FromDiscord | <odexine> im sorry i really dont know the behaviour of this with atomics |
10:35:53 | FromDiscord | <nocturn9x> where do I import `SharedPtr` from? |
10:35:59 | FromDiscord | <nocturn9x> `std/threading` doesn't seem to exist |
10:36:03 | FromDiscord | <nocturn9x> In reply to @odexine "im sorry i really": no problem |
10:36:54 | FromDiscord | <nocturn9x> https://github.com/henryas/nptr? |
10:41:22 | FromDiscord | <odexine> In reply to @nocturn9x "`std/threading` doesn't seem to": hm i think this is something to be installed first |
10:41:30 | FromDiscord | <odexine> so not std/threading but just threading/ |
10:41:42 | FromDiscord | <odexine> my bad i forgot |
10:41:58 | FromDiscord | <odexine> basically install this as a package in nimble https://github.com/nim-lang/threading |
10:42:59 | FromDiscord | <nocturn9x> so I should turn my entire `UCISession` into a shared ptr |
10:43:09 | FromDiscord | <nocturn9x> should `UCISession` be a value type instead of a ref then? |
10:43:50 | FromDiscord | <nocturn9x> I don't undertand how `Isolated` fits into this |
10:43:52 | FromDiscord | <odexine> if youre making it a shared ptr, i guess it should? maybe smth like UCISessionObj = object... then UCISession = SharedPtr[UCISessionObj[ |
10:43:54 | FromDiscord | <odexine> (edit) "SharedPtr[UCISessionObj[" => "SharedPtr[UCISessionObj]" |
10:43:56 | FromDiscord | <nocturn9x> how do I get the value out? |
10:44:23 | FromDiscord | <odexine> deref the ptr `[]` |
10:44:40 | FromDiscord | <odexine> you can get a mut/immut version |
10:44:51 | FromDiscord | <odexine> mutable VIEW |
10:45:09 | FromDiscord | <nocturn9x> so `session: SharedPtr[Isolated[UCISession]]`? |
10:45:13 | FromDiscord | <odexine> no |
10:45:16 | FromDiscord | <odexine> remove the isolated |
10:45:22 | FromDiscord | <nocturn9x> oke |
10:45:23 | FromDiscord | <odexine> the isolated part is only needed to construct the sharedptr |
10:45:29 | FromDiscord | <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:17 | FromDiscord | <nocturn9x> gotcha |
10:48:13 | FromDiscord | <nocturn9x> how do I initialize it tho |
10:48:34 | FromDiscord | <nocturn9x> do I just construct the value type, then isolate it and pass it to newSharedPtr? |
10:48:56 | * | def- quit (Quit: -) |
10:49:21 | FromDiscord | <odexine> yes |
10:49:28 | FromDiscord | <odexine> i believe so yes |
10:49:31 | * | def- joined #nim |
10:50:00 | FromDiscord | <nocturn9x> but `isolate` wants a `sink T` |
10:50:02 | FromDiscord | <nocturn9x> whatever that means |
10:50:30 | FromDiscord | <odexine> means you should not use that value type again after isolating |
10:51:27 | FromDiscord | <nocturn9x> okay, how do I make something into a `sink T` then |
10:51:50 | FromDiscord | <ieltan> it's supposed to be automatic |
10:51:52 | FromDiscord | <odexine> simply dont use it again after |
10:51:53 | FromDiscord | <odexine> yes |
10:52:05 | FromDiscord | <nocturn9x> `expression cannot be isolated` |
10:52:29 | FromDiscord | <odexine> does your data type have references |
10:52:34 | FromDiscord | <nocturn9x> yes, many |
10:52:40 | FromDiscord | <nocturn9x> that's kind of the point |
10:53:14 | FromDiscord | <ieltan> Remember what I said about isolated being limited lol |
10:53:24 | FromDiscord | <odexine> you cannot have references when youre isolating data |
10:53:29 | FromDiscord | <odexine> at all |
10:53:33 | FromDiscord | <odexine> anywhere |
10:53:40 | FromDiscord | <nocturn9x> it would be nice if the language implemented something that works instead of something that is only theoretical |
10:53:54 | FromDiscord | <odexine> "works" depends on the person |
10:54:02 | FromDiscord | <nocturn9x> no, "works" is a universal definition |
10:54:11 | FromDiscord | <odexine> i dont think so |
10:54:16 | FromDiscord | <nocturn9x> you do what all the other sane languages do and it works |
10:54:24 | FromDiscord | <nocturn9x> if it doesn't, your solution _does not work_ |
10:54:31 | FromDiscord | <odexine> sane is again dependent on the person |
10:55:00 | FromDiscord | <nocturn9x> we can talk about type safety and data race prevention all day |
10:55:04 | FromDiscord | <nocturn9x> but people don't write code in a lab |
10:55:07 | FromDiscord | <nocturn9x> they do so in the real world |
10:55:11 | FromDiscord | <nocturn9x> and the real world is sometimes dirty |
10:55:17 | FromDiscord | <nocturn9x> so not supporting that means being broken |
10:55:19 | FromDiscord | <nocturn9x> by definition |
10:55:30 | FromDiscord | <nocturn9x> languages are tools that are supposed to adapt to the users, not the other way around. |
10:55:34 | FromDiscord | <odexine> please provide such definition's source |
10:55:47 | FromDiscord | <nocturn9x> check out this thing called common sense |
10:55:50 | FromDiscord | <nocturn9x> it might amaze you |
10:55:50 | FromDiscord | <nocturn9x> lol |
10:55:52 | FromDiscord | <solitudesf> In reply to @nocturn9x "languages are tools that": adapt it then |
10:55:57 | FromDiscord | <odexine> In reply to @nocturn9x "check out this thing": common sense is clearly not found where you are |
10:56:04 | FromDiscord | <nocturn9x> In reply to @solitudesf "adapt it then": why do you think I'm working on my own language rofl |
10:56:23 | FromDiscord | <odexine> please tell us when you solve your threading problem in such language |
10:56:57 | FromDiscord | <nocturn9x> will do lol |
10:56:59 | FromDiscord | <ieltan> sent a code paste, see https://play.nim-lang.org/#pasty=YTqQpdKwCMre |
10:57:11 | FromDiscord | <nocturn9x> that isn't the problem |
10:57:20 | FromDiscord | <nocturn9x> the problem is that `YourDataType` has refs |
10:57:23 | FromDiscord | <nocturn9x> inside |
10:57:28 | FromDiscord | <nocturn9x> so it cannot be isolated, apparently |
10:58:05 | FromDiscord | <ieltan> welp rip pepperoni |
10:58:06 | FromDiscord | <nocturn9x> I tried that and it still fails to compile |
10:58:12 | FromDiscord | <nocturn9x> so 🤷 |
10:58:33 | FromDiscord | <odexine> nim supports message passing better versus the shared memory model |
10:58:50 | FromDiscord | <odexine> different languages have differing approaches to ideas |
10:58:52 | FromDiscord | <nocturn9x> I need shared ownership |
10:59:21 | FromDiscord | <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:41 | FromDiscord | <nocturn9x> the fact nim doesn't support the literal most basic use case of that is astonishing |
10:59:57 | FromDiscord | <odexine> ...i would say this can be easily implemented with message passing |
11:01:32 | FromDiscord | <nocturn9x> yes of course let me refactor my code because nim is opinionated about how threads should work (except they don't) |
11:01:54 | FromDiscord | <nocturn9x> building abstraction is one thing, but let me do "unsafe" things if I want to without breaking things |
11:02:03 | FromDiscord | <nocturn9x> but nope, apparently nim is too good for that, lol |
11:02:05 | FromDiscord | <odexine> if you want |
11:02:13 | FromDiscord | <odexine> i believe you can create a more raw shared pointer |
11:02:25 | FromDiscord | <nocturn9x> I've tried several things |
11:02:27 | FromDiscord | <odexine> https://nim-lang.org/docs/system.html#createShared%2Ctypedesc |
11:02:34 | FromDiscord | <nocturn9x> let's see if this works |
11:03:05 | FromDiscord | <odexine> chuck the type in, set the val with `varname[] = value`, deref is `[]` as is before |
11:03:53 | FromDiscord | <odexine> basically `var myptr = createShared(MyType); myptr[] = myvaluetype #[type == MyType]#` |
11:04:03 | FromDiscord | <odexine> this needs to be freed like in C |
11:04:20 | FromDiscord | <odexine> no isolated shit whatnot |
11:05:24 | FromDiscord | <nocturn9x> that looks like what I need |
11:05:51 | FromDiscord | <nocturn9x> can `MyType` hold `ref`s? |
11:05:55 | FromDiscord | <odexine> congrats, hope this is good enough, sorry about the common sense comment |
11:05:58 | FromDiscord | <odexine> In reply to @nocturn9x "can `MyType` hold `ref`s?": literally anything |
11:06:02 | FromDiscord | <nocturn9x> good |
11:06:02 | FromDiscord | <odexine> no restrictions at all |
11:06:14 | FromDiscord | <nocturn9x> In reply to @odexine "congrats, hope this is": it's okay, I'm a bit frustrated |
11:06:34 | FromDiscord | <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:43 | FromDiscord | <odexine> any segfaults and null derefs at this point would prolly be your error since the compiler doesnt analyse anything |
11:06:58 | FromDiscord | <ieltan> I guess though accessing the refs from other thread will still subject you to some issues |
11:07:10 | FromDiscord | <odexine> In reply to @ieltan "I guess though accessing": i think this might be a problem too yes |
11:07:20 | FromDiscord | <odexine> the refs inside the type would still be local |
11:07:31 | FromDiscord | <nocturn9x> _pain_ |
11:07:33 | FromDiscord | <odexine> so i think all refs need to be ptrised |
11:07:36 | FromDiscord | <ieltan> Yeh |
11:07:58 | FromDiscord | <odexine> in which case why not just use the isolated thing? SharedPtrs are isolated compatible |
11:07:59 | FromDiscord | <ieltan> I was gonna say you'll drop the ref altogether for ptr |
11:08:10 | FromDiscord | <ieltan> So you'll be refactoring anyways |
11:08:17 | FromDiscord | <odexine> i dont think this is too big of a refactor |
11:08:22 | FromDiscord | <odexine> compared to message passing anyways |
11:08:30 | FromDiscord | <ieltan> True |
11:08:37 | FromDiscord | <nocturn9x> I suppose if it's gonna be a refactoring either way |
11:08:42 | FromDiscord | <nocturn9x> might as well use the higher level abstraction |
11:09:04 | FromDiscord | <nocturn9x> so I should just use `SharedPtr` everywhere instead of `ref`? |
11:09:22 | FromDiscord | <odexine> i think so, yes |
11:09:46 | FromDiscord | <nocturn9x> I can probably do away with another thing actually |
11:09:55 | FromDiscord | <nocturn9x> if I keep all the refs local to one thread |
11:10:00 | FromDiscord | <nocturn9x> that could work |
11:10:03 | FromDiscord | <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:01 | FromDiscord | <demotomohiro> sent a code paste, see https://play.nim-lang.org/#pasty=KhfAsScPefaX |
11:51:36 | FromDiscord | <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:07 | FromDiscord | <nocturn9x> In reply to @nocturn9x "the main thread doesn't": jk it does |
12:01:14 | FromDiscord | <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:02 | FromDiscord | <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:31 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#pasty=pAmOdZzkpcKj |
14:09:52 | * | gst joined #nim |
14:12:31 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#pasty=WPglZjsoQroC |
14:15:24 | gst | is there a way to unordered enum? |
14:34:43 | FromDiscord | <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:54 | FromDiscord | <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:31 | FromDiscord | <odexine> enums are always ordinal |
14:39:49 | FromDiscord | <odexine> not sure what you mean by unordered, i dont understand the benefits to having one be unordered |
14:40:04 | gst | hole enums are supported yes and I am using them, my problem is that currently nim requires that the values are ordered incrementally |
14:40:22 | gst | unordered I mean for example, x = 1, then y = 0 |
14:41:37 | gst | my usecase is protocol implementation, it is much nicer to keep the names in the order of the documentation regardless of the values |
14:42:28 | FromDiscord | <odexine> i dont think so |
14:42:40 | FromDiscord | <odexine> i think nim should allow it for when all values are specified but it doesnt so |
14:43:40 | gst | https://play.nim-lang.org/#pasty=NsXVDYjOvkjz |
14:45:38 | gst | odexine, 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:08 | FromDiscord | <odexine> should check if there is an issue filed, see any discussion |
14:46:09 | gst | I was wondering if there is a pragma or some trick around this. |
14:47:03 | gst | this is the closest I found, https://github.com/nim-lang/Nim/issues/1043, it was not fixed. |
14:50:37 | FromDiscord | <odexine> same, when i searched |
14:50:45 | FromDiscord | <odexine> seems like no one has raised another issue |
15:05:19 | * | def- quit (Quit: -) |
15:05:41 | * | def- joined #nim |
15:19:25 | FromDiscord | <z3ntl3> abc |
15:19:57 | FromDiscord | <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:29 | FromDiscord | <nocturn9x> are `Atomic`s references? |
18:33:50 | FromDiscord | <nocturn9x> still trying to debug the issue with ARC and threads |
18:33:52 | FromDiscord | <nocturn9x> to no avail |
18:34:27 | * | def- joined #nim |
18:37:58 | FromDiscord | <nocturn9x> the question I have is why is it segfaulting in danger/release mode and not in debug mode? |
18:39:06 | FromDiscord | <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:57 | FromDiscord | <marioboi3112> wait is the entire nim site made in nim? (nim playground, the official website, the forum, and package index) |
18:49:15 | FromDiscord | <leorize> the official site is Jekyll iirc |
18:49:22 | FromDiscord | <leorize> but the rest are nim-bases |
18:49:28 | FromDiscord | <leorize> nim-based\ |
18:50:34 | FromDiscord | <marioboi3112> so their html code was written in nim... |
18:50:39 | FromDiscord | <marioboi3112> interestin |
18:50:42 | FromDiscord | <marioboi3112> (edit) "nim..." => "nim...g" |
18:50:46 | FromDiscord | <marioboi3112> (edit) "nim...g" => "nim..." |
18:57:27 | FromDiscord | <nervecenter> @marioboi3112 There are multiple HTML templating libraries for Nim. I use Nimja, it's quite fleshed-out and performant. |
18:58:26 | FromDiscord | <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:19 | FromDiscord | <marioboi3112> In reply to @nervecenter "<@947089775280660571> There are multiple": what uses do you get from the CLI spitting out html code? |
19:13:49 | FromDiscord | <nervecenter> Like I said, they're reports. They can be printed to PDF and sent to our clients |
19:14:18 | FromDiscord | <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:00 | FromDiscord | <marioboi3112> i see |
19:34:00 | * | def- quit (Quit: -) |
19:34:02 | * | Batzy joined #nim |
19:34:26 | * | def- joined #nim |
19:36:03 | FromDiscord | <Phil> Hmmm the entire "reactivex but in nim" thing starts becoming problematic when you include async |
19:36:16 | FromDiscord | <Phil> Or rather, when you realize you somehow must include async |
19:37:05 | FromDiscord | <.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:17 | FromDiscord | <Phil> Not quite, I mean specifically stuff like "emit a value every 3 seconds" or the like |
19:38:41 | FromDiscord | <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:03 | FromDiscord | <Phil> And users need to be aware that they must be in an async-loop |
19:39:08 | FromDiscord | <Phil> (edit) "And users need to be aware that they must be in an async-loop ... " added "for this to work properly" |
19:39:16 | FromDiscord | <.lisuwu_> ahh, i see |
19:39:49 | FromDiscord | <.lisuwu_> bad idea but: couldn't you have separate thread doing all the waiting ? |
19:40:08 | FromDiscord | <Phil> I'm already fucked enough as is, I'm not introducing multithreading |
19:40:20 | FromDiscord | <Phil> Nothing ever got simpler or easier to understand by introducing multithreading |
19:40:29 | FromDiscord | <.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:48 | FromDiscord | <.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:22 | FromDiscord | <nocturn9x> In reply to @isofruit "I don't *think* they": got it |
19:54:30 | FromDiscord | <nocturn9x> then I really don't know what's going on |
19:54:37 | FromDiscord | <nocturn9x> the GC is just segfaulting on me for no reason |
19:54:49 | FromDiscord | <nocturn9x> and I'm using `atomicArc` so that shouldn't even happen |
19:55:12 | FromDiscord | <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:36 | FromDiscord | <Phil> Concurrency is just hard. Really hard. I can't much help there because I myself am barely knowledgeable on the subjectmatter |
19:57:15 | FromDiscord | <nocturn9x> I agree |
19:57:25 | FromDiscord | <nocturn9x> from all my time working on my asynchronous event loops in Python I can tell |
19:57:33 | FromDiscord | <nocturn9x> and the nice thing about those is that it was never parallel |
19:58:02 | FromDiscord | <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:37 | FromDiscord | <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:41 | FromDiscord | <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:48 | FromDiscord | <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:31 | FromDiscord | <nocturn9x> I'm trying to get rid of the references in the session object |
19:59:38 | FromDiscord | <nocturn9x> I'll keep a `ptr SearchManager` around |
20:25:55 | * | lucasta quit (Quit: Leaving) |
20:31:14 | FromDiscord | <nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=FnFcjzEgniqY |
20:31:24 | FromDiscord | <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:47 | FromDiscord | <Elegantbeef> Well are any of the types\ |
20:56:47 | FromDiscord | <Elegantbeef> @nocturn9x is any of the code cyclic? |
20:57:00 | FromDiscord | <nocturn9x> I have fixed that issue |
20:57:06 | FromDiscord | <nocturn9x> but afaik no, it should not be cyclic |
20:57:12 | FromDiscord | <nocturn9x> none of the structures point to one another |
20:57:32 | FromDiscord | <nocturn9x> positions are in a `seq` |
20:59:14 | FromDiscord | <Elegantbeef> Is the code a small digestable file? |
21:00:06 | FromDiscord | <nocturn9x> unfortunately not |
21:13:28 | FromDiscord | <polylokh_39446> sent a code paste, see https://play.nim-lang.org/#pasty=EDxIfyisMOjF |
21:13:53 | FromDiscord | <nocturn9x> yeah that works that's not the problem |
21:13:57 | FromDiscord | <nocturn9x> I am now facing another issue |
21:13:57 | FromDiscord | <polylokh_39446> -d:bug to get the error above. the indices stuff is just for the capture. |
21:14:17 | FromDiscord | <nocturn9x> I have a `SharedPtr[UCISession]` variable |
21:14:39 | FromDiscord | <nocturn9x> which has a field `currentSearch: ptr SearchManager` |
21:15:05 | FromDiscord | <nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=FvyXRpvDnJpe |
21:15:09 | FromDiscord | <nocturn9x> and then in the main thread |
21:15:25 | FromDiscord | <nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=ZcjMrbmaBujQ |
21:15:34 | FromDiscord | <nocturn9x> however, the two echo statements print different addresses |
21:15:36 | FromDiscord | <nocturn9x> how come? |
21:15:48 | FromDiscord | <nocturn9x> isn't that the point of `SharedPtr`? |
21:16:07 | FromDiscord | <nocturn9x> should `currentSearch` also be a `SharedPtr`? |
21:17:14 | FromDiscord | <polylokh_39446> you're getting the addr of `search`, which is a SharedManager (not a ptr - you're dereferencing it) |
21:17:22 | FromDiscord | <nocturn9x> oh |
21:17:58 | FromDiscord | <nocturn9x> let me correct that |
21:18:50 | FromDiscord | <nocturn9x> they still print different addresses |
21:19:20 | FromDiscord | <nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=hYMJsYQsIUhw |
21:19:43 | FromDiscord | <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:55 | FromDiscord | <nocturn9x> I've tried making the search manager a shared ptr but that doesn't change anything |
21:20:11 | FromDiscord | <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:43 | FromDiscord | <nocturn9x> huh |
21:20:50 | FromDiscord | <nocturn9x> you said one thing and the opposite of a thing |
21:21:03 | FromDiscord | <nocturn9x> In reply to @nocturn9x "from within a worker": here I'm taking the address of `searcher` |
21:21:12 | FromDiscord | <nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=UDIBUPdXOrWc |
21:21:13 | FromDiscord | <nocturn9x> and it's not |
21:21:37 | FromDiscord | <nocturn9x> `search` here is not a reference at all, it's a value type |
21:23:24 | FromDiscord | <polylokh_39446> sent a code paste, see https://play.nim-lang.org/#pasty=EmGTKkVjOCxt |
21:24:05 | FromDiscord | <nocturn9x> so how do I get the actual memory address |
21:24:21 | FromDiscord | <polylokh_39446> if you have a pointer, you already have it. Don't use addr |
21:24:27 | FromDiscord | <nocturn9x> I don't have a pointer |
21:24:30 | FromDiscord | <polylokh_39446> the final echo there is printing the pointer |
21:24:31 | FromDiscord | <nocturn9x> that's kinda the point |
21:24:42 | FromDiscord | <nocturn9x> yes but I get it via `addr` in the other thread... |
21:25:21 | FromDiscord | <polylokh_39446> easiest way is probably to work with a ref to begin with, and pass that around |
21:25:37 | FromDiscord | <polylokh_39446> this came up the other day on the forums: <https://forum.nim-lang.org/t/11508> |
21:25:43 | FromDiscord | <nocturn9x> that is literally what I have done |
21:25:47 | FromDiscord | <nocturn9x> and it randomly segfault |
21:25:53 | FromDiscord | <nocturn9x> it's the whole reason I'm avoiding refs like the plague |
21:26:19 | FromDiscord | <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:22 | FromDiscord | <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:11 | FromDiscord | <nocturn9x> sharing refs is the whole pain in the ass that brought me here |
21:27:20 | FromDiscord | <nocturn9x> (edit) "segfault" => "segfaults" |
21:27:31 | FromDiscord | <nocturn9x> (edit) "for" => "with" |
21:28:06 | FromDiscord | <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:16 | FromDiscord | <nocturn9x> that is not a problem |
21:28:21 | FromDiscord | <nocturn9x> the problem is how do I get the right address |
21:28:36 | FromDiscord | <nocturn9x> I know for a fact the pointer will be valid due to how the program's flow is structured |
21:29:53 | FromDiscord | <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:59 | FromDiscord | <nocturn9x> Let me explain what I need to do |
21:31:09 | FromDiscord | <nocturn9x> I receive a `go` command from a chess GUI or other UCI compatible client |
21:31:16 | FromDiscord | <nocturn9x> I have to start a search for the best move in that position |
21:31:21 | FromDiscord | <nocturn9x> but I also cannot stop processing UCI commands |
21:31:27 | FromDiscord | <nocturn9x> hence the search needs to go to a separate thread |
21:31:42 | FromDiscord | <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:50 | FromDiscord | <nocturn9x> then when I receive `stop`, I set an atomic boolean flag |
21:31:55 | FromDiscord | <nocturn9x> and the search stops |
21:32:42 | FromDiscord | <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:43 | FromDiscord | <polylokh_39446> sent a code paste, see https://play.nim-lang.org/#pasty=QrUjmnvBVDPQ |
21:38:38 | FromDiscord | <nocturn9x> I have fixed it by creating the searcher instance in the main thread |
21:38:46 | FromDiscord | <nocturn9x> now the worker thread merely accesses it |
21:39:55 | FromDiscord | <nocturn9x> still getting segfaults regardless |
21:39:59 | * | progranner quit (Ping timeout: 252 seconds) |
21:40:05 | FromDiscord | <nocturn9x> I am seriously starting to consider just dropping nim as a language outright |
21:40:11 | FromDiscord | <nocturn9x> it causes more pain in the ass than it's worth |
21:40:47 | FromDiscord | <michaelb.eth> depending on what you’re accessing (including reads) across threads, it can cause races in the reference counter and segfault |
21:40:57 | FromDiscord | <nocturn9x> yeah, I noticed. |
21:41:04 | FromDiscord | <nocturn9x> that's despite `--mm:atomicArc` |
21:41:06 | FromDiscord | <nocturn9x> atomic my ass |
21:41:32 | FromDiscord | <michaelb.eth> generally with Nim you want to use message passing across channels for multithreaded programs |
21:41:58 | FromDiscord | <nocturn9x> I _just_ need to share a reference |
21:41:59 | FromDiscord | <nocturn9x> it's not that hard |
21:42:05 | FromDiscord | <nocturn9x> plenty of languages do it race-free |
21:42:10 | FromDiscord | <nocturn9x> Nim can't because it's opinionated |
21:42:14 | FromDiscord | <nocturn9x> it's literally the only reason. |
21:42:35 | FromDiscord | <nocturn9x> message passing requires copies or moves, isn't that right |
21:42:44 | FromDiscord | <Elegantbeef> No it cannot due it cause ORC and ARC are not threadsafe 😄 |
21:42:53 | FromDiscord | <nocturn9x> then wtf is `atomicArc` for |
21:42:57 | FromDiscord | <nocturn9x> is that just a lie? |
21:42:58 | FromDiscord | <Elegantbeef> ORC being threadsafe is a complex thing |
21:43:06 | FromDiscord | <nocturn9x> I'm not even using orc |
21:43:09 | FromDiscord | <Elegantbeef> atomic arc has the destructors being atomically called |
21:43:20 | FromDiscord | <nocturn9x> the crashing occurs even with boehm which has a shared heap |
21:43:24 | FromDiscord | <nocturn9x> nim is the problem here |
21:43:29 | FromDiscord | <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:47 | FromDiscord | <nocturn9x> well nim's design is stupid then |
21:43:56 | FromDiscord | <nocturn9x> if it can't work with real world programs with real world needs then it's useless |
21:44:10 | FromDiscord | <nocturn9x> and sharing _one damn reference_ isn't too much to ask |
21:44:15 | FromDiscord | <Elegantbeef> It's not so much against Nim's design as much as Orc is not threadsafe so isolation exists |
21:44:23 | FromDiscord | <nocturn9x> _I'm not usinc ORC_ |
21:44:30 | FromDiscord | <Elegantbeef> I know |
21:44:32 | FromDiscord | <Elegantbeef> I'm not talking to you |
21:44:39 | FromDiscord | <nocturn9x> it's not even just ORC or ARC |
21:44:44 | FromDiscord | <nocturn9x> refc and boehm fail just as bad |
21:44:45 | FromDiscord | <Elegantbeef> atomicarc supposed to work |
21:44:51 | FromDiscord | <nocturn9x> yeah, keyword supposed |
21:45:17 | FromDiscord | <Elegantbeef> Is this project public? |
21:45:20 | FromDiscord | <nocturn9x> it is |
21:45:55 | FromDiscord | <nocturn9x> https://git.nocturn9x.space/nocturn9x/CPG/ |
21:45:59 | FromDiscord | <nocturn9x> `Chess` directory |
21:46:05 | FromDiscord | <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:05 | FromDiscord | <nocturn9x> `nimble install` should do |
21:46:19 | FromDiscord | <nocturn9x> the offending code is in `nimfish/nimfishpkg/uci.nim` |
21:46:25 | FromDiscord | <Elegantbeef> `git clone` is easier 😄 |
21:46:32 | FromDiscord | <nocturn9x> that too |
21:46:48 | FromDiscord | <nocturn9x> In reply to @nocturn9x "the offending code is": specifically it's `bestMove` and `commandLoop` |
21:46:53 | FromDiscord | <michaelb.eth> what version of Nim? |
21:46:56 | FromDiscord | <nocturn9x> 2.0.4 |
21:47:09 | FromDiscord | <nocturn9x> the nimble file has all the info necessary to build it |
21:47:28 | FromDiscord | <nocturn9x> Appreciate the help, by the way |
21:47:48 | FromDiscord | <Elegantbeef> How to run? |
21:47:48 | FromDiscord | <nocturn9x> Just a little frustrated because I'm wasting time fighting with the tool rather than using it to solve my problem |
21:48:14 | FromDiscord | <nocturn9x> To run the offending benchmark you need `cutechess-cli` |
21:48:23 | FromDiscord | <nocturn9x> which runs many instances of the program in parallel |
21:48:28 | FromDiscord | <nocturn9x> I'll send you the appropriate command |
21:48:36 | FromDiscord | <nocturn9x> have you git cloned the repo? |
21:48:43 | FromDiscord | <Elegantbeef> of course |
21:49:12 | FromDiscord | <nocturn9x> first thing you need to do is `unzip Pohl.epd.zip` inside `nimfish/nimfishpkg/resources` |
21:49:28 | FromDiscord | <nocturn9x> then install cutechess-cli |
21:49:56 | FromDiscord | <Elegantbeef> This is where I'll joke about dependency hell |
21:50:08 | FromDiscord | <nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=zuAUzWeblFPr |
21:50:16 | FromDiscord | <nocturn9x> of course you have to run `nimble build` first |
21:51:02 | FromDiscord | <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:20 | FromDiscord | <nocturn9x> yesterday I managed to track down the segfault to basically a `realloc` call on nil |
21:51:25 | FromDiscord | <nocturn9x> deep down in the internals of ARC |
21:51:41 | FromDiscord | <nocturn9x> In reply to @nocturn9x "changing the load to": here |
21:52:37 | FromDiscord | <Elegantbeef> Is it? |
21:52:50 | FromDiscord | <nocturn9x> that's what it seems at least |
21:53:13 | FromDiscord | <Elegantbeef> As you said that I seen `r.move` and was scared that it was calling `move(r)` 😄 |
21:53:25 | FromDiscord | <Elegantbeef> But nah expandArc says it's a field access |
21:53:40 | FromDiscord | <nocturn9x> In reply to @Elegantbeef "As you said that": oh haha yeah no |
21:53:44 | FromDiscord | <nocturn9x> it's not using move semantics |
21:53:48 | FromDiscord | <nocturn9x> at least I'm not doing so explicitly |
21:54:11 | FromDiscord | <Elegantbeef> Well naming a field `move` has got to be asking for a fuckup 😄 |
21:54:21 | FromDiscord | <nocturn9x> _whoops_ |
21:55:46 | FromDiscord | <nocturn9x> you might notice a bunch of `Atomic`s sprinkled somewhere |
21:55:53 | FromDiscord | <nocturn9x> those were my desperate attempts at fixing this |
21:56:12 | FromDiscord | <nocturn9x> except `stopFlag` in `search.nim`, that was purposely put there since the beginning |
21:58:06 | FromDiscord | <Elegantbeef> Is it expected to not compile with `-d:debug`? |
21:58:54 | FromDiscord | <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:11 | FromDiscord | <Elegantbeef> By global they need to be never moved |
22:00:18 | FromDiscord | <nocturn9x> In reply to @Elegantbeef "Is it expected to": it should compile |
22:00:32 | FromDiscord | <Elegantbeef> well with debug it complains about lacking `toFEN` |
22:00:41 | FromDiscord | <nocturn9x> oh yeah I forgot to fix that |
22:01:02 | FromDiscord | <nocturn9x> there is a forward declaration for `toFen` missing in `position.nim` |
22:01:12 | FromDiscord | <nocturn9x> just move it up and it should compile |
22:01:19 | FromDiscord | <Elegantbeef> But it only fails for debug.... |
22:01:21 | FromDiscord | <michaelb.eth> In reply to @Elegantbeef "By global they need": e.g. https://forum.nim-lang.org/t/10772#71871 |
22:01:32 | FromDiscord | <nocturn9x> because the check is inside a `when not defined(danger) ` |
22:01:34 | FromDiscord | <Elegantbeef> Yea I know what he said |
22:01:41 | FromDiscord | <Elegantbeef> But notice he said `local variables` |
22:01:49 | FromDiscord | <Elegantbeef> If they're heap allocated on a seq or `ref` it's fine |
22:02:20 | FromDiscord | <Elegantbeef> > Not, it just cannot be copied, you have to go through the OS to create/destroy it. |
22:02:48 | FromDiscord | <nocturn9x> _Don't use threads directly, use Weave or Malebolgia._↵↵yeah, thanks Araq. I would if either of them worked properly |
22:03:03 | FromDiscord | <nocturn9x> Weave is a mess and Malebolgia straight up does not freaking compile |
22:03:09 | FromDiscord | <nocturn9x> I don't need structured concurrency |
22:03:51 | FromDiscord | <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:13 | FromDiscord | <nocturn9x> This is hands down the single dumbest point of Nim's design |
22:04:13 | FromDiscord | <Elegantbeef> Oh michael they do have a stack thread |
22:04:37 | FromDiscord | <nocturn9x> In reply to @nocturn9x "This is hands down": up there with templates |
22:04:53 | FromDiscord | <morgan> what's the issue with templates? |
22:05:35 | FromDiscord | <nocturn9x> don't even get me started on those, I have a whole rant |
22:05:36 | FromDiscord | <threefour> Parallelism is definitely Nim's biggest pain point for me. |
22:05:41 | FromDiscord | <Elegantbeef> Yea you don't shit on templates |
22:05:54 | FromDiscord | <nocturn9x> but templates I can work around |
22:06:06 | FromDiscord | <nocturn9x> stupid decisions about how parallelism should work, I can not |
22:06:37 | FromDiscord | <nocturn9x> especially when the proposed standard solutions do not, in fact, work in the slightest beyond toy examples |
22:06:58 | FromDiscord | <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:09 | FromDiscord | <nocturn9x> Before this I thought making my own language to fix my issues with nim was a low priority |
22:07:16 | FromDiscord | <nocturn9x> Now it's suddenly at the top of my bucket list |
22:07:39 | FromDiscord | <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:48 | FromDiscord | <Elegantbeef> Yea why is there a `createThread`just floating inside a single scope? |
22:08:07 | FromDiscord | <Elegantbeef> Just hoping the program stays alive long enough that's not an issue |
22:08:22 | FromDiscord | <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:29 | FromDiscord | <Elegantbeef> That is how you do it |
22:08:43 | FromDiscord | <Elegantbeef> But you do not `joinThread` or anything like that so it's not safe |
22:08:43 | FromDiscord | <nocturn9x> The program staying alive is not a problem |
22:09:08 | FromDiscord | <nocturn9x> In reply to @Elegantbeef "But you do not": That doesn't really matter, if the thread dies it died, too bad |
22:09:18 | FromDiscord | <nocturn9x> the UCI spec is surprisingly lax when it comes to handling errors |
22:09:30 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=LdWyAKwSPgcR |
22:09:37 | FromDiscord | <Elegantbeef> This keeps the thread alive and does not have it on the stack |
22:09:48 | FromDiscord | <Elegantbeef> I'm assuming you're writing over the thread and causing issues down the road |
22:09:52 | FromDiscord | <Elegantbeef> Whether this fixes the segfault is another thing |
22:10:02 | FromDiscord | <nocturn9x> testing this will be quite easy |
22:10:02 | FromDiscord | <nocturn9x> let me see |
22:10:05 | FromDiscord | <Elegantbeef> Yes it leaks resources |
22:10:12 | FromDiscord | <Elegantbeef> But you need to keep the thread alive and in a single spot |
22:10:28 | FromDiscord | <Elegantbeef> So using a `seq[ref Thread]` or similar would be ideal |
22:10:32 | FromDiscord | <nocturn9x> the thread exists for the duration of the `go` command and then exits |
22:10:43 | FromDiscord | <nocturn9x> and there is only ever one search running |
22:10:48 | FromDiscord | <nocturn9x> because that's how UCI chess engines work |
22:10:52 | FromDiscord | <Elegantbeef> Right but it exists on the stack so if the program continues running and it pops the stack |
22:11:17 | FromDiscord | <nocturn9x> why would it pop the stack if `commandLoop` never exits |
22:12:13 | FromDiscord | <nocturn9x> `commandLoop` is the program's main loop |
22:12:18 | FromDiscord | <nocturn9x> it exits when everything is done and good |
22:12:23 | FromDiscord | <nocturn9x> not before, not after |
22:13:43 | FromDiscord | <Elegantbeef> Hey don't look at me I just followed what has been said |
22:14:40 | FromDiscord | <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:51 | FromDiscord | <nocturn9x> testing your change right now |
22:15:40 | FromDiscord | <northnaut> 1000001489.gif https://media.discordapp.net/attachments/371759389889003532/1235353976418074694/1000001489.gif?ex=6634108b&is=6632bf0b&hm=41d6927761aa3aec04d1e9fcd58c75b17a82adba8971d6c63e2330bc9a423e93& |
22:16:21 | FromDiscord | <threefour> https://tenor.com/view/cat-huh-cat-huh-etr-gif-15332443943609734737 |
22:17:08 | FromDiscord | <Elegantbeef> @nocturn9x it does probably do `=wasMoved` and `=destroy` inside that scope, which means it likely 0's the thread data |
22:17:19 | FromDiscord | <ElegantBeef> <@&371760044473319454> |
22:17:28 | FromDiscord | <nocturn9x> In reply to @Elegantbeef "<@523555920265871380> it does probably": huh |
22:17:39 | FromDiscord | <nocturn9x> I suppose that would fuck things up yeah |
22:18:13 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=PxqSyhJPENZR |
22:18:16 | FromDiscord | <Elegantbeef> Is what yours did |
22:19:27 | FromDiscord | <northnaut> 1000001489.gif https://media.discordapp.net/attachments/371759389889003532/1235354928864825435/1000001489.gif?ex=6634116e&is=6632bfee&hm=a8669c3b98efc545e2d920c1ac470733b220f8bbae3247ad6a4fcf452d78abb9& |
22:19:37 | FromDiscord | <nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=euOmkyAmozYd |
22:19:47 | FromDiscord | <nocturn9x> that would do it... |
22:20:29 | FromDiscord | <northnaut> 1000001498.jpg https://media.discordapp.net/attachments/371759389889003532/1235355187447730226/1000001498.jpg?ex=663411ac&is=6632c02c&hm=e2508cafe7665faf66598aa4f2185a6231bc95c216023a19fa1648feada17132& |
22:21:07 | FromDiscord | <morgan> In reply to @northnaut "1000001489.gif": couldn’t even get the dog whistle number right smhing my head |
22:22:05 | FromDiscord | <nocturn9x> In reply to @northnaut "1000001498.jpg": can you like, not |
22:23:27 | FromDiscord | <morgan> idk if the <@&371760044473319454> s here are also mods on whatever chat app that’s synced from to discipline them there |
22:23:49 | FromDiscord | <morgan> but at least deleting the messages on discord’s end would be appreciated |
22:24:14 | FromDiscord | <polylokh_39446> they can handle it. Discussing it is just contributing to the disruption. |
22:25:31 | FromDiscord | <polylokh_39446> that the bridge prevents blocks does make it more annoying than normal spam, though. |
22:26:17 | FromDiscord | <morgan> In reply to @Elegantbeef "Morgan will want a": yea it would be nice to have an audio dev channel |
22:27:05 | FromDiscord | <morgan> In reply to @morganalyssa "could we get an": bumping this, in case any mods happen to look at general |
22:32:01 | FromDiscord | <northnaut> 1000001489.gif https://media.discordapp.net/attachments/371759389889003532/1235358090833170462/1000001489.gif?ex=66341460&is=6632c2e0&hm=f698ce9e9c2aa64fd6235fdccbd94723e1ae2a631aacd5916da2e44af21353ef& |
22:32:20 | FromDiscord | <northnaut> Morgan pedophile |
22:32:20 | FromDiscord | <northnaut> Pedophile morgan |
22:46:16 | FromDiscord | <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:36 | FromDiscord | <Elegantbeef> There are moderation tools for matrix |
22:47:19 | FromDiscord | <morgan> i was thinking on the discord, since discord has an automod feature |
22:48:13 | FromDiscord | <Elegantbeef> The biggest issue with discord is that no one can do what matrix does with the pseudo users |
22:48:25 | FromDiscord | <morgan> pseudo user? |
22:48:26 | FromDiscord | <Elegantbeef> Every discord user shows up as a unique person on matrix |
22:48:38 | FromDiscord | <morgan> ah |
22:48:39 | FromDiscord | <morgan> neat |
22:48:50 | FromDiscord | <anuke> Automod doesn't trigger for bots/webhook events unfortunately |
22:49:01 | FromDiscord | <morgan> yeah that was my guess |
22:49:11 | FromDiscord | <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:40 | FromDiscord | <northnaut> Morgan fsggot |
22:49:47 | FromDiscord | <morgan> lol |
22:49:56 | FromDiscord | <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:15 | FromDiscord | <northnaut> I hope you get raped and have a painful abortion you whore |
22:50:22 | FromDiscord | <northnaut> 1000001498.jpg https://media.discordapp.net/attachments/371759389889003532/1235362706194960444/1000001498.jpg?ex=663418ad&is=6632c72d&hm=5f387b365c1cc6b63a7821fe498fc02f06dc174924c4b76f7244883743edd98b& |
22:51:44 | FromDiscord | <Elegantbeef> I don't think the matrix side has any anti spam bots setup |
22:52:51 | FromDiscord | <Elegantbeef> https://github.com/the-draupnir-project/Draupnir https://github.com/matrix-org/mjolnir both exist |
22:53:50 | FromDiscord | <morgan> nice, should be pretty easy to get something set up then |
22:55:01 | FromDiscord | <northnaut> Yeah set it up nigger |
22:55:15 | FromDiscord | <Elegantbeef> I'll never get the shear lack of anything productive to do |
22:56:40 | FromDiscord | <polylokh_39446> does it demonstrate more or less faith in humanity to think he's being paid? |
22:56:54 | FromDiscord | <Elegantbeef> Less |
22:57:07 | FromDiscord | <polylokh_39446> huh. |
22:57:48 | FromDiscord | <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:32 | FromDiscord | <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:28 | FromDiscord | <Elegantbeef> Whether it makes sense is another thing |
23:02:56 | FromDiscord | <northnaut> sent a long message, see https://pasty.ee/VgZJSRBEArrW |
23:02:57 | FromDiscord | <northnaut> sent a long message, see https://pasty.ee/VkGYZCFVklXh |
23:02:58 | FromDiscord | <northnaut> sent a long message, see https://pasty.ee/ZWfAAUSVIqqx |
23:02:59 | FromDiscord | <northnaut> sent a long message, see https://pasty.ee/bAobdWkPHwuM |
23:02:59 | FromDiscord | <northnaut> sent a long message, see https://pasty.ee/snCylxoZFKUh |
23:03:01 | FromDiscord | <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:08 | FromDiscord | <Elegantbeef> Oh no we talked about them |
23:03:08 | FromDiscord | <northnaut> sent a long message, see https://pasty.ee/xCDVhVXlCWPJ |
23:03:09 | FromDiscord | <northnaut> sent a long message, see https://paste.rs/fIKeo |
23:03:15 | FromDiscord | <Elegantbeef> They now need to prove they're an adult |
23:03:15 | FromDiscord | <northnaut> sent a long message, see https://paste.rs/GLIBd |
23:03:21 | FromDiscord | <northnaut> sent a long message, see https://paste.rs/36QLS |
23:03:27 | FromDiscord | <northnaut> sent a long message, see https://paste.rs/LWFq0 |
23:03:33 | FromDiscord | <northnaut> sent a long message, see https://paste.rs/f2Q51 |
23:03:39 | FromDiscord | <northnaut> sent a long message, see https://paste.rs/1AbAw |
23:03:45 | FromDiscord | <northnaut> sent a long message, see https://paste.rs/WKGoG |
23:03:51 | FromDiscord | <northnaut> sent a long message, see https://paste.rs/ov3Jp |
23:03:57 | FromDiscord | <northnaut> sent a long message, see https://paste.rs/Llcle |
23:08:57 | * | def- joined #nim |
23:09:00 | FromDiscord | <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:26 | FromDiscord | <morgan> to use a word they may be familiar with to insult others with, retarded |
23:15:45 | FromDiscord | <northnaut> sent a long message, see https://pasty.ee/BPoDLcYLeAIO |
23:15:45 | FromDiscord | <northnaut> sent a long message, see https://pasty.ee/omhaAxcbIxVS |
23:15:46 | FromDiscord | <northnaut> sent a long message, see https://pasty.ee/yqPsSBTlfnvJ |
23:15:49 | strogon14 | morgan: 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:00 | FromDiscord | <northnaut> sent a long message, see https://pasty.ee/PPDemjxiuKUu |
23:16:03 | FromDiscord | <northnaut> sent a long message, see https://pasty.ee/dUUCAQWStusk |
23:16:03 | FromDiscord | <northnaut> sent a long message, see https://pasty.ee/roRwYAKULzGC |
23:16:40 | FromDiscord | <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:00 | FromDiscord | <northnaut> sent a long message, see https://pasty.ee/TEVAEtewEKJT |
23:17:00 | FromDiscord | <northnaut> sent a long message, see https://pasty.ee/qRZNVyOQPbkR |
23:17:00 | FromDiscord | <northnaut> sent a long message, see https://pasty.ee/GSweKkvmfTll |
23:17:05 | strogon14 | do you have a published repo for your clap stuff yet? |
23:17:10 | FromDiscord | <morgan> <@&371760044473319454> there’s a matrix user being incredibly disruptive |
23:17:14 | FromDiscord | <morgan> yea one sec |
23:17:16 | FromDiscord | <northnaut> sent a long message, see https://pasty.ee/QJWLDnRDMmyr |
23:17:16 | FromDiscord | <northnaut> sent a long message, see https://pasty.ee/fadkFKzsnRQh |
23:17:17 | FromDiscord | <northnaut> sent a long message, see https://pasty.ee/fWxEyplBHxTz |
23:17:28 | FromDiscord | <Elegantbeef> @morgan and it's not me for once 😛 |
23:17:41 | FromDiscord | <morgan> lol |
23:19:35 | FromDiscord | <northnaut> morgan likes touching kids |
23:19:48 | FromDiscord | <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:26 | strogon14 | morgan: sounds awesome |
23:21:23 | strogon14 | I 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:42 | FromDiscord | <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:55 | strogon14 | For 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:12 | FromDiscord | <Elegantbeef> https://github.com/johnnovak/koi is interesting if you want an IMGUI |
23:24:22 | strogon14 | I'm not a fan of immediate UI libs, mainly because I think they all have terrible layouting. |
23:25:05 | FromDiscord | <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:45 | FromDiscord | <morgan> my plan for the ui is just expose sokol callbacks and let the user provide shaders, meshes, uniforms, etc |
23:25:45 | FromDiscord | <Robyn [She/Her]> In reply to @northnaut "STUPID NIGGER STUPID NIGGER": <@&371760044473319454> |
23:26:01 | strogon14 | morgan: yeah, that's similar to my plan as well. |
23:26:08 | FromDiscord | <morgan> mostly because that’s what i need for my ui and i’m primarily making this for myself |
23:26:44 | strogon14 | plus a 'Plugin' type for defining the plugin name, ID, whether it needs MIDI, etc. |
23:27:24 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "They now need to": Lol |
23:29:28 | FromDiscord | <morgan> sent a long message, see https://pasty.ee/EocxwEBmEyvb |
23:45:14 | * | gst quit (Ping timeout: 250 seconds) |
23:53:15 | FromDiscord | <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:08 | FromDiscord | <morgan> because that would be recalculating coefficients for up to 85 filters |
23:55:05 | FromDiscord | <morgan> i might have to split up the calculations into N groups that are recalculated every N samples and interpolated |
23:58:19 | FromDiscord | <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:53 | FromDiscord | <morgan> anyways |