00:56:15 | FromDiscord | <girvo> I have a virus and my brain is not functioning today↵↵do slices allocate? Is there a way to take a slice from an openArray (or an actual array) that doesn't allocate? I swear @ElegantBeef already explained this twice to me |
00:56:27 | FromDiscord | <Elegantbeef> `openArray` is a slice |
00:56:32 | FromDiscord | <Elegantbeef> `[a..b]` is a allocating slice |
00:56:47 | FromDiscord | <girvo> 👍 |
00:57:00 | FromDiscord | <girvo> sent a code paste, see https://play.nim-lang.org/#ix=html> |
00:57:25 | FromDiscord | <girvo> Those nonce and ciphertext creations are allocating and I'd like them not to be haha |
00:57:55 | FromDiscord | <girvo> The nonce isn't that big a problem -- it's a fixed size anyway so theres no real heap fragmentation issue |
00:58:14 | FromDiscord | <girvo> I guess I'll just kick the problem out to the caller |
00:59:30 | FromDiscord | <Elegantbeef> Open arrays cannot be captured they must be consumed |
00:59:31 | FromDiscord | <Elegantbeef> Right I'd say do `template nonce: untyped = bulk.toOpenArray(0, nonce_size-1)` |
00:59:32 | FromDiscord | <Elegantbeef> Also maybe just me but using warnings is always a nice way of doing TODO 😄 |
01:03:38 | * | Mister_Magister quit (Quit: bye) |
01:03:38 | FromDiscord | <girvo> Okay right I'm with you now! |
01:05:33 | * | Mister_Magister joined #nim |
01:07:49 | FromDiscord | <girvo> sent a code paste, see https://play.nim-lang.org/#ix=html> |
01:10:26 | FromDiscord | <girvo> Whats the best way of checking some of these assumptions/profiling memory usage (assume desktop here, I'm testing the code on the server-side first before we move it to embedded) |
01:10:39 | FromDiscord | <girvo> Chuck Valgrind at it to profile memory usage? |
01:11:13 | FromDiscord | <girvo> (specifcally the massif tool or something similar?) |
01:13:13 | FromDiscord | <Elegantbeef> I check assumptions using `echo cast[int](...)` 😛 |
01:14:42 | FromDiscord | <girvo> 🥲 |
01:14:48 | FromDiscord | <girvo> but yeah fair enough haha |
01:15:07 | FromDiscord | <Elegantbeef> Nim does have a `getOccupiedMem` or w/e |
01:17:41 | FromDiscord | <odexine> massif works with the malloc define iirc |
01:18:01 | FromDiscord | <Elegantbeef> Most tooling should work with `-d:useMalloc` which girvo is most certainly using |
01:20:45 | FromDiscord | <girvo> `invalid type: openArray[char] for let` when I try to toOpenArray a string... I must be doing something wrong and misunderstanding this one |
01:21:02 | FromDiscord | <girvo> And yeah i'm -d:useMalloc |
01:21:16 | FromDiscord | <Elegantbeef> I told you you cannot capture them |
01:21:42 | FromDiscord | <girvo> Right |
01:21:44 | FromDiscord | <girvo> Oh right! |
01:21:47 | FromDiscord | <girvo> Thats why you're using a template |
01:23:09 | FromDiscord | <girvo> Ah okay |
01:23:13 | FromDiscord | <Elegantbeef> It's not cause I'm eclectic |
01:23:20 | FromDiscord | <girvo> look sometimes I wonder |
01:23:24 | FromDiscord | <girvo> but yeah I'm with you now haha |
01:23:33 | FromDiscord | <Elegantbeef> Are you sure? |
01:23:46 | FromDiscord | <girvo> Problem is, I'm not going to be able to (safely) take the address of these for the C call? |
01:23:56 | FromDiscord | <Elegantbeef> Yes you are |
01:24:00 | FromDiscord | <girvo> safely/ |
01:24:15 | FromDiscord | <girvo> Alright let me dig into this |
01:24:41 | FromDiscord | <Elegantbeef> You can technically use addr on `openArray` but it's weird |
01:26:01 | FromDiscord | <girvo> haha okay then |
01:26:05 | FromDiscord | <girvo> thats unintuitive tbh! |
01:26:26 | FromDiscord | <girvo> I would've assumed with the rest of the context that it woudn't be possible but yeah it's letting me |
01:28:00 | FromDiscord | <Elegantbeef> But if you're just sending to C why even use an OA |
01:30:15 | FromDiscord | <girvo> I'm using array now, from the calling code. But that internal `cptr` binding isn't actually exported from nim-libsodium |
01:30:45 | FromDiscord | <girvo> If theres a better solve I'm all ears |
01:31:43 | FromDiscord | <Elegantbeef> I have 0 clue what you're doing |
01:31:46 | FromDiscord | <Elegantbeef> So ya |
01:36:17 | FromDiscord | <girvo> yee fair |
01:48:22 | * | jmdaemon joined #nim |
02:04:49 | * | lucasta quit (Quit: Leaving) |
02:15:01 | * | jmdaemon quit (Ping timeout: 255 seconds) |
02:33:47 | * | jmdaemon joined #nim |
03:42:07 | * | azimut quit (Ping timeout: 240 seconds) |
04:04:11 | * | deadmarshal_ quit (Quit: IRCNow and Forever!) |
04:23:14 | * | deadmarshal_ joined #nim |
05:09:56 | * | rockcavera quit (Remote host closed the connection) |
05:11:11 | * | rockcavera joined #nim |
06:48:25 | * | mduardo joined #nim |
06:49:16 | * | mduardo quit (Client Quit) |
06:51:48 | * | advesperacit joined #nim |
08:00:32 | * | rockcavera quit (Remote host closed the connection) |
08:45:53 | FromDiscord | <4zv4l> how can I implement `$` for a type with a generic attribute ? |
08:46:48 | FromDiscord | <odexine> Just like any other procedure with a generic? Not sure what your issue is |
08:47:07 | FromDiscord | <odexine> Is there a problem with how you first tried to implement it? |
08:47:40 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=html> |
08:47:47 | NimEventer | New thread by nimian: Norm select from specific table_schema, see https://forum.nim-lang.org/t/10859 |
08:49:05 | FromDiscord | <odexine> sent a code paste, see https://play.nim-lang.org/#ix=html> |
08:49:20 | FromDiscord | <4zv4l> they are in the same file |
08:49:45 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=html> |
08:52:01 | FromDiscord | <odexine> Is it okay if you post the whole error instead of just part? |
08:52:20 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=html> |
08:52:34 | FromDiscord | <odexine> Ah there it is I thought so |
08:52:58 | FromDiscord | <odexine> In the type linked list the head should just be Node and not a reference Node since Node itself is already a reference |
08:53:15 | FromDiscord | <odexine> Probably the same with the next field in Node |
08:53:53 | FromDiscord | <4zv4l> I wanted to do with pointer but with ref Nim alloc the Node for me right ? |
08:54:08 | FromDiscord | <odexine> Yes |
08:54:17 | FromDiscord | <4zv4l> In reply to @odexine "In the type linked": indeed, that fixed it |
08:54:17 | FromDiscord | <4zv4l> thanks ! |
08:54:45 | FromDiscord | <4zv4l> so `ref` just be used only when describing the type, afterward its always a ref ? |
08:56:55 | FromDiscord | <odexine> Well you don’t have to do that, you can also switch the order (remove the ref in ref object and put ref Node everywhere) |
08:57:19 | FromDiscord | <odexine> In some cases one is easier, in others the other is easier |
08:58:11 | FromDiscord | <4zv4l> In reply to @odexine "Well you don’t have": then do i need to use `new` to say I want it to be allocated on the heap ? |
09:01:02 | FromDiscord | <odexine> In reply to @4zv4l "then do i need": You would or you could also use (ref Node)(data: … etc) |
09:02:30 | FromDiscord | <4zv4l> okay, I get it, thanks ! |
09:08:00 | FromDiscord | <ieltan> It's been a while but I noticed that since recently a lot of links from the Nim playground says "Unable to load ix paste, file too large, or download is too slow" |
09:08:07 | FromDiscord | <ieltan> while i could access them before |
09:08:19 | FromDiscord | <ieltan> Anyone knows what's up ? |
09:19:30 | Amun-Ra | there's something wrong with paste service, iirc |
09:19:45 | FromDiscord | <pmunch> Yes, ix.io is down |
09:20:29 | FromDiscord | <pmunch> I've been meaning to replace it with paste.rs, or some Nim solution, but I haven't gotten around to it |
09:21:59 | FromDiscord | <Robyn [She/Her]> What if you made it so you can supply a custom (pre-toptal) hastebin instance? :p |
09:22:55 | FromDiscord | <Robyn [She/Her]> So `haste=hatebin.com&id=vdijcgeqac`? |
09:24:04 | FromDiscord | <Robyn [She/Her]> Hm maybe that's something I could PR |
09:59:24 | FromDiscord | <alireza0x0> guys |
09:59:35 | FromDiscord | <alireza0x0> what happens when my parent object is marked with {.acyclic.} |
09:59:41 | FromDiscord | <alireza0x0> but my child object not? |
10:00:10 | FromDiscord | <alireza0x0> im getting very weird error ... https://media.discordapp.net/attachments/371759389889003532/1193856665171263518/image.png?ex=65ae3ca9&is=659bc7a9&hm=679158c88284f949bb7a8cc510e5e97d6cfef60c9a381c37141083ce8a956527& |
10:00:15 | FromDiscord | <alireza0x0> (edit) "very" => "avery" |
10:00:18 | FromDiscord | <alireza0x0> (edit) "avery" => "a very" |
10:02:53 | FromDiscord | <pmunch> In reply to @chronos.vitaqua "Hm maybe that's something": That would certainly be possible, the bigger question though is what the paste button should do |
10:18:53 | * | antranigv quit (Ping timeout: 240 seconds) |
10:21:54 | * | antranigv joined #nim |
10:38:18 | FromDiscord | <Robyn [She/Her]> In reply to @pmunch "That would certainly be": Probably use a specific haste service by default? https://hatebin.com is one that's public |
10:38:52 | FromDiscord | <Robyn [She/Her]> I know that Rust's playground uploads code as GitHub gists by default (and also have a link shortener) |
11:01:28 | FromDiscord | <nnsee> i'm in the process of writing a paste service specifically for the nim playground |
11:01:38 | FromDiscord | <nnsee> i just have adhd |
11:01:40 | FromDiscord | <nnsee> but it's coming along |
11:31:52 | FromDiscord | <Robyn [She/Her]> In reply to @nnsee "i'm in the process": Oh epic! |
12:02:18 | * | azimut joined #nim |
12:03:24 | * | wheatengineer joined #nim |
12:05:49 | * | azimut quit (Remote host closed the connection) |
12:06:11 | * | azimut joined #nim |
12:36:22 | * | jmdaemon quit (Ping timeout: 276 seconds) |
13:00:50 | FromDiscord | <Andreas Albert> sent a long message, see <!doctype html> |
13:01:18 | FromDiscord | <ieltan> In reply to @Andreas Albert "HOW HACKERSTEVE HELPED TO": absolutely unhinged lol |
13:11:43 | FromDiscord | <demotomohiro> <@&371760044473319454> |
13:18:41 | * | rockcavera joined #nim |
14:07:30 | FromDiscord | <whisperecean> So does anybody know how to statically compile postgres drivers with Nim? 🙂 |
14:07:56 | FromDiscord | <whisperecean> Also should I build my binary with musl if i want it to be portable? |
14:43:59 | FromDiscord | <demotomohiro> How compile from source is usually explained in readme or text file in repository. |
14:46:41 | FromDiscord | <demotomohiro> I think compiling code on the machine the executable runs on is easier than statically link libraries. |
14:50:24 | FromDiscord | <Phil (he/him)> First you need all your dependencies (the c libs you use outside of Nim, such as the postgres lib)as static libraries.↵Note that a static library is a different form of compiling that library, so whatever you have downloaded is pretty unlikely to be a static library↵(@whisperecean) |
14:50:42 | FromDiscord | <Phil (he/him)> Coming a library to be static can take a bit, I remember trying that for openssl and it taking an hour, openssl is massive though so you're likely not facing that for postgres |
15:12:10 | FromDiscord | <khazakar> Postgresql is also not a small thing |
15:12:45 | FromDiscord | <khazakar> I'm thinking there's such demand for static building. For one binary backend solution or what? |
15:13:01 | FromDiscord | <khazakar> (edit) "I'm thinking ... there's" added "why" |
15:16:08 | FromDiscord | <nnsee> i've seen people do it for super minimalistic and tiny docker images (`FROM scratch; COPY ./bin/whatever /whatever; ENTRYPOINT /whatever`) |
15:16:46 | FromDiscord | <Phil (he/him)> Convenience and one less thing you need to rely on them having stuff↵(@khazakar) |
15:17:03 | FromDiscord | <Phil (he/him)> User convenience mind you |
15:17:51 | FromDiscord | <nnsee> and i use it to build red team tooling, ie malware deployed to target machines |
15:18:39 | FromDiscord | <khazakar> In reply to @Phil (he/him) "Convenience and one less": Makes sense |
15:37:10 | FromDiscord | <whisperecean> In reply to @Phil (he/him) "First you need all": How do I get those? |
15:37:33 | FromDiscord | <whisperecean> Yeah easy of portability is a massive feature. |
15:37:43 | FromDiscord | <whisperecean> Especially for small / simple apps |
15:48:00 | FromDiscord | <khazakar> In reply to @whisperecean "How do I get": By compilation by yourself as static library |
15:50:46 | FromDiscord | <ambient3332> Anyone know why in Windows there's not debug info (stacktrace) on crash but on Linux there is? |
15:51:26 | FromDiscord | <ambient3332> Like, what eats my debug info when compiling the program on debug mode? |
15:52:08 | FromDiscord | <ambient3332> It's another case of Windows having a hidden popup and never printing anything to console? |
15:52:30 | FromDiscord | <ambient3332> (seems like illegal memory access causes the crash) |
15:53:03 | FromDiscord | <whisperecean> In reply to @khazakar "By compilation by yourself": Yes but I would like to learn how to do it. Do I need to download the sources and figure out the compilation flags? |
15:53:29 | FromDiscord | <Phil (he/him)> The answer tends to be to Google how to compile it↵(@whisperecean) |
15:53:33 | FromDiscord | <Phil (he/him)> Ayup↵(@whisperecean) |
15:54:04 | FromDiscord | <Phil (he/him)> That's the cost since there is no free lunch - it's more convenient for users but more complex for you |
15:55:38 | * | adigitoleo quit (Read error: Connection reset by peer) |
15:55:55 | * | adigitoleo joined #nim |
15:57:24 | FromDiscord | <whisperecean> I was more asking about the general proces. So I have to get the sources of libpq then figure out the compiler flags. So i get something out of that compilation process and then that something I need to bundle with my nim binary |
15:57:35 | FromDiscord | <whisperecean> Or is it just as simple as passing that somethign to the nim compiler? |
15:58:56 | FromDiscord | <Phil (he/him)> Not bundle, it gets compiled into your binary and becomes part of it↵(@whisperecean) |
15:59:01 | FromDiscord | <Phil (he/him)> Or the parts of it that you use do |
15:59:35 | FromDiscord | <Phil (he/him)> Bundling implies that they're separate files after compilation |
15:59:53 | FromDiscord | <_goel_> So the `template`s do not accept the `return` keyword? |
16:00:01 | FromDiscord | <Phil (he/him)> Which is the case for assets like images etc that you use but not static libraries |
16:00:29 | FromDiscord | <whisperecean> In reply to @Phil (he/him) "Bundling implies that they're": Yes that's what I meant / was confused about |
16:02:07 | FromDiscord | <Phil (he/him)> Kind of, after compiling to a static library you tell Nim where that line l lib is and that you intend to use it.↵That's a passc flag I think but I don't know it by heart↵(@whisperecean) |
16:03:02 | FromDiscord | <Phil (he/him)> Well, I guess if it's a passc flag that means you tell it to the compiler after Nim that converts the generated c code to binary |
16:03:03 | FromDiscord | <whisperecean> Ahh --passL and path to lib.a |
16:04:02 | FromDiscord | <Phil (he/him)> Passl and passc are different flags but both for things after the Nim compiler |
16:05:31 | FromDiscord | <Phil (he/him)> One is the c compiler such as GCC or clang, the other for the linker step rich happens after compilation |
16:05:56 | FromDiscord | <Phil (he/him)> Might actually be that you only need to passl the flags that tell where those libs are, I only played around with static compilation for a bit a few years back and don't recall that well |
16:06:10 | FromDiscord | <whisperecean> Yeah I think I just need the --passL https://forum.nim-lang.org/t/6905 |
16:07:57 | FromDiscord | <Phil (he/him)> Alrighty |
16:08:21 | FromDiscord | <whisperecean> I will try it as soon as I resolve my issue with table_schema |
16:08:28 | FromDiscord | <whisperecean> I opened a topic on the forum |
16:11:55 | * | azimut quit (Remote host closed the connection) |
16:12:40 | * | azimut joined #nim |
16:13:06 | * | azimut quit (Remote host closed the connection) |
16:13:28 | * | azimut joined #nim |
16:16:31 | * | azimut_ joined #nim |
16:18:31 | * | azimut quit (Ping timeout: 240 seconds) |
16:18:41 | FromDiscord | <khazakar> In reply to @whisperecean "Yes but I would": Yup |
16:25:52 | FromDiscord | <Phil (he/him)> I would assume return in a template means return where you call it.↵A template is a copy pasted piece of code, not a proc.↵It does not return, it already is where you call it↵(@_goel_) |
16:26:37 | FromDiscord | <Phil (he/him)> So if you call it in a proc, that proc returns there.↵In global scope that's a compilation error since you can't return in those |
16:27:10 | FromDiscord | <nnsee> In reply to @Phil (he/him) "I would assume return": doesn't that only work with the template's return type set to untyped? |
16:28:05 | FromDiscord | <Phil (he/him)> I'd need to experiment when I'm back at a pc, but that mental model typically works correctly with templates |
16:28:33 | FromDiscord | <nnsee> maybe i'm just misremembering |
16:28:56 | FromDiscord | <nnsee> there seems to be nothing about it in the manual so i probably am |
16:41:57 | FromDiscord | <Robyn [She/Her]> Is there a Nim space on Matrix so I have access to all the bridged channels? |
16:42:52 | FromDiscord | <Phil (he/him)> There is a Nim space somewhere |
16:44:26 | FromDiscord | <Robyn [She/Her]> Hm |
16:44:26 | FromDiscord | <leorize> [#nim\:envs.net](https://matrix.to/#/#nim:envs.net) |
16:44:31 | FromDiscord | <Robyn [She/Her]> Thanks! |
16:45:15 | FromDiscord | <leorize> pretty sure I have it published on matrix.org directory so you should be able to find it via that too |
16:45:57 | FromDiscord | <Robyn [She/Her]> Gucci! I was asking since I wanna join it on Beeper aha |
16:46:53 | FromDiscord | <leorize> now you can publish it to beeper's directory \:p |
16:47:34 | FromDiscord | <Robyn [She/Her]> Not on mobile sadlyh |
16:47:52 | FromDiscord | <Robyn [She/Her]> Unless I login with a different Matrix client |
16:54:51 | * | azimut_ quit (Remote host closed the connection) |
16:55:42 | FromDiscord | <gcao> sent a code paste, see https://play.nim-lang.org/#ix=html> |
16:59:11 | FromDiscord | <ieltan> Trying to port some `asyncdispatch` code to `chronos` but it doesn't have a shim for `AsyncSocket` (asyncnet). Any ideas how I can approach this? Unfortunately chronos isn't documented well on that front |
17:01:21 | * | azimut joined #nim |
17:02:47 | FromDiscord | <ieltan> Hm, actually I think making a shim myself would be pretty straight forward. I may come ask for help if I struggle with this |
17:02:55 | FromDiscord | <ieltan> (edit) "come" => "comeback" |
17:03:04 | FromDiscord | <ieltan> (edit) "Hm, actually I think making a shim myself would be pretty straight forward. I may comeback ... ask" added "and" |
17:07:43 | NimEventer | New thread by gcao: =destroy and enum, see https://forum.nim-lang.org/t/10860 |
17:13:21 | * | azimut quit (Remote host closed the connection) |
17:13:51 | * | azimut joined #nim |
17:24:08 | * | wheatengineer quit (Ping timeout: 256 seconds) |
18:17:58 | * | wheatengineer joined #nim |
18:18:01 | * | wheatengineer quit (Remote host closed the connection) |
18:30:25 | * | flouer_ joined #nim |
18:30:45 | * | flouer quit (Ping timeout: 260 seconds) |
18:43:20 | * | zgasma quit (Quit: Lost terminal) |
18:53:07 | * | flouer_ quit (Ping timeout: 255 seconds) |
18:56:46 | * | flouer joined #nim |
19:08:04 | FromDiscord | <Robyn [She/Her]> Hello there\~ |
19:08:05 | FromDiscord | <Phil (he/him)> General Kenobi! |
19:08:52 | FromDiscord | <leorize> welcome to the dark side |
19:09:22 | FromDiscord | <Robyn [She/Her]> I'm trying to configure Beeper to put Nim's matrix space into it's own space on Beeper but I don't know hot to aha- |
19:09:33 | FromDiscord | <Robyn [She/Her]> Also is my avatar broken? Or |
19:09:42 | FromDiscord | <Phil (he/him)> Looks all normal |
19:09:42 | FromDiscord | <leorize> your avatar looks correct |
19:09:53 | FromDiscord | <Phil (he/him)> I actually didn't know you were coming from matrix until I swapped to look via discord |
19:10:08 | FromDiscord | <Robyn [She/Her]> Pff fair |
19:10:35 | FromDiscord | <leorize> though I'll warn you that the bridge we use is very slow at times |
19:10:48 | FromDiscord | <Robyn [She/Her]> That's fair \:p |
19:10:54 | FromDiscord | <Robyn [She/Her]> Assuming no reason to make a new bridge? |
19:11:06 | FromDiscord | <Robyn [She/Her]> Or is it just no-one getting around to it? |
19:11:33 | FromDiscord | <leorize> the bridge is not bad, just that it's shared between about like 1000 rooms |
19:12:16 | FromDiscord | <leorize> about running a project-specific bridge then nim has no infrastructure |
19:12:37 | FromDiscord | <Robyn [She/Her]> Fair \:P |
19:12:42 | FromDiscord | <Robyn [She/Her]> Fair enough |
20:03:47 | FromDiscord | <Phil> ... Is it possible to have a seq of threads in global? |
20:03:56 | FromDiscord | <Phil> I kinda wanna have a seq of 8 threads but I don't wanna declare 8 variables |
20:04:04 | FromDiscord | <leorize> why not? |
20:04:31 | FromDiscord | <leorize> the thread object is for tracking the thread, it has little to do with how the thread runs |
20:04:32 | FromDiscord | <Phil> Because 100% of code examples I've seen so far always worked with just declaring a var and letting it default initialied |
20:04:47 | FromDiscord | <Phil> So I assumed some special compiler magic fuckery going on |
20:05:38 | FromDiscord | <leorize> `setLen` should do it for you |
20:05:39 | FromDiscord | <leorize> or just init with `Thread[T]()`? |
20:05:39 | FromDiscord | <Phil (he/him)> Huh, yeah that compiled |
20:05:51 | FromDiscord | <Phil (he/him)> I just did `(0..4).mapIt(Thread[int]())` |
20:06:04 | FromDiscord | <leorize> why would it not work \:p |
20:06:27 | FromDiscord | <Phil (he/him)> Because Threads seem like a unique case for an object that likely would have special rules attached |
20:06:28 | FromDiscord | <leorize> if `var x: T` works then it stands that `var x = T()` also does |
20:06:31 | FromDiscord | <leorize> that's like the nim thing |
20:06:32 | FromDiscord | <Phil (he/him)> That and araq insists on them being globals |
20:07:14 | FromDiscord | <leorize> don't think too much about it |
20:07:50 | FromDiscord | <Phil (he/him)> I'm about to have so many nested forloops |
20:08:32 | FromDiscord | <Phil (he/him)> I'm running an example over the current threading implementation, in part to understand it better, to fuck around with it and thus improve a better amount of "gut feeling" or reference points for validity of things etc. |
20:08:58 | FromDiscord | <Phil (he/him)> And it works for 1 consumer 1 producer.↵Now I'll try out various constellations from 1-5 producers to 1-5 consumers |
20:11:12 | FromDiscord | <Phil (he/him)> Ah, fuck, I just realized, the way I currently track this is going to be fucked |
20:11:25 | FromDiscord | <Phil (he/him)> Because I tracked it so far by writing to a global variable from one thread |
20:11:42 | FromDiscord | <Phil (he/him)> But they can't all write to the same global variable.... time to have them write to their own global variables and just track the sum of those |
20:34:35 | FromDiscord | <leorize> atomics |
20:34:43 | FromDiscord | <leorize> if you're just counting |
20:34:58 | * | zgasma joined #nim |
20:35:25 | FromDiscord | <Phil (he/him)> I'm only counting but now I've already written the code where everybody has their own index in a global seq and counts up |
20:39:41 | FromDiscord | <leorize> you made sure not to expand the seq as you spawn threads, right? |
20:40:12 | FromDiscord | <Phil (he/him)> Define "expand the seq" |
20:40:47 | FromDiscord | <leorize> using `add` on your index seq? |
20:41:03 | FromDiscord | <Phil (he/him)> Nope, never |
20:41:09 | FromDiscord | <Phil (he/him)> I reuse the same threads from the seq |
20:48:52 | FromDiscord | <Phil (he/him)> I make an example, 1 producer, 1 consumer, all works out.↵2 producers\: Instant deadlock |
20:51:09 | FromDiscord | <Phil (he/him)> Aaand its not an actual deadlock, I'm just an idiot |
21:00:39 | FromDiscord | <Phil (he/him)> Aahhhh now its working |
21:24:53 | * | jmdaemon joined #nim |
21:56:58 | * | jmdaemon quit (Ping timeout: 260 seconds) |
22:02:50 | * | jmdaemon joined #nim |
22:07:14 | * | xet7 joined #nim |
22:07:35 | * | xet7 quit (Remote host closed the connection) |
22:08:27 | * | xet7 joined #nim |
22:22:54 | FromDiscord | <ambient3332> Is there any ready-made system for RPC over channels? Or something like that? |
22:23:27 | FromDiscord | <Elegantbeef> Phil is going to have an aneurysm |
22:24:00 | FromDiscord | <Phil (he/him)> I don't think there is. I am working on it but that's going to take a while.↵I mean you can use it, but that's at your own risk\:↵Thread sanitizer is currently telling me that there are definitely still data-races in there |
22:24:34 | FromDiscord | <Phil (he/him)> The problem is that channels themselves contain a data-race that shoooouuuuuld be okay |
22:24:37 | FromDiscord | <Elegantbeef> Just send an object variant and use the kind inside of an array 😄 |
22:25:30 | FromDiscord | <Phil (he/him)> I mean that's pretty much what threadbutler does.↵It just generates the variant for you |
22:25:44 | FromDiscord | <Phil (he/him)> And associates it with a single specific thread |
22:27:27 | FromDiscord | <Phil (he/him)> @ambient3332If you want you can still use it, as stated. Docs are there, examples show it being functional.↵↵However its currently only past the "make it work" phase of it all."make it correct" entails first ensuring you test the fundamentals and that there are no data races and leaks, which will take... a long time, as these things typically come together with me learning a lot about stuff. |
22:27:45 | FromDiscord | <Phil (he/him)> Not sure I'll ever have to make it fast tbh |
22:27:52 | FromDiscord | <ambient3332> I'm not really doing anything mission-critical so I might give it a shot |
23:30:24 | * | advesperacit quit () |
23:49:41 | * | jmdaemon quit (Ping timeout: 240 seconds) |