00:00:28 | FromDiscord | <girvo> Oh yep, it was as simple as adding `quit(O)` to my SIGTERM handler |
00:04:07 | FromDiscord | <girvo> Wonder if `nim-taskpools` will work with chronos well enough? |
00:04:08 | FromDiscord | <leorize> beef\: pick a lib I maintain and copy the CI setup from it |
00:04:14 | FromDiscord | <leorize> usually it's a full package with docs |
00:04:32 | FromDiscord | <Elegantbeef> Oh right my reason for failing in my exceptions test leaking is likely Nim arc injection being silly about exceptionful code |
00:04:59 | FromDiscord | <Elegantbeef> I looked at it leo but got lost in the yaml and went "uh huh" |
00:05:26 | FromDiscord | <leorize> apparently according to dis he just copy them and they work, but ymmv |
00:06:21 | FromDiscord | <Elegantbeef> Well I was going to remove the skull part as it's not testable presently |
00:06:51 | FromDiscord | <that_dude.> sent a code paste, see https://play.nim-lang.org/#pasty=jYmXBctsRYVP |
00:07:18 | FromDiscord | <Elegantbeef> `--nimMainPrefix` should apply to nim proc gen |
00:07:37 | FromDiscord | <that_dude.> But I'm using that and I'm still getting issues |
00:07:54 | FromDiscord | <Elegantbeef> Nim -v? |
00:08:03 | FromDiscord | <that_dude.> 2.1.1 |
00:08:14 | FromDiscord | <that_dude.> Latest devel afaik |
00:08:57 | FromDiscord | <that_dude.> sent a code paste, see https://play.nim-lang.org/#pasty=PLKsuFeSPwII |
00:09:17 | FromDiscord | <Robyn [She/Her]> In reply to @leorize "beef\: pick a lib": Or use mine, I've also made mine fairly alright :P |
00:10:47 | FromDiscord | <Robyn [She/Her]> Actually yours is probably bettwr |
00:10:49 | FromDiscord | <Robyn [She/Her]> Oh well |
00:13:24 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/Nim/issues/19830 seems it broke again |
00:16:22 | * | jmdaemon joined #nim |
00:33:06 | FromDiscord | <girvo> sent a code paste, see https://play.nim-lang.org/#pasty=TsOeVAsTVkBb |
00:33:09 | FromDiscord | <girvo> Well poop |
00:43:25 | FromDiscord | <Elegantbeef> Get with the times old man |
00:45:41 | FromDiscord | <girvo> we _cannnn't_ not yet anyway |
00:45:50 | FromDiscord | <Elegantbeef> Not with that attiude |
00:45:52 | FromDiscord | <girvo> (we have a v2 branch but there shit we need to solve first) |
00:46:10 | FromDiscord | <girvo> Man nimsuggest chk with the nimsaem VSCode extension has lost the plot lately |
00:46:45 | FromDiscord | <girvo> sent a code paste, see https://play.nim-lang.org/#pasty=UOtqsAueSJFF |
00:47:05 | FromDiscord | <Robyn [She/Her]> In reply to @girvo "(we have a v2": Yeaaah, switch to the one in the Nim org |
00:47:37 | FromDiscord | <Robyn [She/Her]> Download the vsx and then drag it onto the extensions tab in VSC and it'll install (probably an easier way to do it) |
00:47:43 | FromDiscord | <girvo> Okay sweet 🙂 |
00:47:46 | FromDiscord | <girvo> Thanks! |
00:48:00 | FromDiscord | <girvo> (theres a `code` commandline thing you can run to install a vsx) |
00:48:05 | FromDiscord | <Robyn [She/Her]> Of course! I did this a few days ago aha, it definitely seems nicer than the Nim saem one |
00:48:10 | FromDiscord | <Elegantbeef> Though that'll be running a newer nimlang server that might have an issue with older code |
00:48:15 | FromDiscord | <Robyn [She/Her]> In reply to @girvo "(theres a `code` commandline": Oh? Is there? |
00:48:24 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "Though that'll be running": Ah true |
00:49:11 | FromDiscord | <girvo> In reply to @Elegantbeef "Though that'll be running": hm good point |
00:49:12 | FromDiscord | <girvo> I'll try anyway |
00:51:18 | FromDiscord | <girvo> Seems okay so far |
00:51:54 | FromDiscord | <girvo> It's using nimsuggest it seems, but isn't yelling about correct code anymore |
00:52:18 | FromDiscord | <girvo> Oh yay! outline and ctrl-shift-o now works properly |
00:59:53 | FromDiscord | <girvo> is there a `{.deprecated.}` pragma or similar approach that will let me annotate it? Or just `{.deprecated.}` with a `# comment` ? |
01:00:09 | FromDiscord | <girvo> `{.deprecated: "3011 and below".}` is what I'd love to do lol |
01:02:59 | FromDiscord | <Elegantbeef> There is a deprecated |
01:08:17 | FromDiscord | <girvo> yes but it doesn't let me annotate it 😛 |
01:08:23 | FromDiscord | <Elegantbeef> What? |
01:08:31 | FromDiscord | <girvo> FourToTwenty = object↵ a: Option[FourToTwentyData]↵ b: Option[FourToTwentyData]↵ inputVoltage {.deprecated: "3011 and below".}: Option[InputVoltage] |
01:08:33 | FromDiscord | <girvo> I wanna do this |
01:08:39 | FromDiscord | <Elegantbeef> `proc doStuff {.deprecated: "Jump in a river".}` |
01:08:51 | FromDiscord | <girvo> I guess its just nimsuggest whinging then? |
01:09:13 | FromDiscord | <girvo> It says "annotation to deprecated not supported here" |
01:09:27 | FromDiscord | <Elegantbeef> I never got you wanted to deprecate a field |
01:09:34 | FromDiscord | <Elegantbeef> It's a bit odd to want to do but yea there is no way to deprecate it |
01:09:41 | FromDiscord | <Elegantbeef> Well there is one way |
01:10:32 | FromDiscord | <Elegantbeef> It involves doing `inputVoltageBacker: ...`, `proc inputVoltage=(val: var FourToTwenty, val: ...) {.deprecated.} = ...` and a getter |
01:17:35 | * | om3ga quit (Read error: Connection reset by peer) |
01:21:32 | * | om3ga joined #nim |
01:42:25 | * | tc424 quit (Ping timeout: 264 seconds) |
01:52:53 | * | tc424 joined #nim |
02:04:41 | FromDiscord | <bosinski2023> In reply to @Elegantbeef "It involves doing `inputVoltageBacker:": hi, i think we should deprecate single-threaded LRU-Caches and instead use a obstruction-free RLU-Cache like the one i put into the #test - channel 🙂 |
02:05:34 | FromDiscord | <Elegantbeef> This is in response to? |
02:06:09 | FromDiscord | <bosinski2023> In reply to @Elegantbeef "This is in response": not really.. |
02:06:16 | * | xet7 quit (Remote host closed the connection) |
02:07:27 | FromDiscord | <bosinski2023> (edit) "In reply to @Elegantbeef "This is in response": not really.. ... " added "but take a loooḱ, its from one of those amazing science-papers, i'm working on it" |
02:07:40 | FromDiscord | <bosinski2023> (edit) "loooḱ," => "look," |
02:13:21 | FromDiscord | <that_dude.> Hey Elegant, I tried some of the cli options as mentioned in that issue, but none fixed my issue. What should I do? Just build a test case and then open a bug report? |
02:17:32 | FromDiscord | <privsec> wahh |
02:17:41 | FromDiscord | <privsec> hi again |
02:29:40 | FromDiscord | <Elegantbeef> @that_dude. yea seems Nim has no mechanism for multiple static libs with the same procs being called |
02:29:54 | FromDiscord | <Elegantbeef> Though to be fair you'd probably want to share procs across shared libs 9/10 times |
02:30:09 | FromDiscord | <Elegantbeef> `$10` should only have a single `$` in the end I'd argue |
02:32:01 | * | xet7 joined #nim |
02:39:41 | FromDiscord | <that_dude.> I'll take what I have and see if I can throw together a bug report for that then. Changing to lib didn't seem to have an effect either, but I'm still trying to mess with the things |
02:55:58 | FromDiscord | <Elegantbeef> The objcopy solution deech mentioned is probably the easiest to use presently |
03:02:17 | FromDiscord | <that_dude.> sent a code paste, see https://play.nim-lang.org/#pasty=zzvFvDruFDCP |
03:02:56 | FromDiscord | <that_dude.> It'll have to do, I just need to clean up any old main stuff since there's one main now |
03:25:32 | * | Lord_Nightmare quit (Quit: ZNC - http://znc.in) |
03:28:06 | FromDiscord | <that_dude.> Is there something that makes `NimMain()` not show up? I had it working before when I was using the prefix option, but now without it, I can't seem to use it from a sub file |
03:28:56 | FromDiscord | <Elegantbeef> It will always be there unless you give it a prefix |
03:29:09 | FromDiscord | <that_dude.> :/ |
03:29:11 | * | Lord_Nightmare joined #nim |
03:32:48 | FromDiscord | <that_dude.> sent a code paste, see https://play.nim-lang.org/#pasty=YWORcAxtvUcJ |
03:32:59 | FromDiscord | <that_dude.> sent a code paste, see https://play.nim-lang.org/#pasty=msHzlZtWrZwm |
03:33:10 | FromDiscord | <that_dude.> (edit) "https://play.nim-lang.org/#pasty=SgwiIrcVePrZ" => "https://play.nim-lang.org/#pasty=fGTzAnprbFRp" |
03:33:20 | FromDiscord | <that_dude.> I don't think I'm doing anything weird |
03:33:54 | FromDiscord | <that_dude.> Fuck |
03:34:02 | FromDiscord | <that_dude.> Forgot it was include I wanted not import |
03:34:09 | FromDiscord | <that_dude.> Ignore this |
03:44:00 | * | redj joined #nim |
03:45:35 | FromDiscord | <Elegantbeef> Should likely wrap that in a `once:` 😄 |
03:47:30 | FromDiscord | <that_dude.> Didn't know that was a thing |
03:47:41 | FromDiscord | <that_dude.> Can do |
04:59:53 | FromDiscord | <girvo> Hm, we're now running out of buffer space in LwIP when they connect to the Chronos server. Odd. The firmware code hasn't changed. ↵↵It's literally dying in the let socket = newSocket() call. Wild |
05:10:32 | FromDiscord | <girvo> Silly question, but what `--gc:` should we be using with `chronos`? its not in their docs |
05:10:56 | FromDiscord | <Elegantbeef> It should work with arc since it's cycle free |
05:11:01 | FromDiscord | <Elegantbeef> So 'any' |
05:11:35 | FromDiscord | <Elegantbeef> Status still uses refc afaik though |
05:12:19 | FromDiscord | <girvo> I compiled with `arc` and it seems to have a cycle in 4.0.0? |
05:12:37 | FromDiscord | <girvo> `/root/.nimble/pkgs/chronos-#head/chronos/internal/asyncfutures.nim(1197, 6) Warning: ':env.cb3 = (:anonymous, :env)' creates an uncollectable ref cycle; annotate 'cb3' with .cursor [CycleCreated]` |
05:13:45 | FromDiscord | <girvo> actually I somehow ended up on #head there... |
05:14:02 | FromDiscord | <girvo> Though 4.0.0 has the same compile warning |
05:15:38 | FromDiscord | <girvo> I'll switch the server back to refc for the moment |
05:18:15 | FromDiscord | <girvo> Whats the issue with `orc` and threads? |
05:18:47 | FromDiscord | <Elegantbeef> The cycle collector is not thread aware |
05:19:08 | FromDiscord | <Elegantbeef> So having cyclical graphs shared across threads just explodes |
05:22:11 | FromDiscord | <girvo> Yeah fair enough |
05:40:47 | FromDiscord | <leorize> chronos does have cycles |
05:40:47 | FromDiscord | <leorize> just ask phil |
05:40:47 | FromDiscord | <Elegantbeef> They played us for fools |
05:47:59 | FromDiscord | <leorize> you don't need cycles |
05:48:14 | FromDiscord | <leorize> just having refs is enough to make orc go boom with threads |
05:48:32 | FromDiscord | <girvo> Now we suddenly have a segfault in our server too |
05:48:48 | FromDiscord | <girvo> Which wasn't there earlier today, with the same client devices communicating with it. Wild |
05:49:20 | FromDiscord | <leorize> if you didn't give it the thread sanitizer treatment, how can you be sure it's ever safe? |
05:49:37 | FromDiscord | <nnsee> fuck around and find out |
05:52:20 | * | rockcavera quit (Remote host closed the connection) |
05:57:41 | FromDiscord | <leorize> the thing with threads is that it's broken unless proven otherwise |
06:45:52 | * | mal`` quit (Quit: Leaving) |
06:55:46 | * | advesperacit joined #nim |
07:05:54 | * | PMunch joined #nim |
07:06:34 | * | mal`` joined #nim |
07:49:51 | * | advesperacit quit () |
07:52:15 | * | advesperacit joined #nim |
08:14:42 | * | azimut joined #nim |
08:23:13 | * | azimut quit (Remote host closed the connection) |
08:23:34 | * | azimut joined #nim |
08:38:20 | NimEventer | New thread by ingo: Create ungraceful exit program, see https://forum.nim-lang.org/t/10999 |
08:54:26 | NimEventer | New thread by ggibson: How to use Weave isReady?, see https://forum.nim-lang.org/t/11000 |
08:57:52 | * | om3ga quit (Read error: Connection reset by peer) |
09:00:35 | * | om3ga joined #nim |
09:24:20 | * | PMunch quit (Quit: Leaving) |
10:58:35 | FromDiscord | <Robyn [She/Her]> To avoid mem leaks from cyclic references, does explicitly setting a ref object to nil make arc able to collect it? |
11:03:12 | FromDiscord | <odexine> I believe breaking cycles does allow arc to work |
11:17:36 | * | ntat joined #nim |
11:23:59 | * | Jjp137 quit (Ping timeout: 260 seconds) |
11:24:19 | * | Jjp137 joined #nim |
11:26:07 | FromDiscord | <grumblygibson> sent a code paste, see https://play.nim-lang.org/#pasty=HQXmTYGevYBN |
11:26:14 | FromDiscord | <grumblygibson> (edit) "https://play.nim-lang.org/#pasty=DzLfWCUgWDjt" => "https://play.nim-lang.org/#pasty=kTjNflYHWOsH" |
11:35:59 | * | derpydoo quit (Ping timeout: 264 seconds) |
11:40:37 | FromDiscord | <demotomohiro> 'move' doesn't means move object itself to other object. 'move' usually used for objects that contains a pointer to internal heap, and copy the pointer to other object. |
11:44:32 | FromDiscord | <demotomohiro> In reply to @grumblygibson "`seq` question: Why moving": So you need to compare the content of `Column`, not an address of `Column` itself to see if it is moved. |
11:46:59 | * | jmdaemon quit (Ping timeout: 252 seconds) |
12:02:25 | FromDiscord | <Robyn [She/Her]> In reply to @odexine "I believe breaking cycles": Sweet |
12:02:34 | FromDiscord | <Robyn [She/Her]> Now I need to figure out how selectors work... |
12:16:42 | FromDiscord | <crufty.> Hi new here. Why is it when I run the following command 'nimble search lean' I get 'Error No package found.' Does this package not exist? |
12:17:54 | FromDiscord | <crufty.> Same with sequtils and time. |
12:21:27 | FromDiscord | <odexine> None of those modules need to be installed, they are bundled |
12:21:39 | FromDiscord | <odexine> Because they are part of the standard library |
12:21:47 | FromDiscord | <crufty.> Ah! OK this makes sense, thank you |
12:22:50 | FromDiscord | <crufty.> I started this search because I'm getting the error Error: cannot open file: time, which is also bundled I suppose because not present in a nimble search |
12:25:04 | FromDiscord | <nnsee> the module in the stdlib is called `times` |
12:26:10 | FromDiscord | <crufty.> Oh my... The S |
12:26:13 | FromDiscord | <crufty.> Thank you |
12:28:57 | FromDiscord | <Robyn [She/Her]> In reply to @nnsee "the module in the": Hey Ras, have you worked with selectors, by any chance? :p |
12:29:09 | FromDiscord | <Robyn [She/Her]> I'm struggling to figure out how I should use them in general atm |
12:34:58 | FromDiscord | <nnsee> can't say that i have tbh |
12:35:59 | FromDiscord | <Robyn [She/Her]> 😠oh well |
12:36:11 | FromDiscord | <Robyn [She/Her]> https://gist.github.com/dom96/3b1c21dcc2598aae5961 I have found this at least |
12:36:27 | FromDiscord | <Robyn [She/Her]> Assuming `Data` is something I want to be passed around? |
12:46:31 | * | PMunch joined #nim |
12:48:25 | * | derpydoo joined #nim |
13:01:47 | * | nazgulsenpai quit (Ping timeout: 264 seconds) |
13:05:20 | * | gooba quit (Remote host closed the connection) |
13:38:44 | FromDiscord | <odexine> i kind of hve, what do you need help with? |
13:41:40 | FromDiscord | <odexine> In reply to @chronos.vitaqua "I'm struggling to figure": basically selectors are a way to ask the operating system if i can do something with a file descriptor |
13:45:21 | * | rockcavera joined #nim |
13:45:30 | FromDiscord | <Robyn [She/Her]> In reply to @odexine "basically selectors are a": Okay I think I kinda understand that |
13:45:36 | FromDiscord | <Robyn [She/Her]> Gonna try implementing something |
13:46:00 | FromDiscord | <Robyn [She/Her]> Just kinda lost on if I need to do anything special for accepting connections... Assuming that also needs to be in a selector |
13:46:02 | FromDiscord | <Robyn [She/Her]> ? |
13:57:13 | FromDiscord | <odexine> if its a file descriptor, it can be done |
13:58:04 | FromDiscord | <demotomohiro> I heard that epoll is newer and better than selectors. And Nim's stdlib use it: https://github.com/nim-lang/Nim/blob/devel/lib/pure/ioselects/ioselectors_epoll.nim |
13:58:55 | FromDiscord | <odexine> selectors uses epoll no? |
14:00:12 | FromDiscord | <odexine> sent a code paste, see https://play.nim-lang.org/#pasty=ivcKDgMcosYg |
14:00:41 | FromDiscord | <odexine> you might be mistaking "selectors" with "poll" |
14:02:58 | advesperacit | easy mistake since there is select() as well as poll() |
14:04:28 | FromDiscord | <demotomohiro> In reply to @odexine "https://nim-lang.org/docs/selectors.html `Supported": I misunderstand that you were talking about `select` C function. |
14:47:57 | FromDiscord | <grumblygibson> In reply to @demotomohiro "So you need to": yes I also compared the address of a field inside column, and it was different. |
15:15:03 | FromDiscord | <demotomohiro> In reply to @grumblygibson "yes I also compared": Content of `Column.data` is moved in this example code:↵https://play.nim-lang.org/#pasty=SvWHKNnSIPba |
15:18:42 | * | ntat quit (Quit: Leaving) |
15:19:32 | FromDiscord | <grumblygibson> And if data is not a seq, like an int? Then the addresses appear different. I actually was thinking that move implied that a new allocation would be avoided. |
15:22:59 | FromDiscord | <odexine> allocation of what? no heap allocations are done in the case you provide |
15:28:00 | * | PMunch quit (Quit: Leaving) |
15:37:20 | * | The_Buhs left #nim (The Lounge - https://thelounge.chat) |
16:25:50 | * | ntat joined #nim |
16:32:10 | * | xet7 quit (Remote host closed the connection) |
16:47:23 | * | jmdaemon joined #nim |
16:48:28 | * | baalajimaestro joined #nim |
17:16:28 | * | krux02 quit (Remote host closed the connection) |
17:24:36 | FromDiscord | <Robyn [She/Her]> This is so weird |
17:24:55 | FromDiscord | <Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=ZpDEmBFmwEHU |
17:25:01 | FromDiscord | <Robyn [She/Her]> (edit) "https://play.nim-lang.org/#pasty=FACwTHPgOwwV" => "https://play.nim-lang.org/#pasty=UxgxRZlYnFcP" |
17:26:08 | * | jmdaemon quit (Ping timeout: 268 seconds) |
17:26:21 | FromDiscord | <Robyn [She/Her]> Ah |
17:26:30 | FromDiscord | <Robyn [She/Her]> Malebolgia's release is broken, that's why |
17:26:33 | FromDiscord | <Robyn [She/Her]> Painful |
18:06:14 | * | krux02 joined #nim |
18:14:08 | FromDiscord | <Robyn [She/Her]> When using selectors, is it better to discard the original `Socket` object and use the underlying file descriptor or... |
18:15:10 | * | nazgulsenpai joined #nim |
18:24:52 | * | cnx quit (Ping timeout: 246 seconds) |
18:29:01 | FromDiscord | <Robyn [She/Her]> Aaagh my enum can't just be the packet IDs, I'm gonna need a table for enum to packet IDs :/ |
18:29:16 | FromDiscord | <Robyn [She/Her]> Since some data uses the same packet ID for the same thing |
18:32:13 | * | cnx joined #nim |
18:33:46 | * | xet7 joined #nim |
18:33:49 | FromDiscord | <Robyn [She/Her]> Wait nvm not an issue |
18:33:54 | FromDiscord | <Robyn [She/Her]> This is a server not a client |
18:34:57 | FromDiscord | <Robyn [She/Her]> I do need to make a template to create constructor procs to automatically set the kind of an object tho |
18:37:02 | FromDiscord | <Robyn [She/Her]> Is there a way to get all objects that inherit from a specific object in Nim? |
18:37:09 | FromDiscord | <Robyn [She/Her]> (edit) "Nim?" => "a Nim macro?" |
18:37:16 | FromDiscord | <leorize> no |
18:41:27 | FromDiscord | <griffith1deadly> In reply to @chronos.vitaqua "Since some data uses": yep |
18:41:52 | FromDiscord | <griffith1deadly> with diffirent states packet ids can be same |
18:47:01 | * | PMunch joined #nim |
19:03:57 | advesperacit | when using futhark on dynamic library, do I have find all dependent header files and put them in one file hierarchy? |
19:04:33 | advesperacit | or can I get it to just do it for me like compiler would using `pkg-config --cflags --libs ...` |
19:06:25 | PMunch | advesperacit, you can leave everything where it is |
19:06:37 | PMunch | pkg-config works great |
19:07:25 | PMunch | Here's an example of my Gtk wrapper using Futhark: https://pasty.ee/xAqdVohjBxki |
19:07:29 | PMunch | @advesperacit * |
19:08:10 | advesperacit | ah, so you put it like that |
19:08:18 | advesperacit | thank you, that'll save me a ton of trouble |
19:08:40 | PMunch | Notice that I use pkg-config twice in that file |
19:12:34 | advesperacit | Do I copy you and reference the my libs in both but --libs on passL and --cflags on the compilerarg? |
19:13:15 | PMunch | Pretty much |
19:13:47 | advesperacit | Great, it'll be much easier with your example to work from |
19:20:30 | advesperacit | "Error: interpretation requires too many iterations" is this a problem or should I just increase iterations? |
19:22:29 | advesperacit | Ah, works with 50000000 |
19:22:53 | PMunch | Yeah that's a problem with the json parser.. |
19:41:59 | FromDiscord | <Robyn [She/Her]> In reply to @leorize "no": Unfortunate |
19:44:58 | FromDiscord | <Robyn [She/Her]> You can't modify `lent` types, can you? |
19:46:06 | FromDiscord | <Robyn [She/Her]> > This is useful for "getter" accessors that seek to allow an immutable view into a container.↵So assuming that's what it means |
19:47:18 | advesperacit | @PMunch I got my little code working with suprisingly little effort thanks to futhark |
19:47:54 | advesperacit | excellent software |
19:49:02 | PMunch | Thank you :) |
19:49:12 | PMunch | It really is marvelous once you figure out how to use it |
20:01:33 | NimEventer | New Nimble package! statsdaemon - StatsD compatible daemon in pure Nim, see https://github.com/Q-Master/statsdaemon.nim |
20:02:36 | FromDiscord | <Robyn [She/Her]> is Malebolgia known to not play well with references or something? |
20:03:50 | PMunch | Not particularly |
20:05:35 | FromDiscord | <Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=gFqKANttdAWE |
20:05:40 | FromDiscord | <Robyn [She/Her]> A tad long |
20:09:24 | FromDiscord | <Robyn [She/Her]> Figured it out |
20:09:30 | FromDiscord | <Robyn [She/Her]> My editor is lying to me |
20:24:27 | FromDiscord | <Robyn [She/Her]> sent a long message, see https://pasty.ee/QwEhyUEClfll |
20:24:42 | FromDiscord | <Robyn [She/Her]> Is it because I'm trying to pass a sequence? Would make sense |
20:24:48 | FromDiscord | <Robyn [She/Her]> But do strings work... |
20:25:07 | FromDiscord | <Robyn [She/Her]> That's a no? |
20:27:07 | FromDiscord | <Robyn [She/Her]> leorize: Hey, do you know why I can't push strings onto a Loony queue? |
20:27:24 | FromDiscord | <leorize> you can only push refs/ptrs |
20:28:21 | FromDiscord | <Robyn [She/Her]> Thanks aha, confused me |
20:30:31 | FromDiscord | <Robyn [She/Her]> Hm... Should I push a buffer type (which is a ref obj) or a ptr seq[byte] |
20:32:33 | FromDiscord | <leorize> anything you want really |
20:32:37 | * | lx12ucy joined #nim |
20:42:10 | FromDiscord | <michaelap> Well, I just completed the Nim track on Exercism. https://media.discordapp.net/attachments/371759389889003532/1207788967026491412/20240215_14h24m00s_grim.png?ex=65e0ec21&is=65ce7721&hm=a27ec25903d409c5e0f86b6a7dd9c3102700c9aaadcca071151edd127e7fdab1& |
20:43:08 | FromDiscord | <Elegantbeef> Congrats you're an expert now |
20:43:14 | * | lx12ucy quit (Ping timeout: 252 seconds) |
20:44:43 | FromDiscord | <michaelap> Haha, certainly not even close. An ignoramus with a checkmark. |
20:44:57 | * | lx12ucy joined #nim |
20:44:59 | FromDiscord | <Elegantbeef> Join the club |
20:54:25 | * | lx12ucy quit (Ping timeout: 264 seconds) |
20:57:36 | * | lx12ucy joined #nim |
21:00:22 | FromDiscord | <Robyn [She/Her]> In reply to @leorize "anything you want really": Assuming no downside to either? |
21:00:37 | FromDiscord | <Robyn [She/Her]> I'll stick with a plain `ptr seq[byte]` then |
21:09:44 | FromDiscord | <Robyn [She/Her]> Does loony's `pop` return nil if there's nothing in the queue? |
21:10:11 | FromDiscord | <Robyn [She/Her]> Seems like a yes |
21:20:51 | * | lx12ucy quit (Ping timeout: 260 seconds) |
21:21:34 | * | ntat quit (Quit: Leaving) |
21:22:27 | * | lx12ucy joined #nim |
21:24:38 | FromDiscord | <Robyn [She/Her]> Selectors seem to bug out the Nim plugin for some reason |
21:24:59 | FromDiscord | <Robyn [She/Her]> Errors pop up on selector-related that aren't showing in compilation |
21:27:33 | * | lx12ucy quit (Ping timeout: 268 seconds) |
21:31:06 | NimEventer | New thread by iffy1: IOS EXC_BAD_ACCESS nimZeroMem, see https://forum.nim-lang.org/t/11012 |
21:51:08 | FromDiscord | <Robyn [She/Her]> Hey leorize, why aren't the socket types exported in https://github.com/alaviss/nim-sys/blob/master/src/sys/sockets.nim ? |
21:51:16 | FromDiscord | <Robyn [She/Her]> Seems like an oversight :p |
21:51:38 | FromDiscord | <leorize> you aren't supposed to use them was the idea \:p |
21:51:52 | FromDiscord | <Robyn [She/Her]> But why? |
21:52:29 | FromDiscord | <Robyn [She/Her]> I'm storing a socket in a `Connection` object so I need to be able to use the types |
21:52:34 | FromDiscord | <leorize> because you should be using `Listener` or `Conn` |
21:52:46 | FromDiscord | <myu_msn_was_better_tbh> Good day ! I am new to Nim. Any idea why I got this ? /Users/myu/.choosenim/toolchains/nim-2.0.2/lib/pure/nativesockets.nim(570, 7) Error: undeclared identifier: 'copyMem' |
21:52:47 | FromDiscord | <Robyn [She/Her]> Wait ah |
21:53:23 | FromDiscord | <leorize> well even if those were exported you wouldn't be able to do much with them anyway |
21:53:57 | FromDiscord | <leorize> the library declares almost nothing for them |
21:55:08 | FromDiscord | <Robyn [She/Her]> Yeah fair enough |
21:55:25 | FromDiscord | <Robyn [She/Her]> I didn't read the docs and I started reading source code :p |
21:56:23 | FromDiscord | <leorize> the source code isn't that bad but you should probably read the docs |
21:56:40 | FromDiscord | <Robyn [She/Her]> Probably yeah, I'll do that now |
21:57:48 | FromDiscord | <Robyn [She/Her]> Agh the distinction between a listener and a connection is useful but annoying here |
21:58:26 | FromDiscord | <Robyn [She/Her]> Before I was able to mess with selectors by passing `nil` and just using the socket I had available in the scope for the server |
21:58:27 | FromDiscord | <leorize> why is that? |
21:59:57 | FromDiscord | <leorize> what does that even mean? |
22:00:18 | FromDiscord | <Robyn [She/Her]> I'll show my code real quick |
22:02:12 | FromDiscord | <Robyn [She/Her]> Oh, by 'mess with selectors' I meant I could pass `nil` instead of my custom connection object so I knew I was using the server socket |
22:03:13 | * | PMunch quit (Quit: Leaving) |
22:03:57 | FromDiscord | <Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=fdcGzWGMSrwi |
22:04:18 | FromDiscord | <leorize> ah you're using selectors |
22:04:25 | * | KhazAkar quit (Ping timeout: 260 seconds) |
22:04:55 | FromDiscord | <leorize> nim-sys is all in on the cps ecosystem, so you should be using ioqueue |
22:05:23 | FromDiscord | <leorize> not that it won't work, though |
22:05:34 | FromDiscord | <leorize> since you can still pass `nil` if you really wanted to |
22:05:56 | * | KhazAkar joined #nim |
22:05:57 | FromDiscord | <leorize> just `Conn[TCP](nil)` since it's still a ref |
22:07:03 | FromDiscord | <Robyn [She/Her]> Fair |
22:08:31 | FromDiscord | <Robyn [She/Her]> Looking at `ioqueue` is leaving me a little confused |
22:08:56 | FromDiscord | <Robyn [She/Her]> I'm guessing I need to use cps together with this to actually use it correctly? |
22:10:29 | FromDiscord | <Robyn [She/Her]> Looking into that now |
22:11:10 | FromDiscord | <leorize> so the only thing you need to do with ioqueue |
22:11:30 | FromDiscord | <leorize> is to tag your function with `{.asyncio.}` |
22:11:56 | FromDiscord | <leorize> and then write the code as if it's blocking |
22:12:30 | FromDiscord | <Robyn [She/Her]> Oh |
22:12:30 | FromDiscord | <leorize> I would be able to give you more details if you tell me exactly what you're doing and what is your thread structure |
22:15:42 | FromDiscord | <Elegantbeef> How are you compiling?↵(@myu_msn_was_better_tbh) |
22:17:41 | FromDiscord | <myu_msn_was_better_tbh> With nim c filename.nim on macOS arm64. The nim compiler is x64 though |
22:17:58 | FromDiscord | <Robyn [She/Her]> In reply to @leorize "I would be able": I struggle with explaining stuff, a lot-↵↵By thread structure do you mean what tasks am I going to be doing on a thread specifically or? |
22:19:32 | FromDiscord | <leorize> yea |
22:20:50 | FromDiscord | <Robyn [She/Her]> Alright so I wanna put all of my network related code onto a single thread... That's really it tbh↵I have many clients connecting to a single TCP server |
22:21:17 | * | lx12ucy joined #nim |
22:22:21 | * | lx12ucy quit (Client Quit) |
22:22:40 | * | lx12ucy joined #nim |
22:23:46 | * | lx12ucy quit (Client Quit) |
22:24:05 | * | lx12ucy joined #nim |
22:26:09 | FromDiscord | <Elegantbeef> Never seen this issue before myu, i'd suggest building the compiler from source to get an arm compiler |
22:27:19 | FromDiscord | <myu_msn_was_better_tbh> In reply to @Elegantbeef "Never seen this issue": Alright, makes sense ! Thank you 🙂 |
22:29:54 | FromDiscord | <leorize> that's easy enough↵(@Robyn [She/Her]) |
22:30:26 | FromDiscord | <leorize> I'll rewrite this one for you, one sec↵(@Robyn [She/Her]) |
22:31:00 | FromDiscord | <Robyn [She/Her]> Alright! Thanks aha, I appreciate it |
22:31:48 | FromDiscord | <leorize> well your send stuff is weird |
22:31:53 | FromDiscord | <Elegantbeef> Robyn is secretly playing the ignorant just to get people to write their code 😄 |
22:33:33 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "*Robyn is secretly playing": That doesn't happen usually tho |
22:33:42 | FromDiscord | <Robyn [She/Her]> In reply to @leorize "well your send stuff": Oh? Why? |
22:34:48 | FromDiscord | <leorize> because you're spinning on the write ready state |
22:35:04 | FromDiscord | <leorize> and then you just do nothing becausse you have no packets |
22:35:36 | FromDiscord | <Robyn [She/Her]> Wdym by spinning? |
22:35:49 | FromDiscord | <Robyn [She/Her]> In reply to @leorize "and then you just": `processClient` has more code hold on |
22:36:04 | FromDiscord | <horsefucking> how do i escape ' from a type? |
22:36:46 | FromDiscord | <Robyn [She/Her]> https://play.nim-lang.org/#pasty=IYBbRqQEtemQ |
22:37:09 | FromDiscord | <Elegantbeef> Escape what from a type? |
22:38:27 | FromDiscord | <horsefucking> sent a code paste, see https://play.nim-lang.org/#pasty=EnQEPIiEhnxu |
22:38:42 | FromDiscord | <Elegantbeef> I mean stop it get some help 😄 |
22:39:24 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=nFBXauOceclr |
22:39:31 | FromDiscord | <Elegantbeef> Not that I see why the hell you're doing this |
22:39:58 | FromDiscord | <soup> i am importing a javascript module which uses " in one of its objects and it doenst work |
22:40:26 | FromDiscord | <Elegantbeef> `importjs` or `importc` is your friend |
22:40:27 | FromDiscord | <soup> someObject["m.relates\_to"] |
22:40:56 | Amun-Ra | even importcpp |
22:41:09 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=MrdCtUVkVmic |
22:51:05 | * | lx12ucy quit (Quit: WeeChat 4.2.1) |
22:51:24 | * | lx12ucy joined #nim |
22:59:01 | * | advesperacit quit () |
23:10:08 | FromDiscord | <leorize> that's some extra juice to handle \:p↵(@Robyn [She/Her]) |
23:12:05 | FromDiscord | <Robyn [She/Her]> :P |
23:12:31 | FromDiscord | <Robyn [She/Her]> Ya don't have to rewrite it for me, I just need to understand what I need to change exactly- |
23:13:20 | FromDiscord | <leorize> how are your event handler done? |
23:13:24 | FromDiscord | <leorize> are they like same thread or what? |
23:15:35 | FromDiscord | <Robyn [She/Her]> Yeah it's on the same thread |
23:16:04 | FromDiscord | <Robyn [She/Her]> The code for the event handler is at https://github.com/Nimberite-Development/Pulse-Nim if you need something more descriptive than my shoddy explanation- |
23:18:36 | FromDiscord | <leorize> lol the queue is practically useless if you use it with nim-sys |
23:19:27 | FromDiscord | <Robyn [She/Her]> Oh? Why? |
23:20:16 | FromDiscord | <Robyn [She/Her]> I'll likely be adding to the queue from another thread so that's why i wanna use a queue |
23:23:12 | FromDiscord | <leorize> you'll want a kind of blocking queue for that |
23:23:22 | FromDiscord | <leorize> there's loony ward but I haven't tested it |
23:23:27 | FromDiscord | <Robyn [She/Her]> AH |
23:23:29 | FromDiscord | <Robyn [She/Her]> Ah |
23:23:38 | FromDiscord | <Robyn [She/Her]> Good reason to start testing it, I guess? :P |
23:24:26 | FromDiscord | <leorize> I don't have a good way to replicate your send code |
23:24:33 | FromDiscord | <leorize> in fact I'd be surprised if it runs at all |
23:24:41 | FromDiscord | <leorize> since it will be perpetually stuck at that send |
23:24:59 | FromDiscord | <Robyn [She/Her]> Oh, I can push the entire code to GitHub if you really want? It's already in a repo but not up-to-date |
23:25:13 | FromDiscord | <Robyn [She/Her]> It'd probably be easier if I just modified it and you said "do X and Y" :p |
23:25:17 | FromDiscord | <leorize> don't worry about it, I'll just let you figure out how to do the send properly \:p |
23:25:32 | FromDiscord | <Robyn [She/Her]> Alright! |
23:25:40 | FromDiscord | <Robyn [She/Her]> In reply to @leorize "since it will be": Wait why |
23:26:08 | FromDiscord | <Robyn [She/Her]> If I'm popping from the queue why is that an issue? |
23:27:04 | FromDiscord | <leorize> it's not that you are popping from the queue |
23:27:23 | FromDiscord | <leorize> it's the fact that you will always be ready to `Write` |
23:27:31 | FromDiscord | <leorize> as such that path will always be triggered |
23:27:47 | FromDiscord | <leorize> and you will spin on that branch |
23:28:37 | FromDiscord | <Robyn [She/Her]> Ah... Not sure how to fix that then, unless I always assume that writing is allowed, I thought there were cases where it may not be possible? |
23:29:33 | FromDiscord | <leorize> yep, but if you haven't written a single byte then ofc it's possible |
23:30:20 | FromDiscord | <leorize> https://play.nim-lang.org/#pasty=KLTEQZbMPClG |
23:31:04 | FromDiscord | <Robyn [She/Her]> trampoline? Welp? |
23:31:29 | FromDiscord | <Robyn [She/Her]> Assuming I need to import ioqueue and cps? |
23:31:35 | FromDiscord | <Robyn [She/Her]> (edit) "Welp?" => "Whelp?" |
23:31:38 | FromDiscord | <leorize> yea |
23:31:48 | FromDiscord | <leorize> so `whelp` creates a continuation |
23:32:01 | FromDiscord | <leorize> and `trampoline` would run the continuation until it's queued |
23:32:10 | FromDiscord | <girvo> delicious cps |
23:32:21 | FromDiscord | <Robyn [She/Her]> In reply to @leorize "and `trampoline` would run": Neat |
23:32:43 | FromDiscord | <leorize> it's prettier when you actually have an event queue |
23:33:16 | FromDiscord | <leorize> since ioqueue only give you the I/O part of a queue |
23:33:19 | FromDiscord | <girvo> In reply to @Elegantbeef "*Robyn is secretly playing": Isn't there some Law of the Internet about that |
23:33:32 | FromDiscord | <Robyn [She/Her]> Fair, I might look into properly learning cps |
23:33:46 | FromDiscord | <girvo> In reply to @chronos.vitaqua "Fair, I might look": do it. continuations are so good |
23:33:50 | FromDiscord | <leorize> cps will make your event scheme obsolete \:P |
23:34:00 | FromDiscord | <leorize> since you won't be sending events, you will be sending compute |
23:34:13 | FromDiscord | <Robyn [She/Her]> And cps works between threads? Or? |
23:34:15 | FromDiscord | <girvo> I've not gone deep into cps in _nim_ but I've used them extensively in Scheme and some other langs lol |
23:34:37 | FromDiscord | <Robyn [She/Her]> I'll gladly give up Pulse for something better so |
23:34:38 | FromDiscord | <leorize> yea, one of the use case was to move compute between threads |
23:34:41 | FromDiscord | <leorize> that's what loony was for btw |
23:34:43 | FromDiscord | <Robyn [She/Her]> Oh sweet |
23:34:48 | FromDiscord | <Robyn [She/Her]> In reply to @leorize "that's what loony was": Figured |
23:35:04 | FromDiscord | <Robyn [She/Her]> In reply to @girvo "I've not gone deep": How's it like there? And how does it compare to async? |
23:35:35 | FromDiscord | <girvo> It's a lower level abstraction than async, while also being sort of a superset of it. I'm very bad at explaining it |
23:35:49 | FromDiscord | <leorize> we spent 3yrs and haven't managed to either \:p |
23:35:49 | FromDiscord | <Robyn [She/Her]> Fair |
23:35:59 | FromDiscord | <leorize> but if you want something similar, look at kotlin |
23:35:59 | * | derpydoo quit (Ping timeout: 256 seconds) |
23:36:00 | FromDiscord | <Robyn [She/Her]> In reply to @leorize "we spent 3yrs and": Lol |
23:36:05 | FromDiscord | <girvo> like you can build async with cps 😛 |
23:36:11 | FromDiscord | <Robyn [She/Her]> In reply to @leorize "but if you want": Kotlin has coroutines right? |
23:36:12 | FromDiscord | <girvo> but not _just_ async |
23:36:42 | FromDiscord | <leorize> yea, coroutines are the closest to cps |
23:36:55 | FromDiscord | <Robyn [She/Her]> Neat |
23:37:03 | FromDiscord | <girvo> coroutines are also lovely, but not every implementation of them is as powerful as they should be |
23:37:08 | FromDiscord | <leorize> though I'd say it's interesting that kotlin has about the same number of restrictions for them as with cps |
23:37:20 | FromDiscord | <girvo> luas coros are decent |
23:37:23 | FromDiscord | <leorize> despite their coroutines being in the compiler |
23:37:35 | FromDiscord | <girvo> In reply to @leorize "despite their coroutines being": oh interesting |
23:37:43 | FromDiscord | <girvo> I haven't actually looked deep into kotlin |
23:38:17 | FromDiscord | <leorize> for most practical usage they should be identical to nim cps |
23:39:04 | FromDiscord | <leorize> they do have a bunch of areas where they are better than our macros-based cps, like being able to integrate with overloading resolution and stuff |
23:39:30 | FromDiscord | <girvo> btw I meant to ask, is a continuation cancellable in nim cps? and if its cancelled, does it properly clean up the scope/call destructors the way its supposed to? |
23:39:31 | FromDiscord | <leorize> but fundamentally they can do more or less the same stuff that we can do with nim cps |
23:39:53 | FromDiscord | <leorize> depends on what kind of cancellation are you looking for |
23:40:03 | FromDiscord | <girvo> I still want to see if it'll run well on two thread/Tasks in freertos and let us be able to cancel/unblock & clean up some blocking IO |
23:40:05 | FromDiscord | <Robyn [She/Her]> In reply to @leorize "but fundamentally they can": Makes sense, definitely seems super neat honestly |
23:40:10 | FromDiscord | <girvo> but I think I need to really plan that out to make the question make more sense |
23:40:33 | FromDiscord | <leorize> there's the yeet to the bin type, which requires destructors to clean up (and this is where nim-sys comes in) |
23:40:47 | * | azimut quit (Remote host closed the connection) |
23:40:48 | FromDiscord | <girvo> In reply to @leorize "there's the *yeet to": yeah that would be basically perfect tbh |
23:40:54 | FromDiscord | <leorize> cooperative then should also be possible, but not built into the library |
23:41:10 | FromDiscord | <girvo> I dont even care if the clean up is automatic: i'd be happy to provide the cleanup procs even |
23:42:02 | FromDiscord | <Robyn [She/Her]> Still can't believe how small you trimmed the network code |
23:42:10 | * | azimut joined #nim |
23:42:18 | FromDiscord | <girvo> basically freertos tasks (read: thread) can't be cancelled/stopped/killed. so their scopes never truly exit, so nothing in them gets cleaned up if i stop the task. I want to fix that, but it's difficult as theres no real preemption that I have access to on an embedded system like this |
23:42:23 | FromDiscord | <leorize> because that code is now in ioqueue \:p |
23:43:14 | FromDiscord | <Robyn [She/Her]> Fair |
23:43:34 | FromDiscord | <Robyn [She/Her]> Hm, if I use cps in my own libraries, can users continue to use it as normal? |
23:43:38 | FromDiscord | <leorize> basically with sys/ioqueue, you write blocking code |
23:44:01 | FromDiscord | <Robyn [She/Her]> Since `readVarNum` and co are from other libraries (that I've written) |
23:44:58 | FromDiscord | <leorize> and cps + sys do the magic to make it run on the same threads |
23:45:15 | FromDiscord | <leorize> sys expose a bunch of cps procs so yes?↵(@Robyn [She/Her]) |
23:46:06 | FromDiscord | <leorize> here's your `read`\: https://github.com/alaviss/nim-sys/blob/d361a03d2a4e02c8ee87328aa4207b142d302bc9/src/sys/files.nim#L153-L197 |
23:46:15 | FromDiscord | <leorize> it's just a regular proc with `{.asyncio.}` on it |
23:50:59 | FromDiscord | <girvo> asyncio is cute btw, smart to not overload {.async.} |
23:52:08 | FromDiscord | <leorize> yea, ioqueue is meant to be a small part of the picture |
23:52:14 | FromDiscord | <leorize> but I think we will have to write a full queue eventually |
23:54:06 | FromDiscord | <Robyn [She/Her]> In reply to @leorize "sys expose a bunch": I mean can they simply call my code as if they never touched cps? |
23:55:06 | FromDiscord | <leorize> you can't do nim -\> cps easily but you can do cps -\> cps |
23:55:29 | FromDiscord | <leorize> my recommendation is to split it into a cps-compatible version and a non-cps compatible version |
23:55:55 | FromDiscord | <leorize> the logic should be easily split, the remainder is just I/O isn't it? |