00:05:36 | FromDiscord | <rb3.nim> sent a long message, see http://ix.io/4uzb |
00:05:54 | FromDiscord | <rb3.nim> (edit) "http://ix.io/4uzb" => "http://ix.io/4uzc" |
00:06:26 | FromDiscord | <rb3.nim> (edit) "http://ix.io/4uzc" => "https://paste.rs/vHL" |
00:08:24 | FromDiscord | <rb3.nim> The reason I'm using `nim compile` instead of `nim check` is I'm doing a lot of C++ ffi, so I want the diagnostics to display errors from the C++ compiler too |
00:09:55 | * | TakinOver quit (Ping timeout: 260 seconds) |
00:11:19 | FromDiscord | <Elegantbeef> @rb3.nim\: `nim -r --eval` should work with ffi |
00:11:25 | FromDiscord | <Elegantbeef> whoops `nim r` |
00:13:18 | * | mal`` joined #nim |
00:21:06 | * | xet7 joined #nim |
00:36:50 | * | xet7 quit (Remote host closed the connection) |
00:44:45 | FromDiscord | <リク> Heya. I'm trying to write some tcp client and server code but ran into an issue. The server accepts data 25 bytes at a time, and that works fine if the client sends data and does nothing else. But if the client sends data and then waits to get a response back, it seems to not fully finish sending the data before moving on to the recv proc. That causes the client and server to both hang.. Is there any way to make sure the client is fully do |
00:48:48 | FromDiscord | <Chronos [She/Her]> Could have a variable somewhere? |
00:49:17 | FromDiscord | <Chronos [She/Her]> After a recv call set it to true, after data is finished being sent, set it to false |
00:50:22 | FromDiscord | <リク> Is there a way to check if the data is fully sent? The receiving is done server-side so the client has no idea about it |
00:51:37 | FromDiscord | <Elegantbeef> Send returns how many bytes has been sent↵(@リク) |
00:51:53 | FromDiscord | <Elegantbeef> Could this be an issue of buffered vs. unbuffered? |
00:52:06 | FromDiscord | <Elegantbeef> By default sockets are buffered |
00:52:19 | * | xet7 joined #nim |
00:52:22 | FromDiscord | <リク> Oh nooooo the high-level version of send doesn't return anything |
00:52:59 | FromDiscord | <Elegantbeef> It has an OsError which would likely be raised if not fully sent |
00:53:07 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/Nim/blob/version-1-6/lib/pure/net.nim#L1783-L1784 yea |
00:53:37 | FromDiscord | <リク> sent a code paste, see https://paste.rs/Pls |
00:55:05 | FromDiscord | <Elegantbeef> The client connects and the server accepts it? |
00:55:59 | FromDiscord | <リク> Yeah the server immediately accepts it and then receives 50 bytes of data before hanging |
00:58:31 | FromDiscord | <Elegantbeef> Is your server equally small? |
00:58:50 | FromDiscord | <Elegantbeef> I'd like to reproduce this, hopefully your server is also a single file |
00:59:33 | FromDiscord | <リク> Yeah I can post the code in a bit, I had to run to the store really quick |
00:59:38 | FromDiscord | <Elegantbeef> ok |
01:24:33 | FromDiscord | <リク> sent a code paste, see https://play.nim-lang.org/#ix=4uzp |
01:25:57 | FromDiscord | <リク> The server outputs↵25↵25↵before hanging heh |
01:29:28 | FromDiscord | <Elegantbeef> You do know `recv` waits until it has read 25 by default right? |
01:30:20 | FromDiscord | <リク> It seems like it requires you to specify a size |
01:34:36 | FromDiscord | <Elegantbeef> It does |
01:34:39 | FromDiscord | <Elegantbeef> but it also has a `timeout` |
01:35:35 | FromDiscord | <リク> Would it make sense to not have it at -1? |
01:38:42 | FromDiscord | <リク> Huh actually setting it to 500ms fixes the issue without corrupting the data or anything |
01:39:31 | FromDiscord | <リク> (I'm sure other timeout periods are fine too but it doesn't matter too much in my case) |
01:39:58 | FromDiscord | <Elegantbeef> Yea you may want to wrap it with a try except though for timeout errors |
01:40:09 | FromDiscord | <Elegantbeef> Cause you probably are building a buffer 25 bytes at a time eh |
01:40:22 | FromDiscord | <リク> Yeah haha |
01:40:39 | FromDiscord | <リク> It's still surprising that having unlimited timeout causes issues though |
01:40:46 | FromDiscord | <リク> I wonder why heh |
01:41:21 | FromDiscord | <Elegantbeef> Cause your logic |
01:41:34 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4uzt |
01:41:45 | FromDiscord | <Elegantbeef> after the first full read of 25 it stays at `client.recv` |
01:41:57 | FromDiscord | <Elegantbeef> Or second i guess |
01:43:38 | FromDiscord | <リク> Yeah heh. I'm wondering how it's okay with getting things out of order though. Like it receives 50 bytes of data, then sends data to the client, then gets the rest somehow? |
01:44:02 | FromDiscord | <Elegantbeef> Nah it never sends to the client |
01:44:08 | FromDiscord | <Elegantbeef> Since it never escapes that loop |
01:44:11 | FromDiscord | <Elegantbeef> Atleast without a timeout |
01:44:50 | FromDiscord | <リク> Yeah without a timeout it just hangs after 50 bytes, but with a timeout it works as expected, though I'd expect it to actually not work hah |
01:46:11 | FromDiscord | <sOkam!> has anyone here dealt with Nim-to-ObjC interop? 🤔 |
01:48:19 | FromDiscord | <リク> Oh wait, I just realized that the data does get corrupted like I thought it should |
01:48:53 | FromDiscord | <リク> sent a code paste, see https://play.nim-lang.org/#ix=4uzv |
01:51:29 | FromDiscord | <Elegantbeef> `recvFrom` might be better |
01:51:40 | FromDiscord | <Elegantbeef> Wait nvm wrong proc 😄 |
01:51:55 | FromDiscord | <Elegantbeef> There is a `recv` that takes a `var string` that's likely the better one |
01:52:40 | FromDiscord | <リク> Alright I'll try that |
01:53:46 | * | derpydoo joined #nim |
02:03:37 | FromDiscord | <Elegantbeef> These recv procs are so odd seems like only the lowlevel one is sane |
02:04:30 | FromDiscord | <リク> It might also be the send proc since the proc returns before the data is fully sent.. |
02:05:00 | FromDiscord | <リク> Because of that, it doesn't matter if you put the timeout on the client, server, or both, you get corrupted data on one or both of the sides |
02:09:44 | FromDiscord | <リク> sent a code paste, see https://paste.rs/D3r |
02:09:58 | FromDiscord | <リク> But the server only gets 50 |
02:10:18 | FromDiscord | <Elegantbeef> Is send even blocking |
02:10:25 | FromDiscord | <Elegantbeef> I guess this is TCP so it should be |
02:10:45 | FromDiscord | <リク> It should be, but I have a feeling that it isn't, or linux is doing weird things behind the scenes.. |
02:11:13 | FromDiscord | <リク> I wonder if the socket on the client side is somehow a udp socket? I think tcp is default though right? |
02:11:50 | * | xet7 quit (Ping timeout: 265 seconds) |
02:12:29 | FromDiscord | <Elegantbeef> TCP should be default yea |
02:13:08 | FromDiscord | <リク> Yeah I checked the docs and tcp is default |
02:13:16 | FromDiscord | <リク> That's so weird lmao |
02:17:29 | FromDiscord | <Elegantbeef> Yea I do not know what to say |
02:18:25 | FromDiscord | <リク> I could try asyncnet instead I guess haha |
02:27:27 | * | krydos joined #nim |
02:29:50 | FromDiscord | <リク> What would be the best place to report issues? I feel like I should officially report this |
02:30:00 | FromDiscord | <Elegantbeef> The github repo |
02:30:08 | FromDiscord | <リク> Alright cool |
02:31:06 | FromDiscord | <Arathanis> when i checkout the `version-2-0` branch and build nim the resulting exe says its version 1.9.3, is that expected? |
02:31:17 | FromDiscord | <Arathanis> (edit) "1.9.3," => "1.9.1," |
02:31:47 | FromDiscord | <Elegantbeef> Afaik, yes |
02:31:57 | FromDiscord | <Arathanis> cool, just making sure. thank you. |
02:34:20 | * | lucasta quit (Remote host closed the connection) |
02:43:19 | FromDiscord | <リク> Submitting issues is scary |
02:43:51 | FromDiscord | <Elegantbeef> I disagree |
02:43:56 | FromDiscord | <Elegantbeef> Worst case someone calls you an idiot |
02:44:01 | FromDiscord | <Elegantbeef> Best case you document a bug |
02:44:11 | FromDiscord | <リク> True true |
03:01:54 | FromDiscord | <rb3.nim> sent a code paste, see https://play.nim-lang.org/#ix=4uzH |
03:04:38 | FromDiscord | <rb3.nim> sent a code paste, see https://play.nim-lang.org/#ix=4uzK |
03:05:07 | FromDiscord | <rb3.nim> (edit) "https://play.nim-lang.org/#ix=4uzK" => "https://play.nim-lang.org/#ix=4uzL" |
03:07:39 | arkanoid | this documentation is not clearly saying if it will wait until whole datagram is received, or if it will yield result when `size` bytes are received https://nim-lang.org/docs/asyncnet.html#recvFrom%2CAsyncSocket%2Cint |
03:16:29 | FromDiscord | <rb3.nim> In reply to @rb3.nim "But if I run": Ah, I'm just dumb. I was discarding a `void` value. |
04:12:16 | * | TakinOver joined #nim |
05:21:22 | * | derpydoo quit (Ping timeout: 276 seconds) |
06:50:12 | * | azimut joined #nim |
07:12:46 | * | Notxor joined #nim |
10:31:04 | * | jmdaemon quit (Ping timeout: 252 seconds) |
11:40:01 | * | oprypin quit (Quit: Bye) |
11:40:19 | * | oprypin joined #nim |
14:19:47 | * | lucasta joined #nim |
14:39:52 | * | Notxor quit (Remote host closed the connection) |
14:51:27 | * | Notxor joined #nim |
15:27:20 | * | robertmeta quit (*.net *.split) |
15:27:20 | * | koltrast quit (*.net *.split) |
15:27:20 | * | acidsys quit (*.net *.split) |
15:28:08 | * | robertmeta joined #nim |
15:28:40 | * | acidsys joined #nim |
15:28:51 | * | robertmeta quit (Changing host) |
15:28:51 | * | robertmeta joined #nim |
15:30:01 | * | koltrast joined #nim |
15:35:21 | FromDiscord | <sOkam!> is there an existing `offsetof()` function/proc in Nim? |
16:15:09 | FromDiscord | <Chronos [She/Her]> Offset? |
16:15:20 | FromDiscord | <Chronos [She/Her]> There's `sizeof`, I believe |
16:15:53 | FromDiscord | <Chronos [She/Her]> Oh, it's literally `offsetof` |
16:16:44 | FromDiscord | <Chronos [She/Her]> @sOkam! |
16:19:15 | FromDiscord | <sOkam!> oh rly? nice, will check it out |
16:19:21 | FromDiscord | <Chronos [She/Her]> Of course aha |
16:24:49 | FromDiscord | <jmgomez> I read somwhere that there was a way to build the compiler with importc support at compile time, anyone know how? Reading through koch sources cant see a flag for it |
16:31:45 | * | arkurious joined #nim |
16:31:49 | * | arkurious quit (Remote host closed the connection) |
16:34:58 | FromDiscord | <jmgomez> found it, `-d:nimHasLibFFI` |
16:40:32 | * | lucasta quit (Remote host closed the connection) |
16:51:34 | * | beholders_eye joined #nim |
16:58:11 | FromDiscord | <Chronos [She/Her]> Ah, I think that gives the NimScript VM FFI capabilities |
16:59:35 | NimEventer | New thread by tcheran: Fetching data from many small .txt files, see https://forum.nim-lang.org/t/10146 |
17:01:31 | FromDiscord | <jmgomez> In reply to @Hourglass, When the Hour Strikes "Ah, I think that": yes, Im exploring it. Not sure how to actually feed in the c/cpp though |
17:01:42 | FromDiscord | <Chronos [She/Her]> Interesting |
17:02:25 | FromDiscord | <Chronos [She/Her]> In reply to @jmgomez "yes, Im exploring it.": Honestly, considering how the importc and importcpp pragma works, I'm guessing it probably compiles the importc'd code and exposed it to the VM? |
17:02:35 | FromDiscord | <Chronos [She/Her]> But I don't know how that works at all since never touched it |
17:03:10 | FromDiscord | <jmgomez> I think I need to actually compile Nim with the C/C++ that I want to be available |
17:04:13 | FromDiscord | <jmgomez> Or maybe I can just use a dll hmm |
17:07:28 | FromDiscord | <Chronos [She/Her]> Oh wait |
17:07:30 | FromDiscord | <Chronos [She/Her]> LibFFI |
17:07:44 | FromDiscord | <Chronos [She/Her]> Using shared libraries |
17:07:51 | FromDiscord | <Chronos [She/Her]> That makes so much more sense |
17:21:25 | FromDiscord | <jmgomez> Yeah, it works |
17:28:37 | FromDiscord | <Require Support> any implementation of async named pipes using `asyncdispatch` ? |
17:28:44 | FromDiscord | <Require Support> (edit) "any implementation of async named pipes using `asyncdispatch` ? ... " added "(for windows)" |
18:36:48 | * | TakinOver quit (Ping timeout: 248 seconds) |
19:19:26 | * | lucasta joined #nim |
19:35:21 | * | junaid_ joined #nim |
19:54:29 | * | progranner joined #nim |
19:59:50 | FromDiscord | <Require Support> is there a way to specify config file for compiler ? |
20:17:22 | * | junaid_ quit (Remote host closed the connection) |
20:45:26 | FromDiscord | <sOkam!> In reply to @Require Support "is there a way": multiple. the ones i use are nim.cfg in the root of the project, for nimc config... and config.nims for nimble config |
20:45:39 | FromDiscord | <sOkam!> but there are more |
20:45:48 | FromDiscord | <sOkam!> (edit) "but there are more ... " added "locations to place them" |
20:46:30 | FromDiscord | <sOkam!> they show up for me in the hints everytime i compile. maybe try running with `--verbose` and it might also print them for you |
21:01:16 | * | progranner quit (Ping timeout: 276 seconds) |
21:10:41 | * | TakinOver joined #nim |
21:51:45 | * | jmdaemon joined #nim |
22:09:16 | * | Notxor quit (Remote host closed the connection) |
22:23:17 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4uDd |
22:24:09 | FromDiscord | <voidwalker> if i change to t.sha1.string (not sure why converter wasn't used automatically?) code compiles. But the position where it marks the error is wrong, it should be for the first pair, not the second |
22:24:39 | FromDiscord | <voidwalker> (edit) "t.sha1.string" => "`t.sha1.string`" |
22:24:42 | FromDiscord | <Elegantbeef> Cause it's the first entry in an array |
22:25:15 | FromDiscord | <voidwalker> more explicit please ? |
22:25:30 | FromDiscord | <Elegantbeef> What information is there that it should convert? |
22:26:01 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4uDe |
22:26:06 | FromDiscord | <Elegantbeef> That's not what i asked |
22:26:18 | FromDiscord | <Elegantbeef> What information is there inside the array that says "you need to convert to X type" |
22:26:37 | FromDiscord | <Elegantbeef> The first element of an array tells the rest of the type of the array |
22:26:43 | FromDiscord | <voidwalker> Ohhhhhh |
22:27:13 | FromDiscord | <Elegantbeef> And it's even worse than that |
22:27:23 | FromDiscord | <Elegantbeef> Cause it's an element of `(string, InfoHash)` |
22:27:24 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4uDf |
22:27:53 | FromDiscord | <Elegantbeef> Ok cool but that call doesnt happen until after the array is created |
22:27:54 | FromDiscord | <Elegantbeef> Nim is locally type inferred |
22:28:03 | FromDiscord | <Elegantbeef> First the array is semantically checked, then it semantically checks the call and so forth |
22:28:07 | FromDiscord | <voidwalker> so first it checks the array is sane |
22:28:08 | FromDiscord | <voidwalker> ok |
22:28:14 | FromDiscord | <Elegantbeef> There are a few cases where information is passed from left to right |
22:28:26 | FromDiscord | <Elegantbeef> But dispatch is not one of them since dispatch can resolve types |
22:28:43 | FromDiscord | <voidwalker> so convert can't work here, got it. no big deal |
22:29:27 | FromDiscord | <Elegantbeef> Correct unless you make a converter for `(string, string)` then one for `openarray[(string, InfoHash)]` 😄 |
22:31:36 | FromDiscord | <voidwalker> I am even questioning if making a separate type with array of char for this is the right thing to do. Since it's needed as a string pretty much everywhere (socket send, message parsing etc) |
22:32:04 | FromDiscord | <Elegantbeef> What's the benefit of it being an array |
22:32:22 | FromDiscord | <voidwalker> well, it's always of size 20, so strictly logically.. it should be an array : P |
22:32:48 | FromDiscord | <voidwalker> But if everything else is a string, there's probably no benefit |
22:36:43 | FromDiscord | <ElegantBeef> Well the bridge is really a prick |
22:36:53 | FromDiscord | <ElegantBeef> In that case consider an object variant maybe |
22:37:16 | FromDiscord | <ElegantBeef> But if it only "should" be an array perhaps assertions is enough |
22:37:27 | FromDiscord | <ElegantBeef> Ensure it's always 20 len everywhere it should be |
22:37:41 | FromDiscord | <ElegantBeef> There is a minor benefit that you can move ownership of a string, you cannot with an array |
22:37:47 | FromDiscord | <voidwalker> come on, object variant for this ? that's overkill |
22:39:50 | FromDiscord | <voidwalker> hm interesting, sounds like it should be strings all the way then. Too bad I can't declare string[20] or something |
22:40:05 | FromDiscord | <ElegantBeef> You technically can but you'd need to implement the type |
22:42:50 | FromDiscord | <ElegantBeef> Paint the rest of the owl |
22:42:53 | FromDiscord | <ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=4uDh |
22:43:37 | FromDiscord | <Nlits (Ping on reply)> Should I just use 1 lock for all my threads or multiple |
22:43:59 | FromDiscord | <Elegantbeef> This is not a question that can be answered without actual design in front of anyone |
22:44:49 | FromDiscord | <Elegantbeef> Are you locking a single resource, are you locking many resources, are your threads in a producer consumer orientation with a single work pile.....? |
22:46:24 | FromDiscord | <voidwalker> Am I the only one that thinks sized strings should be part of nim ? I see it in most languages. Using char arrays has some drawbacks, like not even having a converted included.. |
22:46:29 | FromDiscord | <voidwalker> (edit) "converted" => "converter" |
22:47:03 | FromDiscord | <Elegantbeef> Likely yes |
22:47:05 | FromDiscord | <Elegantbeef> We have arrays |
22:47:10 | FromDiscord | <Elegantbeef> We have low level operations |
22:47:19 | FromDiscord | <Elegantbeef> Write abstractions on top of them and call it a day |
22:47:25 | FromDiscord | <Nlits (Ping on reply)> In reply to @Elegantbeef "Are you locking a": i have 2 "shared" vars. |
22:48:04 | FromDiscord | <Dudugz> A library for sized strings might work, ``std/sizedstr`` |
22:48:55 | FromDiscord | <Elegantbeef> It might but there isnt much reason arrays dont work |
22:49:16 | FromDiscord | <Elegantbeef> If you are using fixed size strings it's not likely you want most string operations to work |
22:49:27 | FromDiscord | <Elegantbeef> Plus more of the stdlib should use `openArray[char]` |
22:50:54 | FromDiscord | <Dudugz> Yes I agree, in my pov there is no need for a sized string, I mean it won't help at all and will only overcomplicate basic operations. |
22:53:21 | FromDiscord | <cmc> sent a long message, see http://ix.io/4uDj |
22:55:20 | FromDiscord | <cmc> sent a code paste, see https://play.nim-lang.org/#ix=4uDk |
22:56:23 | FromDiscord | <Elegantbeef> you cannot inject a variable named the same as the template |
22:58:26 | FromDiscord | <cmc> sent a code paste, see https://play.nim-lang.org/#ix=4uDl |
23:01:16 | FromDiscord | <Elegantbeef> I'd probably do the silly thing and use a macro with `varargs[untyped]` |
23:05:49 | FromDiscord | <cmc> sent a code paste, see https://play.nim-lang.org/#ix=4uDo |
23:08:17 | FromDiscord | <Elegantbeef> Yea i'd say use a macro instead, might be able to push templates to work, but bleh |
23:08:36 | FromDiscord | <cmc> Hahaha yeah |
23:10:32 | * | azimut quit (Ping timeout: 240 seconds) |
23:16:48 | FromDiscord | <Nlits (Ping on reply)> In reply to @not logged in "i have 2 "shared"": So do i have a lock for each one? |
23:17:43 | FromDiscord | <Elegantbeef> You have given 0 insight |
23:18:26 | FromDiscord | <Elegantbeef> What you need depends on your multi-threading architecture |
23:18:39 | FromDiscord | <Elegantbeef> There is no general solution for all 2 shared resources |
23:19:19 | FromDiscord | <Nlits (Ping on reply)> In reply to @Elegantbeef "What you need depends": I am using mummy, idk the architecture |
23:19:43 | FromDiscord | <Elegantbeef> Well then look at how it does threading and where deadlocks may appear |
23:19:52 | FromDiscord | <Elegantbeef> Also consider how you're using these resources |
23:21:11 | FromDiscord | <Nlits (Ping on reply)> In reply to @Elegantbeef "Well then look at": no idea what the means |
23:22:04 | FromDiscord | <Elegantbeef> Perhaps it's time to learn why locks exist |
23:23:18 | FromDiscord | <Nlits (Ping on reply)> In reply to @Elegantbeef "Perhaps it's time to": to lock a thread so that they can safely access resources so other threads won't interfere? |
23:24:18 | FromDiscord | <Elegantbeef> Ok so now you need to wonder if there would be competed access of your resources, and how many locks you need for your design |
23:25:01 | FromDiscord | <Elegantbeef> Are the threads accessing these resources at the same time? If you have access to one resource should the other be locked, unlocked, does it matter? |
23:25:20 | FromDiscord | <Elegantbeef> How many locks you need depends on what you're doing |
23:26:57 | FromDiscord | <Nlits (Ping on reply)> In reply to @Elegantbeef "Are the threads accessing": It would be possible for my program to read and write at the same time without locks |
23:27:00 | * | Batzy quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
23:27:10 | FromDiscord | <Nlits (Ping on reply)> (edit) "In reply to @Elegantbeef "Are the threads accessing": It would be possible for my program to read and write at the same time ... without" added "as other threads" |
23:27:12 | FromDiscord | <Elegantbeef> then there you go you need 0 locks |
23:27:22 | * | Batzy joined #nim |
23:27:35 | FromDiscord | <Elegantbeef> Oh cmon you cannot edit that after i gave confirmation |
23:27:42 | FromDiscord | <Elegantbeef> Well then you need locks |
23:27:58 | FromDiscord | <cmc> sent a code paste, see https://play.nim-lang.org/#ix=4uDs |
23:28:06 | FromDiscord | <Elegantbeef> Ugh |
23:28:09 | FromDiscord | <Elegantbeef> That's not what i meant |
23:28:39 | FromDiscord | <cmc> Yeah I know. I wanted to see what it would take to force the templates for educational purposes \:) |
23:29:19 | FromDiscord | <Nlits (Ping on reply)> In reply to @Elegantbeef "Well then you need": Your statements are confusing and conflicting... |
23:30:28 | FromDiscord | <cmc> Yeah I know. I was looking into macros and found out what it take to force it with templates. It was more an educational accident |
23:32:01 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4uDv |
23:32:15 | FromDiscord | <Elegantbeef> There you go cmc |
23:32:18 | FromDiscord | <Elegantbeef> That's what i meant 😛 |
23:33:06 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4uDw |
23:34:28 | FromDiscord | <cmc> Oh, thank you so much!! |
23:36:36 | FromDiscord | <Elegantbeef> No one here knows how your code is written so it's not like anyone can give you a definitive answer, if both resources are being read/written then you need some lock or if it's a primitive an atomic, otherwise you have a race condition↵(@Nlits (Ping on reply)) |
23:36:50 | FromDiscord | <Elegantbeef> So you'll need to put your thinking cap on |
23:39:31 | FromDiscord | <Nlits (Ping on reply)> sent a code paste, see https://play.nim-lang.org/#ix=4uDx |
23:41:07 | FromDiscord | <Elegantbeef> Ask yourself should messages be added whilst a connection is excluded/included |
23:41:12 | FromDiscord | <Elegantbeef> That's all you need to answer |
23:41:29 | FromDiscord | <Elegantbeef> With a singular lock any connection/message operation is blocking all threads |
23:42:35 | FromDiscord | <Nlits (Ping on reply)> In reply to @Elegantbeef "Ask yourself should messages": they can be. They should be allowed to. So 2 locks ig |
23:44:42 | FromDiscord | <Elegantbeef> Now i have to wonder if spoonfeeding threading logic benefited you |
23:47:15 | FromDiscord | <Nlits (Ping on reply)> In reply to @Elegantbeef "Now i have to": I just needed confirmation, I had the idea already. |
23:56:28 | FromDiscord | <Nlits (Ping on reply)> Ok, now trying to make a ui for that.↵I can't seem to find out how to use the TUI lib↵https://forum.nim-lang.org/t/9244 |
23:56:31 | * | TakinOver quit (Ping timeout: 250 seconds) |
23:57:58 | * | derpydoo joined #nim |
23:58:11 | FromDiscord | <Nlits (Ping on reply)> Or should I just use illwill |
23:59:14 | FromDiscord | <Elegantbeef> I mean refer to the examples |
23:59:17 | FromDiscord | <Elegantbeef> They're very straight forward |